[dev_arch_opt_3.0] 修改obu直连的数据结构和和回调方法
This commit is contained in:
@@ -56,6 +56,4 @@ interface IMoGoFuncBizProvider : IMoGoFunctionServerProvider {
|
||||
fun fetchInfStructures()
|
||||
|
||||
fun getAllV2XEvents()
|
||||
|
||||
fun initOverViewDb(context: Context)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.eagle.core.function.api.map.angle
|
||||
|
||||
import com.mogo.eagle.core.function.api.base.*
|
||||
|
||||
interface IMoGoVisualAngleChangeProvider: IMoGoFunctionServerProvider {
|
||||
|
||||
fun updateLongSightLevel(level: Boolean)
|
||||
|
||||
fun changeAngle(scene: Scene)
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.mogo.eagle.core.function.api.map.angle
|
||||
|
||||
import com.mogo.map.uicontroller.*
|
||||
import java.util.concurrent.*
|
||||
import java.util.concurrent.TimeUnit.SECONDS
|
||||
|
||||
private interface IAttach {
|
||||
val angle: VisualAngleMode
|
||||
val priority: Int
|
||||
val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值,
|
||||
}
|
||||
|
||||
|
||||
sealed class Scene: IAttach
|
||||
|
||||
|
||||
/**
|
||||
* 默认视图
|
||||
* @param delay: 表示多少稍后,默认值为2
|
||||
* @param unit: 时间单位,默认为秒
|
||||
*/
|
||||
class Default(val delay: Long = 2, val unit: TimeUnit = SECONDS): Scene() {
|
||||
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
|
||||
override val priority: Int = 1
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = 0
|
||||
|
||||
override fun toString(): String {
|
||||
return "Default(delay=$delay, unit=$unit, angle=$angle, priority=$priority)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 变道-接收到转向灯信息号
|
||||
*/
|
||||
class Turning(var open: Boolean = false): Scene() {
|
||||
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
|
||||
|
||||
override val priority: Int = 3
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = -1
|
||||
|
||||
override fun toString(): String {
|
||||
return "Turning(open: ${open}, priority=$priority, displayThreshold: $displayThreshold, priority=$priority)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 后方车辆离自车过近
|
||||
*/
|
||||
object TooClose: Scene() {
|
||||
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MAP_STYLE_VR_ANGLE_300
|
||||
|
||||
override val priority: Int = 2
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = SECONDS.toMillis(8)
|
||||
|
||||
override fun toString(): String {
|
||||
return "TooClose(priority=$priority, displayThreshold: $displayThreshold, priority=$priority)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 道路事件
|
||||
*/
|
||||
object RoadEvent: Scene() {
|
||||
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MODE_LONG_SIGHT
|
||||
|
||||
override val priority: Int = 5
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = SECONDS.toMillis(8)
|
||||
|
||||
override fun toString(): String {
|
||||
return "RoadEvent(priority=${priority}, displayThreshold: ${displayThreshold}, priority=${priority})"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 十字路口
|
||||
*/
|
||||
class CrossRoad(var open: Boolean = false): Scene() {
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
|
||||
override val priority: Int = 4
|
||||
override val displayThreshold: Long
|
||||
get() = -1
|
||||
|
||||
override fun toString(): String {
|
||||
return "CrossRoad(open: ${open}, priority=${priority}, displayThreshold: ${displayThreshold}, priority=${priority})"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user