FreeDV UDP QSOLogged integration improvements#990
Merged
ea4k merged 8 commits intoea4k:masterfrom Apr 24, 2026
Merged
Conversation
When klog receives a QSOLogged (type 5) UDP packet from FreeDV: - Populate comment, name, RST TX/RX into the form before the confirmation dialog so the user sees complete QSO data. - Freeze the displayed date/time at the UDP packet's time_on value so the logged time does not drift while the user reviews and clicks Add. Uses a new setFreezeTime() mechanism on MainQSOEntryWidget that suppresses slotUpdateTime() without touching the realtime checkbox or writing settings. - Protect name and locator from being overwritten by a concurrent QRZ.com lookup: latch udpLoggedCall/Name/Locator at the top of slotQSOReceived, restore them in cleanQRZCOMreceivedDataFromUI() and slotElogQRZCOMFoundData() whenever the form callsign matches. - Supplement the saved QSO with name/comment from the form in case QRZ.com filled them in after the form was populated. - Restore name/locator unconditionally after slotClearButtonClicked so the fields survive the post-add form clear. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FreeDV does not populate the time_on field in its QSOLogged UDP packet, leaving _qso.getDateTimeOn() invalid. This caused two bugs: - setDateTime(invalid) was a no-op, so the displayed clock was never frozen and continued to tick while the user reviewed the dialog. - q.copy(_qso) copied the invalid datetime, so addQSO fell back to the current time (= when Add was pressed) rather than QSO time. Fix: capture QDateTime::currentDateTimeUtc() at the top of slotQSOReceived as udpArrivalTime, falling back to the packet's own time_on if FreeDV ever starts sending it. Use udpArrivalTime for both setDateTime() (freezes the display) and q.setDateTimeOn() (DB record). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
QSOLogged UDP packets carry frequency but no band name. Without an explicit band, QSO::isComplete() returns false and addQSO() silently returns -1, leaving the form filled but the QSO unsaved. The user then clicked the klog Add button to save — picking up the current time instead of the packet-arrival timestamp, and bypassing the time freeze. Derive the band via getBandNameFromFreq(getFreqTX()) before calling addQSO() so the save succeeds on the first attempt. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When wsjtxAutoLog is false, populate the klog entry form (callsign, band derived from frequency, mode, time frozen at packet arrival) and return. The normal Add button then saves the QSO with the frozen time, exactly as a manual entry would — no confirmation dialog, no automatic database write. Also reset freezeTime in MainQSOEntryWidget::clear() so the clock resumes automatically when the form is cleared by Add or Clear. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Skip populating the entry form when modify or manualMode is active, so a FreeDV QSOLogged packet never interferes with an in-progress QSO edit. Also move all form-touching code inside the !wsjtxAutoLog block — the auto-log path saves directly to DB and never needed to touch the form. Remove the stale form-read fallback (getName/getComment from UI) from the auto-log path, which was wrong when the form hadn't been pre-populated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
QSqlRelationalTableModel does not reliably persist the DESC sort order set by sortByColumn() through subsequent select() calls triggered from non-UI code paths (e.g. the UDP auto-log signal chain). Explicitly call setSort(1, Qt::DescendingOrder) before every select() in refresh() so the log always shows the most recent QSO at the top. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split the two code paths into populateFormFromUDPQso() and autoLogUDPQso(), reducing slotQSOReceived to a 15-line dispatcher. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Integrates KLog with FreeDV's UDP QSOLogged packet (message type 5), allowing a completed FreeDV QSO to be captured into the KLog entry form for review
before the operator clicks Add to save it — the same workflow as a manual entry.
Changes
src/udpserver.cpp — The existing WSJT-X UDP server already handled the QSOLogged packet and emitted the logged(qso) signal. FreeDV sends the same packet
type, so no protocol changes were needed; the work is entirely in how KLog responds to that signal.
src/mainwindow.cpp — slotQSOReceived
true, so addQSO() was silently returning −1. The fix derives the band name from the frequency via getBandNameFromFreq() before any save attempt.
immediately as udpArrivalTime and used as the QSO timestamp, giving an accurate start time rather than whatever time the user eventually clicks Add.
of its own), the previous code showed a confirmation dialog and then saved anyway. This is replaced with proper populate-form behaviour: callsign, band,
mode, time, RST, name, and comment are all written into the entry form, the clock is frozen at arrival time, and control returns to the user. The QSO is
saved only when the operator clicks Add, exactly as for a manual entry.
is correcting a previous log entry — the packet is silently dropped rather than overwriting the in-progress work. This mirrors the behaviour of the
existing Status packet handler.
path saves directly to the database and never touches the form, so the freeze was unnecessary and has been removed from that path.
cleanQRZCOMreceivedDataFromUI() and slotElogQRZCOMFoundData() use these to restore FreeDV-provided values if a QRZ.com lookup fires concurrently and would
otherwise overwrite them.
src/mainqsoentrywidget.cpp — clear()
Added freezeTime = false to the clear() method so the clock freeze is released when the form is cleared (whether by clicking Add or Clear), allowing
real-time updating to resume for the next QSO.
Behaviour
