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: fixes for new {Single,Multi}SignalHook classes

This commit is contained in:
Steffen Vogel 2021-07-09 19:05:40 +02:00
parent 8d525513e1
commit 8306831942
3 changed files with 6 additions and 3 deletions

View file

@ -173,6 +173,7 @@ public:
virtual void prepare()
{
MultiSignalHook::prepare();
dumperEnable = logger->level() <= SPDLOG_LEVEL_DEBUG;
signal_list_clear(&signals);
@ -253,7 +254,7 @@ public:
Hook::parse(json);
ret = json_unpack_ex(json, &err, 0, "{ s?: i, s?: F, s?: F, s?: F, s?: i , s?: i, s?: s, s?: s, s?: s, s?: b, s?: i, s?: s}",
ret = json_unpack_ex(json, &err, 0, "{ s?: i, s?: F, s?: F, s?: F, s?: i, s?: i, s?: s, s?: s, s?: s, s?: b, s?: i, s?: s}",
"sample_rate", &sampleRate,
"start_freqency", &startFrequency,
"end_freqency", &endFreqency,

View file

@ -106,6 +106,8 @@ public:
{
assert(state == State::CHECKED);
SingleSignalHook::prepare();
/* Check if signal type is float */
auto sig = (struct signal *) vlist_at(&signals, signalIndex);
if (sig->type != SignalType::FLOAT)

View file

@ -94,8 +94,8 @@ public:
const char *mode_str = nullptr;
double fSmps = 0;
ret = json_unpack_ex(json, &err, 0, "{ s?: f, s: F, s?: i, s?: i }",
"mode", &mode,
ret = json_unpack_ex(json, &err, 0, "{ s?: s, s?: f, s: F, s?: i, s?: i }",
"mode", &mode_str,
"threshold", &threshold,
"expected_smp_rate", &fSmps,
"horizon_estimation", &horizonEstimation,