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

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

62 lines
1.5 KiB
C++
Raw Normal View History

2018-12-02 02:46:10 +01:00
/** Common code.
*
2022-03-15 09:13:39 -04:00
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
2022-03-15 09:05:42 -04:00
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
2018-12-02 02:46:10 +01:00
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
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
}
}