Update Json Interface (Enable/Disable components during runtime) (#150)

* Update Hyperion.h

* Add files via upload

* Update CMakeLists.txt

* Update Hyperion.cpp

* Update JsonClientConnection.cpp

* Update JsonClientConnection.h

* Update JsonSchemas.qrc

* Add files via upload

* Update schema.json

* Update JsonConnection.cpp

* Update JsonConnection.h

* Update hyperion-remote.cpp
This commit is contained in:
Paulchen-Panther
2016-08-04 13:10:53 +02:00
committed by brindosch
parent f183032270
commit bfb06966de
12 changed files with 179 additions and 2 deletions

View File

@@ -192,6 +192,25 @@ void JsonConnection::clearAll()
parseReply(reply);
}
void JsonConnection::setComponentState(const std::string& component, const bool state)
{
state ? std::cout << "Enable Component " : std::cout << "Disable Component ";
std::cout << component << std::endl;
// create command
Json::Value command;
command["command"] = "componentstate";
Json::Value & parameter = command["componentstate"];
parameter["component"] = component;
parameter["state"] = state;
// send command message
Json::Value reply = sendMessage(command);
// parse reply message
parseReply(reply);
}
void JsonConnection::setSource(int priority)
{
// create command