Experimental feature: only excite one port when other traces are paused

This commit is contained in:
Jan Käberich 2020-09-15 23:22:08 +02:00
parent 44124bc09e
commit de8761545d
18 changed files with 130 additions and 40 deletions

View file

@ -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) {