upgrade obu version
This commit is contained in:
@@ -295,7 +295,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
info.threat_info.app_id,
|
||||
info.status,
|
||||
info.ext_info.lights,
|
||||
info.ext_info.getLightIndex()
|
||||
info.ext_info.index
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -477,17 +477,17 @@ class MogoPrivateObuManager private constructor() {
|
||||
/**
|
||||
* 处理红绿灯
|
||||
*/
|
||||
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<Light>, indicator: Int) {
|
||||
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<Light>, index: Int) {
|
||||
LogUtils.dTag(
|
||||
MogoObuConst.TAG_MOGO_OBU,
|
||||
"handlerTrafficLight appId = $appId --- status = $status ---indicator = $indicator ---lights.size = ${lights.size} ---lights = $lights "
|
||||
"handlerTrafficLight appId = $appId --- status = $status ---index = $index ---lights.size = ${lights.size} ---lights = $lights "
|
||||
)
|
||||
when (status) {
|
||||
// 添加
|
||||
ObuConstants.STATUS.ADD,
|
||||
ObuConstants.STATUS.UPDATE
|
||||
-> {
|
||||
changeTrafficLightStatus(appId, lights, indicator)
|
||||
changeTrafficLightStatus(appId, lights, index)
|
||||
}
|
||||
// 删除
|
||||
ObuConstants.STATUS.DELETE -> {
|
||||
@@ -507,16 +507,16 @@ class MogoPrivateObuManager private constructor() {
|
||||
private fun changeTrafficLightStatus(
|
||||
appId: Int,
|
||||
lights: List<Light>,
|
||||
indicator: Int
|
||||
index: Int
|
||||
) {
|
||||
var ttsContent = ""
|
||||
var alertContent = ""
|
||||
//这里需要根据真实数据确定 indicator 取值方式
|
||||
if (indicator != -1 && lights.size >= indicator) {
|
||||
val currentLight = lights[0]
|
||||
//这里需要根据真实数据确定 index 取值方式
|
||||
if (index != -1 && lights.size >= index) {
|
||||
val currentLight = lights[index]
|
||||
LogUtils.dTag(
|
||||
MogoObuConst.TAG_MOGO_OBU,
|
||||
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phase} --- indicator = $indicator ---appId = $appId"
|
||||
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phase} --- index = $index ---appId = $appId"
|
||||
)
|
||||
when (currentLight.phase) {
|
||||
// 灯光不可用
|
||||
|
||||
Reference in New Issue
Block a user