[切换线路过滤条件]
This commit is contained in:
yangyakun
2023-03-13 00:23:42 +08:00
parent 5389d91f15
commit ee5ff1ce67
2 changed files with 58 additions and 5 deletions

View File

@@ -8,7 +8,9 @@ import android.view.View
import android.view.animation.LinearInterpolator
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.kotlin.onClick
@@ -32,6 +34,7 @@ import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
import kotlinx.android.synthetic.m1.m1_order_lineside.view.*
import me.jessyan.autosize.utils.AutoSizeUtils
@@ -325,11 +328,49 @@ class LineSiteView @JvmOverloads constructor(
if (gnssSpeed < 0.5) {
// TODO: 自驾中 需要 靠边停车中、到站
// TODO: 没有自驾中 需要 靠边停车中、到站
isChangeIngLineAndSite = false
onlyChangeSite(false)
// 可以切换路径
setEnableLineStatus(true)
queryLineList()
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
// 可以切换路径
isChangeIngLineAndSite = false
onlyChangeSite(false)
// 可以切换路径
setEnableLineStatus(true)
queryLineList()
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
isChangeIngLineAndSite = false
onlyChangeSite(false)
// 可以切换路径
setEnableLineStatus(true)
queryLineList()
}
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
// 自动驾驶中
when (OCHPlanningStopSideStatusManager.stopSiteStatus) {
OCHPlanningStopSideStatusManager.StopSite.NOTHING -> {
isChangeIngLineAndSite = false
onlyChangeSite(false)
// 可以切换路径
setEnableLineStatus(true)
queryLineList()
}
OCHPlanningStopSideStatusManager.StopSite.STOPSITED -> {
isChangeIngLineAndSite = false
onlyChangeSite(false)
// 可以切换路径
setEnableLineStatus(true)
queryLineList()
}
OCHPlanningStopSideStatusManager.StopSite.LANKE_KEEP ->{
ToastUtils.showShort("自动驾驶中无法切换线路")
}
}
}
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
ToastUtils.showShort("因车辆正在平行驾驶中无法切换线路")
}
else -> {}
}
} else {
ToastUtils.showShort("请停车后再修改目的地~")
}

View File

@@ -15,6 +15,8 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
CallerPlanningActionsListenerManager.setListenerHz(TAG,5)
}
var stopSiteStatus = StopSite.NOTHING
val M_LISTENERS: ConcurrentHashMap<String, OCHPlanningActionsCallback> = ConcurrentHashMap()
fun addListener(
@@ -69,6 +71,7 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
MessagePad.DrivingAction.DRIVING_ACTION_STATE_TWO -> {
//表示靠边停车成功
CallerLogger.d(SceneConstant.M_BUS+ TAG,"靠边停车成功")
stopSiteStatus = StopSite.STOPSITED
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
@@ -127,6 +130,9 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
}
}
}
MessagePad.ParkScenarioDrivingState.PARK_SENARIO_LANKE_KEEP ->{
stopSiteStatus = StopSite.LANKE_KEEP
}
else -> {}
}
}
@@ -138,6 +144,12 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
Ending(2)
}
enum class StopSite{
NOTHING,// 初始状态
STOPSITED,// 靠边停车状态
LANKE_KEEP;// 形式状态
}
interface OCHPlanningActionsCallback {
fun onStartAutopilotFailure(actionStatus:Status,stopSideStatus : Boolean?, errorInfo : String?)
}