1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00
VILLASnode/common/lib/common.cpp

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

47 lines
837 B
C++
Raw Normal View History

2018-12-02 02:46:10 +01:00
/** Common code.
*
* @author Steffen Vogel <post@steffenvogel.de>
2022-03-15 09:05:42 -04:00
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
2022-05-19 17:40:10 +02:00
* @license Apache License 2.0
2018-12-02 02:46:10 +01:00
*********************************************************************************/
2019-10-27 20:23:47 +01:00
#include <villas/common.hpp>
2018-12-02 02:46:10 +01:00
#include <cstdlib>
2018-12-02 02:46:10 +01:00
2021-10-04 21:21:17 +02:00
std::string stateToString(enum State s)
2018-12-02 02:46:10 +01:00
{
switch (s) {
2019-06-23 16:12:53 +02:00
case State::DESTROYED:
2018-12-02 02:46:10 +01:00
return "destroyed";
2019-06-23 16:12:53 +02:00
case State::INITIALIZED:
2018-12-02 02:46:10 +01:00
return "initialized";
2019-06-23 16:12:53 +02:00
case State::PARSED:
2018-12-02 02:46:10 +01:00
return "parsed";
2019-06-23 16:12:53 +02:00
case State::CHECKED:
2018-12-02 02:46:10 +01:00
return "checked";
2019-06-23 16:12:53 +02:00
case State::STARTED:
2018-12-02 02:46:10 +01:00
return "running";
2019-06-23 16:12:53 +02:00
case State::STOPPED:
2018-12-02 02:46:10 +01:00
return "stopped";
2019-06-23 16:12:53 +02:00
case State::PENDING_CONNECT:
2018-12-02 02:46:10 +01:00
return "pending-connect";
2019-06-23 16:12:53 +02:00
case State::CONNECTED:
2018-12-02 02:46:10 +01:00
return "connected";
2019-06-23 16:12:53 +02:00
case State::PAUSED:
2018-12-02 02:46:10 +01:00
return "paused";
default:
2021-10-04 21:21:17 +02:00
return "";
2018-12-02 02:46:10 +01:00
}
}