[6.7.0][运营面板][V2X] 移除V2N新链路开关,默认走新链路

This commit is contained in:
renwj
2024-09-27 11:26:05 +08:00
parent 99558e84d9
commit d7a52f7f8c
12 changed files with 54 additions and 70 deletions

View File

@@ -58,12 +58,11 @@ class V2NTest {
if (millis > 0) {
delay(millis)
}
FunctionBuildConfig.v2nNewLinked = true
// FunctionBuildConfig.v2nNewLinked = true
FunctionBuildConfig.v2nTotalSwitch = true
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
it["f2"] = FunctionBuildConfig.v2nNewLinked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
@@ -99,12 +98,11 @@ class V2NTest {
if (millis > 0) {
delay(millis)
}
FunctionBuildConfig.v2nNewLinked = true
// FunctionBuildConfig.v2nNewLinked = true
FunctionBuildConfig.v2nTotalSwitch = true
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
it["f2"] = FunctionBuildConfig.v2nNewLinked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
@@ -179,12 +177,11 @@ class V2NTest {
}
val newPoint = DrivingDirectionUtils.calculateNewPoint(car.longitude, car.latitude, car.heading , 200.0)
Log.d(TAG, "获取到路口数据..., 自车:[${car.longitude}, ${car.latitude}]前方200米外的点: [${newPoint.first}, ${newPoint.second}]")
FunctionBuildConfig.v2nNewLinked = true
// FunctionBuildConfig.v2nNewLinked = true
FunctionBuildConfig.v2nTotalSwitch = true
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
it["f2"] = FunctionBuildConfig.v2nNewLinked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
@@ -211,12 +208,11 @@ class V2NTest {
if (millis > 0) {
delay(millis)
}
FunctionBuildConfig.v2nNewLinked = true
// FunctionBuildConfig.v2nNewLinked = true
FunctionBuildConfig.v2nTotalSwitch = true
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
it["f2"] = FunctionBuildConfig.v2nNewLinked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
@@ -261,12 +257,11 @@ class V2NTest {
if (millis > 0) {
delay(millis)
}
FunctionBuildConfig.v2nNewLinked = true
// FunctionBuildConfig.v2nNewLinked = true
FunctionBuildConfig.v2nTotalSwitch = true
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
it["f2"] = FunctionBuildConfig.v2nNewLinked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}

View File

@@ -115,7 +115,7 @@ class FuncBizProvider : IMoGoFuncBizProvider {
}
override fun queryV2XEvents() {
if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nTotalSwitch || !FunctionBuildConfig.v2nNewLinked)) {
if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nTotalSwitch)) {
v2xPoiLoader.queryWholeRoadEvents()
}
}

View File

@@ -107,7 +107,7 @@ object OverViewDataManager {
.observeOn(AndroidSchedulers.mainThread())
.subscribe {
it?.apply {
if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nTotalSwitch || !FunctionBuildConfig.v2nNewLinked)) {
if (V2NCarTypeCheck.verifyCarType() && (!FunctionBuildConfig.v2nTotalSwitch)) {
CallerFuncBizListenerManager.invokeV2XEvents(this)
}
}

View File

@@ -196,8 +196,8 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
}
is V2XEvent.RoadEventX -> {
val flag = verifyCarType()
Log.d("$M_V2X$TAG", "---- 收到ai云V2N事件 ---:${flag}, ${FunctionBuildConfig.v2nTotalSwitch}, ${FunctionBuildConfig.v2nNewLinked}")
if (flag && (!FunctionBuildConfig.v2nTotalSwitch || !FunctionBuildConfig.v2nNewLinked)) {
Log.d("$M_V2X$TAG", "---- 收到ai云V2N事件 ---:${flag}, ${FunctionBuildConfig.v2nTotalSwitch}")
if (flag && (!FunctionBuildConfig.v2nTotalSwitch)) {
// try {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
Log.d("$M_V2X$TAG", "onAck -> 司机端: 将收到云端事件给到乘客端...")
@@ -210,7 +210,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IV2XCallback,
// }
handleRoadMarkerEvent(event.data.toRoadMarker())
} else{
V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nTotalSwitch,"isNewV2NData" to FunctionBuildConfig.v2nNewLinked), true)
V2XBizTrace.onAck("事件未触发,被开关拦截",mapOf("roadEvent" to event, "v2nMainSwitch" to FunctionBuildConfig.v2nTotalSwitch,"isNewV2NData" to true), true)
}
}
else -> {

View File

@@ -483,42 +483,42 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
}
private fun drawShiGong(events: List<TrackedObject>) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
handler.removeMessages(MSG_WHAT_DRAW_SHIGONE)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGONE, events))
}
}
private fun drawShiGu(events: List<TrackedObject>) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
handler.removeMessages(MSG_WHAT_DRAW_SHIGU)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGU, events))
}
}
private fun drawYongDu(events: List<MogoV2X.RTEData_PB>) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
handler.removeMessages(MSG_WHAT_DRAW_YONGDU)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_YONGDU, events))
}
}
private fun drawOtherRetrogradeVehicle(event: MessagePad.Event) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
handler.removeMessages(MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE, event))
}
}
private fun drawGreenWave(crossSpeed: V2nCrossSpeed) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
handler.removeMessages(MSG_WHAT_DRAW_GREEN_WAVE)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_GREEN_WAVE, crossSpeed))
}
}
private fun drawPeopleCross(event: MessagePad.Event) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
handler.removeMessages(MSG_WHAT_DRAW_PEOPLE_CROSS)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_PEOPLE_CROSS, event))
}

