[sweeper运营&云控合并]feat:增加清扫云控&运营 关键节点日志,并补充日志内容;
This commit is contained in:
@@ -59,6 +59,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.androidxcardview
|
||||
implementation rootProject.ext.dependencies.androidxroomruntime
|
||||
annotationProcessor rootProject.ext.dependencies.androidxroomcompiler
|
||||
implementation rootProject.ext.dependencies.localbroadcastmanager
|
||||
|
||||
implementation project(":OCH:mogo-och-common-module")
|
||||
compileOnly project(":libraries:mogo-map")
|
||||
|
||||
@@ -122,15 +122,20 @@ public class SweeperProvider implements IMogoOCH, IMoGoSweeperModeListener {
|
||||
+ SweeperVehicleConfigUtils.isSPCurrentSweeperOperateMode()
|
||||
+ ", isSPCurrentSweeperCloudMode=" + SweeperVehicleConfigUtils.isSPCurrentSweeperCloudMode());
|
||||
if (SweeperVehicleConfigUtils.isSPCurrentSweeperOperateMode()) {
|
||||
FunctionBuildConfig.sweeperCurrentMode = SweeperVehicleConfigUtils.BUSINESS_MODE_OPERATE;
|
||||
showOperateFragment();
|
||||
} else if (SweeperVehicleConfigUtils.isSPCurrentSweeperCloudMode()) {
|
||||
FunctionBuildConfig.sweeperCurrentMode = SweeperVehicleConfigUtils.BUSINESS_MODE_CLOUD;
|
||||
showCloudFragment();
|
||||
} else if (SweeperVehicleConfigUtils.isDefaultSweeperOperateMode(FunctionBuildConfig.sweeperDefaultMode)) {
|
||||
FunctionBuildConfig.sweeperCurrentMode = SweeperVehicleConfigUtils.BUSINESS_MODE_OPERATE;
|
||||
showOperateFragment();
|
||||
} else if (SweeperVehicleConfigUtils.isDefaultSweeperCloudMode(FunctionBuildConfig.sweeperDefaultMode)) {
|
||||
FunctionBuildConfig.sweeperCurrentMode = SweeperVehicleConfigUtils.BUSINESS_MODE_CLOUD;
|
||||
showCloudFragment();
|
||||
} else {
|
||||
// 默认云控模式
|
||||
FunctionBuildConfig.sweeperCurrentMode = SweeperVehicleConfigUtils.BUSINESS_MODE_CLOUD;
|
||||
showCloudFragment();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.och.sweeper.cloud.fragment;
|
||||
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
@@ -13,16 +14,13 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.google.protobuf.TextFormat;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
@@ -33,32 +31,26 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.sweeper.R;
|
||||
import com.mogo.och.sweeper.cloud.view.SweeperCloudTrafficDataView;
|
||||
import com.mogo.och.sweeper.common.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.common.callback.ISweeperTaskDataToFragmentCallback;
|
||||
import com.mogo.och.sweeper.common.callback.IWeltMapSwitchToSmallCallback;
|
||||
import com.mogo.och.sweeper.common.database.bean.WeltDataBean;
|
||||
import com.mogo.och.sweeper.cloud.util.AutopilotModeConfigManager;
|
||||
import com.mogo.och.sweeper.cloud.util.SweeperCloudTaskUtils;
|
||||
import com.mogo.och.sweeper.cloud.view.SweeperCloudTrafficDataView;
|
||||
import com.mogo.och.sweeper.common.fragment.WeltMapOverViewFragment;
|
||||
import com.mogo.och.sweeper.common.view.DebugView;
|
||||
import com.mogo.och.sweeper.common.view.WeltSmallMapView;
|
||||
import com.zhjt.mogo.adas.data.AiCloudTask;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
* <p>
|
||||
@@ -128,105 +120,22 @@ public abstract class BaseSweeperCloudTabFragment<V extends IView, P extends Pre
|
||||
setMessageBox();
|
||||
//设置左下角四个按钮监听事件
|
||||
setBottomBtnListener();
|
||||
// 模拟 下发启动自驾命令
|
||||
findViewById(R.id.btnStartAutopilot).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() + ", 请稍候重试");
|
||||
return;
|
||||
}
|
||||
new AutopilotModeConfigManager(new AutopilotModeConfigManager.OnReadAutopilotModeConfigListener() {
|
||||
@Override
|
||||
public void onReadFailed(String err) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
ToastUtils.showLong("读取失败=" + err);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParseFailed(String err) {
|
||||
ToastUtils.showLong("解析失败=" + err);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParse(MessagePad.SetAutopilotModeReq bean) {
|
||||
ToastUtils.showLong("下发命令\n" + TextFormat.printer().escapingNonAscii(false).printToString(bean));
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
MessagePad.RouteInfo routeInfo = bean.getRouteInfo();
|
||||
if (routeInfo.getRouteID() > 0) {
|
||||
parameters.routeID = routeInfo.getRouteID();
|
||||
}
|
||||
parameters.routeName = routeInfo.getRouteName();
|
||||
parameters.startName = routeInfo.getStartName();//拼音
|
||||
parameters.endName = routeInfo.getEndName();//拼音
|
||||
parameters.startLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(routeInfo.getStartLocation().getLatitude(), routeInfo.getStartLocation().getLongitude());
|
||||
parameters.endLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(routeInfo.getEndLocation().getLatitude(), routeInfo.getEndLocation().getLongitude());
|
||||
parameters.vehicleType = 10;
|
||||
MessagePad.Line line = routeInfo.getLine();
|
||||
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
|
||||
line.getLineId(), line.getLineName(),
|
||||
line.getTrajUrl(), line.getTrajMd5(),
|
||||
line.getStopUrl(), line.getStopMd5(),
|
||||
line.getTimestamp(), line.getVehicleModel(),
|
||||
line.getTrajUrlDpqp(), line.getTrajMd5Dpqp(),
|
||||
line.getStopUrlDpqp(), line.getStopMd5Dpqp(),
|
||||
line.getTimestampDpqp());
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
}
|
||||
}).read();
|
||||
}
|
||||
});
|
||||
// 模拟 查询当前任务
|
||||
findViewById(R.id.btnQueryCurrentTask).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockQueryCurrentTaskInfo()
|
||||
//打开调试面板
|
||||
findViewById(R.id.btnOpenDebugView).setOnClickListener(view -> {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(DebugView.BROADCAST_ACTION);
|
||||
intent.putExtra(DebugView.BROADCAST_DATA_SHOW, true);
|
||||
LocalBroadcastManager.getInstance(requireContext()).sendBroadcast(intent);
|
||||
}
|
||||
);
|
||||
// 模拟 云端发送任务
|
||||
findViewById(R.id.btnSendTask).setOnClickListener(view -> {
|
||||
SweeperCloudTaskUtils.mockSendCloudTaskInfo(AiCloudTask.MessageType.CloudPushTask);
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
debugEndSubTask();
|
||||
}, 5000);
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
// 模拟 云端发送子任务确认
|
||||
findViewById(R.id.btnSendSubTaskConfirm).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockSendCloudSubTaskConfirm()
|
||||
);
|
||||
|
||||
// 模拟 云端请求结束大任务
|
||||
findViewById(R.id.btnSendEndTask).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockSendCloudBigTaskEnd()
|
||||
);
|
||||
// 模拟 云端发送子任务状态
|
||||
findViewById(R.id.btnSendSubtaskStatus).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockSendCloudUpdateSubTaskStatus()
|
||||
);
|
||||
// 模拟 云端发送大任务状态
|
||||
findViewById(R.id.btnSendTaskStatus).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockSendCloudBigTaskStatus()
|
||||
);
|
||||
// 模拟 添加高精地图Marker
|
||||
findViewById(R.id.btnAddHDMarker).setOnClickListener(view -> {
|
||||
// 坐标地址:湖南省衡阳市雁峰区金龙坪街道科学城大道衡山科学城停车场
|
||||
SweeperCloudTaskUtils.mockAddHdMarker("marker_sweeper_subtask_123_start",
|
||||
112.57742887355035,
|
||||
26.82068193910221,
|
||||
true);
|
||||
// 坐标地址:湖南省衡阳市雁峰区岳屏镇雁鸣路
|
||||
SweeperCloudTaskUtils.mockAddHdMarker("marker_sweeper_subtask_123_end",
|
||||
112.56666738544979,
|
||||
26.822879976829867,
|
||||
false);
|
||||
}
|
||||
);
|
||||
// 模拟 移除高精地图Marker
|
||||
findViewById(R.id.btnRemoveHDMarker).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockRemoveHDMarker()
|
||||
//关闭调试面板
|
||||
findViewById(R.id.btnCloseDebugView).setOnClickListener(view -> {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(DebugView.BROADCAST_ACTION);
|
||||
intent.putExtra(DebugView.BROADCAST_DATA_SHOW, false);
|
||||
LocalBroadcastManager.getInstance(requireContext()).sendBroadcast(intent);
|
||||
}
|
||||
);
|
||||
mTrafficDataView.getSpeedImage().setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -17,8 +17,6 @@ import com.mogo.map.overlay.point.Point
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.common.module.voice.VoiceNotice.showNotice
|
||||
import com.mogo.och.sweeper.R
|
||||
import com.mogo.och.sweeper.common.constant.SweeperConst.Companion.TYPE_MARKER_SWEEPER_SUBTASK_START_END
|
||||
import com.mogo.och.sweeper.common.database.MyDataBase
|
||||
import com.mogo.och.sweeper.cloud.presenter.SweeperCloudPresenter
|
||||
import com.mogo.och.sweeper.cloud.ui.dialog.SweeperCloudDialog
|
||||
import com.mogo.och.sweeper.cloud.ui.dialog.SweeperCloudLoadingDialog
|
||||
@@ -32,6 +30,9 @@ import com.mogo.och.sweeper.cloud.util.SweeperCloudTaskUtils.createSweeperTaskRe
|
||||
import com.mogo.och.sweeper.cloud.util.SweeperCloudTaskUtils.createSweeperTaskSuspendDialog
|
||||
import com.mogo.och.sweeper.cloud.util.SweeperCloudTaskUtils.printMessage
|
||||
import com.mogo.och.sweeper.cloud.view.SweeperCloudCurrentTaskInfoView
|
||||
import com.mogo.och.sweeper.common.constant.SweeperConst.Companion.TYPE_MARKER_SWEEPER_SUBTASK_START_END
|
||||
import com.mogo.och.sweeper.common.database.MyDataBase
|
||||
import com.mogo.och.sweeper.common.view.DebugView
|
||||
import com.zhjt.mogo.adas.data.AiCloudTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable
|
||||
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon
|
||||
@@ -42,8 +43,9 @@ import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.TaskModel
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.cloud.s_r.SweeperTaskCloudSuspendResume
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
|
||||
import kotlinx.android.synthetic.main.fragment_och_sweeper_cloud.*
|
||||
import kotlinx.android.synthetic.main.sweeper_cloud_no_data_common_view.*
|
||||
import kotlinx.android.synthetic.main.fragment_och_sweeper_cloud.sweeper_cl_work_mode
|
||||
import kotlinx.android.synthetic.main.fragment_och_sweeper_cloud.sweeper_current_task_view
|
||||
import kotlinx.android.synthetic.main.sweeper_cloud_no_data_common_view.noTaskDataView
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -311,6 +313,7 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
//已完成的计入任务进度,未完成的不计入
|
||||
ToastUtils.showLong("任务完成")
|
||||
showNotice("任务完成")
|
||||
DebugView.printInfoMsg("[任务状态]任务完成")
|
||||
|
||||
removeHDMapMarkerBySubTask(subTaskList[index])
|
||||
}
|
||||
@@ -374,6 +377,7 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
mDialog = sweeperCloudTaskNormalEndDialog()
|
||||
showNotice("任务已结束")
|
||||
ToastUtils.showLong("任务已结束")
|
||||
DebugView.printInfoMsg("[任务状态]任务已结束")
|
||||
} else {
|
||||
// 产品确认有弹框时不需要同步弹toast, 只需有TTS
|
||||
mDialog = createSweeperTaskEndDialog(context, object : com.mogo.och.sweeper.cloud.callback.SweeperCloudDialogClickListener {
|
||||
@@ -501,12 +505,14 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
}
|
||||
|
||||
showNotice("任务已结束")
|
||||
DebugView.printInfoMsg("[任务状态]任务已结束")
|
||||
// 大任务这里也判断移除HD Marker, 双重判断
|
||||
removeHDMapMarkerBySubTask(mCurrentRunningSubTaskInfo)
|
||||
resetTaskInfoPanel()
|
||||
} else if (bigTaskStatus == TaskStatus.SUSPENDED) {// 暂停
|
||||
showNotice("任务已暂停")
|
||||
ToastUtils.showLong("任务已暂停")
|
||||
DebugView.printInfoMsg("[任务状态]任务已暂停")
|
||||
//更新任务列表中大任务状态
|
||||
val builder = it.toBuilder()
|
||||
builder.taskStatus = TaskStatus.SUSPENDED
|
||||
@@ -517,6 +523,7 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
) { //恢复
|
||||
showNotice("任务已恢复")
|
||||
ToastUtils.showLong("任务已恢复")
|
||||
DebugView.printInfoMsg("[任务状态]任务已恢复")
|
||||
|
||||
//更新任务列表中大任务状态
|
||||
val builder = it.toBuilder()
|
||||
@@ -557,6 +564,7 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
SweeperTaskCloudSuspendResume.ActionType.SUSPENDED -> {
|
||||
mDialog = sweeperCloudTaskSuspendDialog(it.taskId)
|
||||
showNotice("云端暂停任务,注意车辆即将停车!")
|
||||
DebugView.printInfoMsg("[任务状态]云端暂停任务,注意车辆即将停车!")
|
||||
}
|
||||
|
||||
else -> {
|
||||
@@ -579,6 +587,7 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
}
|
||||
}
|
||||
showNotice(ttsString)
|
||||
DebugView.printInfoMsg("[任务状态]$ttsString")
|
||||
mDialog = sweeperCloudTaskResumeDialog(ttsString, it.taskId)
|
||||
}
|
||||
}
|
||||
@@ -610,9 +619,11 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
if (isBootableResp.code == SweeperCommon.Code.SUCCEED) {
|
||||
ToastUtils.showLong("上报云控成功")
|
||||
showNotice("上报云控成功")
|
||||
DebugView.printInfoMsg("[任务状态]上报云控成功")
|
||||
} else {
|
||||
ToastUtils.showLong("上报云控失败")
|
||||
showNotice("上报云控失败")
|
||||
DebugView.printErrorMsg("[任务状态]上报云控失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -773,8 +784,10 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
mDialog?.show()
|
||||
if (subTaskInfo.taskModel == TaskModel.MANUAL) {
|
||||
showNotice("请确认并执行子任务")
|
||||
DebugView.printInfoMsg("[任务状态]请确认并执行子任务")
|
||||
} else { //自动驾驶子任务,需要提醒在N档且拉起手刹,做好准备工作
|
||||
showNotice("请确认并执行子任务, 保持N档拉手刹再进入自动驾驶")
|
||||
DebugView.printInfoMsg("[任务状态]请确认并执行子任务, 保持N档拉手刹再进入自动驾驶")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,6 +843,7 @@ class SweeperCloudFragment : BaseSweeperCloudTabFragment<SweeperCloudFragment?,
|
||||
}, it)
|
||||
mDialog?.show()
|
||||
showNotice("已为您接取任务")
|
||||
DebugView.printInfoMsg("[任务状态]已为您接取任务")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,13 +31,14 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.sweeper.common.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.cloud.callback.ISweeperCloudTaskCallback;
|
||||
import com.mogo.och.sweeper.cloud.callback.ISweeperControllerStatusCallback;
|
||||
import com.mogo.och.sweeper.cloud.util.SweeperCloudTaskUtils;
|
||||
import com.mogo.och.sweeper.common.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.common.constant.SweeperConst;
|
||||
import com.mogo.och.sweeper.common.database.MyDataBase;
|
||||
import com.mogo.och.sweeper.common.database.bean.WeltDataBean;
|
||||
import com.mogo.och.sweeper.cloud.util.SweeperCloudTaskUtils;
|
||||
import com.mogo.och.sweeper.common.view.DebugView;
|
||||
import com.zhjt.mogo.adas.data.AiCloudTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
@@ -197,6 +198,7 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList() != null && routeList.getWayPointsList().size() > 0) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "onAutopilotRotting: " + SweeperCloudTaskUtils.printMessage(routeList));
|
||||
DebugView.Companion.printInfoMsg("[MAP全局规划回调] 回调,getWayPointsList.Size=" + routeList.getWayPointsList().size());
|
||||
|
||||
// MAP返回路线信息,在1秒内返回了2次,这里加上数据过滤
|
||||
long current = System.currentTimeMillis();
|
||||
@@ -290,6 +292,7 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
if (StatusDescriptor.VR_MODE == descriptor) {
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback.onVRModeChanged(isTrue);
|
||||
DebugView.Companion.printInfoMsg("[VRMode变化] isVRMode=" + isTrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -336,6 +339,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
|
||||
CallerLogger.d(M_SWEEPER + TAG,
|
||||
"messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " onSweeperFutianCloudTask:" + (taskInfo == null ? "null" : SweeperCloudTaskUtils.printMessage(taskInfo)) + " mSweeperTaskCallback:" + mSweeperTaskCallback);
|
||||
DebugView.Companion.printInfoMsg("[云控]云端下发大任务,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", taskInfo=("
|
||||
+ (taskInfo == null ? "null" : "taskId=" + taskInfo.getTaskId() + ", taskName=" + taskInfo.getTaskName() + ", taskStatus=" + taskInfo.getTaskStatus().name())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudTask(messageType, taskInfo);
|
||||
@@ -348,6 +357,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
|
||||
CallerLogger.d(M_SWEEPER + TAG, "messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " " +
|
||||
"onSweeperFutianCloudTaskConfirm:" + SweeperCloudTaskUtils.printMessage(taskConfirm));
|
||||
DebugView.Companion.printInfoMsg("[云控]云端下发子任务确认,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", taskConfirm=("
|
||||
+ (taskConfirm == null ? "null" : "taskId=" + taskConfirm.getTaskId() + ", subTaskId=" + taskConfirm.getSubTaskId() + ", isPop=" + taskConfirm.getIsPop())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null && taskConfirm != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudTaskConfirm(taskConfirm.getTaskId(), taskConfirm.getSubTaskId(), taskConfirm.getIsPop());
|
||||
@@ -359,6 +374,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
SweeperTaskStatus.TaskStatusPush taskStatusPush) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " " +
|
||||
"onSweeperFutianCloudTaskStatus:" + SweeperCloudTaskUtils.printMessage(taskStatusPush));
|
||||
DebugView.Companion.printInfoMsg("[云控]云端下发子任务状态,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", taskStatusPush=("
|
||||
+ (taskStatusPush == null ? "null" : "taskId=" + taskStatusPush.getTaskId() + ", subTaskId=" + taskStatusPush.getSubTaskId() + ", taskStatus=" + taskStatusPush.getTaskStatus().name())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null && taskStatusPush != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudTaskStatus(taskStatusPush.getTaskId(), taskStatusPush.getSubTaskId(), taskStatusPush.getTaskStatus());
|
||||
@@ -370,6 +391,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
SweeperTaskStop.StopTaskReq stopTaskReq) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " " +
|
||||
"onSweeperFutianCloudTaskStop:" + SweeperCloudTaskUtils.printMessage(stopTaskReq));
|
||||
DebugView.Companion.printInfoMsg("[云控]云端请求pad结束大任务,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", stopTaskReq=("
|
||||
+ (stopTaskReq == null ? "null" : "taskId=" + stopTaskReq.getTaskId() + ", type=" + stopTaskReq.getType() + ", isPop=" + stopTaskReq.getIsPop())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null && stopTaskReq != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudTaskStop(stopTaskReq.getTaskId(), stopTaskReq.getType(), stopTaskReq.getIsPop());
|
||||
@@ -381,6 +408,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
SweeperTaskSuspendResume.SuspendResumeTaskResp suspendResumeTaskResp) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " " +
|
||||
"onSweeperFutianCloudTaskSuspendResume:" + SweeperCloudTaskUtils.printMessage(suspendResumeTaskResp));
|
||||
DebugView.Companion.printInfoMsg("[云控]pad请求挂起/恢复任务云端回执,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", suspendResumeTaskResp=("
|
||||
+ (suspendResumeTaskResp == null ? "null" : "taskId=" + suspendResumeTaskResp.getTaskId() + ", subTaskId=" + suspendResumeTaskResp.getSubTaskId() + ", code=" + suspendResumeTaskResp.getCode().name())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null && suspendResumeTaskResp != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudTaskSuspendResume(messageType, suspendResumeTaskResp.getTaskId(),
|
||||
@@ -393,6 +426,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
SweeperBootable.IsBootableResp isBootableResp) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " " +
|
||||
"onSweeperFutianCloudBootable:" + SweeperCloudTaskUtils.printMessage(isBootableResp));
|
||||
DebugView.Companion.printInfoMsg("[云控]pad请求启自驾云端回执,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", isBootableResp=("
|
||||
+ (isBootableResp == null ? "null" : "taskId=" + isBootableResp.getTaskId() + ", subTaskId=" + isBootableResp.getSubTaskId())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null && isBootableResp != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudBootable(isBootableResp.getTaskId(), isBootableResp.getSubTaskId(), isBootableResp);
|
||||
@@ -404,6 +443,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
SweeperBigTaskStatus.BigTaskStatusPush bigTaskStatusPush) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " " +
|
||||
"onSweeperFutianCloudBigTaskStatus:" + SweeperCloudTaskUtils.printMessage(bigTaskStatusPush));
|
||||
DebugView.Companion.printInfoMsg("[云控]云端下发大任务状态,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", bigTaskStatusPush=("
|
||||
+ (bigTaskStatusPush == null ? "null" : "taskId=" + bigTaskStatusPush.getTaskId() + ", taskStatus=" + bigTaskStatusPush.getTaskStatus().name() + ", isPop=" + bigTaskStatusPush.getIsPop())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null && bigTaskStatusPush != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudBigTaskStatus(bigTaskStatusPush.getTaskId(), bigTaskStatusPush.getTaskStatus(), bigTaskStatusPush.getIsPop());
|
||||
@@ -415,6 +460,12 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
@Nullable SweeperTaskCloudSuspendResume.BigTaskActionPush bigTaskActionPush) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "messageType: " + messageType.getNumber() + " sysTime:" + sysTime + " reqNo:" + reqNo + " " +
|
||||
"onSweeperFutianCloudTaskCloudSuspendResume:" + SweeperCloudTaskUtils.printMessage(bigTaskActionPush));
|
||||
DebugView.Companion.printInfoMsg("[云控]云端下发暂停/恢复指令,messageType=" + messageType.getNumber()
|
||||
+ ", sysTime=" + sysTime
|
||||
+ ", reqNo=" + reqNo
|
||||
+ ", bigTaskActionPush=("
|
||||
+ (bigTaskActionPush == null ? "null" : "taskId=" + bigTaskActionPush.getTaskId() + ", action=" + bigTaskActionPush.getAction() + ", isPop=" + bigTaskActionPush.getIsPop())
|
||||
+ ")");
|
||||
if (mSweeperTaskCallback != null && bigTaskActionPush != null) {
|
||||
msgTypeAndReqNo.put(messageType.getNumber(), reqNo);
|
||||
mSweeperTaskCallback.onSweeperCloudBigTaskSuspendResume(bigTaskActionPush.getTaskId(), bigTaskActionPush.getAction(), bigTaskActionPush.getIsPop());
|
||||
@@ -435,6 +486,7 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
if (mSweeperTaskCallback != null) {
|
||||
mSweeperTaskCallback.onSweeperFutianCleanSystemState(cleanSystemState);
|
||||
}
|
||||
DebugView.Companion.printInfoMsg("[域控]接收到上装系统状态并更新");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -458,6 +510,7 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
// CallerLogger.INSTANCE.d(M_SWEEPER + TAG,
|
||||
// "mSubTaskType:" + mSubTaskType + "+ onSweeperFutianTaskIndexData:" + printMessage(roboSweeperTaskIndex));
|
||||
// handleWeltData(roboSweeperTaskIndex);
|
||||
// DebugView.Companion.printInfoMsg("[域控]接收到贴边数据并更新");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -538,6 +591,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
getAutoPilotControlManager().sendSweeperStartTaskResp(reqNo, startTaskResp);
|
||||
CallerLogger.d(M_SWEEPER + TAG,
|
||||
"sendSweeperStartTaskResp:" + SweeperCloudTaskUtils.printMessage(startTaskResp) + " reqNo:" + reqNo + " messageType:" + AiCloudTask.MessageType.CloudPushTask.getNumber());
|
||||
DebugView.Companion.printInfoMsg("[云控]pad发送接收 云端下发大任务信息 回执给云端,taskId=" + taskId
|
||||
+ ", StartTaskCode=" + code
|
||||
+ ", reqNo=" + reqNo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -551,9 +607,13 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
builder.setCode(code);
|
||||
SweeperTaskConfirm.TaskConfirmResp taskConfirmResp = builder.build();
|
||||
String reqNo = msgTypeAndReqNo.get(AiCloudTask.MessageType.CloudPushTaskConfirm.getNumber());
|
||||
getAutoPilotControlManager().sendSweeperTaskConfirmResp(reqNo, taskConfirmResp);
|
||||
CallerLogger.d(M_SWEEPER + TAG,
|
||||
"sendSweeperTaskConfirmResp" + SweeperCloudTaskUtils.printMessage(taskConfirmResp) + " reqNo:" + reqNo + " messageType:" + AiCloudTask.MessageType.CloudPushTaskConfirm.getNumber());
|
||||
getAutoPilotControlManager().sendSweeperTaskConfirmResp(reqNo, taskConfirmResp);
|
||||
DebugView.Companion.printInfoMsg("[云控]pad发送接收 云端下发子任务pad确认 回执给云端,taskId=" + taskId
|
||||
+ ", subTaskId=" + subTaskId
|
||||
+ ", TaskConfirmCode=" + code
|
||||
+ ", reqNo=" + reqNo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -573,6 +633,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
CallerLogger.d(M_SWEEPER + TAG,
|
||||
"sendSweeperStopTaskResp" + SweeperCloudTaskUtils.printMessage(stopTaskResp) + " reqNo:" + reqNo + " messageType:" + AiCloudTask.MessageType.CloudPushTaskStop.getNumber());
|
||||
getAutoPilotControlManager().sendSweeperStopTaskResp(reqNo, stopTaskResp);
|
||||
DebugView.Companion.printInfoMsg("[云控]pad发送接收 云端请求pad结束大任务 回执给云端,taskId=" + taskId
|
||||
+ ", StopTaskCode=" + code
|
||||
+ ", reqNo=" + reqNo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -594,6 +657,10 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
CallerLogger.d(M_SWEEPER + TAG,
|
||||
"sendSweeperAutopilotBootable" + SweeperCloudTaskUtils.printMessage(isBootable) + " reqNo:" + reqNo + " messageType:" + AiCloudTask.MessageType.PadSendBootable.getNumber());
|
||||
getAutoPilotControlManager().sendSweeperAutopilotBootable(reqNo, isBootable);
|
||||
DebugView.Companion.printInfoMsg("[云控]pad发送 请求进入自动驾驶 给云端,taskId=" + taskId
|
||||
+ ", subTaskId=" + subTaskId
|
||||
+ ", lineId=" + lineId
|
||||
+ ", reqNo=" + reqNo);
|
||||
//SweeperCloudTaskUtils.mockSendCloudBootable();
|
||||
}
|
||||
|
||||
@@ -613,6 +680,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
CallerLogger.d(M_SWEEPER + TAG,
|
||||
"sendSweeperSuspendResumeTaskResp" + SweeperCloudTaskUtils.printMessage(resp) + " reqNo:" + reqNo + " messageType:" + AiCloudTask.MessageType.CloudPushTaskSuspendResume);
|
||||
getAutoPilotControlManager().sendSweeperCloudSuspendResumeTaskResp(reqNo, resp);
|
||||
DebugView.Companion.printInfoMsg("[云控]pad发送接收 云端下发大任务暂停/恢复 回执给云端,taskId=" + taskId
|
||||
+ ", SuspendResumeCode=" + code
|
||||
+ ", reqNo=" + reqNo);
|
||||
}
|
||||
|
||||
public CallerAutoPilotControlManager getAutoPilotControlManager() {
|
||||
@@ -630,7 +700,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
||||
|
||||
DebugView.Companion.printInfoMsg("[MAP到站通知] 上报到站,endLocation=("
|
||||
+ ((arrivalNotification == null || arrivalNotification.getEndLocation() == null) ? "null" : arrivalNotification.getEndLocation().toString())
|
||||
+ ")");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -651,6 +723,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
getCurrentTask();
|
||||
}, 10000);
|
||||
}
|
||||
DebugView.Companion.printInfoMsg(
|
||||
"[域控连接状态变化] status=" + status
|
||||
+ ", reason=" + reason);
|
||||
//CallerLogger.d(M_SWEEPER + TAG, "onAutopilotIpcConnectStatusChanged status:" + status + " reason:" + reason);
|
||||
}
|
||||
|
||||
@@ -678,6 +753,7 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
public void onSweeperFutianCloudTaskUnknown(@NonNull byte[] bytes) {
|
||||
String string = new String(bytes, StandardCharsets.UTF_8);
|
||||
CallerLogger.d(M_SWEEPER + TAG, "onSweeperFutianCloudTaskUnknown:" + string);
|
||||
DebugView.Companion.printInfoMsg("[云控]接收到云端未知类型消息,Unknown=" + string);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -689,12 +765,16 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene
|
||||
}
|
||||
switch (state) {
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE://不可自动驾驶
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_DISABLE,meaning=不可自动驾驶");
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE://人工驾驶
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_ENABLE,meaning=可自动驾驶,人工干预状态");
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING://自动驾驶中
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNING,meaning=自动驾驶中");
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING://平行驾驶
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_PARALLEL_DRIVING,meaning=平行驾驶中");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.mogo.och.sweeper.common.view
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.text.SpannableString
|
||||
import android.text.Spanned
|
||||
import android.text.method.ScrollingMovementMethod
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.ProcessLifecycleOwner
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.main.MainMoGoApplication
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.sweeper.R
|
||||
import kotlinx.android.synthetic.main.sweeper_debug_view_content.view.currentSweeperModeTextView
|
||||
import kotlinx.android.synthetic.main.sweeper_debug_view_content.view.debugLogHistoryTextView
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
||||
class DebugView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr, defStyleRes) {
|
||||
companion object {
|
||||
const val TAG = "DebugView"
|
||||
private const val ANALYTICS_EVENT_TYPE_DRIVER_SWEEPER_OPERATION_PROCESS_KEY_NODE_LOG =
|
||||
"och.driver.sweeper.operation.process.key.node.log"
|
||||
const val BROADCAST_ACTION = "com.mogo.och.driver.debugview.show"
|
||||
const val BROADCAST_DATA_SHOW = "isShow"
|
||||
private var logHistoryTextView: TextView? = null
|
||||
|
||||
fun printInfoMsg(msg: String) {
|
||||
printMsg("Info $msg", MainMoGoApplication.getApp().getColor(R.color.background_info))
|
||||
trackEvent("Info", msg)
|
||||
}
|
||||
|
||||
fun printWarnMsg(msg: String) {
|
||||
printMsg("Warn $msg", MainMoGoApplication.getApp().getColor(R.color.background_warn))
|
||||
trackEvent("Warn", msg)
|
||||
}
|
||||
|
||||
fun printErrorMsg(msg: String) {
|
||||
printMsg("Error $msg", MainMoGoApplication.getApp().getColor(R.color.background_error))
|
||||
trackEvent("Error", msg)
|
||||
}
|
||||
|
||||
private fun printMsg(msg: String, textColor: Int) {
|
||||
logHistoryTextView?.also {
|
||||
val msg = "${currentDateTimeString()} $msg"
|
||||
val spannableMsg = SpannableString(msg)
|
||||
|
||||
spannableMsg.setSpan(
|
||||
ForegroundColorSpan(textColor), 0, msg.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
UiThreadHandler.post({
|
||||
it.append("\n")
|
||||
it.append(spannableMsg)
|
||||
|
||||
val offset: Int = it.lineCount * it.lineHeight
|
||||
if (offset > it.height) {
|
||||
it.scrollTo(0, offset - it.height)
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上报埋点
|
||||
*/
|
||||
private fun trackEvent(level: String, msg: String) {
|
||||
ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.IO) {
|
||||
val map: MutableMap<String, Any> = HashMap()
|
||||
map["level"] = level
|
||||
map["msg"] = msg
|
||||
MogoAnalyticUtils.track(ANALYTICS_EVENT_TYPE_DRIVER_SWEEPER_OPERATION_PROCESS_KEY_NODE_LOG, map)
|
||||
}
|
||||
}
|
||||
|
||||
private fun currentDateTimeString(): String {
|
||||
return DateTimeUtil.formatCalendarToString(
|
||||
DateTimeUtil.formatLongToCalendar(System.currentTimeMillis()),
|
||||
DateTimeUtil.yyyy_MM_dd_HH_mm_ss
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private val broadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (BROADCAST_ACTION == intent.action) {
|
||||
val isShow = intent.getBooleanExtra(BROADCAST_DATA_SHOW, false)
|
||||
visibility = if (isShow) VISIBLE else GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
initBroadcastReceiver()
|
||||
LayoutInflater.from(context).inflate(R.layout.sweeper_debug_view_content, this, true)
|
||||
debugLogHistoryTextView.movementMethod = ScrollingMovementMethod.getInstance()
|
||||
visibility = GONE
|
||||
logHistoryTextView = debugLogHistoryTextView
|
||||
}
|
||||
|
||||
private fun initBroadcastReceiver() {
|
||||
val intentFilter = IntentFilter()
|
||||
intentFilter.addAction(BROADCAST_ACTION)
|
||||
LocalBroadcastManager.getInstance(context).registerReceiver(broadcastReceiver, intentFilter)
|
||||
}
|
||||
|
||||
fun toggleDebugView() {
|
||||
visibility = if (visibility == View.VISIBLE) View.GONE
|
||||
else View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initView()
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
}
|
||||
|
||||
fun initView() {
|
||||
currentSweeperModeTextView.text = "当前清扫模式:${FunctionBuildConfig.sweeperCurrentMode}"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.och.sweeper.operate.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
@@ -7,12 +8,17 @@ import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
@@ -35,18 +41,14 @@ import com.mogo.och.sweeper.common.callback.IWeltMapSwitchToSmallCallback;
|
||||
import com.mogo.och.sweeper.common.database.bean.WeltDataBean;
|
||||
import com.mogo.och.sweeper.common.fragment.SweeperAmapNaviFragment;
|
||||
import com.mogo.och.sweeper.common.fragment.WeltMapOverViewFragment;
|
||||
import com.mogo.och.sweeper.operate.view.SweeperOperateTrafficDataView;
|
||||
import com.mogo.och.sweeper.common.view.DebugView;
|
||||
import com.mogo.och.sweeper.common.view.WeltSmallMapView;
|
||||
import com.mogo.och.sweeper.operate.view.SweeperOperateTrafficDataView;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
/**
|
||||
* 网约车基础Fragment,主要负责布局通用界面,处理站点面板和通话面板互斥情况
|
||||
* <p>
|
||||
@@ -129,23 +131,21 @@ public abstract class BaseSweeperOperateTabFragment<V extends IView, P extends P
|
||||
setMessageBox();
|
||||
//设置左下角四个按钮监听事件
|
||||
setBottomBtnListener();
|
||||
// 模拟 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接
|
||||
findViewById(R.id.btnAutopilotDisable).setOnClickListener(view ->
|
||||
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE)
|
||||
//打开调试面板
|
||||
findViewById(R.id.btnOpenDebugView).setOnClickListener(view -> {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(DebugView.BROADCAST_ACTION);
|
||||
intent.putExtra(DebugView.BROADCAST_DATA_SHOW, true);
|
||||
LocalBroadcastManager.getInstance(requireContext()).sendBroadcast(intent);
|
||||
}
|
||||
);
|
||||
|
||||
// 模拟 可自动驾驶,工控机连接正常,且处于人工干预状态
|
||||
findViewById(R.id.btnAutopilotEnable).setOnClickListener(view ->
|
||||
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE)
|
||||
);
|
||||
|
||||
// 模拟 自动驾驶能力,自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
|
||||
findViewById(R.id.btnAutopilotRunning).setOnClickListener(view ->
|
||||
debugAutoPilotStatus(IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING)
|
||||
);
|
||||
// 模拟 结束子任务
|
||||
findViewById(R.id.btnEndTask).setOnClickListener(view ->
|
||||
debugEndSubTask()
|
||||
//关闭调试面板
|
||||
findViewById(R.id.btnCloseDebugView).setOnClickListener(view -> {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(DebugView.BROADCAST_ACTION);
|
||||
intent.putExtra(DebugView.BROADCAST_DATA_SHOW, false);
|
||||
LocalBroadcastManager.getInstance(requireContext()).sendBroadcast(intent);
|
||||
}
|
||||
);
|
||||
mTrafficDataView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.mogo.och.sweeper.operate.model;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_SWEEPER;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -12,6 +14,8 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener;
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
@@ -40,20 +44,21 @@ import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.common.module.utils.ToastUtilsOch;
|
||||
import com.mogo.och.common.module.voice.VoiceNotice;
|
||||
import com.mogo.och.sweeper.R;
|
||||
import com.mogo.och.sweeper.common.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.common.callback.ISweeperADASStatusCallback;
|
||||
import com.mogo.och.sweeper.common.constant.SweeperConst;
|
||||
import com.mogo.och.sweeper.common.util.SweeperAnalyticsManager;
|
||||
import com.mogo.och.sweeper.common.view.DebugView;
|
||||
import com.mogo.och.sweeper.operate.bean.BaseResponse;
|
||||
import com.mogo.och.sweeper.operate.bean.SubInfo;
|
||||
import com.mogo.och.sweeper.operate.bean.SweeperMainTaskBean;
|
||||
import com.mogo.och.sweeper.common.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.operate.bean.SweeperSubTaskBean;
|
||||
import com.mogo.och.sweeper.operate.bean.SweeperSubTaskDetailBean;
|
||||
import com.mogo.och.sweeper.common.callback.ISweeperADASStatusCallback;
|
||||
import com.mogo.och.sweeper.operate.callback.ISweeperControllerStatusCallback;
|
||||
import com.mogo.och.sweeper.operate.callback.ISweeperOperateTaskCallback;
|
||||
import com.mogo.och.sweeper.operate.constant.SubTaskTypeEnum;
|
||||
import com.mogo.och.sweeper.common.constant.SweeperConst;
|
||||
import com.mogo.och.sweeper.operate.constant.TaskStatusEnum;
|
||||
import com.mogo.och.sweeper.operate.net.SweeperOperateServiceManager;
|
||||
import com.mogo.och.sweeper.common.util.SweeperAnalyticsManager;
|
||||
import com.mogo.och.sweeper.operate.util.SweeperTrajectoryManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -137,6 +142,9 @@ public class SweeperOperateTaskModel {
|
||||
OCHSocketMessageManager.msgMonitorType,
|
||||
mMogoOnMessageListener);
|
||||
|
||||
IntentManager.getInstance()
|
||||
.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
|
||||
//2022.1.28
|
||||
// 调用Disposable.dispose() 时候会出现InterruptedException 导致出现崩溃
|
||||
// The exception could not be delivered to the consumer because it has already canceled/disposed
|
||||
@@ -191,7 +199,8 @@ public class SweeperOperateTaskModel {
|
||||
|
||||
@Override
|
||||
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
|
||||
if (null != routeList && routeList.getWayPointsList()!=null&&routeList.getWayPointsList().size() > 0) {
|
||||
if (null != routeList && routeList.getWayPointsList() != null && routeList.getWayPointsList().size() > 0) {
|
||||
DebugView.Companion.printInfoMsg("[MAP全局规划回调] 回调,getWayPointsList.Size=" + routeList.getWayPointsList().size());
|
||||
if (mCurrentSubTaskDetail.getLineId() != mLineId) {//判断是否同一条路线
|
||||
mLineId = mCurrentSubTaskDetail.getLineId();
|
||||
points.addAll(coordinateConverterWgsToGcjList(mContext, routeList.getWayPointsList()));
|
||||
@@ -216,7 +225,7 @@ public class SweeperOperateTaskModel {
|
||||
*/
|
||||
public void clearRouteList() {
|
||||
points.clear();
|
||||
mSubTaskType=0;
|
||||
mSubTaskType = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,10 +279,26 @@ public class SweeperOperateTaskModel {
|
||||
}
|
||||
CallerLogger.d(M_SWEEPER + TAG, "onMsgReceived = " + obj.getMessage());
|
||||
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(obj.getPushTimeStamp(),
|
||||
obj.getMessage(),OCHSocketMessageManager.OPERATION_SYSTEM);
|
||||
obj.getMessage(), OCHSocketMessageManager.OPERATION_SYSTEM);
|
||||
}
|
||||
};
|
||||
|
||||
//监听网络变化,避免启动机器时无网导致无法更新信息
|
||||
private final IMogoIntentListener mNetWorkIntentListener = new IMogoIntentListener() {
|
||||
|
||||
@Override
|
||||
public void onIntentReceived(String intentStr, Intent intent) {
|
||||
CallerLogger.d(TAG, "mNetWorkIntentListener: onIntentReceived=" + intentStr);
|
||||
if ((ConnectivityManager.CONNECTIVITY_ACTION.equals(intentStr))) {
|
||||
if (NetworkUtils.isConnected(mContext)) {
|
||||
DebugView.Companion.printInfoMsg("[网络状态变化] isConnected=true");
|
||||
} else {
|
||||
DebugView.Companion.printErrorMsg("[网络状态变化] isConnected=false");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private final IMogoStatusChangedListener mMogoStatusChangedListener = new IMogoStatusChangedListener() {
|
||||
// VR mode变更回调
|
||||
@Override
|
||||
@@ -281,6 +306,7 @@ public class SweeperOperateTaskModel {
|
||||
if (StatusDescriptor.VR_MODE == descriptor) {
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback.onVRModeChanged(isTrue);
|
||||
DebugView.Companion.printInfoMsg("[VRMode变化] isVRMode=" + isTrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -294,6 +320,7 @@ public class SweeperOperateTaskModel {
|
||||
|
||||
@Override
|
||||
public void onStartAutopilotFailure(@NotNull String startFailedCode, @NonNull String startFailedMessage) {
|
||||
DebugView.Companion.printInfoMsg("[启自驾] 执行失败,code=" + startFailedCode + ", msg=" + startFailedMessage);
|
||||
SweeperAnalyticsManager.getInstance().triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage);
|
||||
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode) {
|
||||
CallerLogger.e(M_SWEEPER + TAG, "mAdasStartFailureListener = " + startFailedMessage);
|
||||
@@ -308,7 +335,7 @@ public class SweeperOperateTaskModel {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (null == gnssInfo) return;
|
||||
CallerLogger.e(M_SWEEPER + TAG, "高德定位到站:mLongitude = " + gnssInfo.getLongitude()
|
||||
+ ", mLatitude=" + gnssInfo.getLatitude() + ", mSubTaskType=" + mSubTaskType +", mIsSubTaskWorking=" + mIsSubTaskWorking
|
||||
+ ", mLatitude=" + gnssInfo.getLatitude() + ", mSubTaskType=" + mSubTaskType + ", mIsSubTaskWorking=" + mIsSubTaskWorking
|
||||
+ ", isAutopilotSubTaskArriveEndSite=" + isAutopilotSubTaskArriveEndSite
|
||||
);
|
||||
if (mControllerStatusCallback != null) {
|
||||
@@ -362,6 +389,9 @@ public class SweeperOperateTaskModel {
|
||||
if (distance <= SweeperConst.ARRIVE_AT_END_STATION_DISTANCE) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "行程日志-judgeArrivedStation() distance = " + distance
|
||||
+ " to " + mCurrentSubTaskDetail.getEndSiteName());
|
||||
DebugView.Companion.printInfoMsg(
|
||||
"[自车定位围栏] 触发围栏,围栏范围:" + SweeperConst.ARRIVE_AT_END_STATION_DISTANCE + "米"
|
||||
);
|
||||
isAutopilotSubTaskArriveEndSite = true;
|
||||
//到达子任务终点 结束子任务
|
||||
subTaskEnd(mIsFirstSubtask, mIsLastSubtask, mSubTaskId); //无自动驾驶到终点信息传null
|
||||
@@ -384,9 +414,11 @@ public class SweeperOperateTaskModel {
|
||||
* @param isRestart
|
||||
*/
|
||||
private void startAutopilot(boolean isRestart) {
|
||||
DebugView.Companion.printInfoMsg("[启自驾] startAutoPilot");
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
|
||||
", 请稍候重试");
|
||||
DebugView.Companion.printErrorMsg("[启自驾]" + OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
|
||||
triggerUnableStartAPReasonEvent();
|
||||
return;
|
||||
}
|
||||
@@ -395,9 +427,11 @@ public class SweeperOperateTaskModel {
|
||||
AutopilotControlParameters parameters = initAutopilotControlParameters();
|
||||
if (null == parameters) {
|
||||
CallerLogger.e(M_SWEEPER + TAG, "行程日志-AutopilotControlParameters is empty.");
|
||||
DebugView.Companion.printErrorMsg("[启自驾]行程日志-AutopilotControlParameters is empty");
|
||||
return;
|
||||
}
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
DebugView.Companion.printInfoMsg("[启自驾] 调用成功");
|
||||
CallerLogger.d(M_SWEEPER + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
|
||||
"isRestart = " + isRestart);
|
||||
@@ -444,6 +478,9 @@ public class SweeperOperateTaskModel {
|
||||
public void onArriveTaskEnd(MessagePad.ArrivalNotification data) {
|
||||
//MAP 280 每隔100ms左右返回一次到站, 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题
|
||||
//此处比对 自驾告诉的子任务终点坐标和本地应到子任务终点坐标, 一致时才表示子任务完成
|
||||
DebugView.Companion.printInfoMsg("[MAP到站通知] 上报到站,endLocation=("
|
||||
+ ((data == null || data.getEndLocation() == null) ? "null" : data.getEndLocation().toString())
|
||||
+ ")");
|
||||
if (data != null && data.getEndLocation() != null && mCurrentSubTaskDetail != null) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "MAP到站通知:" + mCurrentSubTaskDetail.getEndSiteName() + " 经度:"
|
||||
+ data.getEndLocation().getLongitude() + " 纬度:" + data.getEndLocation().getLatitude());
|
||||
@@ -494,7 +531,6 @@ public class SweeperOperateTaskModel {
|
||||
* 将轨迹文件信息同步到鹰眼
|
||||
*/
|
||||
private void updateAutopilotControlParameters() {
|
||||
|
||||
AutopilotControlParameters parameters = initAutopilotControlParameters();
|
||||
if (null == parameters) {
|
||||
CallerLogger.e(M_SWEEPER + TAG, "AutopilotControlParameters is empty.");
|
||||
@@ -503,11 +539,13 @@ public class SweeperOperateTaskModel {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "AutopilotControlParameters" + GsonUtil.jsonFromObject(parameters));
|
||||
CallerLogger.d(M_SWEEPER + TAG, "AutopilotControlParameters is update.");
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
|
||||
DebugView.Companion.printInfoMsg("[启自驾] updateAutopilotControlParameters调用成功");
|
||||
}
|
||||
|
||||
private void clearAutopilotControlParameters() {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "AutopilotControlParameters is clear.");
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null);
|
||||
DebugView.Companion.printInfoMsg("[启自驾] clearAutopilotControlParameters调用成功");
|
||||
}
|
||||
|
||||
private AutopilotControlParameters initAutopilotControlParameters() {
|
||||
@@ -538,10 +576,12 @@ public class SweeperOperateTaskModel {
|
||||
* 获取当前正在执行的任务
|
||||
*/
|
||||
public void getCurrentTask() {
|
||||
DebugView.Companion.printInfoMsg("[查询当前任务] 请求中");
|
||||
SweeperOperateServiceManager.getCurrentTask(mContext, new OchCommonServiceCallback<BaseResponse<SweeperSubTaskBean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<SweeperSubTaskBean> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "getCurrentTask:" + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[查询当前任务] 请求success");
|
||||
if (mSweeperTaskCallback != null && data != null) {
|
||||
SweeperSubTaskBean sweeperSubTaskBean = data.getData();
|
||||
if (sweeperSubTaskBean != null && sweeperSubTaskBean.getSubList() != null && sweeperSubTaskBean.getSubList().size() > 0) {
|
||||
@@ -556,8 +596,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询当前任务] 请求error," + mContext.getString(R.string.network_error_tip));
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询当前任务] 请求error," + mContext.getString(R.string.request_error_tip));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,8 +608,10 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[查询当前任务] 请求failed, 网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[查询当前任务] 请求failed, " + msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -578,10 +622,12 @@ public class SweeperOperateTaskModel {
|
||||
* 获取主任务列表
|
||||
*/
|
||||
public void getMainTaskList(boolean refresh) {
|
||||
DebugView.Companion.printInfoMsg("[查询主任务] 请求中");
|
||||
SweeperOperateServiceManager.getMainTaskList(mContext, new OchCommonServiceCallback<BaseResponse<List<SweeperMainTaskBean>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<List<SweeperMainTaskBean>> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "getMainTaskList:" + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[查询主任务] 请求success");
|
||||
if (mSweeperTaskCallback != null && data != null && data.getCode() == 0) {
|
||||
List<SweeperMainTaskBean> list = data.getData();
|
||||
mSweeperTaskCallback.setMainTaskList(list, refresh);
|
||||
@@ -593,8 +639,10 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[查询主任务] 请求error, 网络异常,请稍后重试");
|
||||
} else {
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[查询主任务] 请求error, " + msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -603,8 +651,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询主任务] 请求failed, " + mContext.getString(R.string.network_error_tip));
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询主任务] 请求failed, " + mContext.getString(R.string.request_error_tip));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -614,10 +664,12 @@ public class SweeperOperateTaskModel {
|
||||
* 获取子任务列表
|
||||
*/
|
||||
public void getSubTaskList(int taskId, SweeperSubTaskBean sweeperSubTaskBean) {
|
||||
DebugView.Companion.printInfoMsg("[查询子任务] 请求中, taskId=" + taskId);
|
||||
SweeperOperateServiceManager.getSubTaskList(taskId, mContext, new OchCommonServiceCallback<BaseResponse<List<SubInfo>>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<List<SubInfo>> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "getSubTaskList:" + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[查询子任务] 请求success, taskId=" + taskId);
|
||||
if (mSweeperTaskCallback != null && data != null && data.getCode() == 0) {
|
||||
List<SubInfo> list = data.getData();
|
||||
if (list != null && list.size() > 0) {
|
||||
@@ -634,8 +686,10 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[查询子任务] 请求failed, 网络异常,请稍后重试, taskId=" + taskId);
|
||||
} else {
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[查询子任务] 请求failed, " + msg + ", taskId=" + taskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -644,8 +698,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询子任务] 请求error, " + mContext.getString(R.string.network_error_tip) + ", taskId=" + taskId);
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询子任务] 请求error, " + mContext.getString(R.string.request_error_tip) + ", taskId=" + taskId);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -655,10 +711,12 @@ public class SweeperOperateTaskModel {
|
||||
* 获取子任务详情包括轨迹文件信息
|
||||
*/
|
||||
public void getSubTaskDetail(boolean isFirst, boolean isEnd, int subTaskId, SubTaskTypeEnum subTaskType, boolean isStartSubtask) {
|
||||
DebugView.Companion.printInfoMsg("[查询子任务详情及轨迹信息] 请求中, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
SweeperOperateServiceManager.getSubTaskDetail(subTaskId, mContext, new OchCommonServiceCallback<BaseResponse<SweeperSubTaskDetailBean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<SweeperSubTaskDetailBean> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "getSubTaskDetail:" + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[查询子任务详情及轨迹信息] 请求success, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
if (data != null) {
|
||||
mCurrentSubTaskDetail = data.getData();
|
||||
if (mCurrentSubTaskDetail != null) {
|
||||
@@ -693,8 +751,10 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[查询子任务详情及轨迹信息] 请求failed, 网络异常,请稍后重试, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[查询子任务详情及轨迹信息] 请求failed, " + msg + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -703,8 +763,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询子任务详情及轨迹信息] 请求Error, " + mContext.getString(R.string.network_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[查询子任务详情及轨迹信息] 请求Error, " + mContext.getString(R.string.request_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -714,10 +776,12 @@ public class SweeperOperateTaskModel {
|
||||
* 子任务开始上报
|
||||
*/
|
||||
public void subTaskStart(boolean isFirst, boolean isEnd, int subTaskId, SubTaskTypeEnum subTaskType) {
|
||||
DebugView.Companion.printInfoMsg("[子任务开始上报] 请求中, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
SweeperOperateServiceManager.subTaskStart(isFirst, isEnd, subTaskId, mContext, new OchCommonServiceCallback<BaseResponse<Boolean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<Boolean> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "subTaskStart:" + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[子任务开始上报] 请求success, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
if (mSweeperTaskCallback != null && data != null) {
|
||||
if (data.getData()) {
|
||||
mIsSubTaskWorking = true;
|
||||
@@ -743,8 +807,10 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[子任务开始上报] 请求failed, 网络异常,请稍后重试, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[子任务开始上报] 请求failed, " + msg + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -753,8 +819,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[子任务开始上报] 请求error, " + mContext.getString(R.string.network_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[子任务开始上报] 请求error, " + mContext.getString(R.string.request_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -764,11 +832,13 @@ public class SweeperOperateTaskModel {
|
||||
* 子任务结束上报
|
||||
*/
|
||||
public void subTaskEnd(boolean isFirst, boolean isEnd, int subTaskId) {
|
||||
DebugView.Companion.printInfoMsg("[子任务结束上报] 请求中, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
SweeperOperateServiceManager.subTaskEnd(isFirst, isEnd, subTaskId, mContext, new OchCommonServiceCallback<BaseResponse<Boolean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<Boolean> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "subTaskEnd:" +
|
||||
String.format("isFirst=%b; isEnd=%b; ", isFirst, isEnd) + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[子任务结束上报] 请求success, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
if (data != null) {
|
||||
if (data.getData()) {
|
||||
mIsSubTaskWorking = false;
|
||||
@@ -792,9 +862,11 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[子任务结束上报] 请求failed, 网络异常,请稍后重试, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
if (isAutopilotSubTaskArriveEndSite) return;
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[子任务结束上报] 请求failed, " + msg + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -803,8 +875,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[子任务结束上报] 请求error, " + mContext.getString(R.string.network_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[子任务结束上报] 请求error, " + mContext.getString(R.string.request_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -815,11 +889,13 @@ public class SweeperOperateTaskModel {
|
||||
* 子任务跳过上报
|
||||
*/
|
||||
public void subTaskSkip(boolean isFirst, boolean isEnd, int subTaskId) {
|
||||
DebugView.Companion.printInfoMsg("[子任务跳过上报] 请求中, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
SweeperOperateServiceManager.subTaskSkip(isFirst, isEnd, subTaskId, mContext, new OchCommonServiceCallback<BaseResponse<Boolean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<Boolean> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "subTaskSkip:" +
|
||||
String.format("isFirst=%b; isEnd=%b; ", isFirst, isEnd)+ GsonUtil.jsonFromObject(data));
|
||||
String.format("isFirst=%b; isEnd=%b; ", isFirst, isEnd) + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[子任务跳过上报] 请求success, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
if (mSweeperTaskCallback != null && data != null) {
|
||||
if (data.getData()) {
|
||||
mIsSubTaskWorking = false;
|
||||
@@ -835,8 +911,10 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[子任务跳过上报] 请求failed, 网络异常,请稍后重试, isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[子任务跳过上报] 请求failed, " + msg + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -845,8 +923,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[子任务跳过上报] 请求error, " + mContext.getString(R.string.network_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[子任务跳过上报] 请求error, " + mContext.getString(R.string.request_error_tip) + ", isFirst=" + isFirst + ", isEnd=" + isEnd + ", subTaskId=" + subTaskId);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -856,10 +936,12 @@ public class SweeperOperateTaskModel {
|
||||
* 主任务重置
|
||||
*/
|
||||
public void mainTaskReset(int taskId) {
|
||||
DebugView.Companion.printInfoMsg("[主任务重置] 请求中, taskId=" + taskId);
|
||||
SweeperOperateServiceManager.mainTaskReset(taskId, mContext, new OchCommonServiceCallback<BaseResponse<Boolean>>() {
|
||||
@Override
|
||||
public void onSuccess(BaseResponse<Boolean> data) {
|
||||
CallerLogger.d(M_SWEEPER + TAG, "mainTaskReset:" + GsonUtil.jsonFromObject(data));
|
||||
DebugView.Companion.printInfoMsg("[主任务重置] 请求success, taskId=" + taskId);
|
||||
// 主任务重置 当前子任务也需重置
|
||||
mIsSubTaskWorking = false;
|
||||
isAutopilotSubTaskArriveEndSite = false;
|
||||
@@ -873,8 +955,10 @@ public class SweeperOperateTaskModel {
|
||||
if (ToastUtilsOch.isCustomFastClick(5000)) {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort("网络异常,请稍后重试");
|
||||
DebugView.Companion.printErrorMsg("[主任务重置] 请求failed, 网络异常,请稍后重试, taskId=" + taskId);
|
||||
} else {
|
||||
ToastUtils.showShort(msg);
|
||||
DebugView.Companion.printErrorMsg("[主任务重置] 请求failed, " + msg + ", taskId=" + taskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -883,8 +967,10 @@ public class SweeperOperateTaskModel {
|
||||
public void onError() {
|
||||
if (!NetworkUtils.isConnected(mContext)) {
|
||||
ToastUtils.showShort(mContext.getString(R.string.network_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[主任务重置] 请求error, " + mContext.getString(R.string.network_error_tip) + ", taskId=" + taskId);
|
||||
} else {
|
||||
ToastUtils.showShort(mContext.getString(R.string.request_error_tip));
|
||||
DebugView.Companion.printErrorMsg("[主任务重置] 请求error, " + mContext.getString(R.string.request_error_tip)+ ", taskId=" + taskId);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -893,5 +979,6 @@ public class SweeperOperateTaskModel {
|
||||
//结束自动驾驶
|
||||
public void cancelAutoPilot() {
|
||||
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
|
||||
DebugView.Companion.printInfoMsg("[取消自动驾驶] 请求成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.NumberFormatUtil;
|
||||
import com.mogo.och.sweeper.common.view.DebugView;
|
||||
import com.mogo.och.sweeper.operate.bean.SweeperMainTaskBean;
|
||||
import com.mogo.och.sweeper.common.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweeper.operate.bean.SweeperSubTaskBean;
|
||||
@@ -130,8 +131,10 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
||||
ThreadUtils.runOnUiThread(() -> mView.startAutoBtn(state));
|
||||
switch (state) {
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE://不可自动驾驶
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_DISABLE,meaning=不可自动驾驶");
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE://人工驾驶
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_ENABLE,meaning=可自动驾驶,人工干预状态");
|
||||
if (SweeperOperateTaskModel.getInstance().getSubWorking()) {
|
||||
if (FunctionBuildConfig.isDemoMode) {//美化模式开启时
|
||||
SweeperOperateTaskModel.getInstance().startBeautificationMode();
|
||||
@@ -144,6 +147,7 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
||||
}
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING://自动驾驶中
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNING,meaning=自动驾驶中");
|
||||
SweeperOperateTaskModel.getInstance().triggerStartServiceEvent(
|
||||
SweeperOperateTaskModel.getInstance().isRestartAutopilot(), true);
|
||||
if (SweeperOperateTaskModel.getInstance().getSubWorking()) {
|
||||
@@ -153,6 +157,7 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
||||
}
|
||||
break;
|
||||
case IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING://平行驾驶
|
||||
DebugView.Companion.printInfoMsg("[自驾状态变化] afterValue=STATUS_PARALLEL_DRIVING,meaning=平行驾驶中");
|
||||
if (SweeperOperateTaskModel.getInstance().getSubWorking()) {
|
||||
if (FunctionBuildConfig.isDemoMode) {//美化模式开启时
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true;//是否强制绘制引导线
|
||||
@@ -223,6 +228,9 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
||||
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) {
|
||||
DebugView.Companion.printInfoMsg(
|
||||
"[域控连接状态变化] status=" + status
|
||||
+ ", reason=" + reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -237,6 +245,9 @@ public class SweeperOperatePresenter extends Presenter<SweeperOperateFragment>
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(@Nullable MessagePad.ArrivalNotification arrivalNotification) {
|
||||
SweeperOperateTaskModel.getInstance().onArriveTaskEnd(arrivalNotification);
|
||||
DebugView.Companion.printInfoMsg("[MAP到站通知] 上报到站,endLocation=("
|
||||
+ ((arrivalNotification == null || arrivalNotification.getEndLocation() == null) ? "null" : arrivalNotification.getEndLocation().toString())
|
||||
+ ")");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<stroke
|
||||
android:width="@dimen/dp_2"
|
||||
android:color="@color/background_verbose" />
|
||||
</shape>
|
||||
@@ -81,6 +81,7 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--清扫任务列表面板-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_task_list_container"
|
||||
@@ -93,6 +94,16 @@
|
||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
|
||||
android:layout_marginTop="-20dp"/>
|
||||
|
||||
<!--DebugView-->
|
||||
<com.mogo.och.sweeper.common.view.DebugView
|
||||
android:id="@+id/sweeperDebugView"
|
||||
android:layout_width="@dimen/sweeper_debug_view_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/sweeper_arc"
|
||||
app:layout_constraintBottom_toTopOf="@+id/sweeper_switch_model_icon"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_task_list_container" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHRoundConstraintLayout
|
||||
android:layout_width="@dimen/dp_711"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -100,8 +111,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_27"
|
||||
app:roundLayoutRadius="@dimen/dp_16"
|
||||
>
|
||||
app:roundLayoutRadius="@dimen/dp_16">
|
||||
<com.mogo.och.sweeper.common.view.WeltSmallMapView
|
||||
android:id="@+id/sweeper_task_welt_small_map"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -149,6 +159,7 @@
|
||||
android:src="@drawable/sweeper_setting_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/sweeper_collect_model_icon" />
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
@@ -169,6 +180,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewDriverMsgBoxButton"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!--消息盒子气泡视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
@@ -178,6 +190,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewDriverMsgBoxButton" />
|
||||
|
||||
<!--清扫手动驾驶路线导航-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_navi_panel_container"
|
||||
@@ -226,53 +239,31 @@
|
||||
tools:visibility="visible" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotDisable"
|
||||
android:id="@+id/btnOpenDebugView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#f00"
|
||||
android:text="Disable"
|
||||
android:textSize="30sp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="#0f0"
|
||||
android:text="打开任务调试面板"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotEnable"
|
||||
android:id="@+id/btnCloseDebugView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#0f0"
|
||||
android:text="Enable"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotDisable" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAutopilotRunning"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#00f"
|
||||
android:text="Running"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotDisable"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotEnable" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnEndTask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:text="结束子任务"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAutopilotRunning"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAutopilotRunning" />
|
||||
android:background="#f00"
|
||||
android:text="关闭任务调试面板"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintRight_toRightOf="@+id/btnOpenDebugView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btnOpenDebugView" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/groupTestPanel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="btnAutopilotDisable,btnAutopilotEnable
|
||||
,btnAutopilotRunning,btnEndTask"
|
||||
app:constraint_referenced_ids="btnOpenDebugView,btnCloseDebugView"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -81,6 +81,7 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--清扫任务列表面板-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_task_list_container"
|
||||
@@ -93,6 +94,16 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/sweeper_arc"
|
||||
app:layout_goneMarginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call" />
|
||||
|
||||
<!--DebugView-->
|
||||
<com.mogo.och.sweeper.common.view.DebugView
|
||||
android:id="@+id/sweeperDebugView"
|
||||
android:layout_width="@dimen/sweeper_debug_view_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/sweeper_arc"
|
||||
app:layout_constraintBottom_toTopOf="@+id/sweeper_switch_model_icon"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_mogo_och_task_list_container" />
|
||||
|
||||
<com.mogo.och.common.module.wigets.OCHRoundConstraintLayout
|
||||
android:layout_width="@dimen/dp_711"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -101,8 +112,7 @@
|
||||
android:layout_marginEnd="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_27"
|
||||
app:roundLayoutRadius="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
>
|
||||
android:visibility="gone">
|
||||
<com.mogo.och.sweeper.common.view.WeltSmallMapView
|
||||
android:id="@+id/sweeper_task_welt_small_map"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -150,6 +160,7 @@
|
||||
android:src="@drawable/sweeper_setting_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/sweeper_collect_model_icon" />
|
||||
|
||||
<!--消息盒子选择入口-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView
|
||||
android:id="@+id/viewDriverMsgBoxButton"
|
||||
@@ -170,6 +181,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewDriverMsgBoxButton"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<!--消息盒子气泡视图-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
@@ -186,108 +198,33 @@
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
<Button
|
||||
android:id="@+id/btnStartAutopilot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_200"
|
||||
android:background="#aa0"
|
||||
android:text="下发启动自驾命令"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<Button
|
||||
android:id="@+id/btnQueryCurrentTask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#f80"
|
||||
android:text="pad查询当前大任务"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/btnStartAutopilot"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btnStartAutopilot" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSendTask"
|
||||
android:id="@+id/btnOpenDebugView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="#0f0"
|
||||
android:text="打开任务调试面板"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnCloseDebugView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#f00"
|
||||
android:text="模拟云控下发任务"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@+id/btnQueryCurrentTask"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btnQueryCurrentTask" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSendSubTaskConfirm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#0f0"
|
||||
android:text="模拟云控发送子任务确认"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnSendTask"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSendTask" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSendEndTask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#00f"
|
||||
android:text="模拟云控结束大任务"
|
||||
android:textColor="#fff"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnSendTask"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSendSubTaskConfirm" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSendSubtaskStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:text="模拟云控下发子任务状态"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnSendEndTask"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSendEndTask" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSendTaskStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:text="模拟云控下发大任务状态"
|
||||
android:textColor="#fff"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnSendSubtaskStatus"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSendSubtaskStatus" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAddHDMarker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:text="添加高精地图Marker"
|
||||
android:textColor="#f30"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnSendTaskStatus"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSendTaskStatus" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnRemoveHDMarker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#000000"
|
||||
android:text="移除高精地图Marker"
|
||||
android:textColor="#a90"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintRight_toRightOf="@id/btnAddHDMarker"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnAddHDMarker" />
|
||||
android:text="关闭任务调试面板"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintRight_toRightOf="@+id/btnOpenDebugView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btnOpenDebugView" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/groupTestPanel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="btnStartAutopilot,btnQueryCurrentTask,btnSendTask,btnSendSubTaskConfirm,btnSendEndTask
|
||||
,btnSendSubtaskStatus,btnSendTaskStatus,btnAddHDMarker,btnRemoveHDMarker"
|
||||
app:constraint_referenced_ids="btnOpenDebugView,btnCloseDebugView"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.och.common.module.wigets.OCHBorderShadowLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:bgColor="@android:color/transparent"
|
||||
app:blurRadius="20dp"
|
||||
app:shadowColor="#C7151D4C"
|
||||
app:shadowRadius="42dp"
|
||||
app:xOffset="0dp"
|
||||
app:yOffset="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/sweeperDebugViewContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="清扫车信息"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/currentSweeperModeTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:text="业务流程关键节点日志(司机端)"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/debugLogHistoryTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/sweeper_debug_view_log_history_bg"
|
||||
android:fadeScrollbars="false"
|
||||
android:minLines="30"
|
||||
android:maxLines="30"
|
||||
android:scrollbars="vertical"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
</LinearLayout>
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- 本套资源适配分体机xhdpi -->
|
||||
<dimen name="module_mogo_och_sweeper_station_panel_width">300dp</dimen>
|
||||
<dimen name="module_mogo_och_sweeper_station_panel_height">348dp</dimen>
|
||||
@@ -151,4 +151,6 @@
|
||||
|
||||
<dimen name="sweeper_operate_panel_btn_bg_corner">13dp</dimen>
|
||||
<dimen name="sweeper_operate_panel_btn_text_size">32dp</dimen>
|
||||
|
||||
<dimen name="sweeper_debug_view_width">1000dp</dimen>
|
||||
</resources>
|
||||
@@ -314,17 +314,24 @@ object FunctionBuildConfig {
|
||||
var isFaultSlowDown = true
|
||||
|
||||
/**
|
||||
* 清扫车 默认业务模式(云控)
|
||||
* 清扫车 默认业务模式(打包时默认的模式)
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var sweeperDefaultMode = "Cloud"
|
||||
|
||||
/**
|
||||
* 清扫车 是否能切换当前业务模式
|
||||
* 清扫车 是否能切换当前业务模式(打包时默认的设置)
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var sweeperCanSwitchMode = true
|
||||
|
||||
/**
|
||||
* 清扫车 当前的业务模式
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var sweeperCurrentMode = "Cloud"
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user