Skip to content

Commit 1488087

Browse files
committed
fix(api): add missing function operator serialization
1 parent d298ff7 commit 1488087

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libs/api/include/rtbot/OperatorJson.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class OperatorJson {
119119
return make_addition(id, num_ports);
120120
} else if (type == "GreaterThan") {
121121
return make_greater_than(id, parsed["value"].get<double>());
122+
} else if (type == "Function") {
123+
return make_function(id, parsed["points"].get<std::vector<std::pair<double, double>>>());
122124
} else if (type == "ConstantNumber") {
123125
return make_constant_number(id, parsed["value"].get<double>());
124126
} else if (type == "ConstantBoolean") {
@@ -283,6 +285,8 @@ class OperatorJson {
283285
j["window_size"] = std::dynamic_pointer_cast<PeakDetector>(op)->window_size();
284286
} else if (type == "GreaterThan") {
285287
j["value"] = std::dynamic_pointer_cast<GreaterThan>(op)->get_threshold();
288+
} else if (type == "Function") {
289+
j["points"] = std::dynamic_pointer_cast<Function>(op)->get_points();
286290
} else if (type == "ConstantNumber" || type == "ConstantNumberToBoolean") {
287291
j["value"] = std::dynamic_pointer_cast<ConstantNumber>(op)->get_value().value;
288292
} else if (type == "ConstantBoolean" || type == "ConstantBooleanToNumber") {

0 commit comments

Comments
 (0)