|
|
|
|
@@ -1,6 +1,5 @@
|
|
|
|
|
package com.mogo.och.sweepercloud.fragment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
|
import android.view.MotionEvent;
|
|
|
|
|
@@ -25,6 +24,7 @@ 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;
|
|
|
|
|
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
|
|
|
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
|
|
|
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
|
|
|
|
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
|
|
|
|
@@ -35,8 +35,9 @@ 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.OCHAdasAbilityManager;
|
|
|
|
|
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
|
|
|
|
|
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
|
|
|
|
import com.mogo.och.sweepercloud.R;
|
|
|
|
|
import com.mogo.och.sweepercloud.bean.SweeperRoutePlanningUpdateReqBean;
|
|
|
|
|
@@ -125,23 +126,25 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
//设置左下角四个按钮监听事件
|
|
|
|
|
setBottomBtnListener();
|
|
|
|
|
// 模拟 下发启动自驾命令
|
|
|
|
|
findViewById(R.id.btnStartAutopilot).setOnClickListener(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);
|
|
|
|
|
});
|
|
|
|
|
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 onParseFailed(String err) {
|
|
|
|
|
ToastUtils.showLong("解析失败=" + err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onParse(MessagePad.SetAutopilotModeReq bean) {
|
|
|
|
|
@@ -204,17 +207,21 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
findViewById(R.id.btnSendTaskStatus).setOnClickListener(view ->
|
|
|
|
|
SweeperCloudTaskUtils.mockSendCloudBigTaskStatus()
|
|
|
|
|
);
|
|
|
|
|
mTrafficDataView.getSpeedImage().setOnLongClickListener(v -> {
|
|
|
|
|
debugTestBar();
|
|
|
|
|
return false;
|
|
|
|
|
mTrafficDataView.getSpeedImage().setOnLongClickListener(new View.OnLongClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public boolean onLongClick(View v) {
|
|
|
|
|
debugTestBar();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void updateSwitchMapIcon() {
|
|
|
|
|
if(mapBizView != null){
|
|
|
|
|
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
|
|
|
|
|
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
|
|
|
|
if (controller != null) {
|
|
|
|
|
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
|
|
|
|
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
|
|
|
|
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
|
|
|
|
|
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
|
|
|
|
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
|
|
|
|
} else {
|
|
|
|
|
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
|
|
|
|
@@ -224,6 +231,8 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置任务进度
|
|
|
|
|
*
|
|
|
|
|
* @param progress
|
|
|
|
|
*/
|
|
|
|
|
protected void setTaskProgress(String progress) {
|
|
|
|
|
ThreadUtils.runOnUiThread(() -> {
|
|
|
|
|
@@ -309,7 +318,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
|
|
|
|
|
private void initListener() {
|
|
|
|
|
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
|
|
|
|
|
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> showOrHideOverMapViewFragment(true));
|
|
|
|
|
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> {
|
|
|
|
|
showOrHideOverMapViewFragment(true);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -322,6 +333,8 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 迈速表实时更新
|
|
|
|
|
*
|
|
|
|
|
* @param newSpeed
|
|
|
|
|
*/
|
|
|
|
|
public void updateSpeedView(float newSpeed) {
|
|
|
|
|
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
|
|
|
|
@@ -332,6 +345,8 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 车辆基本信息View
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public SweeperTrafficDataView getTrafficDataView() {
|
|
|
|
|
return mTrafficDataView;
|
|
|
|
|
@@ -378,21 +393,33 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
mSwitchMapModeImage.setOnClickListener(new OnPreventFastClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClickImpl(View v) {
|
|
|
|
|
if(mapBizView != null){
|
|
|
|
|
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
|
|
|
|
|
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
|
|
|
|
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
|
|
|
|
|
if (controller != null) {
|
|
|
|
|
//切换地图的远近视图
|
|
|
|
|
if (controller.getCurrentMapVisualAngle().isLongSight()) {
|
|
|
|
|
// 2.11.0去掉
|
|
|
|
|
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
|
|
|
|
|
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
|
|
|
|
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
|
|
|
|
|
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
|
|
|
|
|
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
|
|
|
|
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
|
|
|
|
|
// 2.11.0去掉
|
|
|
|
|
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
|
|
|
|
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, BusConst.TYPE_MARKER_BUS_ORDER);
|
|
|
|
|
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
|
|
|
|
|
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
|
|
|
|
} else {
|
|
|
|
|
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
|
|
|
|
// 2.11.0去掉
|
|
|
|
|
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
|
|
|
|
|
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
|
|
|
|
|
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mSettingBtn.setOnClickListener(v -> CallerHmiManager.INSTANCE.showToolsView());
|
|
|
|
|
mSettingBtn.setOnClickListener(v -> {
|
|
|
|
|
// TODO: 2021/12/9
|
|
|
|
|
CallerHmiManager.INSTANCE.showToolsView();
|
|
|
|
|
});
|
|
|
|
|
if (mCardBtn != null) {
|
|
|
|
|
CallerDevaToolsManager.INSTANCE.initBadCase(mCardBtn);
|
|
|
|
|
}
|
|
|
|
|
@@ -403,6 +430,8 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置作业任务全览图隐藏或者显示
|
|
|
|
|
*
|
|
|
|
|
* @param isShow
|
|
|
|
|
*/
|
|
|
|
|
public void showOrHideOverMapViewFragment(boolean isShow) {
|
|
|
|
|
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
|
|
|
|
@@ -448,15 +477,20 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置贴边数据到地图
|
|
|
|
|
*
|
|
|
|
|
* @param weltDataBeans
|
|
|
|
|
*/
|
|
|
|
|
public void setWeltDataToMap(ArrayList<WeltDataBean> weltDataBeans, Boolean isWeltData, String distance) {
|
|
|
|
|
mWeltDataBeanList = weltDataBeans;
|
|
|
|
|
ThreadUtils.getSinglePool().execute(() -> {
|
|
|
|
|
if (mMapWeltView != null) {
|
|
|
|
|
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
|
|
|
|
}
|
|
|
|
|
if (mTaskDataToFragmentCallback != null) {
|
|
|
|
|
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
|
|
|
|
ThreadUtils.getSinglePool().execute(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
if (mMapWeltView != null) {
|
|
|
|
|
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
|
|
|
|
}
|
|
|
|
|
if (mTaskDataToFragmentCallback != null) {
|
|
|
|
|
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
@@ -473,6 +507,8 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置当前任务终点
|
|
|
|
|
*
|
|
|
|
|
* @param subTaskCoordinate
|
|
|
|
|
*/
|
|
|
|
|
public void setCurrentTaskEndMarker(LatLng subTaskCoordinate) {
|
|
|
|
|
if (mMapWeltView != null) {
|
|
|
|
|
|