Skip to content

ATU pre-tune: per-band early exit instead of full-sweep abort (deferred from #2649) #3062

Description

@ten9876

Background

#2649 tracked eight candidate Auto-mode safety enhancements. PR #3050 implemented four (license filter, point cap, power warning, audible cue). The remaining four were deferred to follow-ups; this issue tracks item #1 from the original list.

What it does today

Currently when 3 consecutive points fail-bypass during Auto mode, the entire sweep aborts — no further bands are attempted. This makes sense if every band exhibits the failure (genuine equipment problem) but is over-aggressive when only one band's antenna is bad (e.g. broken feedline on 80m while 40m/20m/15m are all fine).

Proposed change

When `m_consecutiveFailBypass >= kMaxConsecutiveFailBypass`, advance `m_currentIndex` past the remaining points whose `bandName` matches the current one (rather than calling `finishSweep()`). The sweep continues on the next band with the failure counter reset.

Behavioral outline:

  1. 3 consecutive fail-bypass detected
  2. Note the current band name
  3. Skip ahead through `m_points` until `m_currentIndex` reaches a point on a different band
  4. Reset `m_consecutiveFailBypass = 0`
  5. Surface a status-bar / sweep-result line: "Band aborted after 3 consecutive fails — continuing on "
  6. Audible cue (already in place from PR ATU pre-tune: add Auto-mode safety nets — class filter, point cap, power warning, audible cue (#2649). Principle IV. #3050)

Implementation sketch

In `AtuPreTuneDialog::onAtuStateChanged` (`src/gui/AtuPreTuneDialog.cpp`) at the 3-consecutive-fail branch (lines ~783-790 after PR #3050):

```cpp
if (m_consecutiveFailBypass >= kMaxConsecutiveFailBypass) {
QApplication::beep();
const QString bandName = m_points.at(m_currentIndex).bandName;
const int skipStart = m_currentIndex;
// Skip remaining points on this band
while (m_currentIndex < m_points.size() - 1
&& m_points.at(m_currentIndex + 1).bandName == bandName) {
++m_currentIndex;
}
m_consecutiveFailBypass = 0;
m_skipCount += (m_currentIndex - skipStart + 1);
m_sweepResult->setText(QString(
"Band %1 aborted after %2 consecutive fails — continuing.")
.arg(bandName).arg(kMaxConsecutiveFailBypass));
nextPoint();
return;
}
```

Edge cases

  • Already on the last band — `m_currentIndex + 1 >= m_points.size()` → finishSweep() as today
  • Single-band sweep — same as above
  • First point of a new band immediately fails-bypasses — counter was reset, so it takes 3 fresh fails on the new band to trigger another skip. Right behavior.

Test plan

  • Force a 3-consecutive fail-bypass on the first band of a multi-band sweep → verify subsequent bands run
  • Force fail-bypass on the last band → verify finishSweep() still fires
  • Single-band sweep with 3 consecutive fails → verify finishSweep() still fires (no further bands to skip to)

Stats

~20 LOC change in `AtuPreTuneDialog.cpp`. No header changes. No JSON changes.

Eligibility

`aetherclaude-eligible` — well-bounded behavioural change with clear test cases.

Why this was deferred from PR #3050

Original maintainer direction prioritised the four highest-impact items (license filter being the only one that genuinely prevents a regulatory violation). The per-band early exit is UX-improving rather than safety-improving — operators with one bad antenna get more useful sweep results, but it doesn't prevent any new class of unsafe TX. So it landed lower on the first-batch list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIUser interfaceenhancementImprovement to existing featuremaintainer-reviewRequires maintainer review before any action is takensafetyEquipment protection concern

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions