Skip to content

[feature] Add A index to propagation overlay#1148

Merged
ten9876 merged 1 commit into
aethersdr:mainfrom
jensenpat:feature/propagation-a-index
Apr 11, 2026
Merged

[feature] Add A index to propagation overlay#1148
ten9876 merged 1 commit into
aethersdr:mainfrom
jensenpat:feature/propagation-a-index

Conversation

@jensenpat

Copy link
Copy Markdown
Collaborator

What changed

This extends the existing HF propagation conditions overlay in the panadapter to include the current A index alongside the existing K index and Solar Flux Index.

The overlay now displays:

K<n> A<n> SFI <n>

with the A index positioned between K and SFI in both rendering paths.

Why this changed

The panadapter already exposes useful propagation context with K index and SFI, but it was missing the A index, which is another commonly used indicator for current geomagnetic conditions.

Adding it makes the propagation label more complete without changing the overall UI pattern.

Implementation details

  • Added aIndex to PropForecast
  • Parsed <aindex> from the existing HamQSL solar XML feed
  • Persisted/restored the A index in AppSettings alongside K, SFI, and timestamp
  • Updated MainWindow plumbing so all panadapters receive the new three-value forecast state
  • Updated the panadapter overlay text in both paint paths to render K, then A, then SFI

User impact

Users who enable View > Propagation Conditions will now see the current A index directly in the panadapter overlay, between the K index and SFI.

Validation

  • Built from the latest main base in a dedicated worktree
  • Verified bundled RADE/Opus dependency download/build path
  • Ran cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
  • Ran cmake --build build -j8
  • Launched the built app and visually confirmed the updated overlay renders correctly

👨🏼‍💻 Generated with OpenAI Codex (GPT-5.3 Pro) and tested by @jensenpat

@jensenpat jensenpat requested a review from ten9876 as a code owner April 10, 2026 22:07

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding A-index — it's a natural complement to K and SFI, and the implementation is clean. The change follows all existing patterns correctly: AppSettings (not QSettings), both GPU and software paint paths updated symmetrically, and the struct default of -1 for "not yet fetched" is consistent with the existing convention.

One thing worth flagging — cache invalidation on upgrade

loadCache() and setEnabled() now both require aIndex >= 0 before restoring or emitting cached data:

if (k >= 0 && a >= 0 && sfi > 0 && ts > 0) {  // a will be -1 for pre-upgrade cache

Any existing user who upgrades will have PropForecastAIndex absent from their settings, so a reads as -1 and the entire cached forecast is silently dropped. The overlay won't appear until after the first successful network fetch post-launch. For most users this is a ~30–60 second gap at most, and the fetch runs automatically, so it's a minor UX issue — but it is a regression from the current behaviour where the overlay appears immediately.

If you want to preserve the instant-on behaviour through the upgrade, a straightforward fix is to treat a missing a as "old cache format, accept it anyway" by initialising it to 0 (a valid A-index) when the key is absent:

int a = s.contains("PropForecastAIndex")
    ? s.value("PropForecastAIndex").toInt()
    : 0;  // treat absent key as A=0 (valid, won't block restore)

Or simply document the one-time miss as acceptable — either way is fine, just wanted to make sure it was a deliberate choice.

Everything else looks good:

  • XML tag <aindex> matches the HamQSL solar feed element name
  • toInt() fallback to 0 on a malformed element is safe — A0 is a valid value and the pattern is consistent with K/SFI parsing
  • All three setPropForecast call sites in MainWindow.cpp are updated
  • showProp guard in both render paths is consistent
  • No out-of-scope files touched

Again, nice clean contribution — thank you @jensenpat!

@ten9876 ten9876 merged commit 502c1ff into aethersdr:main Apr 11, 2026
5 checks passed
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