feat: Management of multiple slices on Flexradio

This commit is contained in:
2026-07-07 19:35:25 +02:00
parent 6b9307b427
commit 6db90abcad
8 changed files with 276 additions and 103 deletions
+17
View File
@@ -245,9 +245,24 @@ func (m *Manager) SendSpot(s SpotInfo) {
// FlexTXState is the FlexRadio transmit/ATU state surfaced to the dedicated
// FlexRadio control tab. Levels are 0-100. (Phase 1: controls + state pushed by
// the radio over TCP; live meters arrive over a separate UDP stream later.)
// FlexSliceInfo identifies one FlexRadio receiver slice (A/B/C/D…) for the
// panel, so the operator sees every slice and which one is active/TX.
type FlexSliceInfo struct {
Index int `json:"index"` // 0-based slice index
Letter string `json:"letter"` // A, B, C, D…
FreqHz int64 `json:"freq_hz"`
Mode string `json:"mode,omitempty"` // ADIF mode
Band string `json:"band,omitempty"`
Active bool `json:"active"` // the focused/operating slice
TX bool `json:"tx"` // this slice transmits
}
type FlexTXState struct {
Available bool `json:"available"` // backend is Flex and handshaked
Model string `json:"model,omitempty"`
// Slices lists every in-use receiver slice (A/B/C/D…) so the panel can show
// them all and highlight the active one. The active slice drives everything.
Slices []FlexSliceInfo `json:"slices,omitempty"`
RFPower int `json:"rf_power"`
TunePower int `json:"tune_power"`
Tune bool `json:"tune"` // tune carrier active
@@ -339,6 +354,8 @@ type FlexController interface {
SetMute(bool) error
SetRXAntenna(string) error
SetTXAntenna(string) error
SetActiveSlice(int) error // focus slice idx so commands target it
SetTXSlice(int) error // make slice idx the transmitter (tx=1)
SetSplit(bool) error
SetNB(bool) error
SetNBLevel(int) error