-
-
Notifications
You must be signed in to change notification settings - Fork 118
fix(gui): share one chart timeframe across the Runtime Monitor tabs (#5496) #5531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -492,8 +492,10 @@ int main(int argc, char** argv) | |
| qRegisterMetaType<AetherSDR::MemorySample>("AetherSDR::MemorySample"); | ||
| SystemInfoDialog memoryDialog; | ||
|
|
||
| // The selector is the dialog's, in the window header (#5496); the | ||
| // lookup on the dialog finds it there as it did on the Memory tab. | ||
| auto* range = memoryDialog.findChild<QComboBox*>(QStringLiteral("systemInfoTimeframe")); | ||
| report("the Memory tab has a timeframe selector", range != nullptr); | ||
| report("the dialog has a timeframe selector", range != nullptr); | ||
| if (range != nullptr) { | ||
| report("it offers the issue's four timeframes", range->count() == 4); | ||
| report("it defaults to 5 minutes", range->currentData().toInt() == 5 * 60); | ||
|
|
@@ -659,8 +661,8 @@ int main(int argc, char** argv) | |
| { | ||
| qRegisterMetaType<AetherSDR::CpuSample>("AetherSDR::CpuSample"); | ||
| SystemInfoDialog ov; | ||
| auto* range = ov.findChild<QComboBox*>(QStringLiteral("systemInfoOverviewTimeframe")); | ||
| report("the Overview tab has its own timeframe selector", range != nullptr && range->count() == 4); | ||
| report("the Overview tab has no timeframe selector of its own (#5496)", | ||
| ov.findChild<QComboBox*>(QStringLiteral("systemInfoOverviewTimeframe")) == nullptr); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now the only Overview-side assertion about the timeframe, and it is purely negative — it passes as long as the old object name is absent. Combined with the Memory case (which asserts only that the readouts are undisturbed by The redraw itself is genuinely hard to assert — report("the Overview tab has no timeframe selector of its own (#5496)",
ov.findChild<QComboBox*>(QStringLiteral("systemInfoOverviewTimeframe")) == nullptr);
// ...and the shared one hides on the tabs with no chart (#5496).
auto* ovTabs = ov.findChild<QTabWidget*>();
auto* ovRange = ov.findChild<QComboBox*>(QStringLiteral("systemInfoTimeframe"));
if (ovTabs != nullptr && ovRange != nullptr) {
ov.show();
QCoreApplication::processEvents();
report("the timeframe shows on Overview", ovRange->isVisible());
ovTabs->setCurrentIndex(1); // Threads: fixed 60 s window
report("the timeframe hides on Threads", !ovRange->isVisible());
ovTabs->setCurrentIndex(2); // Memory: charted again
report("the timeframe returns on Memory", ovRange->isVisible());
ov.hide();
}Non-blocking. |
||
| auto* cpuCard = ov.findChild<QLabel*>(QStringLiteral("systemInfoCardCpu")); | ||
| auto* maxCard = ov.findChild<QLabel*>(QStringLiteral("systemInfoCardMaxThread")); | ||
| auto* memCard = ov.findChild<QLabel*>(QStringLiteral("systemInfoCardMemory")); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked the ordering hazard this introduces and it holds:
m_rangeis fully populated andsetCurrentIndex(1)has already run by line 243, bothconnects come after it, andbuildOverviewTab()/buildMemoryTab()only run at 264-267 — so neither slot can fire against null graph pointers during construction, and the default selection raises no spurious refresh.refreshOverviewis null-guarded on all fourm_overview*Graphmembers besides.No change requested; recording it because "one combo now drives two refreshes" is the place this would have gone wrong.