[2.13.0]notice push data to msgbox and provider the call of hmi

This commit is contained in:
zhongchao
2022-11-28 17:31:50 +08:00
parent 12cffa44f7
commit 636b29b127
11 changed files with 112 additions and 139 deletions

View File

@@ -30,6 +30,11 @@ object TrackerSourceColorHelper {
trackIPCFilter = false
}
}
4 -> {
if(isV2nRSM(data).second){
trackIPCFilter = false
}
}
}
return trackIPCFilter
}
@@ -46,7 +51,7 @@ object TrackerSourceColorHelper {
color = "#00AEFFFF"
}
//等级最高
//level : 2
if (isObu(data).second) {
color = "#36D3FEFF"
// obu预警
@@ -58,6 +63,11 @@ object TrackerSourceColorHelper {
}
}
//融合结果 level : 1
if (isFusion(data)) {
color = "#9900ffFF"
}
// pnc预警
WarningHelper.getPncColor(data.uuid.toString()) {
if (it.isNotBlank()) {
@@ -82,6 +92,13 @@ object TrackerSourceColorHelper {
}
}
/**
* 是否为融合数据,融合数据来源size >=2
*/
fun isFusion(data: TrackedObject): Boolean {
return data.trackedSourceList.size > 1
}
/**
* any match 任何一个匹配到OBU则认为是存在obu数据
*/
@@ -140,4 +157,34 @@ object TrackerSourceColorHelper {
}
/**
* 过滤所有 v2n 感知数据 all match
*/
@SuppressLint("NewApi")
fun isV2nRSM(data: TrackedObject): Pair<SubSource?, Boolean> {
if (data.trackedSourceList.size == 1) { // 如果仅有一个类型
val source = data.trackedSourceList.stream().allMatch { it.source == 2 }
if (source) {
val first = data.trackedSourceList.stream()
.filter { trackedSource: TrackedSource -> trackedSource.source == 2 }
.findFirst()
if (first.isPresent) {
val subV2nRSM = first.get().subSourceList.stream().allMatch {
it.source == 4
}
if (subV2nRSM) {
val subFirst = first.get().subSourceList.stream()
.filter { subSource: SubSource -> subSource.source == 4 }
.findFirst()
if (subFirst.isPresent) {
return Pair(subFirst.get(), true)
}
}
}
}
}
return Pair(null, false)
}
}