[2.15.0]去掉多余的V2X事件的代码

This commit is contained in:
chenfufeng
2023-04-20 19:46:04 +08:00
parent 23e6086cfc
commit b84f8b28af
2 changed files with 22 additions and 25 deletions

View File

@@ -8,7 +8,6 @@ import android.os.Looper
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.config.*
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_CLOUD_V2N
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_CLOUD
@@ -83,9 +82,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
private val hasInit by lazy { AtomicBoolean(false) }
@Volatile
private var eventCount = -1
fun init(context: Context) {
BridgeApi.init(context)
if (hasInit.compareAndSet(false, true)) {
@@ -97,9 +93,9 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
}
private fun registerListener() {
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1,this)
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 1, this)
v2xPoiLoader.addCallback(this)
CallerCloudListenerManager.addListener(TAG,this)
CallerCloudListenerManager.addListener(TAG, this)
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
CallerV2XListenerManager.addListener(TAG, this)
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
@@ -117,7 +113,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) {
BridgeApi.location.set(mogoLocation)
mogoLocation?.let {
v2xPoiLoader.updateCheck(mogoLocation.longitude,mogoLocation.latitude)
v2xPoiLoader.updateCheck(mogoLocation.longitude, mogoLocation.latitude)
refreshCarState(mogoLocation)
}
}
@@ -203,7 +199,8 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
super.onAutopilotIdentifyPlanningObj(planningObjects)
planningObjects?.let {
if (it.isNotEmpty()) {
val first = it.firstOrNull { planningObj: PlanningObject -> planningObj.type >= 1000 }
val first =
it.firstOrNull { planningObj: PlanningObject -> planningObj.type >= 1000 }
var tts = ""
if (first != null) {
val poiType = when (first.type) {
@@ -222,7 +219,14 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
}
}
CallerLogger.d("$M_V2X$TAG", "poiType : $poiType , 触发道路事件")
CallerHmiManager.warningV2X(poiType, tts, tts, null, ALERT_WARNING_TOP, isFromObu = false)
CallerHmiManager.warningV2X(
poiType,
tts,
tts,
null,
ALERT_WARNING_TOP,
isFromObu = false
)
}
}
}
@@ -348,12 +352,13 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
}
}
override fun onDismiss() {
if (change) {
CallerVisualAngleManager.changeAngle(Default())
override fun onDismiss() {
if (change) {
CallerVisualAngleManager.changeAngle(Default())
}
}
}
}, isFromObu = false)
}, isFromObu = false
)
CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(trafficData)
}
2 -> {
@@ -409,12 +414,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
}
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
if (autoPilotStatusInfo.autopilotControlParameters != null) {
eventCount = -1
}
}
override fun onV2nGlobalPathEvents(
eventCount: Int,
construct: MogoV2X.RSI_PB?,
@@ -422,11 +421,8 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
congestion: MogoV2X.RSI_PB?,
parkingViolation: MogoV2X.RSM_PB?
) {
if (this.eventCount == -1) {
this.eventCount = eventCount
if (eventCount >= 0) {
sendToMsgBox(eventCount)
}
if (eventCount >= 0) {
sendToMsgBox(eventCount)
}
}