[6.0.0] 1、恢复取消自驾逻辑 2、增加运营模式(实际还是美化)
This commit is contained in:
@@ -161,6 +161,16 @@ data class QueryCurrentTaskRespBean(var data: Result?) : BaseData() {
|
||||
}
|
||||
return data.currentStatus == TaskStatusEnum.StartTask.code
|
||||
}
|
||||
|
||||
/**
|
||||
* with task.currentStatus == StartTask
|
||||
*/
|
||||
fun isCompleteTaskType(data: QueryCurrentTaskRespBean.Result?): Boolean {
|
||||
if (data == null) {
|
||||
return false
|
||||
}
|
||||
return data.currentStatus == TaskStatusEnum.CompleteTask.code
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +229,8 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
override fun onOrderCancel() {
|
||||
VoiceNotice.showNotice("已取消行程")
|
||||
// updateTaskAndOrderUi(null)
|
||||
//取消自驾,D档位会溜车 map3.6.0 修改
|
||||
TaxiTaskModel.cancelAutopilot()
|
||||
}
|
||||
|
||||
override fun onOrderArriveAtEnd(orderNo: String) {
|
||||
|
||||
@@ -283,12 +283,9 @@ object TaxiTaskModel {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_ENABLE,meaning=可自动驾驶,人工干预状态")
|
||||
if ((FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentTaskCondition()
|
||||
&& (QueryCurrentTaskRespBean.isOrderOnTheWayToEnd(
|
||||
mCurrentTaskWithOrder
|
||||
)
|
||||
|| QueryCurrentTaskRespBean.isOrderArriveAtEnd(
|
||||
mCurrentTaskWithOrder
|
||||
)))
|
||||
&& (QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
|| QueryCurrentTaskRespBean.isOrderArriveAtEnd(mCurrentTaskWithOrder))
|
||||
)
|
||||
) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
return
|
||||
@@ -298,12 +295,9 @@ object TaxiTaskModel {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_DISABLE,meaning=不可自动驾驶")
|
||||
if ((FunctionBuildConfig.isDemoMode
|
||||
&& checkCurrentTaskCondition()
|
||||
&& (QueryCurrentTaskRespBean.isOrderOnTheWayToEnd(
|
||||
mCurrentTaskWithOrder
|
||||
)
|
||||
|| QueryCurrentTaskRespBean.isOrderArriveAtEnd(
|
||||
mCurrentTaskWithOrder
|
||||
)))
|
||||
&& (QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
|| QueryCurrentTaskRespBean.isOrderArriveAtEnd(mCurrentTaskWithOrder))
|
||||
)
|
||||
) {
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
return
|
||||
@@ -315,12 +309,9 @@ object TaxiTaskModel {
|
||||
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_PARALLEL_DRIVING,meaning=平行驾驶中")
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
if ((checkCurrentTaskCondition()
|
||||
&& (QueryCurrentTaskRespBean.isOrderOnTheWayToEnd(
|
||||
mCurrentTaskWithOrder
|
||||
)
|
||||
|| QueryCurrentTaskRespBean.isOrderArriveAtEnd(
|
||||
mCurrentTaskWithOrder
|
||||
)))
|
||||
&& (QueryCurrentTaskRespBean.isStartTaskType(mCurrentTaskWithOrder)
|
||||
|| QueryCurrentTaskRespBean.isOrderArriveAtEnd(mCurrentTaskWithOrder))
|
||||
)
|
||||
) { //订单中
|
||||
// 当美化模式(演示模式)开启时:且有订单、且为去往目的地状态,维持自动驾驶icon开启状态
|
||||
} else { //美化模式下没订单,显示人工驾驶
|
||||
@@ -599,8 +590,8 @@ object TaxiTaskModel {
|
||||
|
||||
if (isArriveAtEndSite) {
|
||||
updateLocalCalculateStation()
|
||||
//到站后不再调用取消自驾. 原因是取消自驾,D档位会溜车
|
||||
//cancelAutopilot()
|
||||
//取消自驾,D档位会溜车 map3.6.0 修改
|
||||
cancelAutopilot()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -801,6 +792,8 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateDemoModeAndAutopilotParameters(result)
|
||||
}
|
||||
|
||||
override fun onFail(code: Int, msg: String?) {
|
||||
@@ -1375,32 +1368,26 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
//更新本地currentOrder信息,并保存订单到本地避免车机重启丢失数据
|
||||
private fun updateNativeCurrentOrder(data: QueryCurrentTaskRespBean.Result?) {
|
||||
//运营模式(美化模式), 鹰眼数据同步
|
||||
private fun updateDemoModeAndAutopilotParameters(data: QueryCurrentTaskRespBean.Result?) {
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
mCurrentTaskWithOrder = data
|
||||
|
||||
SharedPrefsMgr.getInstance(mContext!!).putString(
|
||||
TaxiUnmannedConst.SP_KEY_OCH_TAXI_ORDER,
|
||||
GsonUtil.jsonFromObject(data)
|
||||
)
|
||||
val endSite = data.endSite
|
||||
|
||||
val currentOrder = mCurrentTaskWithOrder!!.order
|
||||
|
||||
if (currentOrder != null) {
|
||||
if (currentOrder!!.orderStatus == TaxiOrderStatusEnum.OnTheWayToEnd.code) {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
// 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true
|
||||
CallerAutoPilotControlManager.setIgnoreConditionDraw(true)
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(true)
|
||||
d(TAG, "美化模式-ignore:置为true(更新本地order信息)")
|
||||
}
|
||||
if (endSite != null) {
|
||||
if (QueryCurrentTaskRespBean.isStartTaskType(data)) {
|
||||
// if (FunctionBuildConfig.isDemoMode) {
|
||||
// // 当美化模式(演示模式)开启时: 订单对应自动驾驶开启后,置true
|
||||
// FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = true
|
||||
// CallerAutoPilotControlManager.setIgnoreConditionDraw(true)
|
||||
// CallerAutoPilotControlManager.setIPCDemoMode(true)
|
||||
// d(TAG, "美化模式-ignore:置为true(更新本地order信息)")
|
||||
// }
|
||||
updateAutopilotControlParameters()
|
||||
}
|
||||
if (currentOrder!!.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.code) {
|
||||
if (QueryCurrentTaskRespBean.isCompleteTaskType(data)) {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
d(TAG, "setIPCDemoMode:false")
|
||||
CallerAutoPilotControlManager.setIPCDemoMode(false)
|
||||
|
||||
Reference in New Issue
Block a user