Skip to content

Conversation

@sjwoodr
Copy link

@sjwoodr sjwoodr commented Nov 8, 2025

This change is to allow WSJT-X format broadcast packets to trigger a callbook lookup even when the grid square is not specified. This is useful for non FT8 content. For example, realtime contest logs being sent from WriteLog to Qlog via the WSJT-X protocol. It is safe to call finalizeCallsignEdit() even without the grid square because the CallbookManager will cache lookups and prevent redundant lookups when WSJT-X sends multiple status type messages.

This change is to allow WSJT-X format broadcast packets to trigger a
callbook lookup even when the grid square is not specified. This is
useful for non FT8 content. For example, realtime contest logs being
sent from WriteLog to Qlog via the WSJT-X protocol.  It is safe to
call finalizeCallsignEdit() even without the grid square because the
CallbookManager will cache lookups and prevent redundant lookups
when WSJT-X sends multiple status type messages.
@foldynl
Copy link
Owner

foldynl commented Nov 8, 2025

Unfortunately, this change breaks the essence of why it was there. And that is the fact that if you have a QSO from WSJT and it doesn't have a Grid, you can't tell whether the received Callbook entry corresponds to the current position of the DX Station. That's why the condition "to have a grid" was there.

@sjwoodr
Copy link
Author

sjwoodr commented Nov 8, 2025

Unfortunately, this change breaks the essence of why it was there. And that is the fact that if you have a QSO from WSJT and it doesn't have a Grid, you can't tell whether the received Callbook entry corresponds to the current position of the DX Station. That's why the condition "to have a grid" was there.

OK, that makes sense. Right now I have a work-around, and that is sending grid AA00 if it is not filled in. That's in the middle of the ocean and unlikely to be valid. This will trigger a callbook lookup in Qlog ... but it results in the AA00 being logged (the callbook lookup won't override it).

What would you say about allowing the callbook to override the grid if it was something like AA00 or even something invalid like 0000 ?

@sjwoodr
Copy link
Author

sjwoodr commented Nov 8, 2025

Oops.. i meant AB00 as a placeholder. But it would be cool to allow callbook lookups to override the grid square if it came in via WSJT-X protocol as an invalid grid like 0000.

@sjwoodr
Copy link
Author

sjwoodr commented Nov 8, 2025

@foldynl How about a change like this instead?

diff --git a/ui/NewContactWidget.cpp b/ui/NewContactWidget.cpp
index 9d5418c0..1926cb3c 100644
--- a/ui/NewContactWidget.cpp
+++ b/ui/NewContactWidget.cpp
@@ -2939,7 +2939,17 @@ void NewContactWidget::prepareWSJTXQSO(const QString &receivedCallsign,

     callsign = receivedCallsign;
     ui->callsignEdit->setText(receivedCallsign);
-    uiDynamic->gridEdit->setText(grid);
+
+    // WSJT-X packets with "XXXX" as a grid:
+    // We should trigger callbook lookup but not persist XXXX in the UI
+    bool shouldTriggerCallbookLookup = (grid == "XXXX");
+    QString gridToUse = shouldTriggerCallbookLookup ? QString() : grid;
+
+    if ( !gridToUse.isEmpty() )
+    {
+        uiDynamic->gridEdit->setText(gridToUse);
+    }
+
     checkDupe();
     setDxccInfo(receivedCallsign);
     queryPota();
@@ -2951,9 +2961,10 @@ void NewContactWidget::prepareWSJTXQSO(const QString &receivedCallsign,
     // 1) prev Callsign empty grid
     // 2) new Callsign empty grid
     // 3) new Calllsign, new gris
-    if ( !grid.isEmpty() )
+    // If grid is "XXXX", treat it as a trigger to perform callbook lookup
+    if ( !gridToUse.isEmpty() || shouldTriggerCallbookLookup )
     {
-        useFieldsFromPrevQSO(callsign, grid);
+        useFieldsFromPrevQSO(callsign, gridToUse);
         finalizeCallsignEdit();
     }
 }

@foldynl
Copy link
Owner

foldynl commented Nov 9, 2025

Can we go back to the beginning? Through which messages does writelog send that data? Because you’re modifying the handling of the “WSJTX Status message”, but that message itself doesn’t log anything. The QSO is written only when the “WSJTX Log message” is received.

You’re right that the “WSJTX Status message” with the Grid triggers a Callbook query, but that’s only a preparation phase for the “WSJTX Log message.”

Could you please send me the complete message flow you expect to occur? Will you also include the XXXX grid in the “WSJTX Log message”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants