2015-03-17 22:46:46 +01:00
|
|
|
/** Node type: OPAL (libOpalAsync API)
|
2014-12-05 12:30:48 +01:00
|
|
|
*
|
|
|
|
* This file implements the opal subtype for nodes.
|
|
|
|
*
|
2015-05-06 11:36:51 +02:00
|
|
|
* @file
|
2015-06-02 21:53:04 +02:00
|
|
|
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
2017-03-03 20:20:13 -04:00
|
|
|
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
|
2017-04-27 12:56:43 +02:00
|
|
|
* @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.
|
2017-05-05 19:24:16 +00:00
|
|
|
*
|
2017-04-27 12:56:43 +02:00
|
|
|
* 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.
|
2017-05-05 19:24:16 +00:00
|
|
|
*
|
2017-04-27 12:56:43 +02:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2017-03-03 20:20:13 -04:00
|
|
|
*********************************************************************************/
|
|
|
|
|
2015-09-19 18:48:00 +02:00
|
|
|
/**
|
|
|
|
* @ingroup node
|
|
|
|
* @addtogroup opal OPAL-RT Async Process node type
|
2015-05-06 11:36:51 +02:00
|
|
|
* @{
|
2017-03-03 20:20:13 -04:00
|
|
|
*/
|
2014-12-05 12:30:48 +01:00
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
#pragma once
|
2014-12-05 12:30:48 +01:00
|
|
|
|
2015-03-17 22:46:46 +01:00
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
#include "node.h"
|
|
|
|
#include "msg.h"
|
|
|
|
|
2015-03-12 22:56:58 +01:00
|
|
|
/* Define RTLAB before including OpalPrint.h for messages to be sent
|
|
|
|
* to the OpalDisplay. Otherwise stdout will be used. */
|
|
|
|
#define RTLAB
|
|
|
|
#include "OpalPrint.h"
|
|
|
|
#include "AsyncApi.h"
|
2015-03-17 22:46:46 +01:00
|
|
|
#include "OpalGenAsyncParamCtrl.h"
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2014-12-05 12:30:48 +01:00
|
|
|
struct opal {
|
2015-03-17 22:46:46 +01:00
|
|
|
int reply;
|
|
|
|
int mode;
|
2014-12-05 12:30:48 +01:00
|
|
|
|
2015-03-17 22:46:46 +01:00
|
|
|
int send_id;
|
|
|
|
int recv_id;
|
2017-05-05 19:24:16 +00:00
|
|
|
|
2015-03-17 22:46:46 +01:00
|
|
|
Opal_SendAsyncParam send_params;
|
|
|
|
Opal_RecvAsyncParam recv_params;
|
2014-12-05 12:30:48 +01:00
|
|
|
};
|
|
|
|
|
2015-03-17 22:46:46 +01:00
|
|
|
/** Initialize global OPAL settings and maps shared memory regions.
|
|
|
|
*
|
2017-04-18 17:58:23 +02:00
|
|
|
* @see node_type::init
|
2015-03-17 22:46:46 +01:00
|
|
|
*/
|
2017-04-07 17:32:36 +02:00
|
|
|
int opal_init(struct super_node *sn);
|
2015-03-17 22:46:46 +01:00
|
|
|
|
|
|
|
/** Free global OPAL settings and unmaps shared memory regions.
|
|
|
|
*
|
2017-04-18 17:58:23 +02:00
|
|
|
* @see node_type::deinit
|
2015-03-17 22:46:46 +01:00
|
|
|
*/
|
|
|
|
int opal_deinit();
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::parse */
|
2015-11-23 16:42:43 +01:00
|
|
|
int opal_parse(struct node *n, config_setting_t *cfg);
|
2015-03-31 13:48:41 +02:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::print */
|
2015-09-22 12:58:37 +02:00
|
|
|
char * opal_print(struct node *n);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2015-12-13 02:00:17 +01:00
|
|
|
/** Print global settings of the OPAL node type. */
|
|
|
|
int opal_print_global();
|
2015-03-17 22:46:46 +01:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::open */
|
2017-03-11 23:30:24 -03:00
|
|
|
int opal_start(struct node *n);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::close */
|
2017-03-11 23:30:24 -03:00
|
|
|
int opal_stop(struct node *n);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::read */
|
2016-06-14 01:17:58 +02:00
|
|
|
int opal_read(struct node *n, struct sample *smps[], unsigned cnt);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2017-04-18 17:58:23 +02:00
|
|
|
/** @see node_type::write */
|
2016-06-14 01:17:58 +02:00
|
|
|
int opal_write(struct node *n, struct sample *smps[], unsigned cnt);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
/** @} */
|