feat: added record qso dvk

This commit is contained in:
2026-06-04 00:46:35 +02:00
parent 1a425a1b0d
commit a2a29c66d2
24 changed files with 3098 additions and 346 deletions
+39
View File
@@ -319,6 +319,43 @@ func (o *OmniRig) SetMode(mode string) error {
return nil
}
// SetPTT keys or unkeys the rig via OmniRig's SetTx(PM_RX|PM_TX). Used by the
// Digital Voice Keyer to put the rig into TX while a voice message plays.
func (o *OmniRig) SetPTT(on bool) error {
if o.rig == nil {
debugLog.Printf("OmniRig.SetPTT(%v): NOT CONNECTED", on)
return fmt.Errorf("not connected")
}
status, statusStr, writeable := int64(-1), "", int64(-1)
if v, err := oleutil.GetProperty(o.rig, "Status"); err == nil {
status = v.Val
}
if v, err := oleutil.GetProperty(o.rig, "StatusStr"); err == nil {
statusStr = v.ToString()
}
if v, err := oleutil.GetProperty(o.rig, "WriteableParams"); err == nil {
writeable = v.Val
}
txWriteable := writeable != -1 && writeable&pmTX != 0
param, name := pmRX, "PM_RX"
if on {
param, name = pmTX, "PM_TX"
}
debugLog.Printf("OmniRig.SetPTT(%v): status=%d(%s) writeableParams=0x%X PM_TX-writeable=%v → Tx=%s",
on, status, statusStr, writeable, txWriteable, name)
if on && !txWriteable {
debugLog.Printf("OmniRig.SetPTT: ⚠ this rig's OmniRig .ini does NOT expose TX keying (PM_TX not writeable). " +
"Use VOX or serial RTS/DTR PTT instead.")
}
// OmniRig has NO SetTx method (that returns "unknown name"); the Tx
// parameter is set via the writeable Tx PROPERTY (PM_TX / PM_RX).
if _, err := oleutil.PutProperty(o.rig, "Tx", int32(param)); err != nil {
debugLog.Printf("OmniRig.SetPTT error: %v", err)
return fmt.Errorf("set Tx=%s: %w", name, err)
}
return nil
}
// ===== OmniRig enum decoders =====
// Bit flags from OmniRig type library (RigParamX enum in OmniRig_TLB.pas).
@@ -328,6 +365,8 @@ func (o *OmniRig) SetMode(mode string) error {
// too low which causes every mode to map to the slot below it (AM → DIG_L,
// FT8 → SSB_L, etc.).
const (
pmRX int64 = 1 << 20 // 0x00100000 — PM_RX (receive)
pmTX int64 = 1 << 21 // 0x00200000 — PM_TX (transmit / PTT on)
pmCWU int64 = 1 << 23 // 0x00800000
pmCWL int64 = 1 << 24 // 0x01000000
pmSSBU int64 = 1 << 25 // 0x02000000