[清扫车]轨迹发布时间字段修改和任务进度逻辑修改

This commit is contained in:
bxb
2023-03-02 09:21:05 +08:00
parent 314e8b9c77
commit af6fce2ae6
13 changed files with 272 additions and 126 deletions

View File

@@ -6,13 +6,13 @@ public class SweeperSubTaskDetailBean {
private String lineName;//线路名称
private int sort;
private int status;
private String startSiteId; //子任务起点id
private int startSiteId; //子任务起点id
private String startSiteName; //子任务起点名称
private double startSiteLon; //子任务起点高德经度
private double startSiteLat; //子任务起点高德纬度
private double startSiteWgs64Lon;//子任务起点高精经度
private double startSiteWgs64Lat;//子任务起点高精纬度
private String endSiteId;//子任务终点id
private int endSiteId;//子任务终点id
private String endSiteName;//子任务终点名称
private double endSiteLon; //子任务终点高德经度
private double endSiteLat;//子任务终点高德纬度
@@ -26,14 +26,17 @@ public class SweeperSubTaskDetailBean {
private String txtFileUrl = ""; //轨迹文件txt url地址
private String txtFileMd5 = ""; //轨迹文件txt md5
private String txtFileName; //轨迹文件txt名称
private long contrailSaveTime;
private long publishTime;
private String contrailFileType; //轨迹文件类型
private String publishStatus;//发布状态 1发布 2未发布 3 发布中
private String csvFileUrlDPQP = ""; //轨迹文件下载的cos url默认“”
private String csvFileMd5DPQP = ""; //轨迹文件md5默认“”
private String txtFileUrlDPQP = ""; //打点文件下载的cos url默认“”
private String txtFileMd5DPQP = ""; //轨迹文件md5默认“”
private long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
private long publishTimeDPQP; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
private long taskCreateTime;
private String brandDPQP;
private String carModelDPQP;
public int getId() {
return id;
@@ -75,11 +78,11 @@ public class SweeperSubTaskDetailBean {
this.status = status;
}
public String getStartSiteId() {
public int getStartSiteId() {
return startSiteId;
}
public void setStartSiteId(String startSiteId) {
public void setStartSiteId(int startSiteId) {
this.startSiteId = startSiteId;
}
@@ -123,11 +126,11 @@ public class SweeperSubTaskDetailBean {
this.startSiteWgs64Lat = startSiteWgs64Lat;
}
public String getEndSiteId() {
public int getEndSiteId() {
return endSiteId;
}
public void setEndSiteId(String endSiteId) {
public void setEndSiteId(int endSiteId) {
this.endSiteId = endSiteId;
}
@@ -171,6 +174,14 @@ public class SweeperSubTaskDetailBean {
this.endSiteWgs64Lat = endSiteWgs64Lat;
}
public long getTaskCreateTime() {
return taskCreateTime;
}
public void setTaskCreateTime(long taskCreateTime) {
this.taskCreateTime = taskCreateTime;
}
public String getBrand() {
return brand;
}
@@ -235,28 +246,28 @@ public class SweeperSubTaskDetailBean {
this.txtFileName = txtFileName;
}
public String getContrailFileType() {
return contrailFileType;
public long getPublishTime() {
return publishTime;
}
public void setContrailFileType(String contrailFileType) {
this.contrailFileType = contrailFileType;
public void setPublishTime(long publishTime) {
this.publishTime = publishTime;
}
public String getPublishStatus() {
return publishStatus;
public String getBrandDPQP() {
return brandDPQP;
}
public void setPublishStatus(String publishStatus) {
this.publishStatus = publishStatus;
public void setBrandDPQP(String brandDPQP) {
this.brandDPQP = brandDPQP;
}
public long getContrailSaveTime() {
return contrailSaveTime;
public String getCarModelDPQP() {
return carModelDPQP;
}
public void setContrailSaveTime(long contrailSaveTime) {
this.contrailSaveTime = contrailSaveTime;
public void setCarModelDPQP(String carModelDPQP) {
this.carModelDPQP = carModelDPQP;
}
public String getCsvFileUrlDPQP() {
@@ -291,11 +302,13 @@ public class SweeperSubTaskDetailBean {
this.txtFileMd5DPQP = txtFileMd5DPQP;
}
public long getContrailSaveTimeDPQP() {
return contrailSaveTimeDPQP;
public long getPublishTimeDPQP() {
return publishTimeDPQP;
}
public void setContrailSaveTimeDPQP(long contrailSaveTimeDPQP) {
this.contrailSaveTimeDPQP = contrailSaveTimeDPQP;
public void setPublishTimeDPQP(long publishTimeDPQP) {
this.publishTimeDPQP = publishTimeDPQP;
}
}

View File

@@ -0,0 +1,58 @@
package com.mogo.och.sweeper.event;
import com.amap.api.maps.model.LatLng;
import com.mogo.och.sweeper.database.bean.WeltDataBean;
import java.util.ArrayList;
public class WeltDataEvent{
private int type; //1.添加起点和终点 2.实时添加贴边数据 3.清除数据 4.任务进度
private ArrayList<WeltDataBean> weltDataBeanList;
private ArrayList<LatLng> markers;
private String distance;//贴边数据
private String progress;//任务进度
public WeltDataEvent(int type) {
this.type = type;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public ArrayList<WeltDataBean> getWeltDataBeanList() {
return weltDataBeanList;
}
public void setWeltDataBeanList(ArrayList<WeltDataBean> weltDataBeanList) {
this.weltDataBeanList = weltDataBeanList;
}
public ArrayList<LatLng> getMarkers() {
return markers;
}
public void setMarkers(ArrayList<LatLng> markers) {
this.markers = markers;
}
public String getDistance() {
return distance;
}
public void setDistance(String distance) {
this.distance = distance;
}
public String getProgress() {
return progress;
}
public void setProgress(String progress) {
this.progress = progress;
}
}

View File

@@ -1,11 +0,0 @@
package com.mogo.och.sweeper.event
import com.amap.api.maps.model.LatLng
import com.mogo.och.sweeper.database.bean.WeltDataBean
data class WeltDataEvent(
var type:Int, //1.添加起点和终点 2.实时添加贴边数据 3.清除数据
var weltDataBeanList: MutableList<WeltDataBean>?,
var markers:MutableList<LatLng>?,
var distance:String//贴边数据
)

View File

@@ -23,6 +23,7 @@ import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
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.UiThreadHandler;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.listener.MogoMapListenerHandler;
@@ -89,6 +90,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
private DriverMsgBoxBubbleView mViewDriverMsgBoxBubble;
private ArrayList<WeltDataBean> weltDataBeanList;//存储贴边数据
private ArrayList<LatLng> latLngList;//存储任务起点和终点
private String mProgress;
@Override
protected int getLayoutId() {
@@ -159,6 +161,19 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
}
}
/**
* 设置任务进度
* @param progress
*/
protected void setTaskProgress(String progress) {
ThreadUtils.runOnUiThread(()->{
mMapWeltView.setTaskProgress(progress);
mProgress=progress;
});
WeltDataEvent weltDataEvent= new WeltDataEvent(4);
weltDataEvent.setProgress(progress);
EventBus.getDefault().postSticky(weltDataEvent);
}
@Override
protected void initViews(Bundle savedInstanceState) {
super.initViews(savedInstanceState);
@@ -219,6 +234,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
super.onDestroyView();
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
}
private void initListener() {
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
mCloseNavIcon.setOnClickListener(this);
@@ -387,7 +403,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
if (isShow) {
mFlWeltMapOverView.setVisibility(View.VISIBLE);
if (mWeltMapOverViewFragment == null) {
mWeltMapOverViewFragment = mWeltMapOverViewFragment.newInstance(this,weltDataBeanList,latLngList);
mWeltMapOverViewFragment = mWeltMapOverViewFragment.newInstance(this, weltDataBeanList, latLngList,mProgress);
}
if (mWeltMapOverViewFragment.isHidden()) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
@@ -422,15 +438,18 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
*
* @param weltDataBeans
*/
public void setWeltDataToMap(ArrayList<WeltDataBean> weltDataBeans,Boolean isWeltData,String distance) {
public void setWeltDataToMap(ArrayList<WeltDataBean> weltDataBeans, Boolean isWeltData, String distance) {
if (mMapWeltView != null) {
UiThreadHandler.post(()->{
mMapWeltView.setWeltData(weltDataBeans,isWeltData,distance);
UiThreadHandler.post(() -> {
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
mMapWeltView.drawablePolyline();
});
}
this.weltDataBeanList = weltDataBeans;
EventBus.getDefault().postSticky(new WeltDataEvent(2, weltDataBeans, null,distance));
WeltDataEvent weltDataEvent= new WeltDataEvent(2);
weltDataEvent.setWeltDataBeanList(weltDataBeanList);
weltDataEvent.setDistance(distance);
EventBus.getDefault().postSticky(weltDataEvent);
}
/**
@@ -444,7 +463,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
latLngs.add(0, startPoint);
latLngs.add(1, endPoint);
this.latLngList = latLngs;
EventBus.getDefault().postSticky(new WeltDataEvent(1, null, latLngs,""));
WeltDataEvent weltDataEvent= new WeltDataEvent(1);
weltDataEvent.setMarkers(latLngs);
EventBus.getDefault().postSticky(weltDataEvent);
}
/**
@@ -454,8 +475,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
if (mMapWeltView != null) {
mMapWeltView.clearAllMarkerAndPolyline();
}
EventBus.getDefault().postSticky(new WeltDataEvent(3, null, null,""));
EventBus.getDefault().postSticky(new WeltDataEvent(3));
}
/**
* 导航去目的地
*/

View File

@@ -29,6 +29,8 @@ import kotlinx.android.synthetic.main.sweeper_no_data_common_view.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.math.BigDecimal
import java.math.RoundingMode
/**
* 清扫车主界面
@@ -120,9 +122,10 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
/**
* 根据自动驾驶状态更新按钮
*/
fun startAutoBtn(autopilotState:Int) {
fun startAutoBtn(autopilotState: Int) {
sweeper_current_task_view.setStartAutoBtn(autopilotState)
}
/**
* 任务按钮状态
*/
@@ -175,8 +178,9 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
}
}
}
fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
lifecycleScope.launch(Dispatchers.Main){
lifecycleScope.launch(Dispatchers.Main) {
mCleanSystemState = cleanSystemState
sweeper_cl_work_mode.setSweeperFutianCleanSystemState(mSubTaskType, cleanSystemState)
}
@@ -219,7 +223,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
setSubTaskData()
if (mSubTaskType.code == SubTaskTypeEnum.AUTOPILOT_SUBTYPE.code) {//自动驾驶子任务需要调用详情
mSubInfo?.let { subInfo ->
presenter?.getSubTaskDetail(isFirstSubTask(), isLastSubTask(),subInfo.taskId, mSubTaskType,false)//加载子任务详情包括轨迹信息
presenter?.getSubTaskDetail(isFirstSubTask(), isLastSubTask(), subInfo.taskId, mSubTaskType, false)//加载子任务详情包括轨迹信息
}
} else {
manualDriving(mSubInfo)
@@ -249,7 +253,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
//关闭人工驾驶导航
showAmapNaviToStationFragment(false)
mSubInfo?.apply {
presenter?.getSubTaskDetail(isFirstSubTask(), isLastSubTask(),taskId, mSubTaskType,true)
presenter?.getSubTaskDetail(isFirstSubTask(), isLastSubTask(), taskId, mSubTaskType, true)
}
} else {
manualDriving(mSubInfo)
@@ -265,7 +269,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
//关闭人工驾驶导航
showAmapNaviToStationFragment(false)
mSubInfo?.apply {
presenter?.getSubTaskDetail(isFirstSubTask(), isLastSubTask(),taskId, mSubTaskType,true)
presenter?.getSubTaskDetail(isFirstSubTask(), isLastSubTask(), taskId, mSubTaskType, true)
}
} else {
manualDriving(mSubInfo)
@@ -317,8 +321,32 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
//设置当前子任务信息
presenter?.setSubtask(isFirstSubTask(), isLastSubTask(), it[mCurrentSubPosition].taskId)
}
}
/**
* 计算任务的进度
*/
lifecycleScope.launch(Dispatchers.IO) {
mSubMutableList?.let {
var sum: Double = 0.0
for (index in it.indices) {
sum += it[index].mileage
}
var current: Double = 0.0
for (index in it.indices) {
if (index <= mCurrentSubPosition) {
current += it[index].mileage
}
}
val progress = "${format((current/sum)*100)}%"
setTaskProgress(progress)
}
}
}
fun format(value: Double): String? {
var bd = BigDecimal(value)
bd = bd.setScale(2, RoundingMode.HALF_UP)
return bd.toString()
}
/**
* 结束主任务
*/
@@ -406,47 +434,49 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
}
private fun addWeltData() {
mSubMutableList?.let { subList ->
if (subList.size <= 0) {
return
lifecycleScope.launch(Dispatchers.IO) {
mSubMutableList?.let { subList ->
if (subList.size <= 0) {
return@launch
}
//添加贴边数据绘制
addStartAndEndMarker(
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[0].startWgs84Lon,
subList[0].startWgs84Lat
),
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[subList.size - 1].endWgs84Lon,
subList[subList.size - 1].endWgs84Lat
)
)
val dataList = ArrayList<WeltDataBean>()
for (index in subList.indices) {
val startPoint = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[index].startWgs84Lon,
subList[index].startWgs84Lat
)
val startWeltData = WeltDataBean()
startWeltData.locLat = startPoint.latitude
startWeltData.locLon = startPoint.longitude
startWeltData.weltDistance = -9999.0
dataList.add(startWeltData)
val endPoint = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[index].endWgs84Lon,
subList[index].endWgs84Lat
)
val endWeltData = WeltDataBean()
endWeltData.locLat = endPoint.latitude
endWeltData.locLon = endPoint.longitude
endWeltData.weltDistance = -9999.0
dataList.add(endWeltData)
}
setWeltDataToMap(dataList, false, "0")
}
//添加贴边数据绘制
addStartAndEndMarker(
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[0].startWgs84Lon,
subList[0].startWgs84Lat
),
CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[subList.size - 1].endWgs84Lon,
subList[subList.size - 1].endWgs84Lat
)
)
val dataList = ArrayList<WeltDataBean>()
for (index in subList.indices) {
val startPoint = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[index].startWgs84Lon,
subList[index].startWgs84Lat
)
val startWeltData = WeltDataBean()
startWeltData.locLat = startPoint.latitude
startWeltData.locLon = startPoint.longitude
startWeltData.weltDistance=-9999.0
dataList.add(startWeltData)
val endPoint = CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(
AbsMogoApplication.getApp(),
subList[index].endWgs84Lon,
subList[index].endWgs84Lat
)
val endWeltData = WeltDataBean()
endWeltData.locLat = endPoint.latitude
endWeltData.locLon = endPoint.longitude
endWeltData.weltDistance=-9999.0
dataList.add(endWeltData)
}
setWeltDataToMap(dataList,false,"0")
}
}
@@ -456,8 +486,8 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
// mPresenter?.onArriveTaskEnd(null)
// }
lifecycleScope.launch(Dispatchers.IO) {
while (true){
onSweeperFutianCleanSystemState( SweeperFutianCmdUtil.buildSweeperFuTionCleanSystemStateMockData())
while (true) {
onSweeperFutianCleanSystemState(SweeperFutianCmdUtil.buildSweeperFuTionCleanSystemStateMockData())
delay(500)
}
}

View File

@@ -47,15 +47,19 @@ class WeltMapOverViewFragment(var mIWeltMapSwitchToSmallCallBack: IWeltMapSwitch
if (bundle != null) {
val latLngs = bundle.getSerializable("startAndEndPoint") as? ArrayList<LatLng>
val weltDataList = bundle.getSerializable("weltDataList") as? ArrayList<WeltDataBean>
val progress = bundle.getString("progress")
latLngs?.let {
if (it.size >= 2) {
addStartAndEndMarker(it[0], it[1])
}
}
weltDataList?.let {
setWeltData(it,false,"")
setWeltData(it,false,"0")
drawablePolyline()
}
progress?.let {
weltMapOverView.setProgress(progress)
}
}
}
@@ -65,11 +69,13 @@ class WeltMapOverViewFragment(var mIWeltMapSwitchToSmallCallBack: IWeltMapSwitch
fun newInstance(
mIWeltMapSwitchToSmallCallBack: IWeltMapSwitchToSmallCallback,
weltDataList: ArrayList<WeltDataBean>?,
latLngs: ArrayList<LatLng>?
latLngs: ArrayList<LatLng>?,
progress:String?
): WeltMapOverViewFragment {
val args = Bundle()
args.putSerializable("weltDataList", weltDataList)
args.putSerializable("startAndEndPoint", latLngs)
args.putString("progress", progress)
val fragment = WeltMapOverViewFragment(mIWeltMapSwitchToSmallCallBack)
fragment.arguments = args
return fragment
@@ -113,6 +119,8 @@ class WeltMapOverViewFragment(var mIWeltMapSwitchToSmallCallBack: IWeltMapSwitch
lifecycleScope.launch(Dispatchers.Main) {
clearAllMarkerAndPolyline()
}
}else if (weltDataEvent.type == 4){
weltMapOverView.setProgress(weltDataEvent.progress)
}
}

View File

@@ -398,6 +398,7 @@ public class SweeperTaskModel {
CallerLogger.INSTANCE.e(M_SWEEPER + TAG, "AutopilotControlParameters is empty.");
return;
}
CallerLogger.INSTANCE.d(M_SWEEPER + TAG, "AutopilotControlParameters" + GsonUtil.jsonFromObject(parameters));
CallerLogger.INSTANCE.d(M_SWEEPER + TAG, "AutopilotControlParameters is update.");
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
}
@@ -423,10 +424,10 @@ public class SweeperTaskModel {
mCurrentSubTaskDetail.getLineId(),
mCurrentSubTaskDetail.getCsvFileUrl(), mCurrentSubTaskDetail.getCsvFileMd5(),
mCurrentSubTaskDetail.getTxtFileUrl(), mCurrentSubTaskDetail.getTxtFileMd5(),
mCurrentSubTaskDetail.getContrailSaveTime(), mCurrentSubTaskDetail.getCarModel(),
mCurrentSubTaskDetail.getPublishTime(), mCurrentSubTaskDetail.getCarModel(),
mCurrentSubTaskDetail.getCsvFileUrlDPQP(), mCurrentSubTaskDetail.getCsvFileMd5DPQP(),
mCurrentSubTaskDetail.getTxtFileUrlDPQP(), mCurrentSubTaskDetail.getTxtFileMd5DPQP(),
mCurrentSubTaskDetail.getContrailSaveTimeDPQP());
mCurrentSubTaskDetail.getPublishTimeDPQP());
}
return parameters;
}
@@ -664,6 +665,7 @@ public class SweeperTaskModel {
if (FunctionBuildConfig.isDemoMode) {//美化模式开启时
SweeperTaskModel.getInstance().closeBeautificationMode();
}
clearAutopilotControlParameters();
//结束自动驾驶
cancelAutoPilot();
}

View File

@@ -179,9 +179,11 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
public void startOpenAutopilot() {
}
public void startAutopilot(){
public void startAutopilot() {
SweeperTaskModel.getInstance().startAutopilot();
}
/**
* 设置当前子任务信息
*/
@@ -189,6 +191,7 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
this.mSubTaskId = subTaskId;
SweeperTaskModel.getInstance().setSubtask(isFirstSubtask, isLastSubtask, subTaskId);
}
/**
* 测试使用
*
@@ -329,14 +332,16 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
weltDataBean.setCleanIntensity(roboSweeperTaskIndex.getCleanIntensity());
weltDataBean.setSubTaskId(mSubTaskId);
MyDataBase.getInstance().getWeltDataDao().insert(weltDataBean);
String distance=format(roboSweeperTaskIndex.getDistToRefEdgePoint()*100);
mView.setWeltDataToMap((ArrayList<WeltDataBean>) MyDataBase.getInstance().getWeltDataDao().loadAllWeltDataInfo(), true,distance);
String distance = format(roboSweeperTaskIndex.getDistToRefEdgePoint() * 100);
mView.setWeltDataToMap((ArrayList<WeltDataBean>) MyDataBase.getInstance().getWeltDataDao().loadAllWeltDataInfo(), true, distance);
}
public static String format(double value) {
BigDecimal bd = new BigDecimal(value);
bd = bd.setScale(2, RoundingMode.HALF_UP);
return bd.toString();
}
BigDecimal bd = new BigDecimal(value);
bd = bd.setScale(2, RoundingMode.HALF_UP);
return bd.toString();
}
/**
* 获取当前正在执行的任务
*/
@@ -371,9 +376,9 @@ public class SweeperPresenter extends Presenter<SweeperFragment>
* 开始任务
*/
public void startTask(boolean isFirst, boolean isEnd, int subTaskId, SubTaskTypeEnum subTaskType, int subTaskStatus) {
if (subTaskStatus==1){
SweeperTaskModel.getInstance().subTaskStart(isFirst, isEnd, subTaskId, subTaskType);
}
if (subTaskStatus == 1) {
SweeperTaskModel.getInstance().subTaskStart(isFirst, isEnd, subTaskId, subTaskType);
}
// AutopilotControlParameters parameters = new AutopilotControlParameters();
// parameters.isSpeakVoice = true;
// parameters.routeID = 164;

View File

@@ -98,10 +98,10 @@ public class SweeperTrajectoryManager {
mAutoPilotLine = new AutopilotControlParameters.AutoPilotLine(subTaskDetail.getLineId(),
subTaskDetail.getCsvFileUrl(), subTaskDetail.getCsvFileMd5(),
subTaskDetail.getTxtFileUrl(), subTaskDetail.getTxtFileMd5(),
subTaskDetail.getContrailSaveTime(), subTaskDetail.getCarModel(),
subTaskDetail.getPublishTime(), subTaskDetail.getCarModel(),
subTaskDetail.getCsvFileUrlDPQP(), subTaskDetail.getCsvFileMd5DPQP(),
subTaskDetail.getTxtFileUrlDPQP(), subTaskDetail.getTxtFileMd5DPQP(),
subTaskDetail.getContrailSaveTimeDPQP());
subTaskDetail.getPublishTimeDPQP());
}
}

View File

@@ -166,25 +166,27 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
mLineMarkers[i]?.remove()
}
mLineMarkers.clear()
mFirst = false
showOrHiddenLegendData(false)
//mFirst = false
//showOrHiddenLegendData(false)
}
/**
* 设置贴边数据
*/
fun setWeltData(weltData: MutableList<WeltDataBean>?, isWeltData: Boolean, distance: String) {
fun setWeltData(weltData: MutableList<WeltDataBean>?, isWeltData: Boolean, distance: String?) {
if (weltData != null) {
this.mWeltData.addAll(weltData)
for (i in mWeltData.indices) {
mCoordinatesLatLng.add(LatLng(mWeltData[i].locLat, mWeltData[i].locLon))
}
}
setDistance(distance)
if (!mFirst && isWeltData) {
mFirst = true
showOrHiddenLegendData(true)
distance?.let {
setDistance(it)
}
//if (!mFirst && isWeltData) {
// mFirst = true
// showOrHiddenLegendData(true)
//}
}
/**
@@ -203,7 +205,14 @@ class WeltMapOverView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
private fun setDistance(distance: String) {
taskWeltDistanceTv.text = "贴边:${distance}cm"
}
fun setProgress(progress:String?){
progress?.let {
taskProgressTv.visibility=View.VISIBLE
taskWeltDistanceTv.visibility=View.VISIBLE
taskProgressTv.text=it
showOrHiddenLegendData(true)
}
}
fun onCreateView(savedInstanceState: Bundle?) {
sweeperTextureMapView.onCreate(savedInstanceState)
}

View File

@@ -192,8 +192,8 @@ class WeltSmallMapView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
mLineMarkers[i]?.remove()
}
mLineMarkers.clear()
mFirst = false
showOrHiddenWelt(false)
//mFirst = false
//showOrHiddenWelt(false)
}
fun getSwitchToBig(): ImageView = sweeperSwitchToBig
@@ -215,12 +215,19 @@ class WeltSmallMapView : ConstraintLayout, IMoGoChassisLocationGCJ02Listener {
mCoordinatesLatLng.add(CoordinateCalculateRouteUtil.coordinateConverterWgsToGcj(context, mWeltData[i].locLon, mWeltData[i].locLat))
}
taskWeltDistanceTv.text="贴边:${distance}cm"
if (!mFirst&&isWeltData) {
showOrHiddenWelt(true)
mFirst = true
}
//if (!mFirst&&isWeltData) {
// showOrHiddenWelt(true)
// mFirst = true
//}
}
/**
* 设置任务进度
*/
fun setTaskProgress(progress:String?){
taskWeltDistanceTv.visibility=View.VISIBLE
taskProgressTv.visibility=View.VISIBLE
taskProgressTv.text=progress
}
fun onCreateView(savedInstanceState: Bundle?) {
sweeperSmallTextureMapView?.onCreate(savedInstanceState)
}

View File

@@ -2,7 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<com.amap.api.maps.TextureMapView
android:id="@+id/sweeperTextureMapView"
android:layout_width="match_parent"
@@ -43,12 +44,13 @@
android:textSize="@dimen/dp_34"
app:layout_constraintWidth_percent="0.5"
android:gravity="center"
android:visibility="gone"
/>
<TextView
android:id="@+id/taskWeltDistanceTv"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="贴边:8cm"
android:text="贴边:0.0cm"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="#3d98c7"
@@ -60,7 +62,8 @@
android:paddingRight="6dp"
android:textSize="@dimen/dp_34"
android:gravity="center"
app:layout_constraintWidth_percent="0.5"/>
app:layout_constraintWidth_percent="0.5"
android:visibility="gone"/>
<com.mogo.och.sweeper.view.LegendItemView
android:id="@+id/sweeperLegend1"
android:layout_width="wrap_content"

View File

@@ -25,7 +25,7 @@
android:id="@+id/taskProgressTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="进度:60%"
tools:text="进度:60%"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#3f69d9"
@@ -40,7 +40,7 @@
android:id="@+id/taskWeltDistanceTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="贴边:8cm"
tools:text="贴边:8cm"
app:layout_constraintTop_toTopOf="parent"
android:background="#3d98c7"
android:textColor="@color/white"