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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
906 B
C++
Raw Permalink Normal View History

/* Dump fields and values in a socket to plot them with villasDump.py.
*
* Author: Manuel Pitz <manuel.pitz@eonerc.rwth-aachen.de>
2022-03-15 09:28:57 -04:00
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
2022-07-04 18:20:03 +02:00
* SPDX-License-Identifier: Apache-2.0
*/
2021-02-16 14:41:55 +01:00
#pragma once
2021-02-16 14:15:14 +01:00
#include <villas/log.hpp>
#include <string>
namespace villas {
namespace node {
class Dumper {
2020-11-03 18:56:07 +01:00
protected:
bool active;
int socketFd;
std::string socketPath;
bool supressRepeatedWarning;
uint64_t warningCounter;
Logger logger;
2020-11-03 18:56:07 +01:00
public:
Dumper();
~Dumper();
2021-02-16 14:41:55 +01:00
int openSocket();
int closeSocket();
bool isActive();
int setActive();
2021-02-16 14:41:55 +01:00
int setPath(const std::string &socketPathIn);
void writeDataCSV(unsigned len, double *yData, double *xData = nullptr);
void writeDataBinary(unsigned len, double *yData, double *xData = nullptr);
2020-11-03 18:56:07 +01:00
};
} // namespace node
} // namespace villas