[清扫车]feat: 新增 发送命令时loading , 命令执行等待、超时等逻辑,新增一些操作命令调用方法;

This commit is contained in:
aibingbing
2022-08-24 21:17:52 +08:00
parent 803257a889
commit 09f15cdbe7
6 changed files with 454 additions and 97 deletions

View File

@@ -72,7 +72,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
protected RelativeLayout mAICollectBtn;
public boolean isOperationStatus;//false-收车true-出车
private FrameLayout flStationPanelContainer;
private FrameLayout flSweepOperatePanelContatiner;//清扫车操作面板View的容器
private Group groupTestPanel;
private FrameLayout flSpeed;
// private BusArcView mouduleArc;
@@ -106,7 +105,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
}
private View panelView;
private View sweepOperatePanelView;
@Override
protected void initViews() {
@@ -116,7 +114,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
ctvAutopilotStatusIv = findViewById(R.id.sweeper_autopilot_btn_iv);
ctvAutopilotStatusTv = findViewById(R.id.sweeper_autopolot_btn_tv);
flStationPanelContainer = findViewById(R.id.module_mogo_och_station_panel_container);
flSweepOperatePanelContatiner = findViewById(R.id.module_mogo_och_sweeper_operate_panel);
// mTrafficLightView = findViewById(R.id.bus_traffic_light_view);
// CallerHmiManager.INSTANCE.setProxyTrafficLightView(mTrafficLightView);
@@ -127,7 +124,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
mTrafficDataView = (TrafficDataView) findViewById(R.id.sweeper_arc);
panelView = LayoutInflater.from(getContext()).inflate(getStationPanelViewId(), flStationPanelContainer);
sweepOperatePanelView = LayoutInflater.from(getContext()).inflate(getSweepOperatePanelViewId(), flSweepOperatePanelContatiner);
slidePanelView.setOnSlidePanelMoveToEndListener(onSlideToEndListener);
mSwitchMapModeLayout = findViewById(R.id.sweeper_switch_model_layout);

View File

@@ -1,35 +1,287 @@
package com.mogo.och.sweeper.ui;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.module.common.view.OnPreventFastClickListener;
import com.mogo.och.sweeper.R;
import chassis.Chassis;
import chassis.SpecialVehicleTaskCmdOuterClass;
import chassis.VehicleStateOuterClass;
/**
* 清扫车操作面板View
*/
public class SweeperOperatePanelView extends LinearLayout {
public class SweeperOperatePanelView extends LinearLayout{
private static final String TAG = "SweeperOperatePanelView";
private static final int CMD_EXECUTE_TIMEOUT_SECONDS = 5;
TextView mBtnMainSwitchOpenClose;//开关
TextView mBtnOperateModePureSweep;//纯扫
TextView mBtnOperateModePureWash;//纯洗
TextView mBtnOperateModeSweepWash;//洗扫
TextView mBtnOperateModePureAbsorption;//纯吸
TextView mBtnCleanDirectionLeftSide;//左侧
TextView mBtnCleanDirectionRightSide;//右侧
TextView mBtnCleanDirectionBothSide;//两侧
TextView mBtnCleanIntensityStandard;//普通
TextView mBtnCleanIntensityStrong;//强力
LinearLayout mLoadingContainer;//loading container
TextView mLoadingHintTop;//loading 提示-上面
TextView mLoadingHintBottom;//loading 提示-下面
public SweeperOperatePanelView(Context context) {
super(context);
}
public SweeperOperatePanelView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initView(context);
}
public SweeperOperatePanelView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView(context);
}
public SweeperOperatePanelView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
initView(context);
}
private void init(Context context) {
LayoutInflater.from(context).inflate(R.layout.sweeper_traffic_light_view, this, true);
private void initView(Context context) {
LayoutInflater.from(context).inflate(R.layout.sweeper_operate_panel_view, this, true);
mBtnMainSwitchOpenClose = findViewById(R.id.btn_main_switch_open_close);
mBtnOperateModePureSweep = findViewById(R.id.btn_operate_mode_pure_sweep);
mBtnOperateModePureWash = findViewById(R.id.btn_operate_mode_pure_wash);
mBtnOperateModeSweepWash = findViewById(R.id.btn_operate_mode_sweep_wash);
mBtnOperateModePureAbsorption = findViewById(R.id.btn_operate_mode_pure_absorption);
mBtnCleanDirectionLeftSide = findViewById(R.id.btn_clean_direction_left_side);
mBtnCleanDirectionRightSide = findViewById(R.id.btn_clean_direction_right_side);
mBtnCleanDirectionBothSide = findViewById(R.id.btn_clean_direction_both_side);
mBtnCleanIntensityStandard = findViewById(R.id.btn_clean_intensity_standard);
mBtnCleanIntensityStrong = findViewById(R.id.btn_clean_intensity_strong);
mLoadingContainer = findViewById(R.id.loading_hint_container);
mLoadingHintTop = findViewById(R.id.loading_hint_top);
mLoadingHintBottom = findViewById(R.id.loading_hint_bottom);
initViewListener();
}
private void initViewListener() {
mBtnMainSwitchOpenClose.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.Builder builder = SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.newBuilder();
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd fuTianCleanCmd = builder.build();
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd fuTianTaskCmd = SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd.newBuilder()
.setRoboSweeperFutianCleanCmd(fuTianCleanCmd).build();
sendSweeperCmd(fuTianTaskCmd, new CmdRequestCallback() {
@Override
public void onSendCmd() {
showLoadingMask("命令执行中。。。", 10);
}
@Override
public void onCountDownTick(int senonds) {
updateLoadingCountDown(senonds);
}
@Override
public boolean onCheckIfCmdSuccess(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
return false;
}
@Override
public void onCmdSuccess() {
ToastUtils.showLong("执行成功");
}
@Override
public void onCmdFailed() {
}
@Override
public void onCmdTimeout() {
hideLoadingMask();
}
}, 10);
}
});
}
private void showLoadingMask(String hint, int timeout) {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
mLoadingContainer.setVisibility(View.VISIBLE);
mLoadingHintTop.setText(hint);
mLoadingHintBottom.setText(
String.format(
getContext().getApplicationContext().getString(R.string.sweeper_operate_panel_cmd_execute_timeout),
timeout
));
}
});
}
private void hideLoadingMask() {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
mLoadingContainer.setVisibility(View.GONE);
}
});
}
private void updateLoadingCountDown(int timeout) {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
mLoadingHintBottom.setText(
String.format(
getContext().getApplicationContext().getString(R.string.sweeper_operate_panel_cmd_execute_timeout),
timeout
));
}
});
}
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
@Override
public void onAutopilotDataException(long timestamp) {
}
@Override
public void onAutopilotLightSwitchData(@Nullable Chassis.LightSwitch lightSwitch) {
}
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
}
@Override
public void onAutopilotSteeringData(float steering) {
}
@Override
public void onAutopilotGearData(@NonNull Chassis.GearPosition gear) {
}
@Override
public void onAutopilotAcc(float carAcc) {
}
@Override
public void onAutopilotThrottle(float throttle) {
}
@Override
public void onAutopilotBrake(float brake) {
}
@Override
public void onSweeperFutianCleanSystemState(@NonNull VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
// 有命令正在执行
if (mCurrentCmdRequestCallback != null) {
if (mCurrentCmdRequestCallback.onCheckIfCmdSuccess(cleanSystemState)) {
mCurrentCmdRequestCallback.onCmdSuccess();
mCurrentCmdRequestCallback = null;
}
}
}
};
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
CallerAutopilotVehicleStateListenerManager.INSTANCE.removeListener(TAG);
}
/**
* 发送清扫车作业命令
*
* @param fuTianCleanCmd
* @param cmdRequestCallback
* @param timeout
*/
private void sendSweeperCmd(
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd fuTianCleanCmd,
CmdRequestCallback cmdRequestCallback,
int timeout) {
// 设置当前请求的回调
mCurrentCmdRequestCallback = cmdRequestCallback;
// onSendCmd
mCurrentCmdRequestCallback.onSendCmd();
// 发送命令
CallerAutoPilotManager.INSTANCE.sendSweeperFuTianTaskCmd(fuTianCleanCmd);
// 开启倒计时
Message msg = Message.obtain();
msg.what = MSG_CMD_EXECUTE_COUNT_DOWN;
msg.obj = timeout;
mSweeperOperateCmdHandler.sendMessage(msg);
}
private final static SweeperOperateCmdHandler mSweeperOperateCmdHandler = new SweeperOperateCmdHandler();
private static CmdRequestCallback mCurrentCmdRequestCallback;
private static final int MSG_CMD_EXECUTE_COUNT_DOWN = 10001;
static class SweeperOperateCmdHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if (msg.what == MSG_CMD_EXECUTE_COUNT_DOWN) {
int seconds = (int) msg.obj;
if (seconds > 0) {
mCurrentCmdRequestCallback.onCountDownTick(seconds);
Message newMsg = Message.obtain();
newMsg.what = MSG_CMD_EXECUTE_COUNT_DOWN;
newMsg.obj = seconds-1;
mSweeperOperateCmdHandler.sendMessageDelayed(newMsg, 1000L);
} else {
if (mCurrentCmdRequestCallback != null) {
mCurrentCmdRequestCallback.onCmdTimeout();
mCurrentCmdRequestCallback = null;
}
}
}
}
}
interface CmdRequestCallback {
void onSendCmd();
void onCountDownTick(int senonds);
boolean onCheckIfCmdSuccess(VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState);
void onCmdSuccess();
void onCmdFailed();
void onCmdTimeout();
}
}

