mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Bug fixes
Former-commit-id: a6783a75edb83988d1737df3d4a7a14c71ec4223
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <hyperion/ImageProcessor.h>
|
||||
#include <hyperion/MessageForwarder.h>
|
||||
#include <hyperion/ColorTransform.h>
|
||||
#include <hyperion/ColorCorrection.h>
|
||||
#include <utils/ColorRgb.h>
|
||||
|
||||
// project includes
|
||||
@@ -247,6 +248,10 @@ void JsonClientConnection::handleMessage(const std::string &messageString)
|
||||
handleClearallCommand(message);
|
||||
else if (command == "transform")
|
||||
handleTransformCommand(message);
|
||||
else if (command == "correction")
|
||||
handleCorrectionCommand(message);
|
||||
else if (command == "temperature")
|
||||
handleTemperatureCommand(message);
|
||||
else
|
||||
handleNotImplemented();
|
||||
}
|
||||
@@ -540,10 +545,10 @@ void JsonClientConnection::handleCorrectionCommand(const Json::Value &message)
|
||||
const Json::Value & correction = message["correction"];
|
||||
|
||||
const std::string correctionId = correction.get("id", _hyperion->getCorrectionIds().front()).asString();
|
||||
ColorCorrection * colorCorrection = _hyperion->getCorrection(CorrectionId);
|
||||
ColorCorrection * colorCorrection = _hyperion->getCorrection(correctionId);
|
||||
if (colorCorrection == nullptr)
|
||||
{
|
||||
//sendErrorReply(std::string("Incorrect transform identifier: ") + transformId);
|
||||
//sendErrorReply(std::string("Incorrect correction identifier: ") + correctionId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -573,10 +578,10 @@ void JsonClientConnection::handleTemperatureCommand(const Json::Value &message)
|
||||
const Json::Value & temperature = message["temperature"];
|
||||
|
||||
const std::string tempId = temperature.get("id", _hyperion->getTemperatureIds().front()).asString();
|
||||
ColorCorrection * colorTemperature = _hyperion->getTemperature(TemperatureId);
|
||||
ColorCorrection * colorTemperature = _hyperion->getTemperature(tempId);
|
||||
if (colorTemperature == nullptr)
|
||||
{
|
||||
//sendErrorReply(std::string("Incorrect transform identifier: ") + transformId);
|
||||
//sendErrorReply(std::string("Incorrect temperature identifier: ") + tempId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
<file alias="schema-clear">schema/schema-clear.json</file>
|
||||
<file alias="schema-clearall">schema/schema-clearall.json</file>
|
||||
<file alias="schema-transform">schema/schema-transform.json</file>
|
||||
<file alias="schema-correction">schema/schema-correction.json</file>
|
||||
<file alias="schema-temperature">schema/schema-temperature.json</file>
|
||||
<file alias="schema-effect">schema/schema-effect.json</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
41
libsrc/jsonserver/schema/schema-correction.json
Normal file
41
libsrc/jsonserver/schema/schema-correction.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"type":"object",
|
||||
"required":true,
|
||||
"properties":{
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["correction"]
|
||||
},
|
||||
"correction": {
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type" : "string",
|
||||
"required" : false
|
||||
},
|
||||
"red" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum": 0.0,
|
||||
"maximum": 255.0
|
||||
},
|
||||
"green" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum": 0.0,
|
||||
"maximum": 255.0
|
||||
},
|
||||
"blue" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum": 0.0,
|
||||
"maximum": 255.0
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
41
libsrc/jsonserver/schema/schema-temperature.json
Normal file
41
libsrc/jsonserver/schema/schema-temperature.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"type":"object",
|
||||
"required":true,
|
||||
"properties":{
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["temperature"]
|
||||
},
|
||||
"temperature": {
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type" : "string",
|
||||
"required" : false
|
||||
},
|
||||
"red" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum": 0.0,
|
||||
"maximum": 255.0
|
||||
},
|
||||
"green" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum": 0.0,
|
||||
"maximum": 255.0
|
||||
},
|
||||
"blue" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum": 0.0,
|
||||
"maximum": 255.0
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
@@ -25,6 +25,16 @@
|
||||
"required" : false,
|
||||
"minimum" : 0.0
|
||||
},
|
||||
"saturationLGain" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum" : 0.0
|
||||
},
|
||||
"luminanceGain" : {
|
||||
"type" : "number",
|
||||
"required" : false,
|
||||
"minimum" : 0.0
|
||||
},
|
||||
"threshold": {
|
||||
"type": "array",
|
||||
"required": false,
|
||||
|
@@ -5,7 +5,7 @@
|
||||
"command": {
|
||||
"type" : "string",
|
||||
"required" : true,
|
||||
"enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform"]
|
||||
"enum" : ["color", "image", "effect", "serverinfo", "clear", "clearall", "transform", "correction", "temperature"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user