This commit is contained in:
wangcongtao
2020-06-29 10:28:32 +08:00
2 changed files with 17 additions and 1 deletions

View File

@@ -33,7 +33,7 @@ object MockUtil {
intervalObs = Observable.interval(5000,TimeUnit.MILLISECONDS).map {
it.toString()
}.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe {
val random = Random.nextInt(0, 3)
val random = Random.nextInt(0, 4)
Logger.d(TAG, "random====$random")
val carEventInfo = CarEventInfo()
when (random) {
@@ -63,6 +63,17 @@ object MockUtil {
carEventInfo.describe = "这个应该是随便写,反正也不用"
dataCallback.showCarEventInfo(carEventInfo)
}
3 -> {
// vip变灯提醒
carEventInfo.type = "vip变灯提醒"
carEventInfo.typeCode = "vip变灯提醒"
val r = Random.nextInt(0, 2)
carEventInfo.describe = when (r) {
0 -> "已更改前方红绿灯状态,可优先通行"
else -> "已增加前方绿灯时间,可优先通行"
}
dataCallback.showCarEventInfo(carEventInfo)
}
else->{
// 其他,不处理
}

View File

@@ -30,4 +30,9 @@ public class ObuConstant {
* 行人碰撞预警
*/
public static final int TYPE_ROAD_USER_COLLISION_WARNING = 115;
/**
* 为vip车辆变灯提醒
*/
public static final int TYPE_CHANGE_LIGHT_FOR_VIP = 116;
}