Documentation
¶
Overview ¶
Package state holds the SharedState struct and PanelKind enum so the root tui package and panels sub-package can both import it without an import cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioReq ¶
AudioReq sets one or more knobs on the audio cockpit. Nil fields are left unchanged.
type EndCallReq ¶
EndCallReq forces the engine to release the active call held on the given device.
type PanelKind ¶
type PanelKind int
PanelKind enumerates the visible panels. The root model owns the active selection; panels themselves don't know their index.
type ResetToneReq ¶
type ResetToneReq struct {
DeviceSerial string
}
ResetToneReq clears tone-out match progress on the given device.
type RingReader ¶
RingReader is the read-side interface RingBuf satisfies. Panels only need read access to the event/tone buffers.
type ScannerConvReq ¶
type ScannerConvReq struct{ Index int }
ScannerConvReq is shared by hold / resume / dwell-on-index for the conventional scanner. Index is ignored for hold/resume.
type ScannerHuntReq ¶
type ScannerHuntReq struct{ System string }
ScannerHuntReq targets a single trunked system for hold / resume / force-retune. The WriteKind discriminates the operation.
type ScannerManualTuneReq ¶
ScannerManualTuneReq adds a temp VFO channel and forces dwell.
type ScannerModeReq ¶
type ScannerModeReq struct{ Mode string }
ScannerModeReq sets the engine's global scan_mode at runtime.
type SettingsReq ¶ added in v0.1.5
SettingsReq carries a single settings-panel edit. Field is the dotted YAML path (e.g. "audio.volume", "log.level") and Value is the operator's typed input; the dispatcher converts to the right SettingsPatch shape per field.
type SharedState ¶
type SharedState struct {
// /api/v1/mutations endpoint AND-ed with the TUI's --write
// flag. Panels read this to decide whether write keybindings
// should fire actions or show a "mutations disabled" toast.
WriteEnabled bool
// show finer-grained tooltips (e.g. "tone-out detector not
// wired" vs "mutations disabled at daemon").
Mutations client.MutationStatus
}
SharedState is the snapshot of daemon-derived data that all panels read from. The root model owns it and passes a pointer into each panel's Update.
type SweepRetentionReq ¶
type SweepRetentionReq struct{}
SweepRetentionReq runs one immediate retention sweep.
type UpdateTalkgroupReq ¶
UpdateTalkgroupReq mutates priority and/or lockout and/or scan on a talkgroup. Pointer fields allow "leave unchanged" semantics.
type WriteKind ¶
type WriteKind int
WriteKind discriminates a WriteRequest's payload.
const ( WriteKindUnknown WriteKind = iota WriteKindEndCall WriteKindUpdateTalkgroup WriteKindSweepRetention WriteKindResetTone WriteKindScannerMode WriteKindScannerHuntHold WriteKindScannerHuntResume WriteKindScannerHuntRetune WriteKindScannerConvHold WriteKindScannerConvResume WriteKindScannerConvDwell WriteKindScannerConvLockout WriteKindScannerConvUnlockout WriteKindAudio WriteKindScannerManualTune WriteKindSettings )
type WriteRequest ¶
type WriteRequest struct {
Confirm string
Label string
Kind WriteKind
EndCall *EndCallReq
UpdateTalkgroup *UpdateTalkgroupReq
SweepRetention *SweepRetentionReq
ResetTone *ResetToneReq
ScannerMode *ScannerModeReq
ScannerHunt *ScannerHuntReq
ScannerConv *ScannerConvReq
ScannerManualTune *ScannerManualTuneReq
Audio *AudioReq
Settings *SettingsReq
}
WriteRequest is a plain-value command emitted by panels when the operator presses a mutation keybinding. The root model unwraps the embedded request type, optionally pops a confirmation modal, and dispatches the matching client method.
Panels can't build the write Cmds themselves (they don't hold a client.Client), so the request shape is a typed value the root resolves. Each request kind has its own struct so the root's type switch is exhaustive.