View File

@@ -0,0 +1,77 @@
package com.mogo.och.sweeper.util;
import chassis.SpecialVehicleTaskCmdOuterClass;
/**
* 清扫车-福田,构建业务命令数据的工具类
*/
public class SweeperFutianCmdUtil {
private static final int CLEAN_WORK_OPEN = 1; //清扫作业-开启
private static final int CLEAN_WORK_CLOSE = 2;//清扫作业-关闭
private static final int CLEAN_MODE_PURE_SWEEP = 1;//作业模式-纯扫
private static final int CLEAN_MODE_WASH_SWEEP = 2;//作业模式-洗扫
private static final int CLEAN_MODE_PURE_WASH = 3;//作业模式-纯洗
private static final int CLEAN_MODE_PURE_DRAW = 4;//作业模式-纯吸
private static final int CLEAN_MODE_CLOSE = 5;//作业模式-关闭
private static final int CLEAN_DIRECTION_BOTH_SIDE = 1;//清扫方向-两侧
private static final int CLEAN_DIRECTION_LEFT_SIDE = 2;//清扫方向-左侧
private static final int CLEAN_DIRECTION_RIGHT_SIDE = 3;//清扫方向-右侧
private static final int CLEAN_DIRECTION_CLOSE = 4;//清扫方向-关闭
private static final int CLEAN_INTENSITY_STRAND = 1;//作业强度-标准
private static final int CLEAN_INTENSITY_STRONG = 2;//作业强度-加强
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanWorkStartCmd() {
return buildCleanWorkCmd(CLEAN_WORK_OPEN);
}
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanWorkStopCmd() {
return buildCleanWorkCmd(CLEAN_WORK_CLOSE);
}
private static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanWorkCmd(int startOrStop) {
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.Builder builder = SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.newBuilder();
builder.setCleanOpenRequirement(startOrStop);
return buildTaskCmd(builder.build());
}
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanModeCmd(int value) {
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.Builder builder = SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.newBuilder();
builder.setCleanModeRequirement(value);
return buildTaskCmd(builder.build());
}
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanModeCloseCmd() {
return buildCleanModeCmd(CLEAN_MODE_CLOSE);
}
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanDirectionCmd(int value) {
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.Builder builder = SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.newBuilder();
builder.setCleanDirectionRequirement(value);
return buildTaskCmd(builder.build());
}
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanDirectionCloseCmd() {
return buildCleanDirectionCmd(CLEAN_DIRECTION_CLOSE);
}
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanIntensityStandardCmd() {
return buildCleanIntensityCmd(CLEAN_INTENSITY_STRAND);
}
public static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanIntensityStrongCmd() {
return buildCleanIntensityCmd(CLEAN_INTENSITY_STRONG);
}
private static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildCleanIntensityCmd(int value) {
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.Builder builder = SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd.newBuilder();
builder.setCleanIntensityRequirement(value);
return buildTaskCmd(builder.build());
}
private static SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd buildTaskCmd(
SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianCleanCmd fuTianCleanCmd) {
return SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd.newBuilder()
.setRoboSweeperFutianCleanCmd(fuTianCleanCmd).build();
}
}

