refactor(cpn): Support JSON radio hardware definitions (#4406)
This commit is contained in:
@@ -116,7 +116,7 @@ Node convert<LogicalSwitchData>::encode(const LogicalSwitchData& rhs)
|
||||
node["delay"] = rhs.delay;
|
||||
node["duration"] = rhs.duration;
|
||||
node["andsw"] = YamlRawSwitchEncode(RawSwitch(rhs.andsw));
|
||||
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -161,6 +161,11 @@ bool convert<LogicalSwitchData>::decode(const Node& node,
|
||||
case LS_FAMILY_VCOMP: {
|
||||
std::string src_str;
|
||||
getline(def, src_str, ',');
|
||||
if (def_str.size() >= 4 && def_str.substr(0, 4) == "lua(") {
|
||||
std::string tmp_str;
|
||||
getline(def, tmp_str, ',');
|
||||
src_str += ("," + tmp_str);
|
||||
}
|
||||
rhs.val1 = YamlRawSourceDecode(src_str).toValue();
|
||||
getline(def, src_str);
|
||||
rhs.val2 = YamlRawSourceDecode(src_str).toValue();
|
||||
@@ -178,6 +183,11 @@ bool convert<LogicalSwitchData>::decode(const Node& node,
|
||||
default: {
|
||||
std::string src_str;
|
||||
getline(def, src_str, ',');
|
||||
if (def_str.size() >= 4 && def_str.substr(0, 4) == "lua(") {
|
||||
std::string tmp_str;
|
||||
getline(def, tmp_str, ',');
|
||||
src_str += ("," + tmp_str);
|
||||
}
|
||||
rhs.val1 = YamlRawSourceDecode(src_str).toValue();
|
||||
def >> rhs.val2;
|
||||
} break;
|
||||
|
||||
Reference in New Issue
Block a user