修改红绿灯的显示

This commit is contained in:
lixiaopeng
2021-09-15 14:48:02 +08:00
committed by 董宏宇
parent f4a9980024
commit 9796e46703
2 changed files with 12 additions and 12 deletions

View File

@@ -80,11 +80,11 @@ class TrafficLightView @JvmOverloads constructor(
changeCountdownRed(greenNum)
}
fun changeCountdownGreen(readNum: Int) {
if (readNum > 0) {
ctvRedTrafficLight.text = "$readNum"
fun changeCountdownGreen(greenNum: Int) {
if (greenNum > 0) {
ctvGreenTrafficLight.text = "$greenNum"
} else {
ctvRedTrafficLight.text = ""
ctvGreenTrafficLight.text = ""
}
}
@@ -96,11 +96,11 @@ class TrafficLightView @JvmOverloads constructor(
}
}
fun changeCountdownRed(greenNum: Int) {
if (greenNum > 0) {
ctvGreenTrafficLight.text = "$greenNum"
fun changeCountdownRed(redNum: Int) {
if (redNum > 0) {
ctvRedTrafficLight.text = "$redNum"
} else {
ctvGreenTrafficLight.text = ""
ctvRedTrafficLight.text = ""
}
}

View File

@@ -51,10 +51,10 @@ class ObuRsuTestTriggerReceiver : BroadcastReceiver() {
cvxIvpThreatIndInfo.threat_info = ivpThreat
val lightList = listOf(
Light(1, 0x0, 1000, 100, 6000, 3000, 100, 1000),
Light(1, 0x1, 1000, 100, 6000, 3000, 100, 1000),
Light(1, 0x2, 1000, 100, 6000, 3000, 100, 1000),
Light(1, 0x3, 1000, 100, 6000, 3000, 100, 1000)
Light(1, 0x0, 1000, 3000, 6000, 3000, 100, 1000),
Light(1, 0x1, 1000, 3000, 6000, 3000, 100, 1000),
Light(1, 0x2, 1000, 3000, 6000, 3000, 100, 1000),
Light(1, 0x3, 1000, 3000, 6000, 3000, 100, 1000)
)
val ivpThreatExt = IvpThreatExt(1, 1000, 1000, 0, indicator, lightList)
cvxIvpThreatIndInfo.ext_info = ivpThreatExt