add reference impedance to trace storage

This commit is contained in:
Jan Käberich 2023-03-05 23:14:35 +01:00
parent afda0e2994
commit f5aeca60da

View File

@ -779,6 +779,7 @@ nlohmann::json Trace::toJSON()
break; break;
} }
j["velocityFactor"] = vFactor; j["velocityFactor"] = vFactor;
j["referenceImpedance"] = reference_impedance;
j["reflection"] = reflection; j["reflection"] = reflection;
auto &pref = Preferences::getInstance(); auto &pref = Preferences::getInstance();
@ -913,6 +914,7 @@ void Trace::fromJSON(nlohmann::json j)
// data has already been loaded if present in the file // data has already been loaded if present in the file
} }
vFactor = j.value("velocityFactor", 0.66); vFactor = j.value("velocityFactor", 0.66);
reference_impedance = j.value("referenceImpedance", 50.0);
reflection = j.value("reflection", false); reflection = j.value("reflection", false);
for(auto jm : j["math"]) { for(auto jm : j["math"]) {
QString operation = QString::fromStdString(jm.value("operation", "")); QString operation = QString::fromStdString(jm.value("operation", ""));