);
};
// --- MAIN DASHBOARD COMPONENT ---
export default function SCADADashboard() {
const { state, simRunning, setSimRunning, selectedId, setSelectedId, triggerLoadSpike } = useGridSimulation(INITIAL_ASSETS, INITIAL_LINES);
// N-1 Contingency Logic
const analyzeContingency = (id) => {
setSelectedId(id);
// Logic: Remove element, simulate overload.
// In a real UI, we would clone the state and re-run power flow.
// Here we visually flag assets in the same "zone" or connected paths.
alert(`N-1 Analysis for ${id}: \nSimulating trip...\nCalculating re-dispatch...`);
};
return (
{/* HEADER */}
GRID_CONTROL_V2.0 // REGIONAL SCADA
FREQ: {state.frequency.toFixed(3)} Hz
SYSTEM LOAD: {(state.totalLoad/1000).toFixed(1)} GW
{/* LEFT SIDEBAR: ASSETS & CONTROLS */}
Frequency Regulation
Simulate sudden loss of generation or load spike to test grid inertia response.
N-1 CONTINGENCY MODE
{selectedId ? `Selected: ${selectedId}. Click 'Analyze' in Asset List to simulate failure cascade.` : 'Select an Asset or Line to begin.'}