1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

hook: add more calls to Hook::parse()

This commit is contained in:
Steffen Vogel 2020-08-28 19:49:36 +02:00
parent 113cef9a60
commit ac572d9d97
12 changed files with 24 additions and 0 deletions

View file

@ -105,6 +105,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
const char *name = nullptr;
const char *unit = nullptr;
const char *type = nullptr;

View file

@ -45,6 +45,8 @@ void DecimateHook::parse(json_t *cfg)
assert(state != State::STARTED);
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s: i }",
"ratio", &ratio
);

View file

@ -156,6 +156,8 @@ public:
json_t *json_harmonics, *json_harmonic, *json_signal;
size_t i;
Hook::parse(cfg);
double rate = -1, dt = -1;
ret = json_unpack_ex(cfg, &err, 0, "{ s: o, s: F, s?: F, s?: F, s: o, s?: b }",

View file

@ -54,6 +54,8 @@ public:
json_error_t err;
json_t *json_phases, *json_phase;
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s: o }",
"phases", &json_phases
);

View file

@ -79,6 +79,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s: o, s?: F, s?: F, s?: i, s?: s }",
"signal", &json_signal,
"threshold", &threshold,

View file

@ -43,6 +43,8 @@ void LimitRateHook::parse(json_t *cfg)
double rate;
const char *m = nullptr;
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s: F, s?: s }",
"rate", &rate,
"mode", &m

View file

@ -65,6 +65,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s: i, s?: f }",
"signal_index", &idx,
"threshold", &thresh

View file

@ -75,6 +75,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s?: F, s?: F, s: o }",
"scale", &scale,
"offset", &offset,

View file

@ -46,6 +46,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s: i }",
"offset", &offset
);

View file

@ -57,6 +57,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s: F }",
"mode", &m,
"offset", &o

View file

@ -69,6 +69,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
ret = json_unpack_ex(cfg, &err, 0, "{ s: F }", "seconds", &s);
if (!ret) {
seconds.wait = time_from_double(s);

View file

@ -190,6 +190,8 @@ public:
assert(state != State::STARTED);
Hook::parse(cfg);
const char *f = nullptr;
const char *u = nullptr;