fix: Yaesu panel — S units, sidebands, three-step ATT, readable sliders, own tab
First look on the FTDX10 turned up six things: The S meter printed a raw percentage — "57" tells an operator nothing, and it is the S number that goes into a report. It now reads S1-S9/S9+dB, the same value the click-to-fill RST already used. CW, RTTY and the data modes exist on BOTH sidebands and the operator is the one who knows which they want. The buttons now carry the rig's actual sideband and a double-click flips it; PSK is added, riding the rig's DATA mode as it does on the radio itself. This also means the mode row drives the rig directly (MD0 with the exact mode) instead of going through the ADIF path, which could only pick a sideband by convention. The attenuator is a 6/12/18 dB pad on these rigs, not the single step I assumed — two thirds of the control was unreachable. Sliders had no visible filled side: --muted is barely lighter than the card it sits on, so the whole track read as one bar. They also came in three kinds (two bare range inputs among them). One component now, explicit track colour, and it takes a min/max so power in watts and DNR 1-15 look like the rest. The panel stretched across the whole window; it is a column of controls, so it is now capped and every row stays readable. And it gets its own Yaesu tab, like FlexRadio and Icom, rather than only being available as a Main-view pane.
This commit is contained in:
@@ -28,6 +28,9 @@ type YaesuTXState struct {
|
||||
Available bool `json:"available"`
|
||||
Model string `json:"model,omitempty"`
|
||||
Mode string `json:"mode,omitempty"`
|
||||
// RawMode is the rig mode with its sideband (CW-U, DATA-L…), which ADIF
|
||||
// deliberately does not record but the panel has to show.
|
||||
RawMode string `json:"raw_mode,omitempty"`
|
||||
|
||||
Transmitting bool `json:"transmitting"`
|
||||
Split bool `json:"split"`
|
||||
@@ -70,6 +73,7 @@ type YaesuController interface {
|
||||
SetYaesuVOX(bool) error
|
||||
SetYaesuSplit(bool) error
|
||||
SetYaesuBand(string) error
|
||||
SetYaesuModeRaw(string) error
|
||||
TuneYaesuATU() error
|
||||
}
|
||||
|
||||
@@ -276,6 +280,46 @@ func (y *Yaesu) SetYaesuSplit(on bool) error {
|
||||
|
||||
// SetYaesuBand switches band with BS, which lands the rig on ITS OWN last-used
|
||||
// frequency for that band — the radio's band memory, not a frequency we choose.
|
||||
// SetYaesuModeRaw selects an exact rig mode, sideband included — "CW-U",
|
||||
// "DATA-L", "RTTY-U"… The plain SetMode path takes an ADIF mode and can only
|
||||
// choose a sideband by convention, but CW, RTTY and the data modes are routinely
|
||||
// run on EITHER sideband and the operator is the one who knows which. This is
|
||||
// what the panel's mode buttons use.
|
||||
func (y *Yaesu) SetYaesuModeRaw(name string) error {
|
||||
d, ok := yaesuRawModeDigit(name)
|
||||
if !ok {
|
||||
return fmt.Errorf("yaesu: unknown rig mode %q", name)
|
||||
}
|
||||
return y.setAndRefresh(fmt.Sprintf("MD0%c;", d))
|
||||
}
|
||||
|
||||
// yaesuRawModeDigit maps a rig-mode name to its MD digit.
|
||||
func yaesuRawModeDigit(name string) (byte, bool) {
|
||||
switch strings.ToUpper(strings.TrimSpace(name)) {
|
||||
case "LSB":
|
||||
return '1', true
|
||||
case "USB":
|
||||
return '2', true
|
||||
case "CW-U", "CWU":
|
||||
return '3', true
|
||||
case "CW-L", "CWL":
|
||||
return '7', true
|
||||
case "FM":
|
||||
return '4', true
|
||||
case "AM":
|
||||
return '5', true
|
||||
case "RTTY-L", "RTTYL":
|
||||
return '6', true
|
||||
case "RTTY-U", "RTTYU":
|
||||
return '9', true
|
||||
case "DATA-L", "DATAL", "DIGI-L":
|
||||
return '8', true
|
||||
case "DATA-U", "DATAU", "DIGI-U":
|
||||
return 'C', true
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
func (y *Yaesu) SetYaesuBand(band string) error {
|
||||
code, ok := yaesuBandCode(band)
|
||||
if !ok {
|
||||
@@ -357,21 +401,32 @@ func yaesuAGCCode(name string) int {
|
||||
return 4 // AUTO — the safe default for anything unrecognised
|
||||
}
|
||||
|
||||
// The FTDX10's attenuator is a single 12 dB step (RA00/RA01). Reporting the dB
|
||||
// rather than the raw code lets the panel label the button honestly, and leaves
|
||||
// room for models with more steps.
|
||||
// The FTDX10/FTDX101 attenuator is a THREE-step pad (RA00..RA03 = off, 6, 12,
|
||||
// 18 dB), not the single step this first assumed — a panel offering only one
|
||||
// step hides two thirds of the control. Reporting the dB rather than the raw
|
||||
// code lets the buttons label themselves honestly.
|
||||
func yaesuAttDB(code int) int {
|
||||
if code == 0 {
|
||||
return 0
|
||||
switch code {
|
||||
case 1:
|
||||
return 6
|
||||
case 2:
|
||||
return 12
|
||||
case 3:
|
||||
return 18
|
||||
}
|
||||
return 12
|
||||
return 0
|
||||
}
|
||||
|
||||
func yaesuAttCode(db int) int {
|
||||
if db <= 0 {
|
||||
return 0
|
||||
switch {
|
||||
case db >= 18:
|
||||
return 3
|
||||
case db >= 12:
|
||||
return 2
|
||||
case db >= 6:
|
||||
return 1
|
||||
}
|
||||
return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
// yaesuBandCode maps an ADIF band to the BS command's band number.
|
||||
@@ -402,3 +457,31 @@ func yaesuBandCode(band string) (int, bool) {
|
||||
}
|
||||
return 0, false
|
||||
}
|
||||
|
||||
// yaesuRawModeName is the inverse of yaesuRawModeDigit: what the rig is on,
|
||||
// sideband included, for the panel's mode buttons to highlight.
|
||||
func yaesuRawModeName(d byte) string {
|
||||
switch d {
|
||||
case '1':
|
||||
return "LSB"
|
||||
case '2':
|
||||
return "USB"
|
||||
case '3':
|
||||
return "CW-U"
|
||||
case '4':
|
||||
return "FM"
|
||||
case '5':
|
||||
return "AM"
|
||||
case '6':
|
||||
return "RTTY-L"
|
||||
case '7':
|
||||
return "CW-L"
|
||||
case '8':
|
||||
return "DATA-L"
|
||||
case '9':
|
||||
return "RTTY-U"
|
||||
case 'C':
|
||||
return "DATA-U"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user