From ce528aa299501ecab63018f91b937766ffbc95be Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Sun, 19 Jan 2014 19:54:38 +0000 Subject: variables writing json --- NT/src/nodes.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'NT/src/nodes.h') diff --git a/NT/src/nodes.h b/NT/src/nodes.h index ede81eb..64d14a2 100644 --- a/NT/src/nodes.h +++ b/NT/src/nodes.h @@ -13,14 +13,14 @@ namespace Rotor{ class Time: public Double_node { public: Time(){type="time";}; - Time(map &settings):Time() { + Time(Json::Value &settings):Time() { init(settings); }; const double &get_output(const Frame_parameters &frame){ value=frame.time; return value; } - Time* clone(map &_settings) { return new Time(_settings);}; + Time* clone(Json::Value &_settings) { return new Time(_settings);}; private: double value; }; @@ -34,15 +34,15 @@ namespace Rotor{ type_id="11c67850-7ce4-11e3-abf6-930ef8613c46"; ui_type="none"; } - Multiply(map &settings):Multiply() { + Multiply(Json::Value &settings):Multiply() { init(settings); }; const double &get_output(const Frame_parameters &frame){ - double val=1.0f; - for (auto var:factors->values) val*=var.get(frame); - return val; + result=1.0f; + for (auto var:factors->values) result*=var.get(frame); + return result; } - Multiply* clone(map &_settings) { return new Multiply(_settings);}; + Multiply* clone(Json::Value &_settings) { return new Multiply(_settings);}; private: Variable_array_type *factors; double result; @@ -57,7 +57,7 @@ namespace Rotor{ inlet=create_inlet("inlet"); type="print"; } - Print(map &settings):Print() { + Print(Json::Value &settings):Print() { init(settings); }; const std::string &get_output(const Frame_parameters &frame){ @@ -66,7 +66,7 @@ namespace Rotor{ result=out.str(); return result; } - Print* clone(map &_settings) { return new Print(_settings);}; + Print* clone(Json::Value &_settings) { return new Print(_settings);}; private: Variable_type *inlet; std::string result; -- cgit v1.2.3