mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 15:04:11 +00:00
Experimental feature: only excite one port when other traces are paused
This commit is contained in:
parent
44124bc09e
commit
de8761545d
18 changed files with 130 additions and 40 deletions
|
|
@ -51,6 +51,7 @@ void TraceModel::togglePause(unsigned int index)
|
|||
traces[index]->pause();
|
||||
}
|
||||
emit dataChanged(createIndex(index, 1), createIndex(index, 1));
|
||||
emit requiredExcitation(PortExcitationRequired(1), PortExcitationRequired(2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,6 +110,23 @@ std::vector<Trace *> TraceModel::getTraces()
|
|||
return traces;
|
||||
}
|
||||
|
||||
bool TraceModel::PortExcitationRequired(int port)
|
||||
{
|
||||
for(auto t : traces) {
|
||||
if(t->isLive() && !t->isPaused()) {
|
||||
// this trace needs measurements from VNA, check if port has to be excited for its measurement
|
||||
auto param = t->liveParameter();
|
||||
if(port == 1 && (param == Trace::LiveParameter::S11 || param == Trace::LiveParameter::S21)) {
|
||||
return true;
|
||||
} else if(port == 2 && (param == Trace::LiveParameter::S22 || param == Trace::LiveParameter::S12)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// checked all traces, none requires this port to be excited
|
||||
return false;
|
||||
}
|
||||
|
||||
void TraceModel::clearVNAData()
|
||||
{
|
||||
for(auto t : traces) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue