Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-d_230217_1.0.1'
Dev arch opt 3.0 See merge request zhjt/AndroidApp/MoGoEagleEye!545
This commit is contained in:
@@ -20,7 +20,6 @@ import com.mogo.support.obu.MogoObuManager
|
||||
@Route(path = MogoServicePaths.PATH_V2X_OBU_MOGO)
|
||||
class MoGoObuProvider : IMoGoObuProvider {
|
||||
private val TAG = "MoGoObuProvider"
|
||||
|
||||
private var mContext: Context? = null
|
||||
private val taxiObuIp = "192.168.1.199" //obu的taxi和bus的ip已经全部统一成1网段ip
|
||||
|
||||
@@ -36,10 +35,11 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
MogoObuDcCombineManager.INSTANCE.init(context)
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
|
||||
|
||||
//bus乘客版本obu功能去掉,大理项目需要全部车辆接收,不在限制
|
||||
//bus乘客版本obu功能去掉,大理项目需要全部车辆接收,不再限制
|
||||
mContext = context
|
||||
mContext?.let {
|
||||
val ipAddress = SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
|
||||
val ipAddress =
|
||||
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, taxiObuIp)
|
||||
//mogo obu
|
||||
MogoPrivateObuNewManager.INSTANCE.connectObu(
|
||||
it,
|
||||
@@ -53,32 +53,28 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
* 通过控制面板设置ip,进行传递
|
||||
*/
|
||||
override fun connect(ipAddress: String) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
//不处理
|
||||
} else {
|
||||
mContext?.let {
|
||||
// 保存本地OBU IP地址
|
||||
SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress)
|
||||
mContext?.let {
|
||||
// 保存本地OBU IP地址
|
||||
SharedPrefsMgr.getInstance(it).putString(MoGoConfig.OBU_IP, ipAddress)
|
||||
|
||||
//连接 mogo obu
|
||||
MogoPrivateObuNewManager.INSTANCE.connectObu(
|
||||
it,
|
||||
ipAddress,
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
|
||||
}
|
||||
//连接 mogo obu
|
||||
MogoPrivateObuNewManager.INSTANCE.connectObu(
|
||||
it,
|
||||
ipAddress,
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun disConnect() {
|
||||
MogoPrivateObuNewManager.INSTANCE.disconnect()
|
||||
MogoPrivateObuNewManager.INSTANCE.disConnectObu()
|
||||
}
|
||||
|
||||
override fun isConnected(): Boolean {
|
||||
return MogoObuManager.getInstance().connectStatus == 1
|
||||
return MogoPrivateObuNewManager.INSTANCE.isConnected()
|
||||
}
|
||||
|
||||
override fun setObuLog(isChecked: Boolean) {
|
||||
MogoPrivateObuNewManager.INSTANCE.setObuLog(isChecked)
|
||||
}
|
||||
}
|
||||
@@ -29,9 +29,11 @@ import com.mogo.support.obu.ObuBase
|
||||
import com.mogo.support.obu.ObuScene
|
||||
import com.mogo.support.obu.constants.MogoObuComType
|
||||
import com.mogo.support.obu.constants.MogoObuConstants
|
||||
import com.mogo.support.obu.constants.MogoObuLogLevel
|
||||
import com.mogo.support.obu.constants.MogoObuTopicId
|
||||
import com.mogo.support.obu.model.*
|
||||
import com.mogo.support.obu.option.MogoObuCom
|
||||
import com.mogo.support.obu.option.MogoObuLog
|
||||
import com.mogo.support.obu.option.MogoObuOptions
|
||||
import com.zhidao.support.obu.ObuManager
|
||||
import com.zhidao.support.obu.OnObuListener
|
||||
@@ -74,7 +76,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
.build()
|
||||
|
||||
//每次连接的时候如果连接连接了,先断开,防止ip改变等导致的连接失败
|
||||
if (ObuManager.getInstance().connectStatus == 1) {
|
||||
if (ObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED) {
|
||||
try {
|
||||
ObuManager.getInstance().disconnect()
|
||||
} catch (e: Exception) {
|
||||
@@ -84,12 +86,32 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
ObuManager.getInstance().connect(options)
|
||||
}
|
||||
|
||||
fun getMogoObuListener(): OnObuListener {
|
||||
return mogoObuListener
|
||||
/**
|
||||
* 断开新obu
|
||||
*/
|
||||
fun disConnectObu() {
|
||||
try {
|
||||
ObuManager.getInstance().disconnect()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
fun disconnect() {
|
||||
ObuManager.getInstance().disconnect()
|
||||
/**
|
||||
* 新obu是否连接
|
||||
*/
|
||||
fun isConnected(): Boolean {
|
||||
return ObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED
|
||||
}
|
||||
|
||||
fun setObuLog(isChecked: Boolean) {
|
||||
ObuManager.getInstance().setEnableLog(isChecked)
|
||||
val builder: com.mogo.support.obu.option.MogoObuLog.Builder =
|
||||
MogoObuLog.newBuilder().setEnableStdio(isChecked)
|
||||
if (isChecked) {
|
||||
builder.setStdioLevel(MogoObuLogLevel.DBG)
|
||||
}
|
||||
ObuManager.getInstance().logConfig(builder.build())
|
||||
}
|
||||
|
||||
private val mogoObuListener: OnObuListener = object : OnObuListener {
|
||||
@@ -133,15 +155,16 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
* v2v预警信息 CvxRvInfoIndInfo CvxV2vThreatIndInfo 他车
|
||||
*/
|
||||
override fun onObuRvWarning(data: ObuScene.RvWarningData) {
|
||||
// if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关
|
||||
if (data.warningMsg != null && !data.warningMsg.warningDataList.isNullOrEmpty()) {
|
||||
// 更新数据,远车数据,之前要匹配uuid
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data.vehBasicsMsg)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it)
|
||||
}
|
||||
if (HmiBuildConfig.isShowObuV2vView) {
|
||||
if (data.warningMsg != null) {
|
||||
// 更新数据,远车数据,之前要匹配uuid
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data.vehBasicsMsg)
|
||||
?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficLocationInfo(it)
|
||||
}
|
||||
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString())
|
||||
data.let {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString())
|
||||
//预警信息,预警类型 threat_level 2、3
|
||||
data.vehBasicsMsg?.let {
|
||||
//预警方位
|
||||
@@ -150,14 +173,12 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
var appId = ""
|
||||
var level = -1
|
||||
var status = -1
|
||||
data.warningMsg?.let {
|
||||
if (data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) {
|
||||
level = data.warningMsg.warningDataList[0].warningLevel
|
||||
appId = data.warningMsg.warningDataList[0].warningType.toString()
|
||||
status = data.warningMsg.warningDataList[0].status
|
||||
//拼凑数据
|
||||
handleSdkObu(appId, direction, status, level, data)
|
||||
}
|
||||
if (data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) {
|
||||
level = data.warningMsg.warningDataList[0].warningLevel
|
||||
appId = data.warningMsg.warningDataList[0].warningType.toString()
|
||||
status = data.warningMsg.warningDataList[0].status
|
||||
//拼凑数据
|
||||
handleSdkObu(appId, direction, status, level, data)
|
||||
}
|
||||
|
||||
CallerLogger.d(
|
||||
@@ -169,224 +190,230 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯预警信息 CvxIvpThreatIndInfo
|
||||
*/
|
||||
override fun onObuSpatWarning(data: ObuScene.SpatWarningData) {
|
||||
handlerTrafficLight(
|
||||
data.warningType,
|
||||
data.status,
|
||||
data.lightsList
|
||||
)
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
handlerTrafficLight(
|
||||
data.warningType,
|
||||
data.status,
|
||||
data.lightsList
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* RSI预警信息 onMogoObuRsiWarning(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等))
|
||||
*/
|
||||
override fun onObuRsiWarning(data: ObuScene.RsiWarningData) {
|
||||
// if (HmiBuildConfig.isShowObuV2iView) {
|
||||
if (data.warningMsgList != null && data.warningMsgList.size > 0) {
|
||||
var alertContent = ""
|
||||
var ttsContent = ""
|
||||
var appId = data.warningMsgList[0].sceneType.toString()
|
||||
val status = data.status
|
||||
val level = data.warningMsgList[0].warningLevel
|
||||
val direction = getMessageDirection(data.warningMsgList[0].targetPosition)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsgList[0].targetPosition}"
|
||||
)
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
if (data.warningMsgList != null && data.warningMsgList.size > 0) {
|
||||
var alertContent = ""
|
||||
var ttsContent = ""
|
||||
var appId = data.warningMsgList[0].sceneType.toString()
|
||||
val status = data.status
|
||||
val level = data.warningMsgList[0].warningLevel
|
||||
val direction = getMessageDirection(data.warningMsgList[0].targetPosition)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsgList[0].targetPosition}"
|
||||
)
|
||||
|
||||
if (appId != "0") {
|
||||
when (appId) {
|
||||
// 道路危险情况预警
|
||||
MogoObuConstants.RSI_SCENE_TYPE.HLW.toString() -> {
|
||||
when (data.warningMsgList[0].eventSerialNum) {
|
||||
MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN -> {//车辆故障
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_ROAD_WATER -> { //道路积水
|
||||
appId = EventTypeEnumNew.FOURS_PONDING.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_PARKING_VIOLATION -> { //异常停车
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_PARKING.poiType
|
||||
}
|
||||
if (appId != "0") {
|
||||
when (appId) {
|
||||
// 道路危险情况预警
|
||||
MogoObuConstants.RSI_SCENE_TYPE.HLW.toString() -> {
|
||||
when (data.warningMsgList[0].eventSerialNum) {
|
||||
MogoObuConstants.RTE.RTI_TYPE_BREAKDOWN -> {//车辆故障
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_BREAKDOWN_WARNING.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_ROAD_WATER -> { //道路积水
|
||||
appId = EventTypeEnumNew.FOURS_PONDING.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_PARKING_VIOLATION -> { //异常停车
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_PARKING.poiType
|
||||
}
|
||||
// MogoObuConstants.RTE.RTI_TYPE_CONSTRUCTION_RTE -> { //施工占道,和标牌重复
|
||||
// appId = EventTypeEnumNew.FOURS_ROAD_WORK.poiType
|
||||
// }
|
||||
MogoObuConstants.RTE.RTI_TYPE_SPEEDING -> { //超速行驶
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_SLW.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_RETRIGRADE -> { //车辆逆行
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType
|
||||
MogoObuConstants.RTE.RTI_TYPE_SPEEDING -> { //超速行驶
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_SLW.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_RETRIGRADE -> { //车辆逆行
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType
|
||||
}
|
||||
}
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format( //事件才有影响范围
|
||||
alertContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
}
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format( //事件才有影响范围
|
||||
alertContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
}
|
||||
|
||||
//车内标牌
|
||||
MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> {
|
||||
when (data.warningMsgList[0].signSerialNum) {
|
||||
MogoObuConstants.RTS.RTI_TYPE_SHAPR_TURNS -> { //急转弯
|
||||
appId = EventTypeEnumNew.TYPE_ID_SHAPR_TURNS.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_BRIDGE -> { //桥梁
|
||||
appId = EventTypeEnumNew.TYPE_ID_BRIDGE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_PEDESTRIAN -> { //行人
|
||||
appId = EventTypeEnumNew.TYPE_ID_PEDESTRIAN.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_SLIPPERY_ROAD -> { //路滑
|
||||
appId = EventTypeEnumNew.TYPE_ID_SLIPPERY_ROAD.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_TUNNEL -> { //隧道
|
||||
appId = EventTypeEnumNew.TYPE_ID_TUNNEL.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_FERRY -> { //渡轮
|
||||
appId = EventTypeEnumNew.TYPE_ID_FERRY.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_UNEVEN_ROAD -> { //路面不平
|
||||
appId = EventTypeEnumNew.TYPE_ID_UNEVEN_ROAD.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NON_MOTOR_VEHICLE -> { //非机动车
|
||||
appId = EventTypeEnumNew.TYPE_ID_NON_MOTOR_VEHICLE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_OBSTACLE -> { //障碍
|
||||
appId = EventTypeEnumNew.TYPE_ID_OBSTACLE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_CONSTRUCTION -> { //施工
|
||||
appId = EventTypeEnumNew.TYPE_FOURS_ROAD_WORK.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_VEHICLE_QUEUE -> { //车队
|
||||
appId = EventTypeEnumNew.TYPE_VEHICLE_QUEUE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_PASSING -> { //不通
|
||||
appId = EventTypeEnumNew.TYPE_NO_PASSING.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_TURNING_AROUND -> { //禁止掉头
|
||||
appId = EventTypeEnumNew.TYPE_NO_TURNING_AROUND.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_STOPPING -> { //禁止停车
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_PARKING.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_TOOTING -> { //禁止鸣笛
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_TOOTING.poiType
|
||||
}
|
||||
//车内标牌
|
||||
MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> {
|
||||
when (data.warningMsgList[0].signSerialNum) {
|
||||
MogoObuConstants.RTS.RTI_TYPE_SHAPR_TURNS -> { //急转弯
|
||||
appId = EventTypeEnumNew.TYPE_ID_SHAPR_TURNS.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_BRIDGE -> { //桥梁
|
||||
appId = EventTypeEnumNew.TYPE_ID_BRIDGE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_PEDESTRIAN -> { //行人
|
||||
appId = EventTypeEnumNew.TYPE_ID_PEDESTRIAN.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_SLIPPERY_ROAD -> { //路滑
|
||||
appId = EventTypeEnumNew.TYPE_ID_SLIPPERY_ROAD.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_TUNNEL -> { //隧道
|
||||
appId = EventTypeEnumNew.TYPE_ID_TUNNEL.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_FERRY -> { //渡轮
|
||||
appId = EventTypeEnumNew.TYPE_ID_FERRY.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_UNEVEN_ROAD -> { //路面不平
|
||||
appId = EventTypeEnumNew.TYPE_ID_UNEVEN_ROAD.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NON_MOTOR_VEHICLE -> { //非机动车
|
||||
appId = EventTypeEnumNew.TYPE_ID_NON_MOTOR_VEHICLE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_OBSTACLE -> { //障碍
|
||||
appId = EventTypeEnumNew.TYPE_ID_OBSTACLE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_CONSTRUCTION -> { //施工
|
||||
appId = EventTypeEnumNew.TYPE_FOURS_ROAD_WORK.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_VEHICLE_QUEUE -> { //车队
|
||||
appId = EventTypeEnumNew.TYPE_VEHICLE_QUEUE.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_PASSING -> { //不通
|
||||
appId = EventTypeEnumNew.TYPE_NO_PASSING.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_TURNING_AROUND -> { //禁止掉头
|
||||
appId = EventTypeEnumNew.TYPE_NO_TURNING_AROUND.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_STOPPING -> { //禁止停车
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_PARKING.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NO_TOOTING -> { //禁止鸣笛
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_NO_TOOTING.poiType
|
||||
}
|
||||
// MogoObuConstants.RTS.RTI_TYPE_SPEED_LIMIT -> { //限速
|
||||
// appId =
|
||||
// EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
|
||||
// }
|
||||
MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_BUS_WARNING.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NARROW_RIGHT -> { //右侧变窄/车道数减少
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_NARROW_RIGHT.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_GAS_STATION -> { //加油站
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_GAS_STATION.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_SCHOOL -> { //学校
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_ACCIDENT -> { //事故
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ACCIDENT.poiType
|
||||
MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_BUS_WARNING.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_NARROW_RIGHT -> { //右侧变窄/车道数减少
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_NARROW_RIGHT.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_GAS_STATION -> { //加油站
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_GAS_STATION.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_SCHOOL -> { //学校
|
||||
appId =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_ACCIDENT -> { //事故
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ACCIDENT.poiType
|
||||
}
|
||||
}
|
||||
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format( //标牌是没有影响范围的
|
||||
alertContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString()
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString()
|
||||
)
|
||||
}
|
||||
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format( //标牌是没有影响范围的
|
||||
alertContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString()
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString()
|
||||
)
|
||||
}
|
||||
|
||||
// 拥堵
|
||||
MogoObuConstants.RSI_SCENE_TYPE.TJW.toString() -> {
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_TJW.poiType
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format( //事件才有影响范围
|
||||
alertContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
}
|
||||
|
||||
//限速预警, ADD处理一次
|
||||
MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> {
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
}
|
||||
}
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"new onMogoObuRsiWarning appId = $appId ---status = $status --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} ---direction = ${direction.direction} --distance = ${
|
||||
Math.round(data.warningMsgList[0].distance)
|
||||
} ---eventRadius = ${Math.round(data.warningMsgList[0].eventRadius)} --speedMaxLimit = ${data.warningMsgList[0].speedMaxLimit.toInt()}"
|
||||
)
|
||||
|
||||
when (status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
//不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
// 拥堵
|
||||
MogoObuConstants.RSI_SCENE_TYPE.TJW.toString() -> {
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_TJW.poiType
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
alertContent = String.format( //事件才有影响范围
|
||||
alertContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
Math.round(data.warningMsgList[0].distance).toString(),
|
||||
Math.round(data.warningMsgList[0].eventRadius).toString()
|
||||
)
|
||||
}
|
||||
saveObuData(appId, alertContent, ttsContent)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
//限速预警, ADD处理一次
|
||||
MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> {
|
||||
appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
|
||||
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"new onMogoObuRsiWarning appId = $appId ---status = $status --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsgList[0].eventSerialNum} ---signSerialNum = ${data.warningMsgList[0].signSerialNum} ---direction = ${direction.direction} --distance = ${
|
||||
Math.round(data.warningMsgList[0].distance)
|
||||
} ---eventRadius = ${Math.round(data.warningMsgList[0].eventRadius)} --speedMaxLimit = ${data.warningMsgList[0].speedMaxLimit.toInt()}"
|
||||
)
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
// 事件结束,还原车辆颜色
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficInfo(it)
|
||||
when (status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
//不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
}
|
||||
saveObuData(appId, alertContent, ttsContent)
|
||||
showWarning(appId, alertContent, ttsContent, direction)
|
||||
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
// 事件结束,还原车辆颜色
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficInfo(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -405,133 +432,135 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsmWarning ------> ${data.toString()}"
|
||||
)
|
||||
// if (HmiBuildConfig.isShowObuV2iView) {
|
||||
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
if (data != null && data.participant != null) {
|
||||
var v2xType = ""
|
||||
if (data.participant.ptcType == 1) { //机动车
|
||||
v2xType =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType
|
||||
} else if (data.participant.ptcType == 2) { //非机动车
|
||||
v2xType =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType
|
||||
} else if (data.participant.ptcType == 3) { //行人
|
||||
v2xType =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
|
||||
} else { //未知
|
||||
v2xType = EventTypeEnumNew.TYPE_ERROR.poiType
|
||||
}
|
||||
|
||||
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
|
||||
val alertContent =
|
||||
EventTypeEnumNew.getWarningContent(v2xType)
|
||||
var level = -1
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
|
||||
//物体数据绘制
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
// 更新数据,模型变色的时候是不是update,如果不是更新,可能导致模型不变色,(add的时候,是否有level高的) TODO
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
if (data != null && data.participant != null) {
|
||||
var v2xType = ""
|
||||
if (data.participant.ptcType == 1) { //机动车
|
||||
v2xType =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType
|
||||
} else if (data.participant.ptcType == 2) { //非机动车
|
||||
v2xType =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType
|
||||
} else if (data.participant.ptcType == 3) { //行人
|
||||
v2xType =
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
|
||||
} else { //未知
|
||||
v2xType = EventTypeEnumNew.TYPE_ERROR.poiType
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
|
||||
val alertContent =
|
||||
EventTypeEnumNew.getWarningContent(v2xType)
|
||||
var level = -1
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
// 更新数据 TODO 删除原来的,改变颜色,删除marker。不影响别的模型添加
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
// 事件结束,还原交通参与者颜色
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
|
||||
//删除弱势交通元素
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
|
||||
}
|
||||
}
|
||||
|
||||
//预警status
|
||||
if (data.warningMsg != null && data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) {
|
||||
level = data.warningMsg.warningDataList[0].warningLevel //默认是1个
|
||||
//物体数据绘制
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningDataList[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ---level = $level"
|
||||
"onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}"
|
||||
)
|
||||
when (data.warningMsg.warningDataList[0].status) {
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
//更新模型的颜色
|
||||
// 更新数据,模型变色的时候是不是update,如果不是更新,可能导致模型不变色,(add的时候,是否有level高的) TODO
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
}
|
||||
saveObuData(v2xType, alertContent, ttsContent)
|
||||
showWarning(v2xType, alertContent, ttsContent, direction)
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> {// 更新
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||
// 更新数据 TODO 删除原来的,改变颜色,删除marker。不影响别的模型添加
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
// 事件结束,还原交通参与者颜色
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
|
||||
//删除弱势交通元素
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
|
||||
}
|
||||
}
|
||||
|
||||
//预警status
|
||||
if (data.warningMsg != null && data.warningMsg.warningDataList != null && data.warningMsg.warningDataList.size > 0) {
|
||||
level = data.warningMsg.warningDataList[0].warningLevel //默认是1个
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningDataList[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ---level = $level"
|
||||
)
|
||||
when (data.warningMsg.warningDataList[0].status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
//更新模型的颜色
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
}
|
||||
saveObuData(v2xType, alertContent, ttsContent)
|
||||
showWarning(v2xType, alertContent, ttsContent, direction)
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> {// 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||
//删除弱势交通元素
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道
|
||||
*/
|
||||
override fun onObuMapMath(data: ObuScene.MapMatchData?) {
|
||||
if (data != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${(data.speedMaxLimit * 3.6).roundToInt()}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
UiThreadHandler.post {
|
||||
if (data.speedMaxLimit > 0) {
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
(data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
|
||||
)
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
if (data != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${(data.speedMaxLimit * 3.6).roundToInt()}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
UiThreadHandler.post {
|
||||
if (data.speedMaxLimit > 0) {
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
(data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
UiThreadHandler.post {
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
-1,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
UiThreadHandler.post {
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
-1,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -543,7 +572,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
* 获取消息的方位 车辆相关
|
||||
*/
|
||||
private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum {
|
||||
// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification")
|
||||
return when (targetClassification) {
|
||||
MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE,
|
||||
MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方
|
||||
@@ -589,7 +617,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
if (FunctionBuildConfig.isObuWarningFusionUnion) {
|
||||
alertContent = "前车距离过近"
|
||||
ttsContent = "前车距离过近"
|
||||
CallerObuWarningListenerManager.invokeTrackerFusionData(ObuManager.getInstance().obuRvToTrackedObject(info))
|
||||
CallerObuWarningListenerManager.invokeTrackerFusionData(
|
||||
ObuManager.getInstance().obuRvToTrackedObject(info)
|
||||
)
|
||||
} else {
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
||||
@@ -650,7 +680,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType
|
||||
if (
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
|
||||
@@ -68,7 +68,6 @@ dependencies {
|
||||
|
||||
// debugImplementation rootProject.ext.dependencies.debugleakcanary
|
||||
// releaseImplementation rootProject.ext.dependencies.releaseleakcanary
|
||||
implementation project(':libraries:mogo-obu')
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.map
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.MainThread
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.core.view.marginTop
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.map.hdcache.IHdCacheListener
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
/**
|
||||
* 离线地图缓存
|
||||
*/
|
||||
class OfflineMapDialog(context: Context): BaseFloatDialog(context) {
|
||||
|
||||
private var roundRootLayout: ConstraintLayout? = null
|
||||
private var offlineTitleView: TextView? = null
|
||||
private var leftView: TextView? = null
|
||||
private var rightView: TextView? = null
|
||||
private var okView: TextView? = null
|
||||
private var vertLineView: View? = null
|
||||
private var horizontalLineView: View? = null
|
||||
private var cacheTipView: TextView? = null
|
||||
|
||||
private var progressBar: ProgressBar? = null
|
||||
private var downloadPercentView: TextView? = null
|
||||
private var downloadResultImg: ImageView? = null
|
||||
|
||||
private var isLoading = false
|
||||
private var isConfirm = true
|
||||
private var isRetry = false
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_offline_map)
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
roundRootLayout = findViewById(R.id.roundRootLayout)
|
||||
offlineTitleView = findViewById(R.id.tv_cache_title)
|
||||
progressBar = findViewById(R.id.progressBar)
|
||||
downloadPercentView = findViewById(R.id.tvDownloadProgress)
|
||||
leftView = findViewById(R.id.tv_cache_confirm)
|
||||
rightView = findViewById(R.id.tv_cache_cancel)
|
||||
okView = findViewById(R.id.tv_cache_ok)
|
||||
vertLineView = findViewById(R.id.view_vertical_line)
|
||||
horizontalLineView = findViewById(R.id.view_horizontal_line)
|
||||
cacheTipView = findViewById(R.id.tv_cache_tips)
|
||||
downloadResultImg = findViewById(R.id.iv_download_Status)
|
||||
|
||||
leftView?.setOnClickListener {
|
||||
when {
|
||||
isConfirm -> {
|
||||
cacheHDOfflineData()
|
||||
showNewContent(isLoading = true, false)
|
||||
}
|
||||
else -> {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rightView?.setOnClickListener {
|
||||
when {
|
||||
isRetry -> {
|
||||
cacheHDOfflineData()
|
||||
}
|
||||
else -> {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
okView?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
private fun cacheHDOfflineData() {
|
||||
CallerMapUIServiceManager.cacheHDDataByCity(object : IHdCacheListener {
|
||||
override fun onMapHdCacheProgress(cityId: Int, progress: Double) {
|
||||
updateProgress(progress.toInt())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateProgress(progress: Int) {
|
||||
if (this@OfflineMapDialog.isShowing) {
|
||||
progressBar?.let {
|
||||
if (it.visibility == View.VISIBLE) {
|
||||
it.progress = if (progress in 1..5) 5 else progress
|
||||
}
|
||||
}
|
||||
downloadPercentView?.text = "$progress%"
|
||||
if (progress == 100) {
|
||||
showNewContent(isLoading = false, true)
|
||||
CallerHmiManager.updateHDDataCacheStatus(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun change2NewStyle() {
|
||||
roundRootLayout?.layoutParams?.width = AutoSizeUtils.dp2px(context, 1110f)
|
||||
roundRootLayout?.layoutParams?.height = AutoSizeUtils.dp2px(context, 668f)
|
||||
|
||||
val titleParams = offlineTitleView?.layoutParams as ConstraintLayout.LayoutParams
|
||||
titleParams.topMargin = AutoSizeUtils.dp2px(context, 51f)
|
||||
|
||||
val horizontalLineParams = horizontalLineView?.layoutParams as ConstraintLayout.LayoutParams
|
||||
horizontalLineParams.topMargin = AutoSizeUtils.dp2px(context, 374f)
|
||||
|
||||
progressBar?.visibility = View.VISIBLE
|
||||
downloadPercentView?.visibility = View.VISIBLE
|
||||
okView?.visibility = View.VISIBLE
|
||||
|
||||
vertLineView?.visibility = View.GONE
|
||||
leftView?.visibility = View.GONE
|
||||
rightView?.visibility = View.GONE
|
||||
cacheTipView?.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
private fun showNewContent(isLoading: Boolean, isSuccess: Boolean) {
|
||||
change2NewStyle()
|
||||
when {
|
||||
isLoading -> {
|
||||
okView?.text = context.resources.getString(R.string.cancel)
|
||||
offlineTitleView?.text = context.resources.getString(R.string.offline_downloading)
|
||||
downloadResultImg?.visibility = View.GONE
|
||||
}
|
||||
else -> {
|
||||
downloadResultImg?.visibility = View.VISIBLE
|
||||
when {
|
||||
isSuccess -> {
|
||||
okView?.visibility = View.VISIBLE
|
||||
okView?.text = context.resources.getString(R.string.ok_tip)
|
||||
offlineTitleView?.text = context.resources.getString(R.string.offline_download_success)
|
||||
progressBar?.visibility = View.GONE
|
||||
downloadPercentView?.visibility = View.GONE
|
||||
downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_success_icon)
|
||||
}
|
||||
else -> {
|
||||
offlineTitleView?.text = context.resources.getString(R.string.offline_download_failure)
|
||||
okView?.visibility = View.GONE
|
||||
progressBar?.visibility = View.GONE
|
||||
downloadPercentView?.visibility = View.GONE
|
||||
leftView?.visibility = View.VISIBLE
|
||||
rightView?.visibility = View.VISIBLE
|
||||
vertLineView?.visibility = View.VISIBLE
|
||||
rightView?.text = context.resources.getString(R.string.retry)
|
||||
downloadResultImg?.background = ContextCompat.getDrawable(context, R.drawable.download_fail_icon)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,9 +73,6 @@ import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.support.obu.MogoObuManager
|
||||
import com.mogo.support.obu.constants.MogoObuLogLevel
|
||||
import com.mogo.support.obu.option.MogoObuLog
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
import kotlinx.coroutines.launch
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -1204,14 +1201,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
* 设置是否输出OBU日志 true-打印日志,false-不打印日志
|
||||
*/
|
||||
tbObuLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
MogoObuManager.getInstance().setEnableLog(isChecked)
|
||||
|
||||
val builder: com.mogo.support.obu.option.MogoObuLog.Builder =
|
||||
MogoObuLog.newBuilder().setEnableStdio(isChecked)
|
||||
if (isChecked) {
|
||||
builder.setStdioLevel(MogoObuLogLevel.DBG)
|
||||
}
|
||||
MogoObuManager.getInstance().logConfig(builder.build())
|
||||
CallerObuApiManager.setObuLog(isChecked)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,18 +95,19 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
/**
|
||||
* obu V2V开关
|
||||
* obu V2V开关,默认打开
|
||||
*/
|
||||
tbObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView
|
||||
tbObuV2vView.setOnCheckedChangeListener { _, isChecked ->
|
||||
// 默认关闭
|
||||
HmiBuildConfig.isShowObuV2vView = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
* obu V2i开关
|
||||
* obu V2i开关,默认打开
|
||||
*/
|
||||
tbObuV2iView.isChecked = HmiBuildConfig.isShowObuV2iView
|
||||
tbObuV2iView.setOnCheckedChangeListener { _, isChecked ->
|
||||
// 默认关闭
|
||||
HmiBuildConfig.isShowObuV2iView = isChecked
|
||||
}
|
||||
|
||||
@@ -174,7 +175,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
//OBU控制总开关
|
||||
tbObu.isChecked = CallerObuApiManager.isConnected()
|
||||
tbObu.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) {
|
||||
if (isChecked) {
|
||||
CallerObuApiManager.resetObuIpAddress("192.168.1.199")
|
||||
} else {
|
||||
//断开链接
|
||||
|
||||
@@ -184,6 +184,10 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
}
|
||||
|
||||
fun updateHDDataCacheStatus(isCached: Boolean) {
|
||||
systemVersionView?.updateHDDataCacheStatus(isCached)
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
|
||||
@@ -10,10 +10,15 @@ import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.bindingcar.IMoGoBindingCarListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingCarListenerManager
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.map.OfflineMapDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
@@ -50,6 +55,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间
|
||||
private var currentProgress: Int = -1 //当前已下载包体大小
|
||||
|
||||
private var isHDCached = false
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_system_version, this, true)
|
||||
initView()
|
||||
@@ -135,6 +142,16 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
|
||||
}
|
||||
|
||||
ivHDCache.setOnClickListener {
|
||||
if (isHDCached) {// 已缓存
|
||||
ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
|
||||
} else {// 未缓存
|
||||
OfflineMapDialog(context).show()
|
||||
}
|
||||
}
|
||||
|
||||
updateHDDataCacheStatus(CallerMapUIServiceManager.isCityDataCached())
|
||||
|
||||
if(AdUpgradeStateHelper.isConfirmUpgrade()){
|
||||
//将角标改为“下载中”
|
||||
ivAdStatus?.setImageResource(R.drawable.icon_downloading)
|
||||
@@ -239,6 +256,15 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
|
||||
}
|
||||
|
||||
fun updateHDDataCacheStatus(isCached: Boolean) {
|
||||
if (isCached) {
|
||||
ivHDCacheStatus?.setImageResource(R.drawable.icon_latest_version)
|
||||
} else {
|
||||
ivHDCacheStatus?.setImageResource(R.drawable.icon_be_updated)
|
||||
}
|
||||
isHDCached = isCached
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示当前鹰眼版本
|
||||
*/
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 设置背景色 -->
|
||||
<item android:id="@android:id/background">
|
||||
<shape>
|
||||
<corners android:radius="21dp" />
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<stroke android:color="#7CF6FF" android:width="2dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- <item android:id="@android:id/secondaryProgress"-->
|
||||
<!-- android:start="1.5dp"-->
|
||||
<!-- android:end="1.5dp"-->
|
||||
<!-- android:top="1.5dp"-->
|
||||
<!-- android:bottom="1.5dp"-->
|
||||
<!-- >-->
|
||||
<!-- <scale android:scaleWidth="100%">-->
|
||||
<!-- <shape>-->
|
||||
<!-- <corners android:radius="21dp" />-->
|
||||
<!-- <solid android:color="@android:color/holo_green_light" />-->
|
||||
<!-- </shape>-->
|
||||
<!-- </scale>-->
|
||||
<!-- </item>-->
|
||||
|
||||
<!-- 设置进度条颜色 -->
|
||||
<item android:id="@android:id/progress"
|
||||
android:start="2dp"
|
||||
android:end="2dp"
|
||||
android:top="2dp"
|
||||
android:bottom="2dp"
|
||||
>
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="21dp" />
|
||||
<gradient
|
||||
android:angle="0"
|
||||
android:endColor="#00E5FF"
|
||||
android:startColor="#374171" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/roundRootLayout"
|
||||
android:layout_width="840dp"
|
||||
android:layout_height="488dp"
|
||||
android:background="@color/dialog_bg_color_90_percent"
|
||||
app:roundLayoutRadius="32dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cache_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="66dp"
|
||||
android:text="@string/offline_map_cache_tip"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="56dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cache_tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="52dp"
|
||||
android:text="@string/cache_offline_map_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="43dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_cache_title" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="800dp"
|
||||
android:layout_height="42dp"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_cache_title"
|
||||
android:layout_marginTop="113dp"
|
||||
android:max="100"
|
||||
android:progress="0"
|
||||
android:progressDrawable="@drawable/progressbar_corner_bg"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDownloadProgress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/progressBar"
|
||||
android:layout_marginTop="50dp"
|
||||
android:text="0%"
|
||||
android:textColor="#06D1ED"
|
||||
android:textSize="43dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_download_Status"
|
||||
android:layout_width="174dp"
|
||||
android:layout_height="174dp"
|
||||
android:layout_marginTop="96dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_cache_title"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_horizontal_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_marginTop="205dp"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_cache_title" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_vertical_line"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cache_confirm"
|
||||
android:layout_width="419dp"
|
||||
android:layout_height="137dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/confirm"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/view_vertical_line"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cache_cancel"
|
||||
android:layout_width="419dp"
|
||||
android:layout_height="137dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/cancel"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/view_vertical_line"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cache_ok"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/ok_tip"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="46dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/view_vertical_line"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_horizontal_line" />
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -203,11 +203,13 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
|
||||
/>
|
||||
|
||||
<!--已经有策略,开关去掉-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRoadLimitSpeedSop"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="获取路侧限速提醒"
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAdStatus"
|
||||
android:layout_width="120dp"
|
||||
@@ -120,4 +119,27 @@
|
||||
android:textSize="32dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivHDCache"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:layout_constraintTop_toTopOf="@id/ivAdVersion"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivAdVersion"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="680dp"
|
||||
android:src="@drawable/icon_hd_map"
|
||||
android:padding="12dp"
|
||||
android:background="@drawable/version_latest_background"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivHDCacheStatus"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="50dp"
|
||||
android:src="@drawable/icon_be_updated"
|
||||
app:layout_constraintCircle="@id/ivHDCache"
|
||||
app:layout_constraintCircleAngle="50"
|
||||
app:layout_constraintCircleRadius="90dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -71,7 +71,5 @@
|
||||
|
||||
<color name="hmi_check_keyboard_input_field">#FF282F62</color>
|
||||
<color name="bus_autopilot_text_color_normal">#FFFFFF</color>
|
||||
|
||||
|
||||
|
||||
<color name="dialog_bg_color_90_percent">#E63B4577</color>
|
||||
</resources>
|
||||
@@ -65,4 +65,12 @@
|
||||
<string name="dispatch_cars_remind_content">车辆将开启自动驾驶,并行驶至:</string>
|
||||
<string name="dispatch_cars_affirm">确认</string>
|
||||
<string name="dispatch_cars_cancel">取消</string>
|
||||
<string name="offline_map_cache_tip">离线地图缓存提醒</string>
|
||||
<string name="cache_offline_map_content">是否缓存最新版本离线地图?</string>
|
||||
<string name="offline_downloading">离线地图下载中</string>
|
||||
<string name="offline_download_success">离线地图下载成功</string>
|
||||
<string name="offline_download_failure">离线地图下载失败</string>
|
||||
<string name="offline_had_downloaded">当前已为最新版本</string>
|
||||
<string name="ok_tip">确定</string>
|
||||
<string name="retry">重试</string>
|
||||
</resources>
|
||||
|
||||
@@ -61,14 +61,14 @@ object HmiBuildConfig {
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var isShowObuV2vView = false
|
||||
var isShowObuV2vView = true
|
||||
|
||||
/**
|
||||
* 是否展示obu的v2i
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var isShowObuV2iView = false
|
||||
var isShowObuV2iView = true
|
||||
|
||||
/**
|
||||
* 是否展示obu通过工控机展示的v2i
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
package com.mogo.eagle.core.data.msgbox
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
* 运营消息:-1表示初始值
|
||||
*/
|
||||
data class OperationMsg(val timestamp : Long, val content: String, val type: Int = -1): Serializable
|
||||
data class OperationMsg(val timestamp : Long, val content: String, val type: Int = -1): Serializable {
|
||||
init {
|
||||
if (content.isEmpty()) {
|
||||
CallerLogger.e("MsgBox", Log.getStackTraceString(Throwable()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.data.msgbox
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import java.io.Serializable
|
||||
|
||||
data class V2XMsg(var type: String = "", var content: String? = "", var tts: String? = ""): Serializable {
|
||||
@@ -9,5 +11,8 @@ data class V2XMsg(var type: String = "", var content: String? = "", var tts: Str
|
||||
|
||||
init {
|
||||
timeStamp = System.currentTimeMillis()
|
||||
if (content.isNullOrEmpty()) {
|
||||
CallerLogger.e("MsgBox", Log.getStackTraceString(Throwable()))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,6 @@ package com.mogo.eagle.core.data.obu
|
||||
* @date 2021/9/30 5:38 下午
|
||||
*/
|
||||
class ObuStatusInfo {
|
||||
/**
|
||||
* 当前链接的IP地址, 默认地址 192.168.1.199
|
||||
*/
|
||||
var connectIP: String = "192.168.1.199"
|
||||
|
||||
/**
|
||||
* OBU SDK 版本
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.eagle.core.function.api.hmi.warning
|
||||
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/2 7:36 下午
|
||||
*/
|
||||
interface IMoGoWaringProvider : IMoGoHmiViewProxy {
|
||||
fun updateHDDataCacheStatus(isCached: Boolean)
|
||||
}
|
||||
@@ -14,4 +14,6 @@ interface IMoGoObuProvider : IMoGoFunctionServerProvider {
|
||||
fun disConnect()
|
||||
|
||||
fun isConnected(): Boolean
|
||||
|
||||
fun setObuLog(isChecked: Boolean)
|
||||
}
|
||||
@@ -212,4 +212,7 @@ object CallerHmiManager {
|
||||
hmiProviderApi?.updateStatusBarDownloadView(insert, tag, progress)
|
||||
}
|
||||
|
||||
fun updateHDDataCacheStatus(isCached: Boolean) {
|
||||
waringProviderApi?.updateHDDataCacheStatus(isCached)
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,9 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapService
|
||||
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.map.location.IMogoGDLocationClient
|
||||
import com.mogo.map.hdcache.IHdCacheListener
|
||||
import com.mogo.map.listener.IMogoHosListenerRegister
|
||||
import com.mogo.map.location.IMogoLocationClient
|
||||
import com.mogo.map.marker.IMogoMarkerManager
|
||||
import com.mogo.map.overlay.IMogoOverlayManager
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
@@ -30,6 +32,14 @@ object CallerMapUIServiceManager {
|
||||
return serviceProvider?.markerService
|
||||
}
|
||||
|
||||
fun cacheHDDataByCity(listener: IHdCacheListener) {
|
||||
serviceProvider?.mapUIController?.cacheHDDataByCity(listener)
|
||||
}
|
||||
|
||||
fun isCityDataCached(): Boolean {
|
||||
return serviceProvider?.mapUIController?.isCityDataCached ?: true
|
||||
}
|
||||
|
||||
fun getOverlayManager(): IMogoOverlayManager?{
|
||||
return serviceProvider?.overlayManager
|
||||
}
|
||||
|
||||
@@ -40,4 +40,11 @@ object CallerObuApiManager {
|
||||
return providerApi.isConnected()
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置obu sdk的 日志
|
||||
*/
|
||||
fun setObuLog(isSet: Boolean) {
|
||||
providerApi.setObuLog(isSet)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.4.2
|
||||
MOGO_TELEMATIC_VERSION=1.4.4.2
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.10.0.2_test_01
|
||||
MAP_SDK_VERSION=2.10.0.2
|
||||
MAP_SDK_OPERATION_VERSION=1.1.4.1
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.mogo.map.hdcache
|
||||
|
||||
interface IHdCacheListener {
|
||||
fun onMapHdCacheProgress(cityId: Int, progress: Double)
|
||||
}
|
||||
@@ -9,6 +9,9 @@ import androidx.annotation.RawRes;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
import java.util.List;
|
||||
@@ -348,4 +351,11 @@ public interface IMogoMapUIController {
|
||||
* @param color // color:"#RRGGBB*
|
||||
*/
|
||||
void setPointCloudColor(String color);
|
||||
void cacheHDDataByCity(IHdCacheListener listener);
|
||||
|
||||
/**
|
||||
* 当前城市离线数据是否已缓存
|
||||
* @return
|
||||
*/
|
||||
boolean isCityDataCached();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -40,13 +41,17 @@ import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.location.GDLocationClient;
|
||||
import com.mogo.map.navi.MogoCarLocationChangedListenerRegister;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.map.utils.HDMapUtils;
|
||||
import com.mogo.map.utils.MogoMapUtils;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.mogo.map.utils.ResIdCache;
|
||||
@@ -64,6 +69,7 @@ import com.zhidaoauto.map.sdk.open.business.PointCloudHelper;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory;
|
||||
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds;
|
||||
import com.zhidaoauto.map.sdk.open.data.CityInfo;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationClient;
|
||||
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
|
||||
@@ -115,6 +121,8 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private boolean mIsFirstLocated = true;
|
||||
private boolean mIsDelayed = false;
|
||||
|
||||
private IHdCacheListener hdCacheListener;
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--AMapViewWrapper: init");
|
||||
this.mMapView = mMapView;
|
||||
@@ -1035,4 +1043,47 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void cacheHDDataByCity(IHdCacheListener listener) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode();
|
||||
Integer id = HDMapUtils.getHDCityCode(gdCityCode);
|
||||
if (id != null) {
|
||||
hdCacheListener = listener;
|
||||
mMapView.getMapAutoViewHelper().cacheHDDataByCity(id, (cityId, progress) -> {
|
||||
if (Thread.currentThread() == Looper.getMainLooper().getThread()) {
|
||||
if (hdCacheListener != null) {
|
||||
hdCacheListener.onMapHdCacheProgress(cityId, progress * 100);
|
||||
}
|
||||
} else {
|
||||
UiThreadHandler.post(() -> {
|
||||
if (hdCacheListener != null) {
|
||||
hdCacheListener.onMapHdCacheProgress(cityId, progress * 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCityDataCached() {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
String gdCityCode = GDLocationClient.getInstance(getContext()).getLastCityCode();
|
||||
Integer id = HDMapUtils.getHDCityCode(gdCityCode);
|
||||
if (id != null) {
|
||||
List<CityInfo> cityInfoList = mMapView.getMapAutoViewHelper().getAllCityCode();
|
||||
if (cityInfoList != null) {
|
||||
for (CityInfo cityInfo : cityInfoList) {
|
||||
if (id == cityInfo.getCityCode()) {
|
||||
return cityInfo.isCache;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package com.mogo.map;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
@@ -449,4 +451,19 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.setPointCloudColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cacheHDDataByCity(IHdCacheListener listener) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.cacheHDDataByCity(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCityDataCached() {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.isCityDataCached();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
|
||||
@@ -389,4 +390,19 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
mClient.setPointCloudColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cacheHDDataByCity(IHdCacheListener listener) {
|
||||
if (mClient != null) {
|
||||
mClient.cacheHDDataByCity(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCityDataCached() {
|
||||
if (mClient != null) {
|
||||
return mClient.isCityDataCached();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.mogo.map.utils
|
||||
|
||||
object HDMapUtils {
|
||||
private val cityCodeMap by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
val map = HashMap<String, Int>()
|
||||
// TODO:("高精地图自己去做")
|
||||
map["0831"] = 5115// 宜宾市
|
||||
map["0512"] = 3205// 苏州市
|
||||
map["0872"] = 5329// 大理市
|
||||
map["0711"] = 4207// 鄂州市
|
||||
map["028"] = 5101// 成都市
|
||||
map["0931"] = 6201// 兰州市
|
||||
map["0535"] = 3706// 烟台市
|
||||
map["027"] = 4201// 武汉市
|
||||
map["010"] = 1101// 北京市
|
||||
map["0734"] = 4304// 衡阳市
|
||||
map
|
||||
}
|
||||
|
||||
/**
|
||||
* gdCityCode: 高德CityCode
|
||||
* return: 高精地图CityCode
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getHDCityCode(gdCityCode: String?): Int? {
|
||||
return cityCodeMap[gdCityCode]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user