warning system

This commit is contained in:
Siwat Sirichai 2025-06-21 13:29:01 +07:00
parent 5e029ff99c
commit 0c5c7bcb5f
10 changed files with 1074 additions and 54 deletions

24
types/sensor.ts Normal file
View file

@ -0,0 +1,24 @@
export interface SensorConfig {
id: string;
x: number;
y: number;
zone: string;
label: string;
pin?: number;
warningThreshold: number;
alarmThreshold: number;
warningDelayMs: number; // Duration in milliseconds before warning escalates to alarm
baseNoise?: number; // For hardware sensors - noise level for analog conversion
}
export interface SensorThresholds {
warningThreshold: number;
alarmThreshold: number;
warningDelayMs: number;
}
export interface SensorZoneConfig {
zone: string;
defaultThresholds: SensorThresholds;
description: string;
}