[Taxi无人化] fix: V620 选择的演练任务拉取时间间隔 没保存状态问题 ;refactor: 增加演练任务拉取时间间隔 增加变化后日志打印;
This commit is contained in:
@@ -304,7 +304,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
}
|
||||
}else{ //演练任务拉取 6.2.0使用配置的时间拉取, 默认45s
|
||||
TaxiTaskModel.startPrepareTaskDelay(
|
||||
CallerUnmannedListenerManager.getPullTime().toLong(), result?.endSite!!.siteId)
|
||||
CallerUnmannedListenerManager.getVirtualTaskPullTaskInterval() * 1000L, result?.endSite!!.siteId)
|
||||
}
|
||||
|
||||
clearDemoModeAndACParameters()
|
||||
@@ -336,7 +336,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
//获取新的任务
|
||||
val currentTaskWithOrder = TaxiTaskModel.getCurrentTaskWithOrder()
|
||||
currentTaskWithOrder?.endSite?.also {//使用配置的时间拉取, 默认是45s
|
||||
TaxiTaskModel.startPrepareTaskDelay(CallerUnmannedListenerManager.getPullTime().toLong(),
|
||||
TaxiTaskModel.startPrepareTaskDelay(CallerUnmannedListenerManager.getVirtualTaskPullTaskInterval() * 1000L,
|
||||
it.siteId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,14 @@ 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.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.unmanned.IUnmannedListener
|
||||
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.CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.unmanned.CallerUnmannedListenerManager
|
||||
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
|
||||
@@ -211,6 +213,7 @@ object TaxiTaskModel {
|
||||
AbnormalFactorsLoopManager.startLoopAbnormalFactors(mContext)
|
||||
TrajectoryAndDistanceManager.addDistanceListener(TAG, localCalculateDistanceListener)
|
||||
TrajectoryAndDistanceManager.addTrajectoryListener(TAG, localCalculateTrajectoryListener)
|
||||
CallerUnmannedListenerManager.addListener(TAG, mMogoUnmanedVirtualTaskPullTaskIntervalListener)
|
||||
}
|
||||
|
||||
private fun releaseListeners() {
|
||||
@@ -227,6 +230,7 @@ object TaxiTaskModel {
|
||||
CallerPlanningRottingListenerManager.removeListener(mMogoAutopilotPlanningListener)
|
||||
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(null)
|
||||
AbnormalFactorsLoopManager.stopLoopAbnormalFactors()
|
||||
CallerUnmannedListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,6 +245,13 @@ object TaxiTaskModel {
|
||||
}
|
||||
}
|
||||
|
||||
private val mMogoUnmanedVirtualTaskPullTaskIntervalListener: IUnmannedListener =
|
||||
object : IUnmannedListener {
|
||||
override fun onVirtualTaskPullTaskIntervalUpdate(time: Int) {
|
||||
DebugView.printInfoMsg("[演练任务拉取时间间隔变化] afterValue=${time}秒")
|
||||
}
|
||||
}
|
||||
|
||||
private val mMogoAutopilotStatusListener: IMoGoAutopilotStatusListener =
|
||||
object : IMoGoAutopilotStatusListener {
|
||||
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
|
||||
|
||||
@@ -490,22 +490,6 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode)
|
||||
CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode)
|
||||
}
|
||||
rgPullTime.setOnCheckedChangeListener { _, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rbFortyFive -> {
|
||||
CallerUnmannedListenerManager.dispatchPullTime(45)
|
||||
}
|
||||
R.id.rbThirty -> {
|
||||
CallerUnmannedListenerManager.dispatchPullTime(30)
|
||||
}
|
||||
R.id.rbFifteen -> {
|
||||
CallerUnmannedListenerManager.dispatchPullTime(15)
|
||||
}
|
||||
R.id.rbFive -> {
|
||||
CallerUnmannedListenerManager.dispatchPullTime(5)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var overTakeEditText: String = ""
|
||||
@@ -652,6 +636,28 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
btnSpeedOverTakeSet.visibility = View.GONE
|
||||
}
|
||||
|
||||
val virtualTaskPullTaskInterval = CallerUnmannedListenerManager.getVirtualTaskPullTaskInterval()
|
||||
rbFive.isChecked = virtualTaskPullTaskInterval == 5
|
||||
rbFifteen.isChecked = virtualTaskPullTaskInterval == 15
|
||||
rbThirty.isChecked = virtualTaskPullTaskInterval == 30
|
||||
rbFortyFive.isChecked = virtualTaskPullTaskInterval == 45
|
||||
rgPullTime.setOnCheckedChangeListener { _, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rbFortyFive -> {
|
||||
CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(45)
|
||||
}
|
||||
R.id.rbThirty -> {
|
||||
CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(30)
|
||||
}
|
||||
R.id.rbFifteen -> {
|
||||
CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(15)
|
||||
}
|
||||
R.id.rbFive -> {
|
||||
CallerUnmannedListenerManager.dispatchVirtualTaskPullTaskInterval(5)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 魔方sop运营相关配置
|
||||
*/
|
||||
|
||||
@@ -576,7 +576,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:checked="true"
|
||||
android:text="45s"
|
||||
android:textSize="32dp" />
|
||||
|
||||
|
||||
@@ -4,5 +4,5 @@ interface IUnmannedListener {
|
||||
/**
|
||||
* 单位: 秒(s)
|
||||
*/
|
||||
fun onPullTimeUpdate(time: Int)
|
||||
fun onVirtualTaskPullTaskIntervalUpdate(time: Int)
|
||||
}
|
||||
@@ -7,22 +7,22 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
/**
|
||||
* 无人化功能状态监听、回调管理者
|
||||
*/
|
||||
object CallerUnmannedListenerManager:CallerBase<IUnmannedListener>() {
|
||||
object CallerUnmannedListenerManager : CallerBase<IUnmannedListener>() {
|
||||
private const val TAG = "CallerUnmannedListenerManager"
|
||||
|
||||
private var time: Int = 45
|
||||
private var virtualTaskPullTaskInterval: Int = 45 //单位:秒
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IUnmannedListener) {
|
||||
super.doSomeAfterAddListener(tag, listener)
|
||||
listener.onPullTimeUpdate(time)
|
||||
listener.onVirtualTaskPullTaskIntervalUpdate(virtualTaskPullTaskInterval)
|
||||
}
|
||||
|
||||
fun dispatchPullTime(time: Int) {
|
||||
this.time = time
|
||||
fun dispatchVirtualTaskPullTaskInterval(interval: Int) {
|
||||
this.virtualTaskPullTaskInterval = interval
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
try {
|
||||
listener.onPullTimeUpdate(time)
|
||||
listener.onVirtualTaskPullTaskIntervalUpdate(interval)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "转发消息出现异常:${e.message}")
|
||||
}
|
||||
@@ -30,9 +30,9 @@ object CallerUnmannedListenerManager:CallerBase<IUnmannedListener>() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取无人化演练拉取的时间间隔(单位ms)
|
||||
* 获取无人化演练拉取的时间间隔(单位: 秒)
|
||||
*/
|
||||
fun getPullTime(): Int {
|
||||
return time * 1000
|
||||
fun getVirtualTaskPullTaskInterval(): Int {
|
||||
return virtualTaskPullTaskInterval
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user