整理代码
This commit is contained in:
@@ -8,7 +8,6 @@ import com.mogo.module.obu.mogo.map.ObuRecognizedResultDrawer
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
import com.mogo.service.warning.IMoGoWaringProvider
|
||||
import com.mogo.utils.UiThreadHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.zhidao.support.obu.MogoObuManager
|
||||
import com.zhidao.support.obu.OnMogoObuListener
|
||||
@@ -126,56 +125,48 @@ class MogoPrivateObuManager private constructor() {
|
||||
//红绿灯
|
||||
override fun onCvxIvpThreatIndInfo(info: CvxIvpThreatIndInfo?) {
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "CvxIvpThreatIndInfo ------> $info")
|
||||
}
|
||||
|
||||
// 弱势交通预警
|
||||
override fun onCvxPtcInfoIndInfo(info: CvxPtcInfoIndInfo?) {
|
||||
super.onCvxPtcInfoIndInfo(info)
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxPtcInfoIndInfo ------> $info")
|
||||
info?.let {
|
||||
when (info.status) {
|
||||
// 删除
|
||||
2 -> {
|
||||
|
||||
// 添加
|
||||
ObuConstants.STATUS.ADD -> {
|
||||
info.ext_info.lights.forEach {
|
||||
when (it.phase) {
|
||||
// 灯光不可用
|
||||
0x0 -> {
|
||||
mIMoGoWaringProvider?.showWarningTrafficLight(0)
|
||||
}
|
||||
// 红灯
|
||||
0x1 -> {
|
||||
mIMoGoWaringProvider?.showWarningTrafficLight(1)
|
||||
}
|
||||
// 绿灯
|
||||
0x2 -> {
|
||||
mIMoGoWaringProvider?.showWarningTrafficLight(3)
|
||||
}
|
||||
// 黄灯
|
||||
0x3 -> {
|
||||
mIMoGoWaringProvider?.showWarningTrafficLight(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
ObuConstants.STATUS.DELETE -> {
|
||||
mIMoGoWaringProvider?.disableWarningTrafficLight()
|
||||
}
|
||||
// 添加\更新
|
||||
else -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 限速预警信息
|
||||
override fun onCvxSlwThreatIndInfo(info: CvxSlwThreatIndInfo?) {
|
||||
super.onCvxSlwThreatIndInfo(info)
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxSlwThreatIndInfo ------> $info")
|
||||
info?.let {
|
||||
when (info.status) {
|
||||
// 删除
|
||||
2 -> {
|
||||
mIMoGoWaringProvider?.disableLimitingVelocity()
|
||||
}
|
||||
// 添加\更新
|
||||
else -> {
|
||||
mIMoGoWaringProvider?.showLimitingVelocity(info.ext_info.speed_limit_max.toInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 红绿灯信息
|
||||
// 地图红绿灯信息
|
||||
override fun onCvxMapSpatInfoIndInfo(info: CvxMapSpatInfoIndInfo?) {
|
||||
super.onCvxMapSpatInfoIndInfo(info)
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxMapSpatInfoIndInfo ------> $info")
|
||||
info?.let {
|
||||
when (info.status) {
|
||||
// 删除红绿灯
|
||||
2 -> {
|
||||
mIMoGoWaringProvider?.disableWarningTrafficLight()
|
||||
}
|
||||
// 添加\更新
|
||||
else -> {
|
||||
// 添加
|
||||
ObuConstants.STATUS.ADD -> {
|
||||
info.ivp_threat_ext.lights.forEach {
|
||||
when (it.phase) {
|
||||
// 灯光不可用
|
||||
@@ -197,6 +188,55 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除红绿灯
|
||||
ObuConstants.STATUS.DELETE -> {
|
||||
mIMoGoWaringProvider?.disableWarningTrafficLight()
|
||||
}
|
||||
// 更新
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 弱势交通预警
|
||||
override fun onCvxPtcInfoIndInfo(info: CvxPtcInfoIndInfo?) {
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxPtcInfoIndInfo ------> $info")
|
||||
info?.let {
|
||||
when (info.status) {
|
||||
// 添加
|
||||
ObuConstants.STATUS.ADD -> {
|
||||
|
||||
}
|
||||
// 删除
|
||||
ObuConstants.STATUS.DELETE -> {
|
||||
|
||||
}
|
||||
// 更新
|
||||
else -> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 限速预警信息
|
||||
override fun onCvxSlwThreatIndInfo(info: CvxSlwThreatIndInfo?) {
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxSlwThreatIndInfo ------> $info")
|
||||
info?.let {
|
||||
when (info.status) {
|
||||
// 添加
|
||||
ObuConstants.STATUS.ADD -> {
|
||||
mIMoGoWaringProvider?.showLimitingVelocity(info.ext_info.speed_limit_max.toInt())
|
||||
}
|
||||
// 删除
|
||||
ObuConstants.STATUS.DELETE -> {
|
||||
mIMoGoWaringProvider?.disableLimitingVelocity()
|
||||
}
|
||||
// 更新
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user