chore: release v0.25.9
This commit is contained in:
@@ -79,6 +79,9 @@ type Manager struct {
|
||||
|
||||
pollEvery time.Duration
|
||||
cmdDelay time.Duration // pause after each command (some rigs need it)
|
||||
// freqOffset is the transverter offset in Hz — see SetFreqOffset. Added to
|
||||
// what the rig reports, taken off what it is told.
|
||||
freqOffset int64
|
||||
}
|
||||
|
||||
func NewManager(emit func(RigState)) *Manager {
|
||||
@@ -185,8 +188,39 @@ func (m *Manager) stopLocked() {
|
||||
}
|
||||
}
|
||||
|
||||
// SetFreqOffset sets the transverter offset: the number of hertz between what
|
||||
// the RIG is tuned to and where the station is actually on the air.
|
||||
//
|
||||
// A 28 MHz IF driving a 144 MHz transverter is an offset of +116 MHz. Everything
|
||||
// above this layer — the entry form, the band, the log, the cluster, the shared
|
||||
// CAT servers — then works in real frequencies, and the rig keeps seeing its own.
|
||||
//
|
||||
// Zero disables it, which is why it is a plain number and not a flag plus a
|
||||
// number: "enabled with an offset of nothing" and "disabled" are the same thing
|
||||
// to everyone downstream.
|
||||
func (m *Manager) SetFreqOffset(hz int64) {
|
||||
m.mu.Lock()
|
||||
m.freqOffset = hz
|
||||
m.mu.Unlock()
|
||||
}
|
||||
|
||||
// freqOffsetHz reads the offset.
|
||||
func (m *Manager) freqOffsetHz() int64 {
|
||||
m.mu.RLock()
|
||||
defer m.mu.RUnlock()
|
||||
return m.freqOffset
|
||||
}
|
||||
|
||||
// SetFrequency dispatches a SetFreq call to the CAT goroutine.
|
||||
//
|
||||
// The caller speaks in REAL frequencies (a 2 m spot is 144.300), so the offset
|
||||
// comes back off before the rig hears it. Without this the offset would be a
|
||||
// display trick: the readout would say 144 and every spot click, band change and
|
||||
// memory recall would send the rig somewhere 116 MHz away.
|
||||
func (m *Manager) SetFrequency(hz int64) error {
|
||||
if off := m.freqOffsetHz(); off != 0 && hz > off {
|
||||
hz -= off
|
||||
}
|
||||
return m.exec(func(b Backend) error { return b.SetFrequency(hz) })
|
||||
}
|
||||
|
||||
@@ -215,6 +249,10 @@ type splitSetter interface {
|
||||
// band when it was transmitting on the DX's own frequency. A refusal WSJT-X can
|
||||
// report is worth far more than a success it cannot check.
|
||||
func (m *Manager) SetSplit(on bool, txHz int64) error {
|
||||
// Real frequency in, IF frequency out — same as SetFrequency.
|
||||
if off := m.freqOffsetHz(); off != 0 && txHz > off {
|
||||
txHz -= off
|
||||
}
|
||||
return m.exec(func(b Backend) error {
|
||||
s, ok := b.(splitSetter)
|
||||
if !ok {
|
||||
@@ -744,6 +782,20 @@ func (m *Manager) run(b Backend, stop, done chan struct{}, cmds chan func(), pol
|
||||
ns.Enabled = true
|
||||
ns.Backend = b.Name()
|
||||
ns.UpdatedAt = time.Now()
|
||||
// Transverter offset: the rig reports its IF, the operator is on the
|
||||
// real band. Applied BEFORE the band is worked out, or a 28 MHz IF
|
||||
// behind a 2 m transverter would log every contact on 10 m — and the
|
||||
// band the backend may already have filled in is the IF's, so it is
|
||||
// recomputed rather than trusted.
|
||||
if off := m.freqOffsetHz(); off != 0 {
|
||||
if ns.FreqHz != 0 {
|
||||
ns.FreqHz += off
|
||||
ns.Band = ""
|
||||
}
|
||||
if ns.RxFreqHz != 0 {
|
||||
ns.RxFreqHz += off
|
||||
}
|
||||
}
|
||||
if ns.FreqHz != 0 && ns.Band == "" {
|
||||
ns.Band = BandFromHz(ns.FreqHz)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user