PSK Reporter Updates#33
Conversation
|
Not sure how you'd want me to review this. Do you want to simply improve on what we have and leave some problems to be dealt with later, or do you want to fix all known problems? If the later, there is more to be done. Check packet fullTo quote https://pskreporter.info/pskdev.html :
I have not looked into this in detail, but this "unless the packet becomes full" promises to become tricky: We need to test whether we have enough data to fill the packet to the brim and send it. This test is most conveniently done the moment the new information comes in from the decoder. Yet, we would do a bad job if we sent right then and there. That would make sending more probable at the times when signals complete in JS8. Once we have a more sizable user crowd than we do now, this would result in load spikes at PSKReporter. I suggest to use a random wait time that, in its maximum, is the same than the current mode's period, once enough data to fill a packet has become available. Precision timerI have found in the Qt documentation: When you do not use precision timers, Qt tries to run several timers' triggers at the same time. This could potentially concentrate network sending triggers to such times as when the protocol has activities. So, even though this may look like overkill (and probably is, though I'm not sure), I would feel better if we used a Qt precision timer here. Put network stuff out of the main threadI have not looked into this in detail, but I find it quite suspicious that And I think network stuff belongs into a thread of its own. If a user switches TCP/IP on and connection attempt fails with a timeout, there is danger that this will freeze the UI. It is "all five minutes"... so the Send last available info, not firstIf several transmissions come in for the same station on the same band while we're waiting for our 5 minutes to elapse before sending again, I would argue the sender wants to know about the last transmission, not the first; but our present code sends the first, not the last. Avoid lifecycle issues - Laster edit: This is ok. The queue and cache copy on insert.I'm a bit concerned about the line The objects behind Finally, we are in a Qt project here, so I would slightly prefer to we standardized on |
|
As far as I'm concerned, you can rebase to the master's HEAD and also squash future commits together with this into one before my next round of reviews. |
|
A small cosmetic problem with In my That line tells me that my friend Chris 2E0EEY sent something to me with the transmission starting 16:00:45. But to PSK reporter, we will report that same transmission with a timestamp of 16:00:58 or thereabouts. Why this inconsistency? For |
|
Maybe we should start a new issue around this, my changes were minimally invasive, these questions are really revisiting basic assumptions about how the whole class works. I think your only question about my changes has to do with lifecycle issues, but when cache_key is inserted into the QHash, it's copied by value, so no problems there. Looks like the enque into spots has worked the same way since Allan worked on it last year. |
|
@rruchte @aknrdureegaesr I think here that Rob proposed a minimally invasive change, as he called it. I see nothing wrong with the PR. If we are going to do a complete overhaul of the class, that should be discussed via the issues list to arrive at a consensus, and submitted as a separate PR. I would suggest just rebasing this one so it will merge. Merge it. Then move to the issues list for the rest. |
i'll make a comment here. This is a valid PR and it should be merged. It is unreasonable through code review to require the author of a PR to attempt an overhaul of an entire class. I just got done fixing an issue that came from js8call that used a deprecated Qt function to make logging timestamps UTC instead of local time. I would've never approved such a merge because there was an actual problem with the code. But at js8call it got merged anyway. That is the purpose of code review. In this case, I see nothing wrong with the code. |
|
This PR is totally legit and an improvement over what we had previously, so if @rruchte wants to merge it, it looks good to me. I was asking whether we want to improve on all known problems in this area. I had no intention towards demanding it, in this PR. |
It was speculation, guided by some knowledge of the code, not observation. I have seen (and partly repaired) the code that does the I somehow presume that the "log to PSK-Reporter" functionality is only called after that data is actually received. I assume that happens, e.g., some 13 or 14 seconds later (my example was normal mode), as it takes a while to push the data through the ether. |
|
@rruchte Rob, after rebasing so this merges, please merge it. Thanks! |
There should be, to my knowledge, nothing network related left on the main thread post 2.3.0; this was indeed a problem in 2.2.0, but should have all been addressed in the 2.3.0 changes. |
I'll register an opposing view here; the lower-level the code, the more we should see In this particular instance, I think either is fine, but as a general rule, if we're out of the UI, i'll tend to reach for the standard library first. |
I saw that after some debugging and a close examination of ALL.TXT output. Before we just close this out with the simple comment change, do we want to try to roll a handful of improvements in in the interest of keeping the changes with this discussion for historical purposes? For instance:
This would simply be a matter of updating the frequency and timestamp in the cached spot if one is found, instead of a noop. Since some of these issue #9 changes are related to this cache, it makes sense to go ahead and do that in this context.
This is an issue that goes all the way up to Example //ActivityDetail d = {};
d.isLowConfidence = decodedtext.isLowConfidence();
d.isCompound = decodedtext.isCompound();
d.isDirected = decodedtext.isDirectedMessage();
d.bits = decodedtext.bits();
d.dial = freq;
d.offset = offset;
d.text = decodedtext.message();
d.utcTimestamp = DriftingDateTime::currentDateTimeUtc();
d.snr = decodedtext.snr();
d.isBuffered = false;
d.submode = decodedtext.submode();
d.tdrift = m_wideGraph->shouldAutoSyncSubmode(d.submode) ? DriftingDateTime::drift()/1000.0 : decodedtext.dt();I've made changes locally to pass the timestamp from the After my change to pass the |
|
Rob, what you want to put in it is totally up to you. This is your PR. |
|
Thanks, this was only supposed to be a comment change, but I'll add the handful of new things that are "in the spirit of" the PR that this is a sequel to, then we can address the other items under discussion separately. |
-Increases MIN_SEND_INTERVAL to 5 minutes -Changes PSKReporter::addRemoteStation to use timestamp passed as an argument instead of generating a new timestamp -Changes spot handling in PSKReporter::addRemoteStation to keep queued spots updated with the newest info, rather keeping the oldest -PSKReporter::addRemoteStation refactored to remove multiple calls to std::time(nullptr), increase clarity, and enhance Fahrvergnügen
|
One request on PRs is that we try to stick to one topic at a time, ie do a separate PR for network stuffs or for mainwindow refactor, etc. and that it points back to an issue. Makes it easier for discussions, review, and changelog/documentation. |
2ab8981 to
49c3bb3
Compare
|
I have pushed a set of changes that address the requests that I believe are in scope of the original issue, new issues have been created that can serve as context for broader changes. -Increases MIN_SEND_INTERVAL to 5 minutes I ran a build with these changes with enhanced logging during a fairly active net tonight, it behaved the way it is supposed to. |
|
Merged. Thanks! |
|
Oh, I like that Rob, thanks for your work! |
Thinking about it some more, I'll agree to that, @bazineta . The |

Updates comment in callsign cache routine to indicate band-awareness