Much improved heartbeat and CQ loop implementation, various minor cleanups.#5
Conversation
|
@aknrdureegaesr how do you want to handle this? There is already a 2.4 tag at that commit, it just hasn't been branched (yet). I intended to create the 2.4 branch from that commit this evening yet to store a "snapshot" in history where the codebase has been thoroughly thrashed and is as bug-free as we can make it. So do you want this to be a WIP and label it as such? Or would you rather merge it to master as-is and fix any bugs later? I'd like to have @bazineta take a look at this. He did the port to C++ and is most familiar with this part of the code. I'm not thoroughly convinced your fix achieves the desired result since in my testing I haven't been able to duplicate any timing issues, or noticed any failed decodes on the receiving end. An HB or CQ is always transmitted in one frame here no matter what speed mode is used, and replies always come on the very next frame. |
|
There's a lot to digest here. A couple of initial comments.
|
|
To add more context to observation (3), for small integral-sized values, a pattern like the following is simple and efficient; an excerpt from some of my own stuff (the Class member, private:
Accessor and mutator, public: This has the desired effect of the protective singleton without all the ceremony; it might be a good pattern here. While I've excerpted from what is a class in my implementation, this works equally well at namespace scope when the mission is just to have a single thread-safe global value. |
Please do so! I'd suggest: Start a 2.4.0 release branch from that commit. That would be a good place to develop whatever bits are missing to run an actual release, possibly including "how to release" documentation. The main branch can continue towards 2.4.1 at the same time. After the 2.4.0 release is a reality, we can later rebase a copy of the 2.4.0 release branch to either become a part of the main branch or of a new 2.4.1 release branch. |
|
This does not yet even work. Can no longer type in messages. Need to fix that. So I decidedly object to this being merged as it presently sits. |
Also a tiny amount of additional logging in Modulator.
|
My own objection has been addressed:
For all I know, it does now. I'll try a few QSOs tomorrow. |
I didn't know what
Guilty as charged. (After moving away from C++, I spent the next 10 or 15 years or so as a Java developer.)
Why is this a singleton? I want a Java-esce or using the power of static? Doing it the Java way was not my not knowing how to use I'm pretty sure it doesn't hurt to construct early. But only "pretty sure". Could it happen that the UI thread isn't the initial thread that starts the whole program? If I'm not sure, do I need to move such a statically generated object from one thread to another? If so, when is the opportune time to do this? And I even boast that lazyness a virtue: It lifts the burden to think through the same issues again from anybody who comes to this code after me. We are application programmers. In my opinon, we should try to avoid subtleties if comprehensible "pedestrian" code gets the job done quite as well. My "Java way" is robust, as far as I can tell, and it fits the bill. Any performance hit will be quite negligible. Finally, why In a Qt project, using I hope you enjoy this discussion, @bazineta . What do you think? Can we count your objection as answered, without me changing the |
The method Later edit: |
Yes....the meaning of the term has changed since 2011, and now, it means 'data race here' ;). Using |
|
So, thanks to @bazineta for the review comments! I learned a thing or two in the process! In the end, I decided to use plain |
|
If I didn't overlook anything, I have by now reacted to all objections. No reviewer has as of yet uttered the coveted "lgtm". So this PR is again up in limbo, like a new PR nobody has yet looked at. |
|
It's been looked at plenty. It builds, seems to run without issues (on MacOS 26). I'd say if @bazineta has no real issues with it, go ahead and merge it. While it won't create a conflict anyway, I'd like to bump master to 2.4.1-dev as soon as this gets merged. |
|
LGTM. |
|
Merged. Thanks! |
JS8Call-improved#3 waterfall right-panel Control/Display/Timing tabs CN visible (User verified). - 69 EN sources → CN: 控制/显示/时序 三 tab + 子控件 (label/tooltip/spinbox 后缀) - QSY 保英文 (§4 缩写锁); NORMAL/SLOW 保英文 (tooltip 内 JS8 mode names) - TX cycle → 发射 (JS8Call-improved#63-66); Timing → 时序 (JS8Call-improved#52) - Offset → 频偏 (JS8Call-improved#3, 与 JS8Call-improved#5 Offset:→频偏: 对偶, 覆盖 lupdate same-text body-fill stub 偏移) - lupdate fresh: Found 851 source text(s) (0 new), FALSIFIER① 排除 Known limitations: - EN switch 需 restart (PARK-092 sub-window changeEvent override 共缺, 接受) - Directed-to 切换"闪现-回 EN" → PARK-095 (动态 menu lifecycle, 另开 sub-phase) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Thus far, the CQ loop and the HB loop code would trigger the PTT up to 1 second too late. So the transmitted signals might loose up to one second of air time. Half that on average.
Also, I have seen it with injected logging that whatever TX delay I might have configured was ignored by the previous code when running HB or CQ loops. This bug has also been fixed.
This PR also contains a good measure of additional comments, name improvements, and some signal and slot cleanup.
I have tested this only somewhat, hope to do more of that in the upcoming days. I hope I did well, but there may be subtle bugs in here somewhere.
I'm not sure what our release plans are.
One option would be to release 2.4.0 from commit 02070cc (which is where that git tag currently sits and what has been tested extensively by @Chris-AC9KH and possibly other people). Then this work could become part of a different release 2.4.1. This would offer a fallback route from 2.4.1 to 2.4.0, should these changes turn out to be buggy.