[2.15.0][opt]兼容V2N新旧链路
This commit is contained in:
@@ -19,6 +19,7 @@ import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb
|
||||
import com.mogo.eagle.function.biz.v2x.road.LineUploadManager
|
||||
import com.mogo.eagle.function.biz.v2x.trafficlight.core.MogoTrafficLightManager
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.V2XEventManager
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.V2XPoiLoader.Companion.v2xPoiLoader
|
||||
import com.mogo.eagle.function.biz.v2x.v2n.pnc.*
|
||||
import com.mogo.eagle.function.biz.v2x.vip.VipCarManager
|
||||
|
||||
@@ -91,11 +92,14 @@ class FuncBizProvider : IMoGoFuncBizProvider {
|
||||
}
|
||||
|
||||
override fun getAllV2XEvents() {
|
||||
// OverViewDataManager.getAllV2XEventsByLineId(MoGoAiCloudClientConfig.getInstance().sn)
|
||||
OverViewDataManager.getAllV2XEventsByLineId(MoGoAiCloudClientConfig.getInstance().sn)
|
||||
}
|
||||
|
||||
override fun queryV2XEvents() {
|
||||
// v2xPoiLoader.queryWholeRoadEvents()
|
||||
if ((AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && !FunctionBuildConfig.isNewV2NData)
|
||||
|| AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
v2xPoiLoader.queryWholeRoadEvents()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -3,10 +3,12 @@ package com.mogo.eagle.function.biz.v2x.overview
|
||||
import androidx.lifecycle.*
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.constants.HostConst
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.function.biz.v2x.overview.db.OverviewDb
|
||||
@@ -105,7 +107,10 @@ object OverViewDataManager {
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
it?.apply {
|
||||
CallerFuncBizListenerManager.invokeV2XEvents(this)
|
||||
if ((AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && !FunctionBuildConfig.isNewV2NData)
|
||||
|| AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
CallerFuncBizListenerManager.invokeV2XEvents(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,6 +207,11 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
FunctionBuildConfig.isReportWarning = isChecked
|
||||
}
|
||||
|
||||
tbNewV2NData.isChecked = FunctionBuildConfig.isNewV2NData
|
||||
tbNewV2NData.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.isNewV2NData = isChecked
|
||||
}
|
||||
|
||||
//变道绕障的目标障碍物速度阈值
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
ivSpeedReduce.setOnClickListener {
|
||||
|
||||
@@ -247,12 +247,26 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tbGreenWaveSop"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/tbNewV2NData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="V2N新链路"
|
||||
android:paddingTop="25dp"
|
||||
android:paddingBottom="25dp"
|
||||
android:scaleY="1.2"
|
||||
android:scaleX="1.2"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbIPCReport"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/verticalGuideLine"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeedThresholdTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbIPCReport"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbNewV2NData"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:textColor="#1A1A1A"
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.amap.api.maps.CameraUpdate
|
||||
import com.amap.api.maps.CameraUpdateFactory
|
||||
import com.amap.api.maps.TextureMapView
|
||||
import com.amap.api.maps.model.*
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.v2x.Center
|
||||
@@ -45,6 +46,7 @@ import com.mogo.eagle.core.function.smp.MarkerDrawerManager.planningPoints
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.startLoopCalCarLocation
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.updateRoutePoints
|
||||
import com.mogo.eagle.core.function.smp.V2XMarkerView
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -319,7 +321,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onV2XEvents(v2XEventData: List<V2XEventData>?) {
|
||||
// showV2XEventMarkers(v2XEventData)
|
||||
showV2XEventMarkers(v2XEventData)
|
||||
}
|
||||
})
|
||||
CallerV2XListenerManager.addListener(TAG, this)
|
||||
@@ -719,34 +721,50 @@ class OverMapView @JvmOverloads constructor(
|
||||
val list = ArrayList<V2XEventData>()
|
||||
constructList?.forEach {
|
||||
it.eventPos?.offsetLL?.positionLatLon?.let { latLon ->
|
||||
list.add(V2XEventData(
|
||||
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10006", 1
|
||||
))
|
||||
list.add(
|
||||
V2XEventData(
|
||||
0, 0, "", Center(
|
||||
latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)
|
||||
), null, 0.0, "10006", 1
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
triangleList?.forEach {
|
||||
it.eventPos?.offsetLL?.positionLatLon?.let { latLon ->
|
||||
list.add(V2XEventData(
|
||||
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10032", 1
|
||||
))
|
||||
list.add(
|
||||
V2XEventData(
|
||||
0, 0, "", Center(
|
||||
latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)
|
||||
), null, 0.0, "10032", 1
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
congestionList?.forEach {
|
||||
it.eventPos?.offsetLL?.positionLatLon?.let { latLon ->
|
||||
list.add(V2XEventData(
|
||||
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10007", 1
|
||||
))
|
||||
list.add(
|
||||
V2XEventData(
|
||||
0, 0, "", Center(
|
||||
latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)
|
||||
), null, 0.0, "10007", 1
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
parkingList?.forEach {
|
||||
it.pos?.offsetLL?.positionLatLon?.let { latLon ->
|
||||
list.add(V2XEventData(
|
||||
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10025", 1
|
||||
))
|
||||
list.add(
|
||||
V2XEventData(
|
||||
0, 0, "", Center(
|
||||
latLon.lat * 10.0.pow(-7.0),
|
||||
latLon.lon * 10.0.pow(-7.0)
|
||||
), null, 0.0, "10025", 1
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
UiThreadHandler.post {
|
||||
|
||||
@@ -187,6 +187,13 @@ object FunctionBuildConfig {
|
||||
@JvmField
|
||||
var isReportWarning = true
|
||||
|
||||
/**
|
||||
* 是否是V2N新链路(云->工控机->App)
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var isNewV2NData = false
|
||||
|
||||
/**
|
||||
* 是否开启PNC障碍物颜色提醒
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoV2XListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import mogo.v2x.MogoV2X
|
||||
|
||||
/**
|
||||
@@ -17,7 +19,9 @@ object CallerV2XListenerManager : CallerBase<IMoGoV2XListener>() {
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IMoGoV2XListener) {
|
||||
if (eventCountTmp >= 0) {
|
||||
listener.onV2nGlobalPathEvents(eventCountTmp, constructTmp, triangleTmp, congestionTmp, parkingViolationTmp)
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.isNewV2NData) {
|
||||
listener.onV2nGlobalPathEvents(eventCountTmp, constructTmp, triangleTmp, congestionTmp, parkingViolationTmp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +36,9 @@ object CallerV2XListenerManager : CallerBase<IMoGoV2XListener>() {
|
||||
parkingViolationTmp = parkingViolation
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onV2nGlobalPathEvents(eventCount, construct, triangle, congestion, parkingViolation)
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.isNewV2NData) {
|
||||
listener.onV2nGlobalPathEvents(eventCount, construct, triangle, congestion, parkingViolation)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user