import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'; import { Plus, Pencil, Trash2, Power, PlugZap, Loader2, Check, X, Compass, Square, Antenna as AntennaIcon, ArrowDownToLine, Minus, RefreshCw, GripVertical, ChevronUp, ChevronDown } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Checkbox } from '@/components/ui/checkbox'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { cn } from '@/lib/utils'; import { MotorAntennaWidget, type AntStatus } from '@/components/MotorAntennaWidget'; import { useI18n } from '@/lib/i18n'; import { writeUiPref } from '@/lib/uiPref'; import { subscribeRotorHeading, pokeRotorHeading } from '@/lib/rotorHeading'; import { RotorCompass } from '@/components/RotorCompass'; import { AmpCard } from '@/components/AmpCard'; import { TunerCard } from '@/components/TunerCard'; import type { TGStatus } from '@/components/TunerGeniusPanel'; import { GetStationDevices, SaveStationDevices, GetStationStatus, StationSetRelay, RotatorGoTo, RotatorStop, SetActiveRotor, GetUltrabeamStatus, SetUltrabeamDirection, UltrabeamRetract, MotorSetElement, MotorReadElements, MotorTuneKHz, MotorNudgeKHz, SetMotorFollow, ListDenkoviDevices, ListSerialPorts, TestStationDevice, GetAmpStatuses, GetFlexState, GetTunerGeniusStatus, GetTunerGeniusSettings, GetPSUStatus, GetPSUSettings, SetPSUOutput, } from '../../wailsjs/go/main/App'; type RotatorProps = { centerLat?: number | null; centerLon?: number | null; bearing?: number | null }; type PSUState = { connected: boolean; on: boolean; volts: number; amps: number; watts: number; set_volts: number; set_amps: number; protected: number; error?: string }; // The bench supply. One button — the output — and the three numbers that say // what it is actually delivering. // // The SET points are shown beside them, small, because "13.8 V set" next to // "0.02 A out" is how an operator sees at a glance that the supply is on but // the radio is not drawing. They are not editable: OpsLog reads them and never // writes them, which is the whole safety story of this device. function PSUCard({ st, busy, onToggle, t }: { st: PSUState; busy: boolean; onToggle: (on: boolean) => void; t: (k: string, v?: any) => string; }) { const tripped = (st.protected ?? 0) !== 0; return (
{t('station.dragHint')}
)} {editing && ({t('station.ftdiHint')}
{detectMsg &&{detectMsg}
}{t('station.usbRelayHint')}
{t('station.valueNeedsLabels')}
}