Update Json Interface (return config file) (#144)

* Add handleConfigGetCommand Function

* Add handleConfigGetCommand Function

* Add schema-configget.json

* Add configget

* Add new JSON file schema-configget.json

* add --configget command to hyperion-remote

* Add getConfigFile function

* Add getConfigFile function
This commit is contained in:
Paulchen-Panther
2016-08-03 22:03:19 +02:00
committed by redPanther
parent 722d4eb357
commit 0e2f0127fd
8 changed files with 79 additions and 3 deletions

View File

@@ -220,6 +220,32 @@ void JsonConnection::setSourceAutoSelect()
parseReply(reply);
}
QString JsonConnection::getConfigFile()
{
std::cout << "Get configuration file from Hyperion Server" << std::endl;
// create command
Json::Value command;
command["command"] = "configget";
// send command message
Json::Value reply = sendMessage(command);
// parse reply message
if (parseReply(reply))
{
if (!reply.isMember("result") || !reply["result"].isObject())
{
throw std::runtime_error("No configuration file available in result");
}
const Json::Value & config = reply["result"];
return QString(config.toStyledString().c_str());
}
return QString();
}
void JsonConnection::setTransform(std::string * transformId, double * saturation, double * value, double * saturationL, double * luminance, double * luminanceMin, ColorTransformValues *threshold, ColorTransformValues *gamma, ColorTransformValues *blacklevel, ColorTransformValues *whitelevel)
{
std::cout << "Set color transforms" << std::endl;