обновление бизнес логики

This commit is contained in:
2026-02-05 18:53:25 +03:00
parent f275db88c9
commit 44473a8d9d
24 changed files with 712 additions and 5397 deletions

View File

@@ -59,11 +59,24 @@ export const getSensorIdFromMesh = (m: AbstractMesh | null): string | null => {
return null
}
export const collectSensorMeshes = (meshes: AbstractMesh[]): AbstractMesh[] => {
export const collectSensorMeshes = (
meshes: AbstractMesh[],
sensorStatusMap?: Record<string, string> | null
): AbstractMesh[] => {
const result: AbstractMesh[] = []
for (const m of meshes) {
const sid = getSensorIdFromMesh(m)
if (sid) result.push(m)
if (sid) {
// Если передана карта статусов - фильтруем только по датчикам из неё
if (sensorStatusMap) {
if (sid in sensorStatusMap) {
result.push(m)
}
} else {
// Если карта не передана - возвращаем все датчики (старое поведение)
result.push(m)
}
}
}
return result
}