Logical switches

This commit is contained in:
Raphael Coeffic
2021-12-31 10:53:09 +01:00
parent 80c62bb1f0
commit c6b23797a7
8 changed files with 269 additions and 22 deletions
@@ -25,6 +25,7 @@
#include "yaml_expodata.h"
#include "yaml_curvedata.h"
#include "yaml_moduledata.h"
#include "yaml_logicalswitchdata.h"
#include "modeldata.h"
#include "output_data.h"
@@ -315,7 +316,13 @@ Node convert<ModelData>::encode(const ModelData& rhs)
node["points"] = points;
}
// logicalSw[]
for (int i = 0; i < CPN_MAX_LOGICAL_SWITCHES; i++) {
const LogicalSwitchData& ls = rhs.logicalSw[i];
if (!ls.isEmpty()) {
node["logicalSw"][std::to_string(i)] = ls;
}
}
// customFn[]
// swashRingData
@@ -397,8 +404,8 @@ bool convert<ModelData>::decode(const Node& node, ModelData& rhs)
node["curves"] >> rhs.curves;
YamlReadCurvePoints(node["points"], rhs.curves);
// logicalSw[]
// customFn[]
node["logicalSw"] >> rhs.logicalSw;
node["customFn"] >> rhs.customFn;
// swashRingData