2018-12-02 02:46:10 +01:00
|
|
|
|
|
|
|
/** Common code.
|
|
|
|
*
|
2022-12-14 17:39:07 +01:00
|
|
|
* @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
|
|
|
|
2019-06-23 16:26:44 +02: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
|
|
|
}
|
|
|
|
}
|