[sweeper-cloud] 清扫车获取云端正在执行的任务逻辑处理
This commit is contained in:
@@ -7,10 +7,15 @@ import chassis.ChassisStatesOuterClass
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.utils.DateTimeUtil
|
||||
import com.mogo.och.sweepercloud.R
|
||||
import com.mogo.och.sweepercloud.bean.SweeperRoutePlanningUpdateReqBean
|
||||
import com.mogo.och.sweepercloud.presenter.SweeperPresenter
|
||||
import com.mogo.och.sweepercloud.ui.dialog.SweeperCloudDialog
|
||||
import com.mogo.och.sweepercloud.util.SweeperCloudTaskMockUtils.sendCloudTaskInfo
|
||||
import com.mogo.och.sweepercloud.view.SweeperCurrentTaskInfoView
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.SubTaskInfo
|
||||
import kotlinx.android.synthetic.main.fragment_och_sweeper.*
|
||||
import kotlinx.android.synthetic.main.sweeper_no_data_common_view.*
|
||||
@@ -20,16 +25,18 @@ import kotlinx.coroutines.launch
|
||||
/**
|
||||
* 清扫车主界面
|
||||
*/
|
||||
class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresenter?>(){
|
||||
class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresenter?>() {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SweeperFragment"
|
||||
}
|
||||
|
||||
private var mCurrentSubPosition: Int = 0 //子任务下标
|
||||
private var mSubMutableList: MutableList<SubTaskInfo>? = null
|
||||
private var mCleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates? = null
|
||||
private var mLocation: MogoLocation? = null
|
||||
private var mSubTaskType:Int=0 //0:自动驾驶子任务 1:人工驾驶子任务
|
||||
private var mTaskInfo: SweeperTask.TaskInfo? = null
|
||||
private var mSubTaskType: Int = 0 //0:自动驾驶子任务 1:人工驾驶子任务
|
||||
|
||||
override fun getTagName(): String {
|
||||
return "SweepersFragment"
|
||||
@@ -39,9 +46,6 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
super.initViews()
|
||||
initListener()
|
||||
sweeper_cl_work_mode.setTrafficDataView(trafficDataView)
|
||||
sweeper_current_task_view.setOnClickListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun createPresenter(): SweeperPresenter {
|
||||
@@ -56,6 +60,19 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
override fun getTaskListPanelViewId(): Int {
|
||||
return R.layout.fragment_och_sweeper
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前任务信息列表是否显示
|
||||
*/
|
||||
private fun setShowCurrentTaskPanelView(isShow: Boolean) {
|
||||
if (isShow) {
|
||||
sweeper_current_task_view.visibility = View.VISIBLE
|
||||
noTaskDataView.visibility=View.GONE
|
||||
} else {
|
||||
sweeper_current_task_view.visibility = View.GONE
|
||||
noTaskDataView.visibility=View.VISIBLE
|
||||
}
|
||||
}
|
||||
/**
|
||||
* VR模式切换
|
||||
*
|
||||
@@ -76,42 +93,15 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
* 设置子任务的状态
|
||||
*/
|
||||
fun setSubTaskState(isWorking: Boolean) {
|
||||
sweeper_current_task_view.setSubTaskState(isWorking)
|
||||
getCurrentView().setSubTaskState(isWorking)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置各种监听事件
|
||||
*/
|
||||
private fun initListener() {
|
||||
//无任务时刷新
|
||||
ivNoTaskRefresh.setOnClickListener {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
builder.titleStr="任务接取"
|
||||
builder.contentStr="请确认是否接取任务AAAAAAA"
|
||||
builder.tipStr="(任务时间09:00-12:00)"
|
||||
builder.leftStr="确认"
|
||||
builder.middleStr=""
|
||||
builder.rightStr="拒绝"
|
||||
builder.countDownTime=15
|
||||
builder.listener=object : SweeperCloudDialog.SweeperCloudClickListener {
|
||||
override fun onConfirm() {
|
||||
ToastUtils.showLong("确认")
|
||||
}
|
||||
getCurrentView().setOnClickListener {
|
||||
|
||||
override fun onRefuse() {
|
||||
ToastUtils.showLong("拒绝")
|
||||
}
|
||||
|
||||
override fun onCountDownStop() {
|
||||
ToastUtils.showLong("倒计时结束")
|
||||
}
|
||||
|
||||
override fun onNext() {
|
||||
ToastUtils.showLong("下一个")
|
||||
}
|
||||
|
||||
}
|
||||
val dialog= context?.let { it1 -> builder.build(it1) }
|
||||
dialog?.show()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +111,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
sweeper_cl_work_mode.setSweeperFutianCleanSystemState(mSubTaskType, cleanSystemState)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前位置经纬度
|
||||
*/
|
||||
@@ -136,10 +127,10 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
}
|
||||
val dataList = ArrayList<LatLng>()
|
||||
for (index in subList.indices) {
|
||||
val startLocation=subList[index].startLocation
|
||||
val startLocation = subList[index].startLocation
|
||||
val startLatLng = LatLng(startLocation.latitude, startLocation.longitude)
|
||||
dataList.add(index, startLatLng)
|
||||
val endLocation=subList[index].endLocation
|
||||
val endLocation = subList[index].endLocation
|
||||
val endLatLng = LatLng(endLocation.latitude, endLocation.longitude)
|
||||
dataList.add(index + 1, endLatLng)
|
||||
}
|
||||
@@ -152,17 +143,31 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
/**
|
||||
* 设置当前子任务终点
|
||||
*/
|
||||
private fun setEndStationMarker(subList:MutableList<SubTaskInfo>) {
|
||||
val endPoint= subList[mCurrentSubPosition].endLocation
|
||||
private fun setEndStationMarker(subList: MutableList<SubTaskInfo>) {
|
||||
val endPoint = subList[mCurrentSubPosition].endLocation
|
||||
val endLatLng = LatLng(endPoint.latitude, endPoint.longitude)
|
||||
super.mCurrentTaskEndStation = endLatLng
|
||||
setCurrentTaskEndMarker(endLatLng)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置云端任务信息
|
||||
*/
|
||||
fun onSweeperCloudTask(messageType: SweeperCloudTask.MessageType, taskInfo: SweeperTask.TaskInfo) {
|
||||
this.mTaskInfo = taskInfo
|
||||
setShowCurrentTaskPanelView(true)
|
||||
if (messageType == SweeperCloudTask.MessageType.PadSendGetTaskReq) {//主动拉取云端正在执行的任务,则直接在任务列表展示
|
||||
getCurrentView().setData(taskInfo, mCurrentSubPosition)
|
||||
} else {//云端下发的任务信息需要弹窗接取
|
||||
receivedTaskInfoDialog()
|
||||
}
|
||||
}
|
||||
|
||||
//模拟结束子任务
|
||||
override fun debugEndSubTask() {
|
||||
super.debugEndSubTask()
|
||||
mPresenter?.getCurrentTask()
|
||||
//sendCloudTaskInfo(SweeperCloudTask.MessageType.CloudPushTask)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,4 +176,53 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
override fun setTaskRouteList(routeList: ArrayList<SweeperRoutePlanningUpdateReqBean.Result>) {
|
||||
super.setTaskRouteList(routeList)
|
||||
}
|
||||
|
||||
private fun getCurrentView(): SweeperCurrentTaskInfoView = sweeper_current_task_view
|
||||
|
||||
/**
|
||||
* 接取云端任务弹窗
|
||||
*/
|
||||
private fun receivedTaskInfoDialog() {
|
||||
mTaskInfo?.apply {
|
||||
var builder: SweeperCloudDialog.Builder = SweeperCloudDialog.Builder()
|
||||
val startCalendar = DateTimeUtil.formatLongToCalendar(taskStartTime)
|
||||
val endCalendar = DateTimeUtil.formatLongToCalendar(taskEndTime)
|
||||
builder.titleStr = "任务接取"
|
||||
builder.contentStr = "请确认是否接取任务${taskName}"
|
||||
builder.tipStr = "(任务时间${DateTimeUtil.formatCalendarToString(startCalendar, DateTimeUtil.HH_mm)}-${
|
||||
DateTimeUtil.formatCalendarToString(
|
||||
endCalendar,
|
||||
DateTimeUtil.HH_mm
|
||||
)
|
||||
})"
|
||||
builder.leftStr = "确认"
|
||||
builder.middleStr = ""
|
||||
builder.rightStr = "拒绝"
|
||||
builder.countDownTime = 15
|
||||
builder.listener = object : SweeperCloudDialog.SweeperCloudClickListener {
|
||||
override fun onConfirm() {
|
||||
ToastUtils.showLong("确认")
|
||||
setShowCurrentTaskPanelView(true)
|
||||
}
|
||||
|
||||
override fun onRefuse() {
|
||||
ToastUtils.showLong("拒绝")
|
||||
setShowCurrentTaskPanelView(false)
|
||||
}
|
||||
|
||||
override fun onCountDownStop() {
|
||||
ToastUtils.showLong("倒计时结束")
|
||||
setShowCurrentTaskPanelView(false)
|
||||
}
|
||||
|
||||
override fun onNext() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
val dialog = context?.let { it1 -> builder.build(it1) }
|
||||
dialog?.show()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import com.mogo.och.sweepercloud.callback.ISweeperCloudTaskCallback;
|
||||
import com.mogo.och.sweepercloud.constant.SweeperConst;
|
||||
import com.mogo.och.sweepercloud.database.MyDataBase;
|
||||
import com.mogo.och.sweepercloud.database.bean.WeltDataBean;
|
||||
import com.mogo.och.sweepercloud.util.SweeperCloudTaskMockUtils;
|
||||
import com.mogo.och.sweepercloud.util.SweeperFutianCmdUtil;
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
@@ -507,7 +508,11 @@ public class SweeperTaskModel implements IMoGoSweeperFutianCloudTaskListener, IM
|
||||
public void getCurrentTask() {
|
||||
SweeperTask.GetTaskReq.Builder builder = SweeperTask.GetTaskReq.newBuilder();
|
||||
builder.setSn(getDriverSn());
|
||||
getAutoPilotControlManager().sendSweeperGetTaskReq(String.valueOf(System.currentTimeMillis()), builder.build());
|
||||
String reqNo = String.valueOf(System.currentTimeMillis());
|
||||
SweeperTask.GetTaskReq getTaskReq = builder.build();
|
||||
CallerLogger.INSTANCE.d(M_SWEEPER + TAG, "getCurrentTask:" + GsonUtil.jsonFromObject(getTaskReq) + "reqNo:" + reqNo);
|
||||
getAutoPilotControlManager().sendSweeperGetTaskReq(reqNo, builder.build());
|
||||
SweeperCloudTaskMockUtils.sendCloudTaskInfo(SweeperCloudTask.MessageType.PadSendGetTaskReq);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -558,6 +563,7 @@ public class SweeperTaskModel implements IMoGoSweeperFutianCloudTaskListener, IM
|
||||
|
||||
/**
|
||||
* pad上报是否可以进自驾
|
||||
*
|
||||
* @param taskId
|
||||
* @param subTaskId
|
||||
* @param lineId
|
||||
@@ -568,10 +574,10 @@ public class SweeperTaskModel implements IMoGoSweeperFutianCloudTaskListener, IM
|
||||
builder.setTaskId(taskId);
|
||||
builder.setSubTaskId(subTaskId);
|
||||
builder.setLineId(lineId);
|
||||
SweeperBootable.IsBootable isBootable=builder.build();
|
||||
SweeperBootable.IsBootable isBootable = builder.build();
|
||||
String reqNo = String.valueOf(System.currentTimeMillis());
|
||||
CallerLogger.INSTANCE.d(M_SWEEPER + TAG, "sendSweeperAutopilotBootable" + GsonUtil.jsonFromObject(isBootable) + "reqNo:" + reqNo);
|
||||
getAutoPilotControlManager().sendSweeperAutopilotBootable(reqNo,isBootable);
|
||||
getAutoPilotControlManager().sendSweeperAutopilotBootable(reqNo, isBootable);
|
||||
}
|
||||
|
||||
public CallerAutoPilotControlManager getAutoPilotControlManager() {
|
||||
@@ -616,7 +622,7 @@ public class SweeperTaskModel implements IMoGoSweeperFutianCloudTaskListener, IM
|
||||
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) {
|
||||
CallerLogger.INSTANCE.d(M_SWEEPER + TAG, "onAutopilotIpcConnectStatusChanged status:" + status + "reason:" + reason);
|
||||
//CallerLogger.INSTANCE.d(M_SWEEPER + TAG, "onAutopilotIpcConnectStatusChanged status:" + status + " reason:" + reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.big.SweeperBigTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
|
||||
|
||||
|
||||
@@ -110,6 +111,7 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
AutopilotStatusInfo info = new AutopilotStatusInfo();
|
||||
info.setState(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前正在执行的任务
|
||||
*/
|
||||
@@ -117,6 +119,48 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
SweeperTaskModel.getInstance().getCurrentTask();
|
||||
}
|
||||
|
||||
/**
|
||||
* 接取任务弹窗响应
|
||||
*
|
||||
* @param taskId
|
||||
* @param code
|
||||
*/
|
||||
public void sendSweeperStartTaskResp(String taskId, SweeperTask.StartTaskCode code) {
|
||||
SweeperTaskModel.getInstance().sendSweeperStartTaskResp(taskId, code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 子任务弹窗确认
|
||||
*
|
||||
* @param taskId
|
||||
* @param subTaskId
|
||||
* @param code
|
||||
*/
|
||||
public void sendSweeperTaskConfirmResp(String taskId, String subTaskId, SweeperTaskConfirm.TaskConfirmCode code) {
|
||||
SweeperTaskModel.getInstance().sendSweeperTaskConfirmResp(taskId, subTaskId, code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 大任务结束弹窗确认
|
||||
*
|
||||
* @param taskId
|
||||
* @param code
|
||||
*/
|
||||
public void sendSweeperStopTaskResp(String taskId, SweeperTaskStop.StopTaskCode code) {
|
||||
SweeperTaskModel.getInstance().sendSweeperStopTaskResp(taskId, code);
|
||||
}
|
||||
|
||||
/**
|
||||
* pad上报是否可以进自驾
|
||||
*
|
||||
* @param taskId
|
||||
* @param subTaskId
|
||||
* @param lineId
|
||||
*/
|
||||
public void sendSweeperAutopilotBootable(String taskId, String subTaskId, long lineId) {
|
||||
SweeperTaskModel.getInstance().sendSweeperAutopilotBootable(taskId, subTaskId, lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRouteList(@NonNull ArrayList<SweeperRoutePlanningUpdateReqBean.Result> routeList) {
|
||||
mView.setTaskRouteList(routeList);
|
||||
@@ -124,7 +168,7 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
|
||||
@Override
|
||||
public void onSweeperCloudTask(@NonNull SweeperCloudTask.MessageType messageType, @NonNull SweeperTask.TaskInfo taskInfo) {
|
||||
|
||||
mView.onSweeperCloudTask(messageType,taskInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,11 +204,11 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
|
||||
|
||||
@Override
|
||||
public void setWeltDataToMap(@NonNull ArrayList<WeltDataBean> weltDataBeans, boolean isWeltData, @NonNull String distance) {
|
||||
mView.setWeltDataToMap(weltDataBeans,isWeltData,distance);
|
||||
mView.setWeltDataToMap(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianCleanSystemState(@NonNull ChassisStatesOuterClass.SweeperFuTianTaskSystemStates cleanSystemState) {
|
||||
mView.onSweeperFutianCleanSystemState(cleanSystemState);
|
||||
mView.onSweeperFutianCleanSystemState(cleanSystemState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.mogo.och.sweepercloud.util
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.och.sweepercloud.model.SweeperTaskModel
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask.MessageType
|
||||
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.Location
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.SubTaskInfo
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.TaskInfo
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.TaskModel
|
||||
|
||||
object SweeperCloudTaskMockUtils {
|
||||
/**
|
||||
* 模拟云控发送任务给pad
|
||||
*/
|
||||
@JvmStatic
|
||||
fun sendCloudTaskInfo(messageType: MessageType) {
|
||||
val builder = TaskInfo.newBuilder()
|
||||
builder.sn = getDriverSn()
|
||||
builder.taskId = "10"
|
||||
builder.taskName = "环球贸易中心B座"
|
||||
builder.currentTime = System.currentTimeMillis()
|
||||
builder.taskStartTime = 1682664162000
|
||||
builder.taskEndTime = 1682750562000
|
||||
//第一个子任务
|
||||
val subBuilder0 = SubTaskInfo.newBuilder()
|
||||
subBuilder0.subTaskId = "0"
|
||||
subBuilder0.subTaskName = "自动驾驶子任务0"
|
||||
subBuilder0.taskModel = TaskModel.AUTO
|
||||
subBuilder0.taskStatus = SweeperCommon.TaskStatus.TO_START
|
||||
val startLocation0 = Location.newBuilder()
|
||||
startLocation0.siteName = "子任务起点0"
|
||||
startLocation0.wgsLongitude = 121.6421189511
|
||||
startLocation0.wgsLatitude = 37.4767125311
|
||||
startLocation0.longitude = 121.64693997741931
|
||||
startLocation0.latitude = 37.47740504453125
|
||||
subBuilder0.startLocation = startLocation0.build()
|
||||
val endLocation0 = Location.newBuilder()
|
||||
endLocation0.siteName = "子任务终点0"
|
||||
endLocation0.wgsLongitude = 121.6392313
|
||||
endLocation0.wgsLatitude = 37.4726471
|
||||
endLocation0.longitude = 121.64404710861349
|
||||
endLocation0.latitude = 37.47333410433059
|
||||
subBuilder0.startLocation = endLocation0.build()
|
||||
subBuilder0.lineId = 123
|
||||
subBuilder0.lineName = "测试路线0"
|
||||
builder.addSubList(subBuilder0.build())
|
||||
//第二个子任务
|
||||
val subBuilder1 = SubTaskInfo.newBuilder()
|
||||
subBuilder1.subTaskId = "1"
|
||||
subBuilder1.subTaskName = "自动驾驶子任务1"
|
||||
subBuilder1.taskModel = TaskModel.AUTO
|
||||
subBuilder1.taskStatus = SweeperCommon.TaskStatus.TO_START
|
||||
val startLocation1 = Location.newBuilder()
|
||||
startLocation1.siteName = "测试子任务站点1"
|
||||
startLocation1.wgsLongitude = 121.6421189511
|
||||
startLocation1.wgsLatitude = 37.47264711
|
||||
startLocation1.longitude = 121.6469395478903
|
||||
startLocation1.latitude = 37.47333856025812
|
||||
subBuilder1.startLocation=startLocation1.build()
|
||||
val endLocation1 = Location.newBuilder()
|
||||
endLocation1.siteName = "测试子任务站点1"
|
||||
endLocation1.wgsLongitude = 121.4261245286646
|
||||
endLocation1.wgsLatitude = 37.52885874483938
|
||||
endLocation1.longitude = 121.43138115208806
|
||||
endLocation1.latitude = 37.52987767688798
|
||||
subBuilder1.endLocation = endLocation1.build()
|
||||
builder.addSubList(subBuilder1.build())
|
||||
//第三个子任务
|
||||
val subBuilder2 = SubTaskInfo.newBuilder()
|
||||
subBuilder2.subTaskId = "1"
|
||||
subBuilder2.subTaskName = "人工驾驶子任务路线2"
|
||||
subBuilder2.taskModel = TaskModel.MANUAL
|
||||
subBuilder2.taskStatus = SweeperCommon.TaskStatus.TO_START
|
||||
val startLocation2 = Location.newBuilder()
|
||||
startLocation2.siteName = "人工驾驶子任务站点2"
|
||||
startLocation2.wgsLongitude = 121.31344761929978
|
||||
startLocation2.wgsLatitude = 37.53205755535642
|
||||
startLocation2.longitude = 121.3185679517558
|
||||
startLocation2.latitude = 37.5329694887952
|
||||
subBuilder2.startLocation=startLocation2.build()
|
||||
val endLocation2 = Location.newBuilder()
|
||||
endLocation2.siteName = "人工驾驶子任务站点2"
|
||||
endLocation2.wgsLongitude = 121.4551205070834
|
||||
endLocation2.wgsLatitude =37.47936696980237
|
||||
endLocation2.longitude =121.46030960742117
|
||||
endLocation2.latitude = 37.48032689641474
|
||||
subBuilder2.endLocation = endLocation2.build()
|
||||
builder.addSubList(subBuilder2.build())
|
||||
SweeperTaskModel.getInstance().onSweeperFutianCloudTask(
|
||||
messageType,
|
||||
"${System.currentTimeMillis()}",
|
||||
System.currentTimeMillis(),
|
||||
builder.build()
|
||||
)
|
||||
}
|
||||
|
||||
fun getDriverSn(): String? {
|
||||
return MoGoAiCloudClientConfig.getInstance().sn
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,7 @@ class SubTaskView : ConstraintLayout {
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
|
||||
initView(context)
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
|
||||
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
|
||||
|
||||
private fun initView(context: Context) {
|
||||
@@ -32,6 +31,11 @@ class SubTaskView : ConstraintLayout {
|
||||
fun setData(taskInfo: SubTaskInfo, isSelect: Boolean = false, isLastTask: Boolean = false) {
|
||||
tvSubTaskName.text = taskInfo.subTaskName
|
||||
tvSubTaskName.setTextColor(if (isSelect) Color.parseColor("#3BD2FF") else Color.parseColor("#FFFFFF"))
|
||||
if (taskInfo.taskModel.number == 1) {//人工驾驶子任务
|
||||
ivManualDriving.visibility = View.VISIBLE
|
||||
} else {
|
||||
ivManualDriving.visibility = View.GONE
|
||||
}
|
||||
if (isSelect) {
|
||||
ivSubTask.setImageResource(R.drawable.sweeper_icon_select_subtask)
|
||||
} else {
|
||||
|
||||
@@ -30,14 +30,4 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivNoTaskData" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivNoTaskRefresh"
|
||||
android:layout_width="@dimen/dp_42"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:layout_marginTop="@dimen/dp_39"
|
||||
android:layout_marginEnd="@dimen/dp_39"
|
||||
android:src="@drawable/sweeper_refresh"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user