mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-16 00:00:02 +01:00
ebm: added skeleton for new hook
This commit is contained in:
parent
c26d3bc093
commit
6c01a32ee3
2 changed files with 113 additions and 7 deletions
lib/hooks
|
@ -21,22 +21,23 @@
|
|||
###################################################################################
|
||||
|
||||
set(HOOK_SRC
|
||||
average.c
|
||||
cast.c
|
||||
decimate.c
|
||||
dp.c
|
||||
drop.c
|
||||
dump.c
|
||||
ebm.c
|
||||
fix.c
|
||||
jitter_calc.c
|
||||
limit_rate.c
|
||||
restart.c
|
||||
scale.c
|
||||
shift_seq.c
|
||||
shift_ts.c
|
||||
skip_first.c
|
||||
stats.c
|
||||
ts.c
|
||||
limit_rate.c
|
||||
scale.c
|
||||
fix.c
|
||||
cast.c
|
||||
average.c
|
||||
dump.c
|
||||
dp.c
|
||||
)
|
||||
|
||||
if(WITH_IO)
|
||||
|
|
105
lib/hooks/ebm.c
Normal file
105
lib/hooks/ebm.c
Normal file
|
@ -0,0 +1,105 @@
|
|||
/** Energy-based Metric hook.
|
||||
*
|
||||
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
* @copyright 2014-2019, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @license GNU General Public License (version 3)
|
||||
*
|
||||
* VILLASnode
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************************/
|
||||
|
||||
/** @addtogroup hooks Hook functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <villas/hook.h>
|
||||
#include <villas/plugin.h>
|
||||
#include <villas/sample.h>
|
||||
|
||||
struct ebm {
|
||||
|
||||
};
|
||||
|
||||
static int ebm_init(struct hook *h)
|
||||
{
|
||||
__attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ebm_destroy(struct hook *h)
|
||||
{
|
||||
__attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ebm_start(struct hook *h)
|
||||
{
|
||||
__attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ebm_stop(struct hook *h)
|
||||
{
|
||||
__attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ebm_parse(struct hook *h, json_t *cfg)
|
||||
{
|
||||
__attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ebm_prepare(struct hook *h)
|
||||
{
|
||||
__attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int ebm_process(struct hook *h, struct sample *smps[], unsigned *cnt)
|
||||
{
|
||||
__attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct plugin p = {
|
||||
.name = "ebm",
|
||||
.description = "Energy-based Metric",
|
||||
.type = PLUGIN_TYPE_HOOK,
|
||||
.hook = {
|
||||
.flags = HOOK_PATH | HOOK_NODE_READ | HOOK_NODE_WRITE,
|
||||
.priority = 99,
|
||||
.init = ebm_init,
|
||||
.init_signals = ebm_prepare,
|
||||
.destroy = ebm_destroy,
|
||||
.start = ebm_start,
|
||||
.stop = ebm_stop,
|
||||
.parse = ebm_parse,
|
||||
.process = ebm_process,
|
||||
.size = sizeof(struct ebm)
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_PLUGIN(&p)
|
||||
|
||||
/** @} */
|
Loading…
Add table
Reference in a new issue