2023-08-28 12:31:18 +02:00
|
|
|
/* Common code.
|
2018-12-02 02:46:10 +01:00
|
|
|
*
|
2023-08-31 11:17:07 +02:00
|
|
|
* Author: Steffen Vogel <post@steffenvogel.de>
|
|
|
|
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2023-08-28 12:31:18 +02:00
|
|
|
*/
|
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
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
std::string stateToString(enum State s) {
|
|
|
|
switch (s) {
|
|
|
|
case State::DESTROYED:
|
|
|
|
return "destroyed";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::INITIALIZED:
|
|
|
|
return "initialized";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::PARSED:
|
|
|
|
return "parsed";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::CHECKED:
|
|
|
|
return "checked";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::STARTED:
|
|
|
|
return "running";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::STOPPED:
|
|
|
|
return "stopped";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::PENDING_CONNECT:
|
|
|
|
return "pending-connect";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::CONNECTED:
|
|
|
|
return "connected";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
case State::PAUSED:
|
|
|
|
return "paused";
|
2018-12-02 02:46:10 +01:00
|
|
|
|
2023-09-07 13:19:19 +02:00
|
|
|
default:
|
|
|
|
return "";
|
|
|
|
}
|
2018-12-02 02:46:10 +01:00
|
|
|
}
|