Merge branch 'dev_robotaxi-d_240401_6.4.0' into dev_robotaxi-d_240401_6.4.0_work_order
This commit is contained in:
@@ -322,10 +322,13 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
* @param text 指定的文字
|
||||
*/
|
||||
public void showSlidePanel(String text) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
slidePanelView.setText(text);
|
||||
slidePanelView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
slidePanelView.setText(text);
|
||||
slidePanelView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
setArrivedClickable(false);
|
||||
}
|
||||
|
||||
@@ -335,23 +338,29 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
* @param isClickable
|
||||
*/
|
||||
public void setArrivedClickable(boolean isClickable) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable) {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
|
||||
} else {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable) {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
|
||||
} else {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
|
||||
}
|
||||
}
|
||||
});
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏滑动按钮
|
||||
*/
|
||||
public void hideSlidePanel() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
slidePanelView.setVisibility(View.GONE);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
slidePanelView.setVisibility(View.GONE);
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void playDI() {
|
||||
@@ -364,9 +373,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
* @param autopilotStatus 0:不可用 1:可用状态 2:自动驾驶中
|
||||
*/
|
||||
public void onAutopilotStatusChanged(int autopilotStatus) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
changeAutopilotBtnView(autopilotStatus, isAnimateRunning);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
changeAutopilotBtnView(autopilotStatus, isAnimateRunning);
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void setAutopilotBtnStatus(int autopilotStatus) {
|
||||
@@ -443,19 +455,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
* 隐藏【自动驾驶】按钮
|
||||
*/
|
||||
public void hideAutopilotBiz() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
// ctvAutopilotStatus.setVisibility(View.GONE);
|
||||
// slidePanelView.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示【自动驾驶】按钮
|
||||
*/
|
||||
public void showAutopilotBiz() {
|
||||
// getActivity().runOnUiThread(() -> {
|
||||
// ctvAutopilotStatus.setVisibility(View.VISIBLE);
|
||||
// });
|
||||
}
|
||||
|
||||
public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() {
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
@@ -191,20 +192,23 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
return;
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (stationList == null) {
|
||||
// 获取小巴数据失败
|
||||
return;
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (stationList == null) {
|
||||
// 获取小巴数据失败
|
||||
return;
|
||||
}
|
||||
|
||||
showStationsPanel();
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
mLineName.setText(lineName);
|
||||
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
|
||||
// 渲染小巴路线数据
|
||||
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
|
||||
}
|
||||
|
||||
showStationsPanel();
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
mLineName.setText(lineName);
|
||||
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
|
||||
// 渲染小巴路线数据
|
||||
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
|
||||
});
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
private void updateBusStationStatus(List<BusStationBean> stationList,
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.mogo.och.bus.util.BusAnalyticsManager;
|
||||
import com.mogo.och.bus.util.BusSendTripInfoManager;
|
||||
import com.mogo.och.bus.util.BusTrajectoryManager;
|
||||
import com.mogo.och.bus.util.BusVoiceManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.AppConnectMsg;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
|
||||
@@ -661,7 +662,7 @@ public class OrderModel {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
|
||||
CallerLogger.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
|
||||
|
||||
@@ -238,33 +238,12 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
onAutopilotStatusResponse(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRouteLineId(long lineId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
|
||||
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo,lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(@NonNull AdasConstants.IpcConnectionStatus status, @Nullable String reason) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChange(LoginStatusEnum currentStatus) {
|
||||
@@ -299,11 +278,4 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSsmReceiveTimeout(boolean isTimeout) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ public class BusTrajectoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo,long lineId) {
|
||||
onAutopilotGuardian(guardianInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口MEC反馈的常规信息(MAP v2.5.0新增轨迹相关信息)
|
||||
* @param guardianInfo
|
||||
|
||||
@@ -46,6 +46,9 @@ import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.pushAppOperationalMsgBox
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.startLoopAbnormalFactors
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.stopLoopAbnormalFactors
|
||||
@@ -331,7 +334,7 @@ object BusPassengerModel {
|
||||
private fun initListeners() {
|
||||
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
|
||||
IntentManager.getInstance()
|
||||
.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener)
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
@@ -360,7 +363,7 @@ object BusPassengerModel {
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.unregisterLifecycleListener(10010)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
|
||||
CallerTelematicListenerManager.removeListener(TAG)
|
||||
stopLoopAbnormalFactors()
|
||||
}
|
||||
@@ -471,8 +474,8 @@ object BusPassengerModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
private val mGoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
private val mGoAutopilotStatusListener: IOchAutopilotStatusListener =
|
||||
object : IOchAutopilotStatusListener {
|
||||
private var arriveAtEnd = false //乘客app专用字段
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
@@ -499,7 +502,7 @@ object BusPassengerModel {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {
|
||||
if (FunctionBuildConfig.isDemoMode
|
||||
&& isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
|
||||
@@ -427,12 +427,15 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
|
||||
public void onAutopilotStatusChanged(int status) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
// 3. 其他过程直接更新
|
||||
if (mPrevAPStatus != status){
|
||||
AutopilotStatusChanged(status);
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 3. 其他过程直接更新
|
||||
if (mPrevAPStatus != status){
|
||||
AutopilotStatusChanged(status);
|
||||
}
|
||||
mPrevAPStatus = status;
|
||||
}
|
||||
mPrevAPStatus = status;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
|
||||
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.distance.IDistanceListener
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
@@ -109,7 +111,7 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
private fun initListener() {
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
|
||||
@@ -267,8 +269,8 @@ class PM2DrivingModel private constructor() {
|
||||
mDrivingInfoCallback?.updateSpeed(speedKM)
|
||||
}
|
||||
|
||||
private val mAutoPilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
private val mAutoPilotStatusListener: IOchAutopilotStatusListener =
|
||||
object : IOchAutopilotStatusListener {
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
super.onAutopilotStatusResponse(state)
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.magic.mogo.och.charter.manager
|
||||
|
||||
import com.magic.mogo.och.charter.R
|
||||
import com.magic.mogo.och.charter.constant.CharterConst
|
||||
import com.magic.mogo.och.charter.model.DriverM1Model.Companion.get
|
||||
import com.magic.mogo.och.charter.model.DriverM1Model
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendTrajectoryDownloadReq
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
@@ -43,7 +43,7 @@ object CharterTrajectoryManager {
|
||||
fun syncTrajectoryInfo(lineId: Int, lineName: String) {
|
||||
mLineId = lineId
|
||||
mLineName = lineName
|
||||
val routesResult = get().getBusRoutesResult()
|
||||
val routesResult = DriverM1Model.get().getBusRoutesResult()
|
||||
if (LoginStatusManager.isLogin() && routesResult != null) {
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "syncTrajectoryInfo() start.")
|
||||
startTrajReqLoop()
|
||||
@@ -54,6 +54,10 @@ object CharterTrajectoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun onAutopilotGuardian(guardianInfo: MogoReportMessage?, lineId: Long) {
|
||||
onAutopilotGuardian(guardianInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口MEC反馈的常规信息(MAP v2.5.0新增轨迹相关信息)
|
||||
* @param guardianInfo
|
||||
@@ -63,43 +67,33 @@ object CharterTrajectoryManager {
|
||||
if ("ISYS_INIT_TRAJECTORY_START" == guardianInfo.code) {
|
||||
// 1. 轨迹管理_轨迹开始下载(本地已有对应轨迹也触发)
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() 轨迹开始下载")
|
||||
// ToastUtils.showShort("轨迹开始下载");
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹开始下载", eventID = OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
stopTrajReqLoop()
|
||||
} else if ("ISYS_INIT_TRAJECTORY_SUCCESS" == guardianInfo.code) {
|
||||
// 2. 轨迹管理_轨迹下载成功(本地已有对应轨迹也触发)
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() 轨迹下载成功")
|
||||
// ToastUtils.showShort("轨迹下载成功");
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载成功", eventID = OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
stopTrajReqLoop()
|
||||
} else if ("ISYS_INIT_TRAJECTORY_FAILURE" == guardianInfo.code) {
|
||||
// 3. 轨迹管理_轨迹下载失败,本地无对应轨迹
|
||||
d(
|
||||
SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地无对应轨迹"
|
||||
)
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() " + "轨迹下载失败,本地无对应轨迹")
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地无对应轨迹", eventID = OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
// ToastUtils.showShort("轨迹下载失败,本地无对应轨迹");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_WARNING" == guardianInfo.code) {
|
||||
// 4. 轨迹管理_轨迹下载失败,本地有对应轨迹,认为成功
|
||||
d(
|
||||
SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地有对应轨迹,认为成功"
|
||||
)
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() " + "轨迹下载失败,本地有对应轨迹,认为成功")
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地有对应轨迹,认为成功", eventID = OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
// ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_TIMEOUT" == guardianInfo.code) {
|
||||
// 5. 轨迹管理_轨迹下载超时
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() 轨迹下载超时")
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载超时", eventID = OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
// ToastUtils.showShort("轨迹下载超时");
|
||||
} else if ("EMAP_ATTITUDE_INIT_FAILED" == guardianInfo.getCode()) {
|
||||
// 收到ssm的自动驾驶变为ready,再次下发轨迹下载.解决:域控重启,或者102域控启动太早,107节点初始化未完成导致的轨迹未进行下载。
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() ssm ready,再次发起下载")
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 当前位置距离轨迹距离大于15m", eventID = OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY)
|
||||
get().getBusOrderResult()?.lineId?.let {
|
||||
syncTrajectoryInfo(it,
|
||||
get().getBusOrderResult()?.lineName!!)
|
||||
DriverM1Model.get().getBusOrderResult()?.lineId?.let {
|
||||
syncTrajectoryInfo(it, DriverM1Model.get().getBusOrderResult()?.lineName!!)
|
||||
}
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
@@ -114,7 +108,7 @@ object CharterTrajectoryManager {
|
||||
}
|
||||
|
||||
private fun setupAutoPilotLine() {
|
||||
val routesResult = get().getBusRoutesResult()
|
||||
val routesResult = DriverM1Model.get().getBusRoutesResult()
|
||||
if (routesResult == null) {
|
||||
e(
|
||||
SceneConstant.M_CHARTER_D + TAG,
|
||||
@@ -177,7 +171,7 @@ object CharterTrajectoryManager {
|
||||
CharterConst.LOOP_DELAY,
|
||||
CharterConst.LOOP_PERIOD_10S, TimeUnit.MILLISECONDS
|
||||
)
|
||||
.map(Function { aLong: Long -> aLong + 1 })
|
||||
.map { aLong: Long -> aLong + 1 }
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe { aLong: Long ->
|
||||
@@ -208,24 +202,6 @@ object CharterTrajectoryManager {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: 2022/6/24
|
||||
// test1
|
||||
// mAutoPilotLine.setLineId(148);
|
||||
// mAutoPilotLine.setTrajUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/e27c20c2da32481021d934c3ef084536/traj_148.csv");
|
||||
// mAutoPilotLine.setTrajMd5("e27c20c2da32481021d934c3ef084536");
|
||||
// mAutoPilotLine.setStopUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/6224c9dd2c0e2bd990c6482c0464de45/stop_148.txt");
|
||||
// mAutoPilotLine.setStopMd5("6224c9dd2c0e2bd990c6482c0464de45");
|
||||
// mAutoPilotLine.setTimestamp(1654596000000L); //20220607 18:00
|
||||
// mAutoPilotLine.setVehicleModel("红旗H9");
|
||||
|
||||
// test2
|
||||
// mAutoPilotLine.setLineId(148);
|
||||
// mAutoPilotLine.setTrajUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/8654497cf918be461a59c7ad8e22920d/traj_148.csv");
|
||||
// mAutoPilotLine.setTrajMd5("8654497cf918be461a59c7ad8e22920d");
|
||||
// mAutoPilotLine.setStopUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/1bb098b244922649bf3e7bada0d3950f/stop_148.txt");
|
||||
// mAutoPilotLine.setStopMd5("1bb098b244922649bf3e7bada0d3950f");
|
||||
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
|
||||
// mAutoPilotLine.setVehicleModel("红旗H9");
|
||||
mAutoPilotLine?.let {
|
||||
OchChainLogManager.writeChainLog("轨迹监控", "sendTrajectoryReq() 下发轨迹 轨迹id" + it.lineId,
|
||||
true,
|
||||
@@ -233,12 +209,8 @@ object CharterTrajectoryManager {
|
||||
)
|
||||
}
|
||||
|
||||
sendTrajectoryDownloadReq(mAutoPilotLine!!)
|
||||
d(
|
||||
SceneConstant.M_CHARTER_D + TAG,
|
||||
"sendTrajectoryReq(): "
|
||||
+ GsonUtils.toJson(mAutoPilotLine)
|
||||
)
|
||||
CallerAutoPilotControlManager.sendTrajectoryDownloadReq(mAutoPilotLine!!)
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "sendTrajectoryReq(): ${GsonUtils.toJson(mAutoPilotLine)}")
|
||||
}
|
||||
|
||||
init {
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.mogo.eagle.core.data.msgbox.OperationMsg
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
@@ -52,6 +51,7 @@ import com.mogo.och.common.module.manager.CharterSendTripInfoManager.ARRIVE_STAT
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.END_TRIP
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.START_TRIP
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.device.LightAirconditionDoorManager
|
||||
import com.mogo.och.common.module.manager.device.LightAirconditionDoorStatusManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.data.OperateDoorMsg
|
||||
@@ -492,7 +492,7 @@ class DriverM1Model {
|
||||
d(SceneConstant.M_CHARTER_D + TAG, "行程日志-AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
startAutoPilot(parameters)
|
||||
OchAutoPilotManager.startAutoPilot(parameters)
|
||||
d(
|
||||
SceneConstant.M_CHARTER_D + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName
|
||||
|
||||
@@ -20,6 +20,9 @@ import com.mogo.och.common.module.biz.login.LoginStatusEnum
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.OPERATION_ROAD_SIDE_TYPE
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.beautifymode.BeautifyManager
|
||||
import com.mogo.och.common.module.manager.stopside.OCHPlanningActionsCallback
|
||||
import com.mogo.och.common.module.manager.stopside.StopSideStatus
|
||||
@@ -35,7 +38,7 @@ import mogo_msg.MogoReportMsg
|
||||
class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
Presenter<DriverM1Fragment?>(view),
|
||||
ILoginCallback, DriverM1OrderCallback, ChangeDestCallback,
|
||||
IMoGoAutopilotStatusListener, OCHPlanningActionsCallback{
|
||||
IOchAutopilotStatusListener, OCHPlanningActionsCallback{
|
||||
|
||||
companion object{
|
||||
private const val TAG = "DriverM1Presenter"
|
||||
@@ -50,7 +53,7 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
|
||||
private fun registerListener() {
|
||||
//2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
StopSideManager.addListener(TAG,this)
|
||||
DriverM1Model.get().setDriverM1OrderCallback(this)
|
||||
DriverM1Model.get().setChangeDestCallback(this)
|
||||
@@ -58,7 +61,7 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
|
||||
private fun releaseListener() {
|
||||
StopSideManager.removeListener(TAG)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
DriverM1Model.get().setDriverM1OrderCallback(null)
|
||||
DriverM1Model.get().setChangeDestCallback(null)
|
||||
}
|
||||
@@ -122,12 +125,12 @@ class DriverM1Presenter(view: DriverM1Fragment?) :
|
||||
DriverM1Model.get().pushOperationalToMsgBox(DateTimeUtil.getCurrentTimeStamp()
|
||||
,context.getString(R.string.charter_last_15_minutes))
|
||||
}
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
CharterTrajectoryManager.onAutopilotGuardian(guardianInfo)
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?, lineId: Long) {
|
||||
CharterTrajectoryManager.onAutopilotGuardian(guardianInfo,lineId)
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {
|
||||
DriverM1Model.get().onAutopilotArriveAtStation()
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
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.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.beautifymode.BeautifyManager
|
||||
import com.mogo.och.common.module.manager.beautifymode.IBeautifyModeCallback
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
@@ -22,7 +24,7 @@ import com.mogo.och.common.module.utils.RxUtils
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
class AutopilotStatusViewModel: ViewModel(), IDriverM1ControllerStatusCallback,
|
||||
IMoGoAutopilotStatusListener, IBeautifyModeCallback {
|
||||
IOchAutopilotStatusListener, IBeautifyModeCallback {
|
||||
|
||||
private val TAG = AutopilotStatusViewModel::class.java.simpleName
|
||||
|
||||
@@ -43,7 +45,7 @@ class AutopilotStatusViewModel: ViewModel(), IDriverM1ControllerStatusCallback,
|
||||
|
||||
fun setAutopilotStatusCallback(viewCallback:IAutopilotStatusCallback){
|
||||
this.viewCallback = viewCallback
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
BeautifyManager.setStatusChangeListener(TAG,this)
|
||||
this.setUIMode(CallerAutoPilotStatusListenerManager.getState())
|
||||
}
|
||||
|
||||
@@ -11,12 +11,9 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
@@ -45,6 +42,10 @@ import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager
|
||||
import com.mogo.och.common.module.manager.CharterSendTripInfoManager.LEAVE_STATION
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.beautifymode.BeautifyManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager
|
||||
@@ -133,7 +134,7 @@ object CharterPassengerModel {
|
||||
}
|
||||
|
||||
private fun releaseListeners() {
|
||||
CallerAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
|
||||
CallerPlanningRottingListenerManager.removeListener(moGoAutopilotPlanningListener)
|
||||
}
|
||||
|
||||
@@ -142,7 +143,7 @@ object CharterPassengerModel {
|
||||
IntentManager.getInstance()
|
||||
.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener)
|
||||
// 自动驾驶状态变化监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
|
||||
// 自动驾驶路线规划接口 返回自动驾驶轨迹
|
||||
CallerPlanningRottingListenerManager.addListener(TAG, moGoAutopilotPlanningListener)
|
||||
// 登录状态监听
|
||||
@@ -189,15 +190,15 @@ object CharterPassengerModel {
|
||||
|
||||
// region 设置外部回调
|
||||
// 自动驾驶状态监听
|
||||
private val mGoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
private val mGoAutopilotStatusListener: IOchAutopilotStatusListener =
|
||||
object : IOchAutopilotStatusListener {
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
mAutoStatusChnageListener.forEach {
|
||||
it.value.onAutoStatusChange(state)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {
|
||||
d(M_BUS_P + TAG, "底盘给到站信息")
|
||||
arriveDest()
|
||||
}
|
||||
@@ -1139,7 +1140,7 @@ object CharterPassengerModel {
|
||||
}
|
||||
ToastCharterUtils.showToastShort("启动自动驾驶中")
|
||||
cleanRoutePoints()
|
||||
startAutoPilot(parameters)
|
||||
OchAutoPilotManager.startAutoPilot(parameters)
|
||||
d(
|
||||
SceneConstant.M_BUS + TAG,
|
||||
"行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
|
||||
@@ -6,14 +6,16 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.utilcode.util.TAG
|
||||
import com.mogo.och.common.module.manager.audition.AuditionManager
|
||||
import com.mogo.och.common.module.manager.audition.PlayState
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
object MusicModel : IMoGoAutopilotStatusListener, IOrderStatusChangeListener {
|
||||
object MusicModel : IOchAutopilotStatusListener, IOrderStatusChangeListener {
|
||||
init {
|
||||
CharterPassengerModel.setStatusChangeListener(TAG,this)
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private var stopMusicDisposable: Disposable? = null
|
||||
|
||||
@@ -25,6 +25,8 @@ import com.mogo.och.charter.passenger.bean.response.OrderInfoResponse
|
||||
import com.mogo.och.charter.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.charter.passenger.model.OrderStatusEnum
|
||||
import com.mogo.och.charter.passenger.ui.debugview.DebugEvent
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.beautifymode.BeautifyManager
|
||||
import com.mogo.och.common.module.manager.beautifymode.IBeautifyModeCallback
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
@@ -45,7 +47,8 @@ class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoBatteryManagementSystemListener, IMoGoAutopilotStatusListener,
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoBatteryManagementSystemListener,
|
||||
IOchAutopilotStatusListener,
|
||||
IBeautifyModeCallback {
|
||||
|
||||
companion object {
|
||||
@@ -90,7 +93,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
//电池电量监听
|
||||
CallerBatteryManagementSystemListenerManager.addListener(TAG,this)
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
|
||||
BeautifyManager.setStatusChangeListener(TAG,this)
|
||||
|
||||
|
||||
@@ -28,4 +28,10 @@ public class ArrivedStation {
|
||||
return new ArrivedStation(mogoLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ArrivedStation{" +
|
||||
"mogoLocation=" + mogoLocation +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.autopilot;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation;
|
||||
import com.zhjt.mogo.adas.data.AdasConstants;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
public interface IOchAutopilotStatusListener {
|
||||
/**
|
||||
* 自驾路线触发下载请求回调
|
||||
*/
|
||||
default void onAutopilotTrajectoryDownloadReq(AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态信息
|
||||
*
|
||||
* @param state 状态信息
|
||||
*/
|
||||
default void onAutopilotStatusResponse(int state) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶docker信息
|
||||
*
|
||||
* @param dockerVersion docker版本
|
||||
*/
|
||||
default void onAutopilotDockerInfo(String dockerVersion) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶到站
|
||||
*
|
||||
* @param arrivalNotification 所到车站的简单信息
|
||||
*/
|
||||
default void onAutopilotArriveAtStation(ArrivedStation arrivalNotification) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机获取SN
|
||||
*/
|
||||
default void onAutopilotSNRequest(MessagePad.BasicInfoReq basicInfoReq) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控事件报告
|
||||
*/
|
||||
default void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 监控事件报告
|
||||
*/
|
||||
default void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机连接状态回调
|
||||
*/
|
||||
default void onAutopilotIpcConnectStatusChanged(AdasConstants.IpcConnectionStatus status, String reason) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控SSM接口接收超时
|
||||
* 状态变动时才会回调,默认SSM状态正常
|
||||
*
|
||||
* @param isTimeout true:SSM接口接收超时 false:SSM接口恢复正常
|
||||
*/
|
||||
default void onSsmReceiveTimeout(boolean isTimeout) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机主动查询 AdasManager#sendStatusQueryReq(),后会收到如下回调
|
||||
*/
|
||||
default void onAutopilotStatusRespByQuery(SystemStatusInfo.StatusInfo status) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 定频SSM
|
||||
* 老版本 SSM(SystemStatusInfo.StatusInfo) HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
*/
|
||||
default void onSystemStatus(SsmInfo.SsmStatusInf statusInf) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶路线ID回调
|
||||
*/
|
||||
default void onAutopilotRouteLineId(long lineId) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.autopilot
|
||||
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
|
||||
interface IOchAutopilotStatusListener {
|
||||
/**
|
||||
* 自动驾驶状态信息
|
||||
*
|
||||
* @param state 状态信息
|
||||
*/
|
||||
fun onAutopilotStatusResponse(state: Int) {}
|
||||
|
||||
/**
|
||||
* 自动驾驶docker信息
|
||||
*
|
||||
* @param dockerVersion docker版本
|
||||
*/
|
||||
fun onAutopilotDockerInfo(dockerVersion:String){}
|
||||
|
||||
/**
|
||||
* 自动驾驶到站
|
||||
*
|
||||
* @param arrivalNotification 所到车站的简单信息
|
||||
*/
|
||||
fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {}
|
||||
|
||||
/**
|
||||
* 工控机获取SN
|
||||
*/
|
||||
fun onAutopilotSNRequest(basicInfoReq: MessagePad.BasicInfoReq) {}
|
||||
|
||||
/**
|
||||
* 监控事件报告
|
||||
*/
|
||||
fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {}
|
||||
|
||||
/**
|
||||
* 监控事件报告
|
||||
*/
|
||||
fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?,lineId: Long) {}
|
||||
|
||||
/**
|
||||
* 工控机连接状态回调
|
||||
*/
|
||||
fun onAutopilotIpcConnectStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) {}
|
||||
|
||||
/**
|
||||
* 域控SSM接口接收超时
|
||||
* 状态变动时才会回调,默认SSM状态正常
|
||||
* @param isTimeout true:SSM接口接收超时 false:SSM接口恢复正常
|
||||
*/
|
||||
fun onSsmReceiveTimeout(isTimeout: Boolean) {}
|
||||
|
||||
/**
|
||||
* 工控机主动查询 AdasManager#sendStatusQueryReq(),后会收到如下回调
|
||||
*/
|
||||
fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {}
|
||||
|
||||
/**
|
||||
* 定频SSM
|
||||
* 老版本 SSM(SystemStatusInfo.StatusInfo) HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
*/
|
||||
fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {}
|
||||
|
||||
/**
|
||||
* 自动驾驶路线ID回调
|
||||
*/
|
||||
fun onAutopilotRouteLineId(lineId: Long){}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* 不可自动驾驶,目前场景是刚开机,adas还未和工控机连接
|
||||
*/
|
||||
const val STATUS_AUTOPILOT_DISABLE = 0
|
||||
|
||||
/**
|
||||
* 可自动驾驶,工控机连接正常,且处于人工干预状态
|
||||
*/
|
||||
const val STATUS_AUTOPILOT_ENABLE = 1
|
||||
|
||||
/**
|
||||
* 自动驾驶中,可能是停车,可能是行进,但是是机器在处理车的前进后退,不是人
|
||||
*/
|
||||
const val STATUS_AUTOPILOT_RUNNING = 2
|
||||
|
||||
/**
|
||||
* 平行驾驶
|
||||
*/
|
||||
const val STATUS_PARALLEL_DRIVING = 7
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
|
||||
object OchAutoPilotManager {
|
||||
|
||||
const val TAG = "OchAutoPilotManager"
|
||||
init {shoulong
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
|
||||
CallerAutoPilotControlManager.startAutoPilot(controlParameters)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.mogo.och.common.module.manager.autopilot.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryManager
|
||||
import com.mogo.och.common.module.utils.CallerBase
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.mogo.adas.data.bean.MogoReport
|
||||
@@ -19,6 +21,17 @@ object OchAutoPilotStatusListenerManager : CallerBase<IOchAutopilotStatusListene
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onAutopilotTrajectoryDownloadReq(
|
||||
autoPilotLine: AutopilotControlParameters.AutoPilotLine,
|
||||
downloadType: Int
|
||||
) {
|
||||
super.onAutopilotTrajectoryDownloadReq(autoPilotLine, downloadType)
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotTrajectoryDownloadReq(autoPilotLine,downloadType)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
super.onAutopilotStatusResponse(state)
|
||||
M_LISTENERS.forEach {
|
||||
@@ -82,6 +95,13 @@ object OchAutoPilotStatusListenerManager : CallerBase<IOchAutopilotStatusListene
|
||||
|
||||
}
|
||||
}
|
||||
if (MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_SUCCESS == guardianInfo?.code){
|
||||
TrajectoryManager.addDownLoadSuccessLine(lineId)
|
||||
}
|
||||
if (MogoReport.Code.Info.ISYS.INIT_TRAJECTORY_FAILURE == guardianInfo?.code){
|
||||
// 更新轨迹没有更新lineId 第二次下载失败 删除App成功缓存(概率很低)
|
||||
TrajectoryManager.removeDownLoadSuccessLine(lineId)
|
||||
}
|
||||
}
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
|
||||
@@ -17,6 +17,8 @@ object TrajectoryManager : IMoGoPlanningRottingListener {
|
||||
private val distanceListeners: ConcurrentHashMap<String, ITrajectoryListListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
private val downLoadSuccessLineIds = mutableListOf<Long>()
|
||||
|
||||
/**
|
||||
* 所有轨迹点
|
||||
*/
|
||||
@@ -99,4 +101,15 @@ object TrajectoryManager : IMoGoPlanningRottingListener {
|
||||
distanceListeners[tag] = listener
|
||||
}
|
||||
|
||||
fun addDownLoadSuccessLine(lineId:Long){
|
||||
if(lineId>0){
|
||||
downLoadSuccessLineIds.add(lineId)
|
||||
}
|
||||
}
|
||||
fun removeDownLoadSuccessLine(lineId:Long){
|
||||
if(lineId>0&& downLoadSuccessLineIds.contains(lineId)){
|
||||
downLoadSuccessLineIds.remove(lineId)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -324,10 +324,13 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
|
||||
* @param text 指定的文字
|
||||
*/
|
||||
public void showSlidePanel(String text) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
slidePanelView.setText(text);
|
||||
slidePanelView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
slidePanelView.setText(text);
|
||||
slidePanelView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
setArrivedClikable(false);
|
||||
}
|
||||
|
||||
@@ -337,23 +340,29 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
|
||||
* @param isClickable
|
||||
*/
|
||||
public void setArrivedClikable(boolean isClickable) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable) {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
|
||||
} else {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable) {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_white));
|
||||
} else {
|
||||
tvArrived.setTextColor(getResources().getColor(R.color.bus_arrived_btn_un_clickable_color));
|
||||
}
|
||||
}
|
||||
});
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏滑动按钮
|
||||
*/
|
||||
public void hideSlidePanel() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
slidePanelView.setVisibility(View.GONE);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
slidePanelView.setVisibility(View.GONE);
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void playDI() {
|
||||
@@ -366,9 +375,12 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
|
||||
* @param autopilotStatus 0:不可用 1:可用状态 2:自动驾驶中
|
||||
*/
|
||||
public void onAutopilotStatusChanged(int autopilotStatus) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
changeAutopilotBtnView(autopilotStatus, isAnimateRunning);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
changeAutopilotBtnView(autopilotStatus, isAnimateRunning);
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void setAutopilotBtnStatus(int autopilotStatus) {
|
||||
@@ -450,19 +462,12 @@ public abstract class BaseShuttleTabFragment<V extends IView, P extends Presente
|
||||
* 隐藏【自动驾驶】按钮
|
||||
*/
|
||||
public void hideAutopilotBiz() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
// ctvAutopilotStatus.setVisibility(View.GONE);
|
||||
// slidePanelView.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示【自动驾驶】按钮
|
||||
*/
|
||||
public void showAutopilotBiz() {
|
||||
// getActivity().runOnUiThread(() -> {
|
||||
// ctvAutopilotStatus.setVisibility(View.VISIBLE);
|
||||
// });
|
||||
}
|
||||
|
||||
public SlidePanelView.OnSlidePanelMoveToEndListener getSlidePanelOnEndListener() {
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant;
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
@@ -198,20 +199,23 @@ public class ShuttleFragment extends BaseShuttleTabFragment<ShuttleFragment, Bus
|
||||
return;
|
||||
}
|
||||
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (stationList == null) {
|
||||
// 获取小巴数据失败
|
||||
return;
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (stationList == null) {
|
||||
// 获取小巴数据失败
|
||||
return;
|
||||
}
|
||||
|
||||
showStationsPanel();
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
mLineName.setText(lineName);
|
||||
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
|
||||
// 渲染小巴路线数据
|
||||
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
|
||||
}
|
||||
|
||||
showStationsPanel();
|
||||
showOrHideSwitchLineBtn(false);
|
||||
|
||||
mLineName.setText(lineName);
|
||||
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
|
||||
// 渲染小巴路线数据
|
||||
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
|
||||
});
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
private void updateBusStationStatus(List<BusStationBean> stationList,
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.socket.lan.LanSocketManager;
|
||||
import com.mogo.och.shuttle.bean.BusRoutesResponse;
|
||||
import com.mogo.och.shuttle.util.ShuttleVoiceManager;
|
||||
@@ -634,7 +635,7 @@ public class OrderModel {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
|
||||
CallerLogger.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
|
||||
|
||||
@@ -161,10 +161,6 @@ public class BusPresenter extends Presenter<ShuttleFragment>
|
||||
OrderModel.getInstance().onArriveAt(arrivedStation,type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest(@NonNull MessagePad.BasicInfoReq basicInfoReq) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(int state) {
|
||||
switch (state) {
|
||||
@@ -232,30 +228,10 @@ public class BusPresenter extends Presenter<ShuttleFragment>
|
||||
onAutopilotStatusResponse(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRouteLineId(long lineId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
|
||||
}
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(@NonNull AdasConstants.IpcConnectionStatus status, @Nullable String reason) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
|
||||
public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo,lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -279,12 +255,4 @@ public class BusPresenter extends Presenter<ShuttleFragment>
|
||||
runOnUIThread(() -> mView.stopAnimAndUpdateBtnStatus());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSsmReceiveTimeout(boolean isTimeout) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ public class BusTrajectoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo,long lineId) {
|
||||
onAutopilotGuardian(guardianInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口MEC反馈的常规信息(MAP v2.5.0新增轨迹相关信息)
|
||||
* @param guardianInfo
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_speed"
|
||||
android:layout_width="@dimen/dp_62"
|
||||
android:layout_width="@dimen/dp_624"
|
||||
android:layout_height="@dimen/dp_269"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
||||
@@ -339,12 +339,15 @@ public class BusPassengerRouteFragment extends
|
||||
}
|
||||
|
||||
public void onAutopilotStatusChanged(int status) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
// 3. 其他过程直接更新
|
||||
if (mPrevAPStatus != status){
|
||||
AutopilotStatusChanged(status);
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// 3. 其他过程直接更新
|
||||
if (mPrevAPStatus != status){
|
||||
AutopilotStatusChanged(status);
|
||||
}
|
||||
mPrevAPStatus = status;
|
||||
}
|
||||
mPrevAPStatus = status;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.pushAppOperationalMsgBox
|
||||
import com.mogo.och.common.module.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.distance.IDistanceListener
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
@@ -107,7 +109,7 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
private fun initListener() {
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
|
||||
@@ -273,8 +275,8 @@ class PM2DrivingModel private constructor() {
|
||||
mDrivingInfoCallback?.updateSpeed(speedKM)
|
||||
}
|
||||
|
||||
private val mAutoPilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
private val mAutoPilotStatusListener: IOchAutopilotStatusListener =
|
||||
object : IOchAutopilotStatusListener {
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
super.onAutopilotStatusResponse(state)
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback;
|
||||
@@ -430,7 +431,7 @@ public class SweeperOperateTaskModel {
|
||||
DebugView.Companion.printErrorMsg("[启自驾]行程日志-AutopilotControlParameters is empty");
|
||||
return;
|
||||
}
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
DebugView.Companion.printInfoMsg("[启自驾] 调用成功");
|
||||
CallerLogger.d(M_SWEEPER + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
|
||||
+ " startLatLon=" + parameters.startName + ",endLatLon=" + parameters.endName +
|
||||
|
||||
@@ -39,6 +39,10 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager;
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager;
|
||||
import com.mogo.och.common.module.manager.socket.cloud.data.OCHOperationalMessage;
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager;
|
||||
@@ -211,7 +215,7 @@ public class TaxiModel {
|
||||
|
||||
private void initListeners() {
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
OchAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, mGoAutopilotStatusListener);
|
||||
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener);
|
||||
|
||||
//定位监听, 传false是高德坐标系
|
||||
@@ -260,7 +264,7 @@ public class TaxiModel {
|
||||
|
||||
OCHSocketMessageManager.INSTANCE.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType);
|
||||
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
|
||||
OchAutoPilotStatusListenerManager.INSTANCE.removeListener(mGoAutopilotStatusListener);
|
||||
CallerPlanningRottingListenerManager.INSTANCE.removeListener(moGoAutopilotPlanningListener);
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null);
|
||||
|
||||
@@ -972,7 +976,8 @@ public class TaxiModel {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
|
||||
CallerLogger.d(M_TAXI + TAG, "start autopilot with parameter: %s",
|
||||
GsonUtil.jsonFromObject(parameters)
|
||||
+ " ,startSiteName=" + mCurrentOCHOrder.startSiteAddr
|
||||
@@ -1201,33 +1206,11 @@ public class TaxiModel {
|
||||
startServicePilotDone();
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() {
|
||||
private final IOchAutopilotStatusListener mGoAutopilotStatusListener = new IOchAutopilotStatusListener() {
|
||||
|
||||
@Override
|
||||
public void onAutopilotTrajectoryDownloadReq(@NonNull AutopilotControlParameters.AutoPilotLine autoPilotLine, int downloadType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSsmReceiveTimeout(boolean isTimeout) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRouteLineId(long lineId) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(@NonNull AdasConstants.IpcConnectionStatus status, @Nullable String reason) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo) {
|
||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo);
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
|
||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo,lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1290,11 +1273,7 @@ public class TaxiModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotSNRequest(@NonNull MessagePad.BasicInfoReq basicInfoReq) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification data) {
|
||||
public void onAutopilotArriveAtStation(ArrivedStation data) {
|
||||
CallerLogger.i(M_TAXI + TAG, "onAutopilotArriveAtStation = " + data.toString());
|
||||
|
||||
if (data == null || !checkCurrentOCHOrder()
|
||||
@@ -1305,20 +1284,10 @@ public class TaxiModel {
|
||||
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 到达目的地,置false
|
||||
// 2022.10.08 到达目的地时候取消自动起自驾, 服务完成取消引导线和自动驾驶按钮状态
|
||||
// FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;
|
||||
// CallerAutoPilotManager.INSTANCE.setIgnoreConditionDraw(false);
|
||||
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
|
||||
CallerLogger.d(M_TAXI + TAG, "美化模式-ignore:置为false(到达目的地)");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
|
||||
}
|
||||
@Override
|
||||
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoPlanningRottingListener moGoAutopilotPlanningListener = new IMoGoPlanningRottingListener() {
|
||||
|
||||
@@ -362,20 +362,23 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
|
||||
public void onAutopilotStatusChanged(int status) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
|
||||
// 1. 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return;
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING != status) {
|
||||
// 1. 主动开启自动驾驶中,不为2(为0、1)则继续loading
|
||||
return;
|
||||
}
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
// 2. 主动开启自动驾驶中,为2则停止loading,并isStarting = false
|
||||
startAutopilotDone(true);
|
||||
return;
|
||||
}
|
||||
// 3. 其他过程直接更新
|
||||
startOrStopLoadingAnim(false);
|
||||
autopilotStatusAnimchanged(status);
|
||||
}
|
||||
if (isStarting && IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING == status) {
|
||||
// 2. 主动开启自动驾驶中,为2则停止loading,并isStarting = false
|
||||
startAutopilotDone(true);
|
||||
return;
|
||||
}
|
||||
// 3. 其他过程直接更新
|
||||
startOrStopLoadingAnim(false);
|
||||
autopilotStatusAnimchanged(status);
|
||||
});
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void stopAnimAndUpdateBtnStatus() {
|
||||
@@ -523,15 +526,20 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
}
|
||||
|
||||
public void hidPanel() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
flStationPanelContainer.setVisibility(View.GONE);
|
||||
});
|
||||
}},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public void showPanel() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
flStationPanelContainer.setVisibility(View.VISIBLE);
|
||||
});
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
flStationPanelContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
public View getPanelView() {
|
||||
@@ -552,12 +560,15 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
|
||||
|
||||
public void changeOperationViewVisible(int visible) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
if (tvOperationStatus == null) {
|
||||
return;
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (tvOperationStatus == null) {
|
||||
return;
|
||||
}
|
||||
tvOperationStatus.setVisibility(visible);
|
||||
}
|
||||
tvOperationStatus.setVisibility(visible);
|
||||
});
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
protected void showAmapNaviToStationFragment(boolean isShow) {
|
||||
|
||||
@@ -66,6 +66,10 @@ public class TaxiTrajectoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo, long lineId) {
|
||||
onAutopilotGuardian(guardianInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口MEC反馈的常规信息(MAP v2.5.0新增轨迹相关信息)
|
||||
* @param guardianInfo
|
||||
|
||||
@@ -14,6 +14,9 @@ import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
import com.mogo.och.common.module.utils.PinYinUtil
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
@@ -23,12 +26,12 @@ import com.mogo.och.taxi.passenger.ui.model.order.TaxiPassengerOrderStatusEnum
|
||||
import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager
|
||||
import com.mogo.och.taxi.passenger.utils.TaxiPassengerAnalyticsManager
|
||||
|
||||
object AutopilotManager : IMoGoAutopilotStatusListener {
|
||||
object AutopilotManager : IOchAutopilotStatusListener {
|
||||
|
||||
private const val TAG = "AutopilotManager"
|
||||
|
||||
init {
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
//检测当前订单
|
||||
private fun checkCurrentOCHOrder(): Boolean {
|
||||
@@ -80,7 +83,7 @@ object AutopilotManager : IMoGoAutopilotStatusListener {
|
||||
)
|
||||
return "自动化驾驶参数异常"
|
||||
}
|
||||
CallerAutoPilotControlManager.startAutoPilot(parameters)
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_TAXI_P + TAG,
|
||||
"start autopilot with parameter: %s",
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.debug.DebugViewWatchDogFragment
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.debug.DebugEvent
|
||||
@@ -29,7 +31,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IOchAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusBarView"
|
||||
@@ -73,7 +75,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
layoutParams = params
|
||||
}
|
||||
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
|
||||
iv_biz_icon.setOnClickListener { continuousClick(debugView) }
|
||||
vShowDebugView.setOnLongClickListener {
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.TAG
|
||||
import com.mogo.och.common.module.manager.audition.AuditionManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.utils.RxUtils
|
||||
import com.mogo.och.taxi.passenger.ui.model.order.BaseOrderBean
|
||||
import com.mogo.och.taxi.passenger.ui.model.order.OrderListener
|
||||
@@ -12,11 +14,11 @@ import com.mogo.och.taxi.passenger.ui.model.order.OrderModel
|
||||
import com.mogo.och.taxi.passenger.ui.model.order.TaxiPassengerOrderStatusEnum
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
object MusicModel : OrderListener, IMoGoAutopilotStatusListener {
|
||||
object MusicModel : OrderListener, IOchAutopilotStatusListener {
|
||||
init {
|
||||
OrderModel.setOrderStatusCallback(TAG,this)
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
private var stopMusicDisposable: Disposable? = null
|
||||
|
||||
@@ -8,10 +8,8 @@ import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
@@ -23,6 +21,10 @@ import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager
|
||||
import com.mogo.och.taxi.bean.ContrailBean
|
||||
import com.mogo.och.taxi.bean.EndGrayContrailTaskReq
|
||||
@@ -37,9 +39,6 @@ import com.mogo.och.taxi.callback.ITaxiRoutingCallback
|
||||
import com.mogo.och.taxi.constant.TaxiUnmannedConst
|
||||
import com.mogo.och.taxi.network.TaxiRoutingServiceManager
|
||||
import com.mogo.och.taxi.ui.debug.DebugView
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object TaxiRoutingModel {
|
||||
@@ -82,26 +81,18 @@ object TaxiRoutingModel {
|
||||
}
|
||||
|
||||
fun addAutoPilotStatusListener() {
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mMogoAutopilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mMogoAutopilotStatusListener)
|
||||
}
|
||||
|
||||
fun removeAutoPilotStatusListener() {
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
//MAP到站监听
|
||||
private val mMogoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) {
|
||||
}
|
||||
private val mMogoAutopilotStatusListener: IOchAutopilotStatusListener =
|
||||
object : IOchAutopilotStatusListener {
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {
|
||||
CallerLogger.i(
|
||||
TAG,
|
||||
"onAutopilotArriveAtStation = ${arrivalNotification.toString()}"
|
||||
@@ -499,7 +490,8 @@ object TaxiRoutingModel {
|
||||
return
|
||||
}
|
||||
|
||||
CallerAutoPilotControlManager.startAutoPilot(parameters)
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
|
||||
DebugView.printInfoMsg("[启自驾] 调用成功")
|
||||
CallerLogger.d(
|
||||
TAG, "start autopilot with parameter: %s",
|
||||
|
||||
@@ -45,6 +45,10 @@ import com.mogo.och.common.module.biz.login.LoginService
|
||||
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback
|
||||
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.distance.IDistanceListener
|
||||
import com.mogo.och.common.module.manager.distance.ITrajectoryListener
|
||||
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
|
||||
@@ -80,7 +84,6 @@ import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import mogo.telematics.pad.MessagePad.ArrivalNotification
|
||||
import mogo.telematics.pad.MessagePad.GlobalPathResp
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -208,7 +211,7 @@ object TaxiTaskModel {
|
||||
|
||||
private fun initListeners() {
|
||||
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mMogoAutopilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, mMogoAutopilotStatusListener)
|
||||
//定位监听, 传false是高德坐标系 10 -> 100ms一次
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 5, mMapLocationListener)
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
@@ -243,7 +246,7 @@ object TaxiTaskModel {
|
||||
// 注销地图监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
OCHSocketMessageManager.releaseSocketMessageListener(OCHSocketMessageManager.msgMonitorType)
|
||||
CallerAutoPilotStatusListenerManager.removeListener(mMogoAutopilotStatusListener)
|
||||
OchAutoPilotStatusListenerManager.removeListener(mMogoAutopilotStatusListener)
|
||||
CallerPlanningRottingListenerManager.removeListener(mMogoAutopilotPlanningListener)
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null)
|
||||
AbnormalFactorsLoopManager.stopLoopAbnormalFactors()
|
||||
@@ -269,8 +272,8 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
private val mMogoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
private val mMogoAutopilotStatusListener: IOchAutopilotStatusListener =
|
||||
object : IOchAutopilotStatusListener {
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) {
|
||||
DebugView.printInfoMsg(
|
||||
"[域控连接状态变化] status=$status, reason=${
|
||||
@@ -282,8 +285,8 @@ object TaxiTaskModel {
|
||||
)
|
||||
}
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?) {
|
||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo)
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?, lineId: Long) {
|
||||
TaxiTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo,lineId)
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
@@ -343,7 +346,7 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {
|
||||
i(TAG, "onAutopilotArriveAtStation = ${arrivalNotification.toString()}")
|
||||
DebugView.printInfoMsg("[MAP到站通知] 上报到站,location=${arrivalNotification?.endLocation}")
|
||||
if (arrivalNotification == null || !checkCurrentTaskCondition() ||
|
||||
@@ -1256,7 +1259,7 @@ object TaxiTaskModel {
|
||||
return
|
||||
}
|
||||
|
||||
CallerAutoPilotControlManager.startAutoPilot(parameters)
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
DebugView.printInfoMsg("[启自驾] 调用成功")
|
||||
d(
|
||||
TAG, "start autopilot with parameter: %s",
|
||||
|
||||
@@ -85,6 +85,10 @@ public class TaxiTrajectoryManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void onAutopilotGuardian(@Nullable MogoReportMsg.MogoReportMessage guardianInfo,long lineId) {
|
||||
onAutopilotGuardian(guardianInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口MEC反馈的常规信息(MAP v2.5.0新增轨迹相关信息)
|
||||
* @param guardianInfo
|
||||
@@ -95,31 +99,26 @@ public class TaxiTrajectoryManager {
|
||||
// 1. 轨迹管理_轨迹开始下载(本地已有对应轨迹也触发)
|
||||
CallerLogger.d(M_TAXI + TAG, "onAutopilotGuardian() 轨迹开始下载");
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹开始下载", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY);
|
||||
// ToastUtils.showShort("轨迹开始下载");
|
||||
stopTrajReqLoop();
|
||||
} else if ("ISYS_INIT_TRAJECTORY_SUCCESS".equals(guardianInfo.getCode())) {
|
||||
// 2. 轨迹管理_轨迹下载成功(本地已有对应轨迹也触发)
|
||||
CallerLogger.d(M_TAXI + TAG, "onAutopilotGuardian() 轨迹下载成功");
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载成功", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY);
|
||||
// ToastUtils.showShort("轨迹下载成功");
|
||||
stopTrajReqLoop();
|
||||
} else if ("ISYS_INIT_TRAJECTORY_FAILURE".equals(guardianInfo.getCode())) {
|
||||
// 3. 轨迹管理_轨迹下载失败,本地无对应轨迹
|
||||
CallerLogger.d(M_TAXI + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地无对应轨迹");
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地无对应轨迹", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY);
|
||||
// ToastUtils.showShort("轨迹下载失败,本地无对应轨迹");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_WARNING".equals(guardianInfo.getCode())) {
|
||||
// 4. 轨迹管理_轨迹下载失败,本地有对应轨迹,认为成功
|
||||
CallerLogger.d(M_TAXI + TAG, "onAutopilotGuardian() " +
|
||||
"轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载失败,本地有对应轨迹,认为成功", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY);
|
||||
// ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功");
|
||||
} else if ("ISYS_INIT_TRAJECTORY_TIMEOUT".equals(guardianInfo.getCode())) {
|
||||
// 5. 轨迹管理_轨迹下载超时
|
||||
CallerLogger.d(M_TAXI + TAG, "onAutopilotGuardian() 轨迹下载超时");
|
||||
OchChainLogManager.writeChainLog("轨迹监控","onAutopilotGuardian() 轨迹下载超时", true, OchChainLogManager.EVENT_KEY_INFE_WITH_TRAJECTORY);
|
||||
// ToastUtils.showShort("轨迹下载超时");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.taxi.passenger.bean.TaxiPassengerBaseRespBean
|
||||
@@ -20,14 +23,14 @@ import com.mogo.och.taxi.passenger.ui.model.order.TaxiPassengerOrderStatusEnum
|
||||
import com.mogo.och.taxi.passenger.network.TaxiPassengerServiceManager
|
||||
import com.mogo.och.taxi.passenger.utils.TaxiPassengerAnalyticsManager
|
||||
|
||||
object AutopilotManager : IMoGoAutopilotStatusListener {
|
||||
object AutopilotManager : IOchAutopilotStatusListener {
|
||||
|
||||
private const val TAG = "AutopilotManager"
|
||||
|
||||
private var needSpeakByStartAutopilot = false
|
||||
|
||||
init {
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
//检测当前订单
|
||||
@@ -76,7 +79,7 @@ object AutopilotManager : IMoGoAutopilotStatusListener {
|
||||
)
|
||||
return "自动化驾驶参数异常"
|
||||
}
|
||||
CallerAutoPilotControlManager.startAutoPilot(parameters)
|
||||
OchAutoPilotManager.startAutoPilot(parameters);
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_TAXI_P + TAG,
|
||||
"start autopilot with parameter: %s",
|
||||
@@ -199,7 +202,6 @@ object AutopilotManager : IMoGoAutopilotStatusListener {
|
||||
*/
|
||||
private fun startAutoPilotServiceByPassenger() {
|
||||
if (TaxiPassengerModel.currentOCHOrder == null) return
|
||||
//val currentLocation = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
OchChainLogManager.writeChainLog(TaxiPassengerModel.currentOCHOrder.toString(),"action:启动自驾状态流转")
|
||||
TaxiPassengerServiceManager.startAutoPilotServiceByPassenger(
|
||||
TaxiPassengerModel.currentOCHOrder!!.orderNo,
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.utilcode.util.ActivityUtils
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.debug.DebugViewWatchDogFragment
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.ui.debug.DebugEvent
|
||||
@@ -27,7 +29,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IOchAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusBarView"
|
||||
@@ -69,7 +71,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
layoutParams = params
|
||||
}
|
||||
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
|
||||
iv_biz_icon.setOnClickListener { continuousClick() }
|
||||
vShowDebugView.setOnLongClickListener {
|
||||
|
||||
@@ -11,7 +11,7 @@ sonarqube {
|
||||
property "sonar.android.lint.report", false
|
||||
property "sonar.scm.exclusions.disabled", false
|
||||
property "sonar.scm.exclusions.file", "**/.gitignore"
|
||||
property "sonar.exclusions", "**/AndroidManifest.xml, **/src/test/**, com/mogo/eagle/core/utilcode, **/*.jar, **/*.aar, **/*.war, **/*.ear, **/*.rar, **/*.tgz, **/*.zip, **/src/test/java/**/*.java, **/src/test/java/**/*.kt, **/test/**/*, **/*Test.java, **/*Tests.java, **/*Test.kt, **/*.xml,*.xml, **/target/**, **/src/main/java/proto/**, **/build/**, build, build/**, **/db/dao/*.java, **/build/intermediates/**/*"
|
||||
property "sonar.exclusions", "**/AndroidManifest.xml, **/src/test/**, com/mogo/eagle/core/utilcode, **/*.jar, **/*.aar, **/*.war, **/*.ear, **/*.rar, **/*.tgz, **/*.zip, **/src/test/java/**/*.java, **/src/test/java/**/*.kt, **/test/**/*, **/*Test.java, **/*Tests.java, **/*Test.kt, **/*.xml,*.xml, **/raw/*.nt3d, ,**/target/**, **/src/main/java/proto/**, **/build/**, build, build/**, **/db/dao/*.java, **/build/intermediates/**/*"
|
||||
// property "sonar.java.coveragePlugin", "jacoco"
|
||||
// property("sonar.coverage.jacoco.xmlReportPaths", "../../build/reports/jacocoTestReport.xml,../build/reports/jacocoTestReport.xml")
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ import com.tencent.matrix.trace.config.TraceConfig
|
||||
import com.zhjt.mogo_core_function_devatools.apm.*
|
||||
import com.mogo.eagle.core.function.api.upgrade.*
|
||||
import com.mogo.weak.network.SdtManager
|
||||
import com.zhjt.mogo.adas.data.bean.ReceivedAck.Status
|
||||
import com.zhjt.mogo_core_function_devatools.adas.PowerOffManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
@@ -61,6 +60,7 @@ import com.zhjt.mogo_core_function_devatools.perf.MoGoCpuUsageProviderImpl
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager.Companion.iPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.IAutopilotPreLaunchStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteDownloadStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.ui.AutoPilotLaunchBeforeView
|
||||
import com.zhjt.mogo_core_function_devatools.strict.*
|
||||
@@ -72,7 +72,6 @@ import com.zhjt.mogo_core_function_devatools.weaknetwork.WeakNetworkStrategy
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_DEVA_TOOLS)
|
||||
class DevaToolsProvider : IDevaToolsProvider {
|
||||
@@ -103,14 +102,28 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
private var container: WeakReference<ViewGroup>? = null
|
||||
|
||||
private val downloadCallbacks by lazy { ConcurrentHashMap<String, ArrayList<(Int) -> Unit>>() }
|
||||
private val startAutopilotCallbacks by lazy { ConcurrentHashMap<String, ArrayList<(Boolean) -> Unit>>() }
|
||||
|
||||
private val statusListener by lazy {
|
||||
object : StatusManager.IStatusListener {
|
||||
override fun onStatusChanged(data: List<com.zhjt.mogo_core_function_devatools.status.entity.Status>, hasException: Boolean) {
|
||||
data.filterIsInstance(RouteDownloadStatus::class.java).forEach { s ->
|
||||
downloadCallbacks.values.flatten().forEach { listener ->
|
||||
listener.invoke(s.state.ordinal)
|
||||
var hasExceptionForAutopilotBefore = false
|
||||
data.forEach { s ->
|
||||
if (s is RouteDownloadStatus) {
|
||||
runCatching {
|
||||
downloadCallbacks.values.flatten().forEach { listener ->
|
||||
listener.invoke(s.state.ordinal)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (s is IAutopilotPreLaunchStatus && s.isException()) {
|
||||
hasExceptionForAutopilotBefore = true
|
||||
runCatching { startAutopilotCallbacks.values.flatten().forEach { it.invoke(false) } }
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
if (!hasExceptionForAutopilotBefore) {
|
||||
runCatching { startAutopilotCallbacks.values.flatten().forEach { it.invoke(true) } }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -530,4 +543,12 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
override fun unRegisterRouteDownloadListener(tag: String) {
|
||||
downloadCallbacks.remove(tag)
|
||||
}
|
||||
|
||||
override fun registerStartAutopilotStateListener(tag: String, block: (isCanStartAutopilot: Boolean) -> Unit) {
|
||||
startAutopilotCallbacks.getOrPut(tag) { ArrayList() } += block
|
||||
}
|
||||
|
||||
override fun unRegisterStartAutopilotStateListener(tag: String) {
|
||||
startAutopilotCallbacks.remove(tag)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.zhjt.mogo_core_function_devatools.status.entity
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteFailed
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteNone
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteStart
|
||||
@@ -311,7 +313,7 @@ data class SteerStatus(val angle: Float, var isError: Boolean = false): Status()
|
||||
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
return isError && CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
@@ -339,7 +341,7 @@ data class SteerStatus(val angle: Float, var isError: Boolean = false): Status()
|
||||
data class AcceleratorStatus(val angle: Float, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
return isError && CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
@@ -369,7 +371,7 @@ data class AcceleratorStatus(val angle: Float, var isError: Boolean = false): St
|
||||
data class BrakeStatus(val angle: Float, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
return isError && CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
@@ -398,7 +400,7 @@ data class BrakeStatus(val angle: Float, var isError: Boolean = false): Status()
|
||||
data class DoubleFlashStatus(val type: Int, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
return isError && CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
@@ -426,7 +428,7 @@ data class DoubleFlashStatus(val type: Int, var isError: Boolean = false): Statu
|
||||
data class GearStatus(val value: Int, var isError: Boolean = false): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return isError
|
||||
return isError && CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
@@ -462,7 +464,7 @@ enum class RouteState {
|
||||
data class RouteDownloadStatus(val lineId: Long = -1, val state: RouteState = RouteNone): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return state == RouteStart || state == RouteFailed
|
||||
return (state == RouteStart || state == RouteFailed) && CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
@@ -283,7 +283,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
val car = if (isGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val rotateAngle = MapAutoApi.getAngle(car.longitude, car.latitude, target.target.poi_lon, target.target.poi_lat)
|
||||
Log.d(TAG, "angle->:$rotateAngle")
|
||||
it.animateTo(0.0 ,0.0,1f, -rotateAngle,11.5f,28f,3000,target.target.isGps)
|
||||
it.animateTo(0.0 ,0.0,1f, -rotateAngle,11.5f,12f,3000,target.target.isGps)
|
||||
}
|
||||
} else {
|
||||
if (target.target is Default && previous != null && (previous.target is RoadEvent)) {
|
||||
|
||||
@@ -307,4 +307,8 @@ interface IDevaToolsProvider : IProvider {
|
||||
fun registerRouteDownloadListener(tag: String, block:(state: Int) -> Unit)
|
||||
|
||||
fun unRegisterRouteDownloadListener(tag: String)
|
||||
|
||||
fun registerStartAutopilotStateListener(tag: String, block: (isCanStartAutopilot: Boolean) -> Unit)
|
||||
|
||||
fun unRegisterStartAutopilotStateListener(tag: String)
|
||||
}
|
||||
@@ -70,6 +70,21 @@ object CallerAutoPilotControlManager {
|
||||
* @param controlParameters 开启自动驾驶的控制参数
|
||||
*/
|
||||
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
|
||||
if (controlParameters == null) {
|
||||
//LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息")
|
||||
return
|
||||
}
|
||||
providerApi?.startAutoPilot(controlParameters)
|
||||
// 更新记录在全局的控制参数
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters)
|
||||
}
|
||||
|
||||
/**
|
||||
* 启自驾前,是否要拦截
|
||||
* @param isShowTip true: 展示Toast+语音提示; false:不展示Toast+语音提示
|
||||
*
|
||||
*/
|
||||
fun isCanStartAutopilot(isShowTip: Boolean): Boolean {
|
||||
/**
|
||||
* 方向盘: 1<<0
|
||||
* 油门 : 1<<1
|
||||
@@ -80,49 +95,52 @@ object CallerAutoPilotControlManager {
|
||||
*/
|
||||
val exceptionValue = CallerDevaToolsManager.getExceptionStatusBeforeLaunchAutopilot()
|
||||
if (exceptionValue != 0) {
|
||||
val sb = StringBuilder("请检查车辆")
|
||||
if ((exceptionValue and 1) != 0) {
|
||||
sb.append("方向盘$")
|
||||
}
|
||||
if (((exceptionValue and (1 shl 1)) != 0)) {
|
||||
sb.append("油门$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 2)) != 0) {
|
||||
sb.append("刹车$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 3)) != 0) {
|
||||
sb.append("双闪$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 4)) != 0) {
|
||||
sb.append("档位$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 5)) != 0 || ((exceptionValue and (1 shl 6)) != 0)) {
|
||||
sb.setLength(0)
|
||||
sb.append("轨迹未就绪,请稍后重试")
|
||||
}
|
||||
val voiceText = sb.toString().let { str ->
|
||||
val count = str.count { it == '$' }
|
||||
if (count == 1) {
|
||||
str.replace("$", "")
|
||||
} else {
|
||||
str.removeSuffix("$").replace("$", "、")
|
||||
if (isShowTip) {
|
||||
val sb = StringBuilder("请检查车辆")
|
||||
if ((exceptionValue and 1) != 0) {
|
||||
sb.append("方向盘$")
|
||||
}
|
||||
if (((exceptionValue and (1 shl 1)) != 0)) {
|
||||
sb.append("油门$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 2)) != 0) {
|
||||
sb.append("刹车$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 3)) != 0) {
|
||||
sb.append("双闪$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 4)) != 0) {
|
||||
sb.append("档位$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 5)) != 0 || ((exceptionValue and (1 shl 6)) != 0)) {
|
||||
sb.setLength(0)
|
||||
sb.append("轨迹未就绪,请稍后重试")
|
||||
}
|
||||
val voiceText = sb.toString().let { str ->
|
||||
val count = str.count { it == '$' }
|
||||
if (count == 1) {
|
||||
str.replace("$", "")
|
||||
} else {
|
||||
str.removeSuffix("$").replace("$", "、")
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "voiceText: $voiceText")
|
||||
ToastUtils.showShort(voiceText)
|
||||
AppStateManager.currentActivity()?.also {
|
||||
AIAssist.getInstance(it).speakTTSVoice(voiceText)
|
||||
}
|
||||
}
|
||||
Logger.d(TAG, "voiceText: $voiceText")
|
||||
ToastUtils.showShort(voiceText)
|
||||
AppStateManager.currentActivity()?.also {
|
||||
AIAssist.getInstance(it).speakTTSVoice(voiceText)
|
||||
}
|
||||
return
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if (controlParameters == null) {
|
||||
//LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息")
|
||||
return
|
||||
}
|
||||
providerApi?.startAutoPilot(controlParameters)
|
||||
// 更新记录在全局的控制参数
|
||||
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters)
|
||||
fun addStartAutopilotStateListener(tag: String, listener: (Boolean) -> Unit) {
|
||||
CallerDevaToolsManager.registerStartAutopilotStateListener(tag, listener)
|
||||
}
|
||||
|
||||
fun removeStartAutopilotStateListener(tag: String) {
|
||||
CallerDevaToolsManager.unRegisterStartAutopilotStateListener(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -382,4 +382,12 @@ object CallerDevaToolsManager {
|
||||
fun getExceptionStatusBeforeLaunchAutopilot(): Int {
|
||||
return devaToolsProviderApi?.getExceptionStatusBeforeLaunchAutopilot() ?: 0
|
||||
}
|
||||
|
||||
fun registerStartAutopilotStateListener(tag: String, block: (isCanStartAutopilot: Boolean) -> Unit) {
|
||||
devaToolsProviderApi?.registerStartAutopilotStateListener(tag, block)
|
||||
}
|
||||
|
||||
fun unRegisterStartAutopilotStateListener(tag: String) {
|
||||
devaToolsProviderApi?.unRegisterStartAutopilotStateListener(tag)
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import android.util.Log
|
||||
import com.apm.insight.log.VLog
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
|
||||
class VLogUtils {
|
||||
|
||||
@@ -22,7 +23,7 @@ class VLogUtils {
|
||||
handler.post {
|
||||
runCatching {
|
||||
handleMsg("time:$time, msg:$msg", max).forEach {
|
||||
VLog.d(tag, it)
|
||||
Logger.d(tag, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +35,7 @@ class VLogUtils {
|
||||
handler.post {
|
||||
runCatching {
|
||||
handleMsg("time:$time, msg:$msg", max).forEach {
|
||||
VLog.v(tag, it)
|
||||
Logger.v(tag, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +47,7 @@ class VLogUtils {
|
||||
handler.post {
|
||||
runCatching {
|
||||
handleMsg("time:$time, msg:$msg", max).forEach {
|
||||
VLog.w(tag, it)
|
||||
Logger.w(tag, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +59,7 @@ class VLogUtils {
|
||||
handler.post {
|
||||
runCatching {
|
||||
handleMsg("time:$time, msg:$msg", max).forEach {
|
||||
VLog.e(tag, it)
|
||||
Logger.e(tag, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,19 +4,19 @@ if (!isAndroidTest) {
|
||||
apply plugin: 'bytex'
|
||||
|
||||
ByteX {
|
||||
enable false
|
||||
enable true
|
||||
enableInDebug true
|
||||
}
|
||||
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_config.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_router.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_log_chain.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_sticky_service.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_thread_opt.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_lancetx.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_apm.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_systrace.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_matrix.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_handler_proxy.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_config.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_router.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_log_chain.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_sticky_service.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_thread_opt.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_lancetx.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_apm.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_systrace.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_matrix.gradle')
|
||||
apply from: rootProject.file('gradle/bytex/bytex_handler_proxy.gradle')
|
||||
// apply from: rootProject.file('gradle/bytex/bytex_btrace.gradle')
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apply plugin: 'bytex.handler_proxy'
|
||||
handler_proxy {
|
||||
enable rootProject.isJunkDetectEnable()
|
||||
enable false
|
||||
enableInDebug rootProject.isJunkDetectEnable()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apply plugin: 'LancetX'
|
||||
LancetX {
|
||||
enable false
|
||||
enable true
|
||||
enableInDebug true
|
||||
blackList = [
|
||||
"com.mogo.launcher.lancet.jank",
|
||||
|
||||
@@ -2,7 +2,7 @@ if (!rootProject.isReleaseBuild()) {
|
||||
apply plugin: 'bytex.matrix'
|
||||
matrix {
|
||||
trace {
|
||||
enable = false //if you don't want to use trace canary, set false
|
||||
enable = true //if you don't want to use trace canary, set false
|
||||
baseMethodMapFile = "${project.buildDir}/matrix_output/customMethodMapping.txt"
|
||||
blackListFile = "${project.projectDir}/matrixTrace/blackMethodList.txt"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apply plugin: 'bytex.threadOpt'
|
||||
thread_opt {
|
||||
enable false
|
||||
enable true
|
||||
enableInDebug true
|
||||
logLevel "DEBUG"
|
||||
trace_enable !rootProject.isReleaseBuild()
|
||||
|
||||
Reference in New Issue
Block a user