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.
*
* 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
*/
#include <villas/common.hpp>
#include <cstdlib>
std::string stateToString(enum State s) {
switch (s) {
case State::DESTROYED:
return "destroyed";
case State::INITIALIZED:
return "initialized";
case State::PARSED:
return "parsed";
case State::CHECKED:
return "checked";
case State::STARTED:
return "running";
case State::STOPPED:
return "stopped";
case State::PENDING_CONNECT:
return "pending-connect";
case State::CONNECTED:
return "connected";
case State::PAUSED:
return "paused";
default:
return "";
}
}