View File

@@ -1166,7 +1166,6 @@ class MoGoAutopilotControlProvider :
runCatching {
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
it["f2"] = FunctionBuildConfig.v2nNewLinked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}

View File

@@ -150,7 +150,6 @@ class TeleMsgHandler : IMsgHandler {
val f2 = data["f2"] as Boolean
Log.d(TAG, "乘客屏收到司机屏转发的新链路开关 --- 3 ---:$data, f1: $f1, f2:$f2")
FunctionBuildConfig.v2nTotalSwitch = f1
FunctionBuildConfig.v2nNewLinked = f2
} catch (t: Throwable) {
t.printStackTrace()
Log.e(TAG, "乘客屏收到司机屏转发的新链路开关异常", t)

View File

@@ -301,7 +301,7 @@ class OperatePanelLayout : LinearLayout {
companion object {
private const val KEY_V2X_TOTAL_SWITCH = "v2x_total_switch"
private const val KEY_V2N_TOTAL_SWITCH = "v2n_total_switch"
private const val KEY_V2N_NEW_LINKED = "v2n_new_linked"
// private const val KEY_V2N_NEW_LINKED = "v2n_new_linked"
private const val KEY_V2N_NEW_LINKED_TO_PNC = "v2n_new_linked_to_pnc"
private const val KEY_V2N_NEW_LINKED_GREEN_WAVE = "v2n_new_linked_green_wave"
private const val KEY_V2I_TOTAL_SWITCH = "v2i_total_switch"
@@ -324,9 +324,9 @@ class OperatePanelLayout : LinearLayout {
KEY_V2N_TOTAL_SWITCH -> {
return FunctionBuildConfig.v2nTotalSwitch
}
KEY_V2N_NEW_LINKED -> {
return FunctionBuildConfig.v2nNewLinked
}
// KEY_V2N_NEW_LINKED -> {
// return FunctionBuildConfig.v2nNewLinked
// }
KEY_V2N_NEW_LINKED_TO_PNC -> {
return FunctionBuildConfig.v2nNewLinkedToPNC
}
@@ -382,19 +382,19 @@ class OperatePanelLayout : LinearLayout {
hmiAction("V2N总开关, ", isChecked)
clickEventAnalytics("V2N总开关", isChecked)
if (!isChecked) {
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED)?.also { changeValue(it, false) }
// preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED)?.also { changeValue(it, false) }
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED_TO_PNC)?.also { changeValue(it, false) }
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED_GREEN_WAVE)?.also { changeValue(it, false) }
}
return true
}
KEY_V2N_NEW_LINKED -> {
val isChecked = newValue as? Boolean ?: false
FunctionBuildConfig.v2nNewLinked = isChecked
hmiAction("V2N新链路", isChecked)
clickEventAnalytics("V2N新链路", isChecked)
return true
}
// KEY_V2N_NEW_LINKED -> {
// val isChecked = newValue as? Boolean ?: false
// FunctionBuildConfig.v2nNewLinked = isChecked
// hmiAction("V2N新链路", isChecked)
// clickEventAnalytics("V2N新链路", isChecked)
// return true
// }
KEY_V2N_NEW_LINKED_TO_PNC -> {
val isChecked = newValue as? Boolean ?: false
FunctionBuildConfig.v2nNewLinkedToPNC = isChecked

View File

@@ -199,8 +199,8 @@ internal class SOPSettingView @JvmOverloads constructor(
clickEventAnalytics("V2N总开关",isChecked)
if (isChecked) {
//V2N新链路
scNewV2NData.isChecked = FunctionBuildConfig.v2nNewLinked
hmiAction("SOP 是否是V2N新链路(云->工控机->App)", FunctionBuildConfig.v2nNewLinked)
// scNewV2NData.isChecked = FunctionBuildConfig.v2nNewLinked
hmiAction("SOP 是否是V2N新链路(云->工控机->App)", true)
//V2N场景进PNC
scV2nPnc.isChecked = FunctionBuildConfig.v2nNewLinkedToPNC
hmiAction("SOP V2N场景进PNC, ", FunctionBuildConfig.v2nNewLinkedToPNC)
@@ -237,7 +237,6 @@ internal class SOPSettingView @JvmOverloads constructor(
FunctionBuildConfig.v2nTotalSwitch = isChecked
val map = HashMap<String, Boolean>().also {
it["f1"] = isChecked
it["f2"] = FunctionBuildConfig.v2nNewLinked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
@@ -291,21 +290,20 @@ internal class SOPSettingView @JvmOverloads constructor(
}
//V2N新链路
scNewV2NData.isChecked = FunctionBuildConfig.v2nNewLinked
scNewV2NData.setOnCheckedChangeListener { compoundButton, isChecked ->
if (!compoundButton.isPressed) {
return@setOnCheckedChangeListener
}
clickEventAnalytics("V2N新链路",isChecked)
hmiAction("SOP 是否是V2N新链路(云->工控机->App)", isChecked)
FunctionBuildConfig.v2nNewLinked = isChecked
val map = HashMap<String, Boolean>().also {
it["f1"] = FunctionBuildConfig.v2nTotalSwitch
it["f2"] = isChecked
}
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
}
scNewV2NData.isEnabled = false
// scNewV2NData.setOnCheckedChangeListener { compoundButton, isChecked ->
// if (!compoundButton.isPressed) {
// return@setOnCheckedChangeListener
// }
// clickEventAnalytics("V2N新链路",isChecked)
// hmiAction("SOP 是否是V2N新链路(云->工控机->App)", isChecked)
// FunctionBuildConfig.v2nNewLinked = isChecked
//
// val map = HashMap<String, Boolean>().also {
// it["f1"] = FunctionBuildConfig.v2nTotalSwitch
// }
// CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_NEW_LINK_SWITCH, GsonUtils.toJson(map).toByteArray())
// }
//V2N场景进PNC
scV2nPnc.isChecked = FunctionBuildConfig.v2nNewLinkedToPNC

View File

@@ -18,14 +18,14 @@
android:defaultValue="@bool/v2n_total_switch"
android:layout="@layout/layout_operate_panel_preference_switch_compat"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/>
<SwitchPreferenceCompat
android:key="v2n_new_linked"
android:title="V2N新链路"
android:persistent="false"
android:dependency="v2n_total_switch"
android:defaultValue="@bool/v2n_new_linked"
android:layout="@layout/layout_operate_panel_preference_switch_compat_dependee"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/>
<!-- <SwitchPreferenceCompat-->
<!-- android:key="v2n_new_linked"-->
<!-- android:title="V2N新链路"-->
<!-- android:persistent="false"-->
<!-- android:dependency="v2n_total_switch"-->
<!-- android:defaultValue="@bool/v2n_new_linked"-->
<!-- android:layout="@layout/layout_operate_panel_preference_switch_compat_dependee"-->
<!-- android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/>-->
<SwitchPreferenceCompat
android:key="v2n_new_linked_to_pnc"
android:title="V2N场景进PNC"

View File

@@ -320,13 +320,6 @@ object FunctionBuildConfig {
@JvmField
var v2nGreenWave = Utils.getApp().resources.getBoolean(R.bool.v2n_green_wave)
/**
* 是否是V2N新链路(云->工控机->App)
*/
@Volatile
@JvmField
var v2nNewLinked = false
/**
* 是否开启PNC障碍物颜色提醒
*/

View File

@@ -35,7 +35,7 @@ object CallerV2XListenerManager : CallerBase<IMoGoV2XListener>() {
override fun doSomeAfterAddListener(tag: String, listener: IMoGoV2XListener) {
if (eventCountTmp >= 0) {
if (verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
listener.onV2nGlobalPathEvents(eventCountTmp, constructTmp, triangleTmp, congestionTmp, parkingViolationTmp)
}
}
@@ -52,7 +52,7 @@ object CallerV2XListenerManager : CallerBase<IMoGoV2XListener>() {
parkingViolationTmp = parkingViolation
M_LISTENERS.forEach {
val listener = it.value
if (verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nNewLinked) {
if (verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
listener.onV2nGlobalPathEvents(eventCount, construct, triangle, congestion, parkingViolation)
}
}