mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-08 07:53:40 +00:00
Improve automatic graph configuraion when traces change domains
This commit is contained in:
parent
7dd2c0501e
commit
d99dab35aa
5 changed files with 41 additions and 16 deletions
|
|
@ -788,12 +788,18 @@ void TracePlot::checkIfStillSupported(Trace *t)
|
|||
// attempt to configure the graph for the changed trace, remove only if this fails
|
||||
if(!configureForTrace(t)) {
|
||||
enableTrace(t, false);
|
||||
}
|
||||
// remove non-supported traces after graph has been adjusted
|
||||
for(auto t : activeTraces()) {
|
||||
if(!supported(t)) {
|
||||
enableTrace(t, false);
|
||||
}
|
||||
} else {
|
||||
// other trace may need to be removed because the graph no longer supports them. However, they (the traces)
|
||||
// may change soon as well (e.g. because multiple traces changed at the same time and we are only handling
|
||||
// the first changed trace right now). Postpone the deletion of other traces until all currently executing
|
||||
// slots have completed
|
||||
QTimer::singleShot(0, [this]{
|
||||
for(auto t : activeTraces()) {
|
||||
if(!supported(t)) {
|
||||
enableTrace(t, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue