More user friendly time gate with filter in time domain

This commit is contained in:
Jan Käberich 2021-04-25 15:46:34 +02:00
parent bb18dffb55
commit 4f4b2db549
18 changed files with 914 additions and 54 deletions

View file

@ -396,7 +396,7 @@ void Trace::fromJSON(nlohmann::json j)
continue;
}
qDebug() << "Creating math operation of type:" << operation;
auto op = TraceMath::createMath(type);
auto op = TraceMath::createMath(type)[0];
if(jm.contains("settings")) {
op->fromJSON(jm["settings"]);
}
@ -731,6 +731,18 @@ void Trace::addMathOperation(TraceMath *math)
updateLastMath(mathOps.rbegin());
}
void Trace::addMathOperations(std::vector<TraceMath *> maths)
{
TraceMath *input = lastMath;
for(auto m : maths) {
MathInfo info = {.math = m, .enabled = true};
m->assignInput(input);
input = m;
mathOps.push_back(info);
}
updateLastMath(mathOps.rbegin());
}
void Trace::removeMathOperation(unsigned int index)
{
if(index < 1 || index >= mathOps.size()) {