|
23 | 23 | #include "rtbot/std/EqualTo.h" |
24 | 24 | #include "rtbot/std/FiniteImpulseResponse.h" |
25 | 25 | #include "rtbot/std/GreaterThan.h" |
| 26 | +#include "rtbot/std/GreaterThanStream.h" |
26 | 27 | #include "rtbot/std/HermiteResampler.h" |
27 | 28 | #include "rtbot/std/Identity.h" |
28 | 29 | #include "rtbot/std/LessThan.h" |
| 30 | +#include "rtbot/std/LessThanStream.h" |
29 | 31 | #include "rtbot/std/Linear.h" |
30 | 32 | #include "rtbot/std/Minus.h" |
31 | 33 | #include "rtbot/std/MovingAverage.h" |
@@ -167,6 +169,26 @@ void from_json(const json& j, Or<T, V>& p) { |
167 | 169 | p = Or<T, V>(j["id"].get<string>()); |
168 | 170 | } |
169 | 171 |
|
| 172 | +template <class T, class V> |
| 173 | +void to_json(json& j, const GreaterThanStream<T, V>& p) { |
| 174 | + j = json{{"type", p.typeName()}, {"id", p.id}}; |
| 175 | +} |
| 176 | + |
| 177 | +template <class T, class V> |
| 178 | +void from_json(const json& j, GreaterThanStream<T, V>& p) { |
| 179 | + p = GreaterThanStream<T, V>(j["id"].get<string>()); |
| 180 | +} |
| 181 | + |
| 182 | +template <class T, class V> |
| 183 | +void to_json(json& j, const LessThanStream<T, V>& p) { |
| 184 | + j = json{{"type", p.typeName()}, {"id", p.id}}; |
| 185 | +} |
| 186 | + |
| 187 | +template <class T, class V> |
| 188 | +void from_json(const json& j, LessThanStream<T, V>& p) { |
| 189 | + p = LessThanStream<T, V>(j["id"].get<string>()); |
| 190 | +} |
| 191 | + |
170 | 192 | template <class T, class V> |
171 | 193 | void to_json(json& j, const Division<T, V>& p) { |
172 | 194 | j = json{{"type", p.typeName()}, {"id", p.id}}; |
@@ -428,6 +450,8 @@ FactoryOp::FactoryOp() { |
428 | 450 | op_registry_add<Variable<uint64_t, double>, json>(); |
429 | 451 | op_registry_add<TimeShift<uint64_t, double>, json>(); |
430 | 452 | op_registry_add<Pipeline<uint64_t, double>, json>(); |
| 453 | + op_registry_add<GreaterThanStream<uint64_t, double>, json>(); |
| 454 | + op_registry_add<LessThanStream<uint64_t, double>, json>(); |
431 | 455 | } |
432 | 456 |
|
433 | 457 | static FactoryOp factory; |
|
0 commit comments