Save/load trace and graph setup

This commit is contained in:
Jan Käberich 2020-12-04 23:49:52 +01:00
parent b91f431473
commit 9ad8def2ea
33 changed files with 605 additions and 28 deletions

View file

@ -293,6 +293,24 @@ void SpectrumAnalyzer::initializeDevice()
window->getDevice()->Configure(settings);
}
nlohmann::json SpectrumAnalyzer::toJSON()
{
nlohmann::json j;
j["traces"] = traceModel.toJSON();
j["tiles"] = central->toJSON();
return j;
}
void SpectrumAnalyzer::fromJSON(nlohmann::json j)
{
if(j.contains("traces")) {
traceModel.fromJSON(j["traces"]);
}
if(j.contains("tiles")) {
central->fromJSON(j["tiles"]);
}
}
using namespace std;
void SpectrumAnalyzer::NewDatapoint(Protocol::SpectrumAnalyzerResult d)