Thème
Superviseur — Frontend v0.14.0
Superviseur — Frontend / features/panel/panel.store / usePanelStore
Variable: usePanelStore
ts
const usePanelStore: StoreDefinition<"panel", Pick<{
configurations: Ref<object[],
| StationConfiguration[]
| object[]>;
profiles: Ref<object[],
| ModbusProfile[]
| object[]>;
liveStates: Ref<Record<string, FireStationSystem>, Record<string, FireStationSystem>>;
panelStates: Ref<Record<string, PanelSnapshot>, Record<string, PanelSnapshot>>;
selectedStationId: Ref<string | null, string | null>;
selectedPanelId: ComputedRef<string | number | null>;
currentConfig: ComputedRef<
| {
id?: string | number;
name: string;
systemSerialNumber?: string;
label: string;
connectionType?: "Tcp" | "Rtu";
ipAddress?: string;
port?: number;
serialPortName?: string;
baudRate?: number;
dataBits?: number;
parity?: number;
stopBits?: number;
pollingIntervalMilliseconds: number;
slaveId: number;
panelType: PanelType;
color: string;
modbusMapping: string;
modbusProfileId: string;
zones: object[];
points?: object[];
rawConfiguration?: string;
}
| undefined>;
panelState: ComputedRef<
| FireStationSystem
| null>;
apiConnected: Ref<boolean, boolean>;
modbusConnected: Ref<boolean, boolean>;
isConfigurationMode: ComputedRef<boolean>;
systemStatus: ComputedRef<
| {
text: "apiDisconnected";
color: string;
}
| {
text: "normal";
color: string;
}
| {
text: "disconnected";
color: string;
}
| {
text: "evacuation";
color: string;
}
| {
text: "emissionExt";
color: string;
}
| {
text: "manualTrigger";
color: string;
}
| {
text: "fireAlarm";
color: string;
}
| {
text: "fault";
color: string;
}>;
activeAlerts: ComputedRef<object[]>;
allActiveAlerts: ComputedRef<Alert[]>;
activeAlertsCount: ComputedRef<number>;
allActiveAlertsCount: ComputedRef<number>;
isGlobalEvacuationActive: ComputedRef<boolean>;
connectionStatus: ComputedRef<{
api: {
connected: boolean;
text: string;
color: string;
};
modbus: {
connected: boolean | undefined;
text: string;
color: string;
};
}>;
systemIssues: ComputedRef<SystemIssue[]>;
lastDataChange: Ref<number, number>;
isFleetHealthy: ComputedRef<boolean>;
setPanelState: (newState) => void;
switchPanel: (id) => void;
addPanel: (config) => Promise<void>;
removePanel: (dbId) => Promise<void>;
loadConfigurations: () => Promise<void>;
loadInitialData: () => Promise<void>;
updatePanel: (config) => Promise<void>;
updatePanelState: (snapshot) => void;
isPanelConnected: (id) => boolean;
isPanelInAlarm: (id) => boolean;
setConnectionStatus: (isConnected) => void;
setModbusConnected: (s) => boolean;
initialize: () => Promise<void>;
toggleMute: () => void;
isAudioMuted: ComputedRef<boolean>;
currentPriority: ComputedRef<AudioPriority>;
acknowledgeAlert: (stationId, type, index, flag?) => Promise<void>;
rearmStation: (stationId) => Promise<void>;
},
| "modbusConnected"
| "configurations"
| "profiles"
| "liveStates"
| "panelStates"
| "selectedStationId"
| "apiConnected"
| "lastDataChange">, Pick<{
configurations: Ref<object[],
| StationConfiguration[]
| object[]>;
profiles: Ref<object[],
| ModbusProfile[]
| object[]>;
liveStates: Ref<Record<string, FireStationSystem>, Record<string, FireStationSystem>>;
panelStates: Ref<Record<string, PanelSnapshot>, Record<string, PanelSnapshot>>;
selectedStationId: Ref<string | null, string | null>;
selectedPanelId: ComputedRef<string | number | null>;
currentConfig: ComputedRef<
| {
id?: string | number;
name: string;
systemSerialNumber?: string;
label: string;
connectionType?: "Tcp" | "Rtu";
ipAddress?: string;
port?: number;
serialPortName?: string;
baudRate?: number;
dataBits?: number;
parity?: number;
stopBits?: number;
pollingIntervalMilliseconds: number;
slaveId: number;
panelType: PanelType;
color: string;
modbusMapping: string;
modbusProfileId: string;
zones: object[];
points?: object[];
rawConfiguration?: string;
}
| undefined>;
panelState: ComputedRef<
| FireStationSystem
| null>;
apiConnected: Ref<boolean, boolean>;
modbusConnected: Ref<boolean, boolean>;
isConfigurationMode: ComputedRef<boolean>;
systemStatus: ComputedRef<
| {
text: "apiDisconnected";
color: string;
}
| {
text: "normal";
color: string;
}
| {
text: "disconnected";
color: string;
}
| {
text: "evacuation";
color: string;
}
| {
text: "emissionExt";
color: string;
}
| {
text: "manualTrigger";
color: string;
}
| {
text: "fireAlarm";
color: string;
}
| {
text: "fault";
color: string;
}>;
activeAlerts: ComputedRef<object[]>;
allActiveAlerts: ComputedRef<Alert[]>;
activeAlertsCount: ComputedRef<number>;
allActiveAlertsCount: ComputedRef<number>;
isGlobalEvacuationActive: ComputedRef<boolean>;
connectionStatus: ComputedRef<{
api: {
connected: boolean;
text: string;
color: string;
};
modbus: {
connected: boolean | undefined;
text: string;
color: string;
};
}>;
systemIssues: ComputedRef<SystemIssue[]>;
lastDataChange: Ref<number, number>;
isFleetHealthy: ComputedRef<boolean>;
setPanelState: (newState) => void;
switchPanel: (id) => void;
addPanel: (config) => Promise<void>;
removePanel: (dbId) => Promise<void>;
loadConfigurations: () => Promise<void>;
loadInitialData: () => Promise<void>;
updatePanel: (config) => Promise<void>;
updatePanelState: (snapshot) => void;
isPanelConnected: (id) => boolean;
isPanelInAlarm: (id) => boolean;
setConnectionStatus: (isConnected) => void;
setModbusConnected: (s) => boolean;
initialize: () => Promise<void>;
toggleMute: () => void;
isAudioMuted: ComputedRef<boolean>;
currentPriority: ComputedRef<AudioPriority>;
acknowledgeAlert: (stationId, type, index, flag?) => Promise<void>;
rearmStation: (stationId) => Promise<void>;
},
| "systemStatus"
| "currentPriority"
| "selectedPanelId"
| "currentConfig"
| "panelState"
| "isConfigurationMode"
| "activeAlerts"
| "allActiveAlerts"
| "activeAlertsCount"
| "allActiveAlertsCount"
| "isGlobalEvacuationActive"
| "connectionStatus"
| "systemIssues"
| "isFleetHealthy"
| "isAudioMuted">, Pick<{
configurations: Ref<object[],
| StationConfiguration[]
| object[]>;
profiles: Ref<object[],
| ModbusProfile[]
| object[]>;
liveStates: Ref<Record<string, FireStationSystem>, Record<string, FireStationSystem>>;
panelStates: Ref<Record<string, PanelSnapshot>, Record<string, PanelSnapshot>>;
selectedStationId: Ref<string | null, string | null>;
selectedPanelId: ComputedRef<string | number | null>;
currentConfig: ComputedRef<
| {
id?: string | number;
name: string;
systemSerialNumber?: string;
label: string;
connectionType?: "Tcp" | "Rtu";
ipAddress?: string;
port?: number;
serialPortName?: string;
baudRate?: number;
dataBits?: number;
parity?: number;
stopBits?: number;
pollingIntervalMilliseconds: number;
slaveId: number;
panelType: PanelType;
color: string;
modbusMapping: string;
modbusProfileId: string;
zones: object[];
points?: object[];
rawConfiguration?: string;
}
| undefined>;
panelState: ComputedRef<
| FireStationSystem
| null>;
apiConnected: Ref<boolean, boolean>;
modbusConnected: Ref<boolean, boolean>;
isConfigurationMode: ComputedRef<boolean>;
systemStatus: ComputedRef<
| {
text: "apiDisconnected";
color: string;
}
| {
text: "normal";
color: string;
}
| {
text: "disconnected";
color: string;
}
| {
text: "evacuation";
color: string;
}
| {
text: "emissionExt";
color: string;
}
| {
text: "manualTrigger";
color: string;
}
| {
text: "fireAlarm";
color: string;
}
| {
text: "fault";
color: string;
}>;
activeAlerts: ComputedRef<object[]>;
allActiveAlerts: ComputedRef<Alert[]>;
activeAlertsCount: ComputedRef<number>;
allActiveAlertsCount: ComputedRef<number>;
isGlobalEvacuationActive: ComputedRef<boolean>;
connectionStatus: ComputedRef<{
api: {
connected: boolean;
text: string;
color: string;
};
modbus: {
connected: boolean | undefined;
text: string;
color: string;
};
}>;
systemIssues: ComputedRef<SystemIssue[]>;
lastDataChange: Ref<number, number>;
isFleetHealthy: ComputedRef<boolean>;
setPanelState: (newState) => void;
switchPanel: (id) => void;
addPanel: (config) => Promise<void>;
removePanel: (dbId) => Promise<void>;
loadConfigurations: () => Promise<void>;
loadInitialData: () => Promise<void>;
updatePanel: (config) => Promise<void>;
updatePanelState: (snapshot) => void;
isPanelConnected: (id) => boolean;
isPanelInAlarm: (id) => boolean;
setConnectionStatus: (isConnected) => void;
setModbusConnected: (s) => boolean;
initialize: () => Promise<void>;
toggleMute: () => void;
isAudioMuted: ComputedRef<boolean>;
currentPriority: ComputedRef<AudioPriority>;
acknowledgeAlert: (stationId, type, index, flag?) => Promise<void>;
rearmStation: (stationId) => Promise<void>;
},
| "initialize"
| "removePanel"
| "addPanel"
| "setPanelState"
| "switchPanel"
| "loadConfigurations"
| "loadInitialData"
| "updatePanel"
| "updatePanelState"
| "isPanelConnected"
| "isPanelInAlarm"
| "setConnectionStatus"
| "setModbusConnected"
| "toggleMute"
| "acknowledgeAlert"
| "rearmStation">>;Défini dans: features/panel/panel.store.ts:195
Store Pinia central gérant l'état temps réel des centrales incendie : configurations, états des zones/points, connexions Modbus/API et alertes actives.