Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into 'test_robotaxi-d-app-module_2130_221116_2.13.0.1'

Dev robotaxi d app module 2130 221116 2.13.0

See merge request zhjt/AndroidApp/MoGoEagleEye!398
This commit is contained in:
wangmingjun
2022-12-06 07:45:22 +00:00
18 changed files with 176 additions and 165 deletions

View File

@@ -297,6 +297,7 @@ public class BusPassengerModel {
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
if (null == location) return;
mLocation = location;
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
callback.onCarLocationChanged(location);

View File

@@ -382,6 +382,7 @@ public class BusOrderModel {
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
if (null == location) return;
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
if (mControllerStatusCallback != null) {

View File

@@ -86,7 +86,7 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {
//长链接监听、
if (StatusDescriptor.CLOUD_SOCKET == descriptor && isTrue){
if (StatusDescriptor.CLOUD_SOCKET == descriptor){
socketStatus = isTrue
}
}

View File

@@ -216,7 +216,7 @@ public class CoordinateCalculateRouteUtil {
//转成MogoLatLng集合
List<LatLng> list = new ArrayList<>();
for (MogoLocation m : models) {
LatLng mogoLatLng = coordinateConverterWgsToGcj(mContext, m.getLongitude(),m.getLatitude());
LatLng mogoLatLng = new LatLng(m.getLatitude(), m.getLongitude());
list.add(mogoLatLng);
}
return list;

View File

@@ -289,6 +289,7 @@ public class SweeperOrderModel {
private final IMoGoMapLocationListener mMapLocationListener = new IMoGoMapLocationListener() {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
if (null == location) return;
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
if (mControllerStatusCallback != null) {

View File

@@ -452,7 +452,8 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
//位置变化时通过围栏判断是否到达x点
if (location != null && checkCurrentOCHOrder()) {
if (null == location) return;
if (checkCurrentOCHOrder()) {
if (getCurOrderStatus() == TaxiPassengerOrderStatusEnum.OnTheWayToEnd) {
calculateTravelDistance(location);
}

View File

@@ -1056,7 +1056,8 @@ public class TaxiModel {
@Override
public void onLocationChanged(@Nullable MogoLocation location, int from, boolean isGps) {
//位置变化时通过围栏判断是否到达x点
if (location != null && checkCurrentOCHOrder()) {
if (null == location) return;
if (checkCurrentOCHOrder()) {
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToStart) {
judgeStartStation(location);
}
@@ -1266,7 +1267,6 @@ public class TaxiModel {
}
if (null != routeList && routeList.getWayPointsList().size() > 0) {
updateOrderRoute(routeList.getWayPointsList());
// setRouteLineMarker(routeList.getWayPointsList());
updateOrderRouteInfo(routeList.getWayPointsList());
}
}

View File

@@ -81,8 +81,8 @@
<ImageView
android:id="@+id/module_och_taxi_navi_end_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_50"
android:src="@drawable/taxi_navi_icon"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"

View File

@@ -288,9 +288,9 @@ dependencies {
androidTestImplementation rootProject.ext.dependencies.localbroadcastmanager
androidTestImplementation rootProject.ext.dependencies.mogo_v2x
if (isAndroidTestBuild()) {
implementation "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
}
// if (isAndroidTestBuild()) {
// implementation "com.mogo.thread.opt:lib:${THREAD_OPT_VERSION}"
// }
}
if (!isAndroidTestBuild()) {

View File

@@ -40,7 +40,7 @@ internal class WarningFloatWindowHelper(
}
fun createWindow(): Boolean {
return if (context is Activity) {
return if (context is Activity && !context.isFinishing && !context.isDestroyed) {
initParams()
addView()
config.isShow = true

View File

@@ -4,24 +4,19 @@ import android.content.Context
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.EventTypeEnumWeaknessTraffic
import com.mogo.eagle.core.data.enums.V2iEventTypeEnum
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
import com.mogo.eagle.core.data.enums.*
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showLimitingVelocity
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager.invokeOnLimitingVelocityChange
import com.mogo.eagle.core.function.obu.mogo.MogoObuConst.TAG_MOGO_OBU
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -577,7 +572,7 @@ class MogoPrivateObuNewManager private constructor() {
}
/**
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道 TODO
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道
*/
override fun onMogoObuMapMath(data: MogoObuMapMathData?) {
super.onMogoObuMapMath(data)
@@ -615,7 +610,7 @@ class MogoPrivateObuNewManager private constructor() {
* 获取消息的方位 车辆相关
*/
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
// CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "预警红边:预警方向->$targetClassification")
// CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "预警红边:预警方向->$targetClassification")
return when (targetClassification) {
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
@@ -844,75 +839,68 @@ class MogoPrivateObuNewManager private constructor() {
//这里需要根据真实数据确定 index 取值方式
val currentLight = lights[0]
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"$M_OBU${TAG_MOGO_OBU}",
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId"
)
// 闯红灯预警
// 闯红灯预警,绿波通行和闯红灯是互斥的
when (appId) {
0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效
}
0x1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT TODO 需要约束一个红灯周期只显示一次
// CallerHmiManager.disableWarningV2X(appId.toString())
// CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}","changeTrafficLightStatus 闯红灯 --------> ")
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
// CallerHmiManager.warningV2X(
// appId.toString(), alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
// appId.toString(), null, true, 5000L, MsgBoxType.OBU
// )
// CallerHmiManager.disableWarningV2X(0x2.toString())
// CallerLogger.d("$M_OBU${TAG_MOGO_OBU}","changeTrafficLightStatus 闯红灯 --------> ")
// ttsContent = EventTypeEnumTrafficLight.getWarningTts(appId.toString())
// alertContent = EventTypeEnumTrafficLight.getWarningContent(appId.toString())
// CallerHmiManager.warningV2X(
// appId.toString(), alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
// appId.toString(), null, true, 5000L)
}
0x2 -> {//绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION TODO 需要约束一个绿灯周期只显示一次
ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(
appId.toString(),
alertContent,
ttsContent
)
)
)
CallerHmiManager.warningV2X(
appId.toString(), alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(), null, true, 3000L
)
// 拼接建议速度
// CallerLogger.d(
// "$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
// "绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
// )
// val adviceSpeed =
// "${currentLight.suggestMinSpeed*3.6} - ${currentLight.suggestMaxSpeed*3.6}"
// val adviceSpeedTts =
// "${currentLight.suggestMinSpeed*3.6}到${currentLight.suggestMaxSpeed*3.6}"
// 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*3.6
// if (maxSpeed > 0) {
// CallerHmiManager.warningV2X(
// EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
// alertContent,
// ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
// appId.toString(),
// null,
// true,
// 5000L,
// MsgBoxType.OBU
// )
// }
0x2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION TODO 需要约束一个绿灯周期只显示一次
// CallerHmiManager.disableWarningV2X(0x1.toString())
// CallerLogger.d(
// "$M_OBU${TAG_MOGO_OBU}",
// "speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
// )
// val adviceSpeed =
// "${currentLight.suggestMinSpeed} - ${currentLight.suggestMaxSpeed}"
// val adviceSpeedTts =
// "${currentLight.suggestMinSpeed}到${currentLight.suggestMaxSpeed}"
// ttsContent =
// String.format(
// EventTypeEnumTrafficLight.getWarningTts(appId.toString()),
// adviceSpeedTts
// )
// alertContent =
// String.format(
// EventTypeEnumTrafficLight.getWarningContent(appId.toString()),
// adviceSpeed
// )
//
// val maxSpeed = currentLight.suggestMaxSpeed
// if (maxSpeed > 0) {
// CallerMsgBoxManager.saveMsgBox(
// MsgBoxBean(
// MsgBoxType.OBU,
// V2XMsg(
// EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
// alertContent,
// ttsContent
// )
// )
// )
//
// CallerHmiManager.warningV2X(
// EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
// alertContent,
// ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
// appId.toString(),
// null,
// true,
// 5000L
// )
// }
}
}
@@ -933,6 +921,7 @@ class MogoPrivateObuNewManager private constructor() {
val red = currentLight.countDown.toInt()
CallerHmiManager.changeCountdownRed(red)
}
// 绿灯
4, 5, 6 -> {
if (!isGreenLight) {
@@ -943,52 +932,8 @@ class MogoPrivateObuNewManager private constructor() {
CallerHmiManager.showWarningTrafficLight(3, 2)
val green = currentLight.countDown.toInt()
CallerHmiManager.changeCountdownGreen(green)
//防止数据出现问题的容错
CallerHmiManager.changeCountdownRed(0)
CallerHmiManager.changeCountdownYellow(0)
// 拼接建议速度
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
)
val adviceSpeed =
"${currentLight.suggestMinSpeed} - ${currentLight.suggestMaxSpeed}"
val adviceSpeedTts =
"${currentLight.suggestMinSpeed}${currentLight.suggestMaxSpeed}"
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) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
)
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(),
null,
true,
3000L
)
}
}
// 黄灯
7, 8 -> {
CallerHmiManager.disableWarningV2X(appId.toString())

View File

@@ -13,10 +13,7 @@ import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
import com.mogo.eagle.core.data.trafficlight.isGreen
import com.mogo.eagle.core.data.trafficlight.isRed
import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.data.v2x.VipMessage
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
@@ -210,12 +207,22 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
// 请求变灯成功,直接提示
if (it.sn == MoGoAiCloudClientConfig.getInstance().sn && it.code == 0) {
CallerLogger.d("$M_V2X$TAG", "变灯请求成功")
showWarning(
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType,
EventTypeEnum.TYPE_VIP_IDENTIFICATION.content,
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType
)
val light = this.result?.currentRoadTrafficLight()
if (light != null && light.isGreen()) {
showWarning(
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.content,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.tts,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_EXTEND.poiType
)
} else {
showWarning(
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.content,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.tts,
EventTypeEnum.TYPE_VIP_IDENTIFICATION_PASS.poiType
)
}
return@turnLightToGreen
}
@@ -223,7 +230,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
if (this.result == null || this.result?.currentRoadTrafficLight() == null) {
showWarning(
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + "稍后重试",
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试",
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.tts,
EventTypeEnum.TYPE_VIP_ERROR_IDENTIFICATION.poiType
)

View File

@@ -364,8 +364,9 @@ enum class EventTypeEnum(
tts = ""
),
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯,请优先通行"),
TYPE_VIP_ERROR_IDENTIFICATION("10023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,请稍后重试"),
TYPE_VIP_IDENTIFICATION_PASS("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您变为绿灯", "VIP车辆优先通行已为您变为绿灯"),
TYPE_VIP_IDENTIFICATION_EXTEND("10023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行已为您延长绿灯", "VIP车辆优先通行已为您延长绿灯"),
TYPE_VIP_ERROR_IDENTIFICATION("10024", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,稍后重试"),
TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线");
@@ -748,7 +749,8 @@ enum class EventTypeEnum(
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.poiTypeSrcVr
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.poiTypeSrcVr
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.poiTypeSrcVr
TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.poiTypeSrcVr
TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.poiTypeSrcVr
TYPE_ERROR.poiType -> TYPE_ERROR.poiTypeSrcVr
TYPE_OPTIMAL_ROUTE_RECOMMEND.poiType -> TYPE_OPTIMAL_ROUTE_RECOMMEND.poiTypeSrcVr
GHOST_PROBE.poiType -> GHOST_PROBE.poiTypeSrcVr
@@ -790,7 +792,8 @@ enum class EventTypeEnum(
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.content
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.content
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.content
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.content
TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.content
TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.content
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.content
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.content
TYPE_ERROR.poiType -> TYPE_ERROR.content
@@ -833,7 +836,8 @@ enum class EventTypeEnum(
TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.poiType -> TYPE_USECASE_ID_ROAD_HUMP_BRIDGE.tts
TYPE_USECASE_ID_ROAD_NO_PARKING.poiType -> TYPE_USECASE_ID_ROAD_NO_PARKING.tts
TYPE_USECASE_ID_ROAD_GIVE_WAY.poiType -> TYPE_USECASE_ID_ROAD_GIVE_WAY.tts
TYPE_VIP_IDENTIFICATION.poiType -> TYPE_VIP_IDENTIFICATION.tts
TYPE_VIP_IDENTIFICATION_PASS.poiType -> TYPE_VIP_IDENTIFICATION_PASS.tts
TYPE_VIP_IDENTIFICATION_EXTEND.poiType -> TYPE_VIP_IDENTIFICATION_EXTEND.tts
FOURS_ROAD_WORK.poiType -> FOURS_ROAD_WORK.tts
AI_ROAD_WORK.poiType -> AI_ROAD_WORK.tts
TYPE_ERROR.poiType -> TYPE_ERROR.tts

View File

@@ -0,0 +1,71 @@
package com.mogo.eagle.core.data.enums
import com.mogo.eagle.core.data.R
/**
* 交通信号灯
*/
enum class EventTypeEnumTrafficLight(
val poiType: String, val poiTypeStr: String = "",
val poiTypeStrVr: String = "",
val poiTypeSrcVr: Int = R.drawable.v2x_icon_live_logo,
val content: String = "", val tts: String = ""
) {
TYPE_USECASE_ID_IVP_RED(
0x1.toString(),
"闯红灯预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_red,
content = "路口红灯,禁止通行",
tts = "路口红灯,禁止通行"
),
TYPE_USECASE_ID_IVP_GREEN(
0x2.toString(),
"绿波通行",
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_green,
content = "建议车速 %s KM/H",
tts = "建议车速 %s KM/H"
),
TYPE_ERROR(
0.toString(),
"未知/错误/异常",
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
content = "",
tts = ""
);
companion object {
@JvmStatic
fun getWarningIcon(poiType: String?): Int {
return when (poiType) {
TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.poiTypeSrcVr
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.poiTypeSrcVr
else -> TYPE_ERROR.poiTypeSrcVr
}
}
@JvmStatic
fun getWarningContent(poiType: String?): String {
return when (poiType) {
TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.content
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.content
else -> TYPE_ERROR.content
}
}
@JvmStatic
fun getWarningTts(poiType: String?): String {
return when (poiType) {
TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.tts
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.tts
else -> TYPE_ERROR.tts
}
}
}
}

View File

@@ -20,10 +20,10 @@ enum class EventTypeEnumWeaknessTraffic(
content = "注意机动车",
tts = "注意机动车"
),
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES( //TODO 图标需要换
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES(
2.toString(),
"弱势交通参与者碰撞预警",
poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision,
poiTypeSrcVr = R.drawable.icon_warning_v2x_motobike,
content = "注意非机动车",
tts = "注意非机动车"
),

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,18 +0,0 @@
package com.mogo.commons.module.status;
/**
* @author congtaowang
* @since 2020-01-04
* <p>
* 状态控制器监听
*/
public interface IMogoStickyStatusChangedListener extends IMogoStatusChangedListener {
/**
* 是否需要黏性状态: 先改变状态,后注册监听
*
* @param descriptor 状态
* @return 默认不需要
*/
boolean requestStickyStatus( StatusDescriptor descriptor );
}

View File

@@ -166,11 +166,9 @@ public class MogoStatusManager implements IMogoStatusManager {
}
mListeners.get(descriptor).add(listener);
if (listener instanceof IMogoStickyStatusChangedListener && ((IMogoStickyStatusChangedListener) listener).requestStickyStatus(descriptor)) {
Boolean val = mStatus.get(descriptor);
if (val != null) {
listener.onStatusChanged(descriptor, get_bool_val(descriptor));
}
Boolean val = mStatus.get(descriptor);
if (val != null) {
listener.onStatusChanged(descriptor, get_bool_val(descriptor));
}
}