71 lines
2.5 KiB
Java
71 lines
2.5 KiB
Java
package com.ubt.jimu.controller.data.widget;
|
|
|
|
import android.content.Context;
|
|
import com.thoughtworks.xstream.annotations.XStreamConverter;
|
|
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
|
import com.ubt.jimu.R;
|
|
import com.ubt.jimu.base.data.CtrlMotionType;
|
|
import com.ubt.jimu.controller.data.config.SliderConfig;
|
|
|
|
@XStreamConverter(priority = 9999, value = SliderDataConverter.class)
|
|
/* loaded from: classes.dex */
|
|
public class SliderWidgetData extends MoveBaseData<SliderConfig> {
|
|
|
|
@XStreamOmitField
|
|
private SliderConfig config;
|
|
|
|
public SliderWidgetData() {
|
|
}
|
|
|
|
@Override // com.ubt.jimu.controller.data.widget.MoveBaseData
|
|
public String getShowName(Context context) {
|
|
String string = context.getResources().getString(R.string.servo_mode_servo_index);
|
|
if (getConfig().getMotionType() == CtrlMotionType.motor) {
|
|
string = context.getResources().getString(R.string.control_motor_index);
|
|
}
|
|
return String.format(string, Integer.valueOf(getConfig().getServoID()));
|
|
}
|
|
|
|
@Override // com.ubt.jimu.controller.data.widget.ItemBaseData
|
|
public String getWidgetInfo(Context context) {
|
|
if (this.config == null) {
|
|
return "";
|
|
}
|
|
StringBuilder sb = new StringBuilder(String.format(context.getResources().getString(R.string.servo_mode_servo_index), Integer.valueOf(this.config.getServoID())));
|
|
sb.append("(");
|
|
sb.append(this.config.isDirectionDisclock() ? context.getResources().getString(R.string.engine_rotate_anticlockwise) : context.getResources().getString(R.string.engine_rotate_clockwise));
|
|
sb.append(")");
|
|
return sb.toString();
|
|
}
|
|
|
|
@Override // com.ubt.jimu.controller.data.widget.ItemBaseData
|
|
public String toString() {
|
|
return super.toString() + " " + getConfig().toString();
|
|
}
|
|
|
|
public SliderWidgetData(String str) {
|
|
super(str);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // com.ubt.jimu.controller.data.widget.MoveBaseData
|
|
public SliderConfig getConfig() {
|
|
return this.config;
|
|
}
|
|
|
|
@Override // com.ubt.jimu.controller.data.widget.MoveBaseData
|
|
public void setConfig(SliderConfig sliderConfig) {
|
|
super.setConfig((SliderWidgetData) sliderConfig);
|
|
this.config = sliderConfig;
|
|
}
|
|
|
|
public SliderWidgetData(String str, float f, float f2) {
|
|
super(str, f, f2);
|
|
}
|
|
|
|
@Deprecated
|
|
public SliderWidgetData(String str, CtrlMotionType ctrlMotionType, byte b, boolean z, float f, float f2) {
|
|
super(str, f, f2);
|
|
}
|
|
}
|