[6.4.0]
[启动自驾拦截]
This commit is contained in:
@@ -632,6 +632,10 @@ public class OrderModel {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerLogger.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
|
||||
FunctionBuildConfig.isPassStartAutopilotCommand);
|
||||
|
||||
|
||||
@@ -486,6 +486,9 @@ class DriverM1Model {
|
||||
triggerUnableStartAPReasonEvent()
|
||||
return
|
||||
}
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
|
||||
return
|
||||
}
|
||||
triggerStartServiceEvent(false, false)
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
|
||||
@@ -1129,6 +1129,9 @@ object CharterPassengerModel {
|
||||
ToastCharterUtils.showToastLong("已到达目的地请重新选择线路")
|
||||
return
|
||||
}
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
|
||||
return
|
||||
}
|
||||
val parameters = initAutopilotControlParameters()
|
||||
if (null == parameters) {
|
||||
ToastCharterUtils.showToastShort("请选择站点")
|
||||
|
||||
@@ -625,6 +625,10 @@ public class OrderModel {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
firstStartAutopilot++;
|
||||
|
||||
triggerStartServiceEvent(isRestart, false);
|
||||
|
||||
@@ -936,6 +936,10 @@ public class TaxiModel {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState()
|
||||
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
ToastUtils.showShort("自驾中、请勿重复启动");
|
||||
|
||||
@@ -8,8 +8,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
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.function.call.devatools.CallerDevaToolsManager
|
||||
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.AppStateManager
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.network.OchCommonServiceCallback
|
||||
@@ -25,6 +27,7 @@ import com.mogo.och.taxi.passenger.bean.TaxiPassengerStartReqBean
|
||||
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
|
||||
import java.lang.StringBuilder
|
||||
|
||||
object AutopilotManager : IOchAutopilotStatusListener {
|
||||
|
||||
@@ -51,6 +54,44 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
if (TaxiPassengerModel.currentOCHOrder!!.orderStatus == TaxiPassengerOrderStatusEnum.UserArriveAtStart.code) {
|
||||
startServicePilotDone()
|
||||
}
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(false)) {
|
||||
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("$", "、")
|
||||
}
|
||||
}
|
||||
ToastUtils.showShort(voiceText)
|
||||
AppStateManager.currentActivity()?.also {
|
||||
AIAssist.getInstance(it).speakTTSVoice(voiceText)
|
||||
}
|
||||
return sb.toString()
|
||||
}
|
||||
}
|
||||
if(CallerAutoPilotStatusListenerManager.getState()
|
||||
== IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
ToastUtils.showShort("自驾中、请勿重复启动");
|
||||
|
||||
@@ -475,6 +475,9 @@ object TaxiRoutingModel {
|
||||
)
|
||||
return
|
||||
}
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
|
||||
return
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
DebugView.printErrorMsg("[启自驾] ${OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason}")
|
||||
ToastUtils.showLong(
|
||||
|
||||
@@ -1235,6 +1235,9 @@ object TaxiTaskModel {
|
||||
TAG, "isPassStartAutopilotCommand = " +
|
||||
FunctionBuildConfig.isPassStartAutopilotCommand
|
||||
)
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(true)) {
|
||||
return
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
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.devatools.CallerDevaToolsManager
|
||||
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.ToastUtils
|
||||
@@ -22,6 +23,7 @@ import com.mogo.och.taxi.passenger.constant.TaxiPassengerConst
|
||||
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
|
||||
import java.lang.StringBuilder
|
||||
|
||||
object AutopilotManager : IOchAutopilotStatusListener {
|
||||
|
||||
@@ -58,6 +60,41 @@ object AutopilotManager : IOchAutopilotStatusListener {
|
||||
// ToastUtils.showShort("自驾中、请勿重复启动")
|
||||
// return
|
||||
// }
|
||||
if (!CallerAutoPilotControlManager.isCanStartAutopilot(false)) {
|
||||
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("$", "、")
|
||||
}
|
||||
}
|
||||
ToastUtils.showShort(voiceText)
|
||||
return sb.toString()
|
||||
}
|
||||
}
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().autopilotAbilityStatus) {
|
||||
ToastUtils.showLong(
|
||||
OCHAdasAbilityManager.getInstance().autopilotUnAbilityReason +
|
||||
|
||||
Reference in New Issue
Block a user