View File

@@ -63,12 +63,12 @@
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
tools:visibility="visible" />
<FrameLayout
<com.mogo.och.sweeper.ui.SweeperOperatePanelView
android:id="@+id/module_mogo_och_sweeper_operate_panel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginStart="@dimen/dp_16"
app:layout_constraintLeft_toRightOf="@id/fl_speed"
app:layout_constraintTop_toTopOf="@id/fl_speed"
tools:background="#f00"

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto">
android:layout_height="wrap_content">
<TextView
android:id="@+id/hint_main_switch"
@@ -13,24 +13,24 @@
android:text="车辆准备"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/btn_main_switch_open_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn1_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="open"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginStart="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/hint_main_switch"
app:layout_constraintLeft_toRightOf="@id/hint_main_switch"/>
app:layout_constraintLeft_toRightOf="@id/hint_main_switch"
app:layout_constraintTop_toTopOf="@id/hint_main_switch" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/main_switch_barrier"
@@ -43,77 +43,77 @@
android:id="@+id/hint_operate_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_32"
android:background="#ffffff"
android:text="作业模式"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginTop="@dimen/dp_32"
app:layout_constraintTop_toBottomOf="@id/main_switch_barrier"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/main_switch_barrier" />
<TextView
android:id="@+id/btn_operate_mode_pure_sweep"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="纯扫"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginLeft="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/hint_operate_mode"
app:layout_constraintLeft_toRightOf="@id/hint_operate_mode"/>
app:layout_constraintLeft_toRightOf="@id/hint_operate_mode"
app:layout_constraintTop_toTopOf="@id/hint_operate_mode" />
<TextView
android:id="@+id/btn_operate_mode_pure_wash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="纯洗"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginStart="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/hint_operate_mode"
app:layout_constraintLeft_toRightOf="@id/btn_operate_mode_pure_sweep"/>
app:layout_constraintLeft_toRightOf="@id/btn_operate_mode_pure_sweep"
app:layout_constraintTop_toTopOf="@id/hint_operate_mode" />
<TextView
android:id="@+id/btn_operate_mode_sweep_wash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="洗扫"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginTop="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toBottomOf="@id/btn_operate_mode_pure_sweep"
app:layout_constraintLeft_toLeftOf="@id/btn_operate_mode_pure_sweep"/>
app:layout_constraintLeft_toLeftOf="@id/btn_operate_mode_pure_sweep"
app:layout_constraintTop_toBottomOf="@id/btn_operate_mode_pure_sweep" />
<TextView
android:id="@+id/btn_operate_mode_pure_absorption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:text="洗吸"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="纯吸"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginStart="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/btn_operate_mode_sweep_wash"
app:layout_constraintLeft_toRightOf="@id/btn_operate_mode_sweep_wash"/>
app:layout_constraintLeft_toRightOf="@id/btn_operate_mode_sweep_wash"
app:layout_constraintTop_toTopOf="@id/btn_operate_mode_sweep_wash" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/operate_mode_barrier"
@@ -126,61 +126,61 @@
android:id="@+id/hint_clean_direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_32"
android:background="#ffffff"
android:text="清扫方向"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginTop="@dimen/dp_32"
app:layout_constraintTop_toBottomOf="@id/operate_mode_barrier"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/operate_mode_barrier" />
<TextView
android:id="@+id/btn_clean_direction_left_side"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="左侧"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginStart="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/hint_clean_direction"
app:layout_constraintLeft_toRightOf="@id/hint_clean_direction"/>
app:layout_constraintLeft_toRightOf="@id/hint_clean_direction"
app:layout_constraintTop_toTopOf="@id/hint_clean_direction" />
<TextView
android:id="@+id/btn_clean_direction_right_side"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="右侧"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginStart="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/hint_clean_direction"
app:layout_constraintLeft_toRightOf="@id/btn_clean_direction_left_side"/>
app:layout_constraintLeft_toRightOf="@id/btn_clean_direction_left_side"
app:layout_constraintTop_toTopOf="@id/hint_clean_direction" />
<TextView
android:id="@+id/btn_clean_direction_both_side"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="两侧"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginTop="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toBottomOf="@id/btn_clean_direction_left_side"
app:layout_constraintLeft_toLeftOf="@id/btn_clean_direction_left_side"/>
app:layout_constraintLeft_toLeftOf="@id/btn_clean_direction_left_side"
app:layout_constraintTop_toBottomOf="@id/btn_clean_direction_left_side" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/clean_direction_barrier"
@@ -190,46 +190,76 @@
app:constraint_referenced_ids="hint_clean_direction, btn_clean_direction_left_side, btn_clean_direction_right_side, btn_clean_direction_both_side" />
<TextView
android:id="@+id/hint_work_level"
android:id="@+id/hint_clean_intensity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_32"
android:background="#ffffff"
android:text="作业强度"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginTop="@dimen/dp_32"
app:layout_constraintTop_toBottomOf="@id/clean_direction_barrier"
app:layout_constraintLeft_toLeftOf="parent"/>
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/clean_direction_barrier" />
<TextView
android:id="@+id/btn_work_level_normal"
android:id="@+id/btn_clean_intensity_standard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:text="普通"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="标准"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginStart="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/hint_work_level"
app:layout_constraintLeft_toRightOf="@id/hint_work_level"/>
app:layout_constraintLeft_toRightOf="@id/hint_clean_intensity"
app:layout_constraintTop_toTopOf="@id/hint_clean_intensity" />
<TextView
android:id="@+id/btn_work_level_hard"
android:id="@+id/btn_clean_intensity_strong"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_32"
android:background="@drawable/sweeper_operate_panel_btn2_bg_selector"
android:paddingStart="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingEnd="@dimen/dp_20"
android:paddingBottom="@dimen/dp_6"
android:text="强力"
android:textColor="#000000"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size"
android:layout_marginStart="@dimen/dp_32"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
android:paddingTop="@dimen/dp_6"
android:paddingBottom="@dimen/dp_6"
app:layout_constraintTop_toTopOf="@id/hint_work_level"
app:layout_constraintLeft_toRightOf="@id/btn_work_level_normal"/>
app:layout_constraintLeft_toRightOf="@id/btn_clean_intensity_standard"
app:layout_constraintTop_toTopOf="@id/hint_clean_intensity" />
<LinearLayout
android:id="@+id/loading_hint_container"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#80000000"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone">
<TextView
android:id="@+id/loading_hint_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="正在执行中,请稍后"
android:textColor="#ffffff"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size" />
<TextView
android:id="@+id/loading_hint_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="预计等待30秒"
android:textColor="#ffffff"
android:textSize="@dimen/sweeper_operate_panel_btn_text_size" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -24,4 +24,6 @@
<string name="sweeper_arrive_to_current_tag">当前站点:</string>
<string name="sweeper_arrive_to_next_tag">下一站:</string>
<string name="sweeper_auto_disable_tip">自动驾驶状态为0不可用</string>
<string name="sweeper_operate_panel_cmd_execute_timeout">预计等待%d秒</string>
</resources>