JSON RPC Writer (configSet) (#175)

* Remove "endOfJson" Value

Deprecated value from Hypercon

* Remove "endOfJson" Value

Deprecated value from Hypercon

* Add writeJson function to JsonFactory

* ability to ignore required value in schema file

* Remove "endOfJson" Value

* Add handleConfigSetCommand function

* Add handleConfigSetCommand function

* Update JsonSchemas.qrc

* Update schema.json

* Update JsonSchemaChecker.cpp

* Add configSet command to Hyperion-remote

* Add setConfigFile function

* Add setConfigFile function

* Add schema-configset.json
This commit is contained in:
Paulchen-Panther
2016-08-14 20:17:12 +02:00
committed by redPanther
parent 97181fa83c
commit 68fd395670
14 changed files with 138 additions and 20 deletions

View File

@@ -265,6 +265,29 @@ QString JsonConnection::getConfigFile()
return QString();
}
void JsonConnection::setConfigFile(const std::string &jsonString, bool create)
{
// create command
Json::Value command;
command["command"] = "configset";
command["create"] = create;
Json::Value & config = command["configset"];
if (jsonString.size() > 0)
{
Json::Reader reader;
if (!reader.parse(jsonString, config, false))
{
throw std::runtime_error("Error in configset arguments: " + reader.getFormattedErrorMessages());
}
}
// send command message
Json::Value reply = sendMessage(command);
// parse reply message
parseReply(reply);
}
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;