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/common/lib/common.cpp

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

45 lines
803 B
C++
Raw Permalink Normal View History

/* Common code.
2018-12-02 02:46:10 +01: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
*/
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
std::string stateToString(enum State s) {
switch (s) {
case State::DESTROYED:
return "destroyed";
2018-12-02 02:46:10 +01:00
case State::INITIALIZED:
return "initialized";
2018-12-02 02:46:10 +01:00
case State::PARSED:
return "parsed";
2018-12-02 02:46:10 +01:00
case State::CHECKED:
return "checked";
2018-12-02 02:46:10 +01:00
case State::STARTED:
return "running";
2018-12-02 02:46:10 +01:00
case State::STOPPED:
return "stopped";
2018-12-02 02:46:10 +01:00
case State::PENDING_CONNECT:
return "pending-connect";
2018-12-02 02:46:10 +01:00
case State::CONNECTED:
return "connected";
2018-12-02 02:46:10 +01:00
case State::PAUSED:
return "paused";
2018-12-02 02:46:10 +01:00
default:
return "";
}
2018-12-02 02:46:10 +01:00
}