[dev_opt_2.15.0] 合并2.14.2的修改

This commit is contained in:
lixiaopeng
2023-03-29 15:26:05 +08:00
parent d045570443
commit 544592f50f
3 changed files with 54 additions and 33 deletions

View File

@@ -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
)
}

View File

@@ -221,29 +221,29 @@ enum class EventTypeEnumNew(
1001.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision,
content = "注意摩托车",
tts = "注意摩托车"
content = "前方摩托车",
tts = "前方摩托车"
),
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES(
1002.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_motobike,
content = "注意非机动车",
tts = "注意非机动车"
content = "前方非机动车",
tts = "前方非机动车"
),
TYPE_USECASE_ID_VRUCW_PERSON(
1003.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_pedestrian_crossing,
content = "注意行人",
tts = "注意行人"
content = "前方行人",
tts = "前方行人"
),
TYPE_ERROR_WEAKNESS(
1006.toString(),
"未知/错误/异常",
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
content = "前方未知障碍物",
tts = "前方未知障碍物"
content = "前方未知障碍物闯入",
tts = "前方未知障碍物闯入"
),
//---------弱势交通参与者 obu and cloud end -------->
@@ -252,8 +252,8 @@ enum class EventTypeEnumNew(
1666.toString(),
"闯红灯预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_red,
content = "路口红灯,禁止通行",
tts = "路口红灯,禁止通行"
content = "前方路口有闯红灯风险",
tts = "前方路口有闯红灯风险,建议降低车速"
),
TYPE_USECASE_ID_IVP_GREEN(
@@ -312,8 +312,8 @@ enum class EventTypeEnumNew(
6666.toString(),
"超速",
poiTypeSrcVr = R.drawable.icon_warning_v2x_over_speed,
content = "您已超速,请减速行驶",
tts = "您已超速,请减速行驶"
content = "当前路段限速 %s KM/H已超速",
tts = "当前路段限速 %s KM/H已超速"
),
//------------道路危险情况预警 obu end ----------->
@@ -413,8 +413,8 @@ enum class EventTypeEnumNew(
78.toString(),
"禁止停车",
poiTypeSrcVr = R.drawable.icon_warning_v2x_no_parking,
content = "前方%s米禁止停车",
tts = "前方%s米禁止停车"
content = "前方%s米有禁停路段",
tts = "前方%s米有禁停路段"
),
TYPE_USECASE_ID_ROAD_NO_TOOTING(
80.toString(),

View File

@@ -15,7 +15,7 @@ public class MogoObuConst {
/**
* 自研obu 默认ip obu的taxi和bus的ip已经全部统一成1网段ip
*/
public static String OBU_DEFAULT_IP = "192.168.1.199";
public static String OBU_DEFAULT_IP = "192.168.1.193";
// public static String OBU_DEFAULT_IP = "192.168.0.53"; //obu室内环境
/**