[6.5.0][视角切换] 添加获取当前视角的接口
This commit is contained in:
@@ -44,7 +44,6 @@ import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.v2x.MogoV2X
|
||||
import mogo.v2x.MogoV2X.RSI_PB
|
||||
import mogo.v2x.MogoV2X.RTEData_PB
|
||||
import java.lang.Math.abs
|
||||
import java.util.concurrent.TimeUnit.SECONDS
|
||||
|
||||
/**
|
||||
@@ -296,13 +295,13 @@ internal object V2NIdentifyDrawer {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.START) }
|
||||
CallerVisualAngleManager.changeAngle(RoadEvent(2, SECONDS))
|
||||
CallerVisualAngleManager.changeScene(RoadEvent(2, SECONDS))
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.STOP) }
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
CallerVisualAngleManager.changeScene(Default())
|
||||
}
|
||||
},
|
||||
ALERT_WARNING_TOP,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road;
|
||||
|
||||
import android.telecom.Call;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.enums.CommunicationType;
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
@@ -171,7 +168,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
if (isNeedChangeAngle()) {
|
||||
MarkerLocation location = content.getLocation();
|
||||
if (location != null) {
|
||||
CallerVisualAngleManager.INSTANCE.changeAngle(new RoadEvent(2, TimeUnit.SECONDS));
|
||||
CallerVisualAngleManager.INSTANCE.changeScene(new RoadEvent(2, TimeUnit.SECONDS));
|
||||
}
|
||||
}
|
||||
if (entity.isNeedAddLine() && !EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(content.getPoiType())) {
|
||||
@@ -202,7 +199,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
} catch (Throwable ignore) {}
|
||||
}
|
||||
}
|
||||
CallerVisualAngleManager.INSTANCE.changeAngle(new Default(3, TimeUnit.SECONDS));
|
||||
CallerVisualAngleManager.INSTANCE.changeScene(new Default(3, TimeUnit.SECONDS));
|
||||
}
|
||||
release();
|
||||
}
|
||||
|
||||
@@ -417,12 +417,12 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
showWarning(v2xType, alertContent, ttsContent, direction, object : IMoGoWarningStatusListener {
|
||||
|
||||
override fun onShow() {
|
||||
CallerVisualAngleManager.changeAngle(CrossRoad(2))
|
||||
CallerVisualAngleManager.changeScene(CrossRoad(2))
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
super.onDismiss()
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
CallerVisualAngleManager.changeScene(Default())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.angle.scenes.CrossRoad
|
||||
import com.mogo.eagle.core.function.angle.scenes.Default
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.map.angle.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
@@ -968,14 +967,14 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
override fun onShow() {
|
||||
if (appId == MogoObuShowConstants.V2X_WARNING_TYPE.BSW.toString()) {
|
||||
//盲区预警,展示近视角
|
||||
CallerVisualAngleManager.changeAngle(CrossRoad(2))
|
||||
CallerVisualAngleManager.changeScene(CrossRoad(2))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
if (appId == MogoObuShowConstants.V2X_WARNING_TYPE.BSW.toString()) {
|
||||
//盲区预警,取消近视角
|
||||
CallerVisualAngleManager.changeAngle(Default())
|
||||
CallerVisualAngleManager.changeScene(Default())
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -71,7 +71,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
}
|
||||
}
|
||||
if (triggerClose) {
|
||||
changeAngle(Default())
|
||||
changeScene(Default())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
triggerRoadId.set(this.roadId.get())
|
||||
distanceOfCarToStopLine.set(info.distance)
|
||||
triggerLocation.set(CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02())
|
||||
changeAngle(CrossRoad(2))
|
||||
changeScene(CrossRoad(2))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
mLevel = level
|
||||
}
|
||||
|
||||
override fun changeAngle(scene: Scene) {
|
||||
override fun changeScene(scene: Scene) {
|
||||
if(mLevel){
|
||||
return
|
||||
}
|
||||
@@ -140,13 +140,21 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
if (delay > 0) {
|
||||
delay(delay)
|
||||
}
|
||||
|
||||
val lastPriority = prevScene.get()?.priority ?: Int.MIN_VALUE
|
||||
val currentPriority = scene.priority
|
||||
if (lastPriority > currentPriority) {
|
||||
return@launch
|
||||
}
|
||||
doChangeAngle(scene)
|
||||
}.also {
|
||||
prevJob = it
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCurrentScene(): Scene {
|
||||
return prevScene.get() ?: Default()
|
||||
}
|
||||
|
||||
private fun doChangeAngle(target: Scene) {
|
||||
val angle = target.angle
|
||||
CallerMapUIServiceManager.getMapUIController()?.also {
|
||||
@@ -159,6 +167,12 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
notifyChanged(target)
|
||||
}
|
||||
prevScene.set(target)
|
||||
if (target.displayThreshold > 0) {
|
||||
scope.launch {
|
||||
delay(target.displayThreshold)
|
||||
doChangeAngle(Default(0))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class CrossRoad(private val delayTime: Long): Scene {
|
||||
override val angle: VisualAngleMode
|
||||
get() = MAP_STYLE_VR_ANGLE_CROSS
|
||||
|
||||
override val priority: Int = 4
|
||||
override val priority: Int = 0
|
||||
override val displayThreshold: Long
|
||||
get() = -1
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class Default(val delayTime: Long = 2, val unit: TimeUnit = TimeUnit.SECONDS): S
|
||||
override val angle: VisualAngleMode
|
||||
get() = CallerMapUIServiceManager.getMapUIController()?.getVrAngleDefaultMode() ?: MODE_MEDIUM_SIGHT
|
||||
|
||||
override val priority: Int = 1
|
||||
override val priority: Int = 0
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = 0
|
||||
|
||||
@@ -12,7 +12,7 @@ class LongSight(private val delayTime: Long, private val unit: TimeUnit = TimeUn
|
||||
override val priority: Int
|
||||
get() = 0
|
||||
override val displayThreshold: Long
|
||||
get() = 0
|
||||
get() = -1
|
||||
|
||||
override val delay: Long
|
||||
get() = unit.toMillis(delayTime)
|
||||
|
||||
@@ -13,10 +13,10 @@ class RoadEvent(private val delayTime: Long, private val unit: TimeUnit): Scene
|
||||
|
||||
override val angle: VisualAngleMode = CallerMapUIServiceManager.getMapUIController()?.getVrAngleDefaultMode() ?: MODE_MEDIUM_SIGHT
|
||||
|
||||
override val priority: Int = 5
|
||||
override val priority: Int = 0
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = TimeUnit.SECONDS.toMillis(8)
|
||||
get() = -1
|
||||
|
||||
override val delay: Long
|
||||
get() = unit.toMillis(delayTime)
|
||||
|
||||
Reference in New Issue
Block a user