[dev_opt_2.15.0] 合并2.14.2的修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.datacenter.obu
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
@@ -9,6 +10,8 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.api.map.angle.Default
|
||||
import com.mogo.eagle.core.function.api.map.angle.TooClose
|
||||
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.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
@@ -59,6 +62,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
|
||||
private var mObuStatusInfo = CallerObuConnectListenerManager.getObuStatusInfo()
|
||||
private var mContext: Context? = null
|
||||
private var mLimitSpeed: Int = 0
|
||||
|
||||
fun connectObu(context: Context, obuIpAddress: String, padIpAddress: String) {
|
||||
ObuManager.getInstance().registerObuListener(mogoObuListener)
|
||||
@@ -499,8 +503,12 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
//限速预警, ADD处理一次
|
||||
MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> {
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
// alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
// ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
if (mLimitSpeed > 0) {
|
||||
alertContent = String.format(EventTypeEnumNew.getWarningContent(appId), mLimitSpeed)
|
||||
ttsContent = String.format(EventTypeEnumNew.getWarningTts(appId), mLimitSpeed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,6 +683,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
UiThreadHandler.post {
|
||||
if (data.speedMaxLimit > 0) {
|
||||
mLimitSpeed = (data.speedMaxLimit * 3.6).roundToInt()
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
(data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
|
||||
)
|
||||
@@ -971,6 +980,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
) {
|
||||
var ttsContent = ""
|
||||
var alertContent = ""
|
||||
var ttsContentNew = ""
|
||||
var alertContentNew = ""
|
||||
//这里需要根据真实数据确定 index 取值方式
|
||||
val currentLight = lights[0]
|
||||
CallerLogger.d(
|
||||
@@ -1012,30 +1023,40 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
minSpeedTemp -= 5
|
||||
}
|
||||
|
||||
val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
|
||||
val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp"
|
||||
ttsContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeedTts
|
||||
)
|
||||
alertContent =
|
||||
String.format(
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeed
|
||||
)
|
||||
// val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp"
|
||||
// val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp"
|
||||
// ttsContent =
|
||||
// String.format(
|
||||
// EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
// adviceSpeedTts
|
||||
// )
|
||||
// alertContent =
|
||||
// String.format(
|
||||
// EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
// adviceSpeed
|
||||
// )
|
||||
|
||||
val maxSpeed = currentLight.suggestMaxSpeed
|
||||
if (maxSpeed > 0) {
|
||||
var currentSpeed = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed.toDouble()
|
||||
if (currentSpeed > 0) {
|
||||
ttsContentNew = if ((currentSpeed * 3.6).roundToInt() in (minSpeedTemp + 1) until maxSpeedTemp) {
|
||||
"推荐保持当前车速通过路口"
|
||||
} else {
|
||||
"推荐保持车速$minSpeedTemp - $maxSpeedTemp KM/H通过路口"
|
||||
}
|
||||
alertContentNew = "推荐车速$minSpeedTemp - $maxSpeedTemp KM/H"
|
||||
}
|
||||
|
||||
saveObuData(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
alertContentNew,
|
||||
ttsContentNew
|
||||
)
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
alertContentNew,
|
||||
ttsContentNew,
|
||||
WarningDirectionEnum.ALERT_WARNING_NON
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user