debug(motor-antenna): trace the follow band-gate decision (why the antenna did/didn't move)
This commit is contained in:
@@ -11990,6 +11990,8 @@ func (a *App) ultrabeamFollowNow(freqHz int64) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !motorBandAllowed(s.Bands, freqHz) {
|
if !motorBandAllowed(s.Bands, freqHz) {
|
||||||
|
applog.Printf("ultrabeam: followNow %.3f MHz is %q — not in covered bands %v; no move",
|
||||||
|
float64(freqHz)/1e6, bandForHz(freqHz), s.Bands)
|
||||||
return // a band the antenna doesn't cover — leave it where it is
|
return // a band the antenna doesn't cover — leave it where it is
|
||||||
}
|
}
|
||||||
khz := int(freqHz / 1000)
|
khz := int(freqHz / 1000)
|
||||||
@@ -14448,6 +14450,7 @@ func (a *App) startUltrabeam() {
|
|||||||
if s.Follow {
|
if s.Follow {
|
||||||
stop := make(chan struct{})
|
stop := make(chan struct{})
|
||||||
a.ubFollowStop = stop
|
a.ubFollowStop = stop
|
||||||
|
applog.Printf("ultrabeam: follow loop starting — covered bands %v, step %d kHz", s.Bands, s.StepKHz)
|
||||||
go a.ultrabeamFollowLoop(a.motorAnt, s.StepKHz, s.Bands, stop)
|
go a.ultrabeamFollowLoop(a.motorAnt, s.StepKHz, s.Bands, stop)
|
||||||
}
|
}
|
||||||
if s.TXInhibit {
|
if s.TXInhibit {
|
||||||
@@ -14635,15 +14638,21 @@ func (a *App) ultrabeamFollowLoop(c motorAntenna, stepKHz int, bands []string, s
|
|||||||
// follow loop chases. If the antenna QSYs unexpectedly, this shows the
|
// follow loop chases. If the antenna QSYs unexpectedly, this shows the
|
||||||
// CAT backend started reporting that frequency (e.g. WSJT-X moved the
|
// CAT backend started reporting that frequency (e.g. WSJT-X moved the
|
||||||
// dial, or the active slice changed) even though you didn't touch the VFO.
|
// dial, or the active slice changed) even though you didn't touch the VFO.
|
||||||
if rigKHz != lastRigKHz {
|
newFreq := rigKHz != lastRigKHz
|
||||||
|
if newFreq {
|
||||||
applog.Printf("ultrabeam: follow loop reads rig freq %.3f MHz (mode %s) — antenna at %d kHz, step %d kHz",
|
applog.Printf("ultrabeam: follow loop reads rig freq %.3f MHz (mode %s) — antenna at %d kHz, step %d kHz",
|
||||||
float64(rs.FreqHz)/1e6, rs.Mode, st.Frequency, stepKHz)
|
float64(rs.FreqHz)/1e6, rs.Mode, st.Frequency, stepKHz)
|
||||||
lastRigKHz = rigKHz
|
lastRigKHz = rigKHz
|
||||||
}
|
}
|
||||||
// Skip bands the antenna doesn't cover (per the operator's band list) —
|
// Skip bands the antenna doesn't cover (per the operator's band list) —
|
||||||
// no tune command, so the elements stay where they are on 80 m, an
|
// no tune command, so the elements stay where they are on 80 m, an
|
||||||
// un-fitted 30 m, etc.
|
// un-fitted 30 m, etc. Log the decision once per QSY so "why did/didn't
|
||||||
|
// the antenna move" is answerable from the log.
|
||||||
if !motorBandAllowed(bands, rs.FreqHz) {
|
if !motorBandAllowed(bands, rs.FreqHz) {
|
||||||
|
if newFreq {
|
||||||
|
applog.Printf("ultrabeam: %.3f MHz is %q — not in covered bands %v; leaving the antenna put",
|
||||||
|
float64(rs.FreqHz)/1e6, bandForHz(rs.FreqHz), bands)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Deadband reference = the rig freq we LAST commanded a move for, not the
|
// Deadband reference = the rig freq we LAST commanded a move for, not the
|
||||||
|
|||||||
Reference in New Issue
Block a user