[3.4.0-map-sdk] update ,wait to test
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
package com.mogo.och.sweepercloud.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_SWEEPER;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -16,7 +14,6 @@ import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.google.protobuf.TextFormat;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
@@ -28,23 +25,19 @@ 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;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
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.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.sweepercloud.R;
|
||||
import com.mogo.och.sweepercloud.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweepercloud.callback.ISweeperTaskDataToFragmentCallback;
|
||||
@@ -132,55 +125,52 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
//设置左下角四个按钮监听事件
|
||||
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.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.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);
|
||||
});
|
||||
}
|
||||
|
||||
@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.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 ->
|
||||
@@ -213,12 +203,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
findViewById(R.id.btnSendTaskStatus).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockSendCloudBigTaskStatus()
|
||||
);
|
||||
mTrafficDataView.getSpeedImage().setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
debugTestBar();
|
||||
return false;
|
||||
}
|
||||
mTrafficDataView.getSpeedImage().setOnLongClickListener(v -> {
|
||||
debugTestBar();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -236,8 +223,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置任务进度
|
||||
*
|
||||
* @param progress
|
||||
*/
|
||||
protected void setTaskProgress(String progress) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
@@ -323,9 +308,7 @@ 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));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,8 +321,6 @@ 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为负值
|
||||
@@ -350,8 +331,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 车辆基本信息View
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public SweeperTrafficDataView getTrafficDataView() {
|
||||
return mTrafficDataView;
|
||||
@@ -412,10 +391,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
}
|
||||
}
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> {
|
||||
// TODO: 2021/12/9
|
||||
CallerHmiManager.INSTANCE.showToolsView();
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> CallerHmiManager.INSTANCE.showToolsView());
|
||||
if (mCardBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mCardBtn);
|
||||
}
|
||||
@@ -426,8 +402,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置作业任务全览图隐藏或者显示
|
||||
*
|
||||
* @param isShow
|
||||
*/
|
||||
public void showOrHideOverMapViewFragment(boolean isShow) {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
@@ -473,20 +447,15 @@ 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(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
ThreadUtils.getSinglePool().execute(() -> {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -503,8 +472,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置当前任务终点
|
||||
*
|
||||
* @param subTaskCoordinate
|
||||
*/
|
||||
public void setCurrentTaskEndMarker(LatLng subTaskCoordinate) {
|
||||
if (mMapWeltView != null) {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/huanwei"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user