priorities rework, webc update (#366)

* update

* update

* tabs test

* update

* test

* ...

* fix editor

* update ui

* fix visual glitch if help is off

* fix fadecandy error and th

[skip ci]
This commit is contained in:
brindosch
2017-01-17 21:53:35 +01:00
committed by redPanther
parent 5b809743f7
commit 8d7137136b
75 changed files with 1713 additions and 1144 deletions

View File

@@ -381,7 +381,7 @@ int EffectEngine::runEffectScript(const QString &script, const QString &name, co
_activeEffects.push_back(effect);
// start the effect
_hyperion->registerPriority("EFFECT: "+name.toStdString(), priority);
_hyperion->registerPriority(name.toStdString(), priority);
effect->start();
return 0;
@@ -426,5 +426,5 @@ void EffectEngine::effectFinished(Effect *effect)
// cleanup the effect
effect->deleteLater();
_hyperion->unRegisterPriority("EFFECT: " + effect->getName().toStdString());
_hyperion->unRegisterPriority(effect->getName().toStdString());
}

View File

@@ -8,7 +8,6 @@
"type" : "object",
"title" : "edt_conf_gen_heading_title",
"required" : true,
"defaultProperties": ["name"],
"properties" :
{
"name" :
@@ -47,6 +46,9 @@
"type" : "string",
"enum" : ["silent", "warn", "verbose", "debug"],
"title" : "edt_conf_log_level_title",
"options" : {
"enum_titles" : ["edt_conf_enum_logsilent", "edt_conf_enum_logwarn", "edt_conf_enum_logverbose", "edt_conf_enum_logdebug"]
},
"default" : "warn"
}
},
@@ -62,8 +64,7 @@
{
"type" :
{
"type" : "string",
"required" : true
"type" : "string"
},
"ledCount" :
{
@@ -100,13 +101,12 @@
"type":"object",
"title" : "edt_conf_color_heading_title",
"required" : true,
"defaultProperties": ["imageToLedMappingType","channelAdjustment_enable","channelAdjustment"],
"properties":
{
"imageToLedMappingType" :
{
"type" : "string",
"title" : "edt_conf_color_imageToLedMappingType",
"title" : "edt_conf_color_imageToLedMappingType_title",
"enum" : ["multicolor_mean", "unicolor_mean"],
"default" : "multicolor_mean",
"options" : {
@@ -117,14 +117,14 @@
"channelAdjustment_enable" :
{
"type" : "boolean",
"title" : "edt_conf_color_channelAdjustment_enable",
"title" : "edt_conf_color_channelAdjustment_enable_title",
"default" : true,
"propertyOrder" : 2
},
"channelAdjustment_v4l_only" :
{
"type" : "boolean",
"title" : "edt_conf_color_channelAdjustment_v4l_only",
"title" : "edt_conf_color_channelAdjustment_v4l_only_title",
"default" : false,
"propertyOrder" : 3
},
@@ -143,7 +143,7 @@
"id" :
{
"type" : "string",
"title" : "edt_conf_color_id",
"title" : "edt_conf_color_id_title",
"required" : true,
"default" : "A userdefined name",
"propertyOrder" : 1
@@ -151,7 +151,7 @@
"leds" :
{
"type" : "string",
"title" : "edt_conf_color_leds",
"title" : "edt_conf_color_leds_title",
"required" : true,
"default" : "*",
"propertyOrder" : 2
@@ -159,7 +159,7 @@
"black" :
{
"type" : "array",
"title" : "edt_conf_color_black",
"title" : "edt_conf_color_black_title",
"format" : "colorpicker",
"required" : true,
"default": [0,0,0],
@@ -175,7 +175,7 @@
"white" :
{
"type" : "array",
"title" : "edt_conf_color_white",
"title" : "edt_conf_color_white_title",
"format" : "colorpicker",
"required" : true,
"default": [255,255,255],
@@ -191,7 +191,7 @@
"red" :
{
"type" : "array",
"title" : "edt_conf_color_red",
"title" : "edt_conf_color_red_title",
"format" : "colorpicker",
"required" : true,
"default": [255,0,0],
@@ -207,7 +207,7 @@
"green" :
{
"type" : "array",
"title" : "edt_conf_color_green",
"title" : "edt_conf_color_green_title",
"format" : "colorpicker",
"required" : true,
"default": [0,255,0],
@@ -223,7 +223,7 @@
"blue" :
{
"type" : "array",
"title" : "edt_conf_color_blue",
"title" : "edt_conf_color_blue_title",
"format" : "colorpicker",
"required" : true,
"default": [0,0,255],
@@ -239,7 +239,7 @@
"cyan" :
{
"type" : "array",
"title" : "edt_conf_color_cyan",
"title" : "edt_conf_color_cyan_title",
"format" : "colorpicker",
"required" : true,
"default": [0,255,255],
@@ -255,7 +255,7 @@
"magenta" :
{
"type" : "array",
"title" : "edt_conf_color_magenta",
"title" : "edt_conf_color_magenta_title",
"format" : "colorpicker",
"required" : true,
"default": [255,0,255],
@@ -271,7 +271,7 @@
"yellow" :
{
"type" : "array",
"title" : "edt_conf_color_yellow",
"title" : "edt_conf_color_yellow_title",
"format" : "colorpicker",
"required" : true,
"default": [255,255,0],
@@ -287,7 +287,7 @@
"brightnessMin" :
{
"type" : "number",
"title" : "edt_conf_color_brightness_min",
"title" : "edt_conf_color_brightness_min_title",
"required" : true,
"minimum" : 0.0,
"maximum": 1.0,
@@ -298,7 +298,7 @@
"brightness" :
{
"type" : "number",
"title" : "edt_conf_color_brightness",
"title" : "edt_conf_color_brightness_title",
"required" : true,
"minimum" : 0.0,
"maximum": 1.0,
@@ -309,7 +309,7 @@
"gammaRed" :
{
"type" : "number",
"title" : "edt_conf_color_gamma_red",
"title" : "edt_conf_color_gamma_red_title",
"required" : true,
"minimum" : 0.0,
"maximum": 100.0,
@@ -320,7 +320,7 @@
"gammaGreen" :
{
"type" : "number",
"title" : "edt_conf_color_gamma_green",
"title" : "edt_conf_color_gamma_green_title",
"required" : true,
"minimum" : 0.0,
"maximum": 100.0,
@@ -331,7 +331,7 @@
"gammaBlue" :
{
"type" : "number",
"title" : "edt_conf_color_gamma_blue",
"title" : "edt_conf_color_gamma_blue_title",
"required" : true,
"minimum" : 0.0,
"maximum": 100.0,
@@ -493,9 +493,9 @@
{
"type" : "integer",
"minimum" : 100,
"maximum" : 2000000000,
"maximum" : 253,
"title" : "edt_conf_general_priority_title",
"default" : 900,
"default" : 240,
"propertyOrder" : 9
},
"mode" :
@@ -679,8 +679,8 @@
"type" : "integer",
"title" : "edt_conf_general_priority_title",
"minimum" : 100,
"maximum" : 2000000000,
"default" : 890
"maximum" : 253,
"default" : 250
},
"cropLeft" :
{
@@ -815,6 +815,9 @@
"title": "edt_conf_bb_mode_title",
"enum" : ["default", "classic", "osd"],
"default" : "default",
"options" : {
"enum_titles" : ["edt_conf_enum_bbdefault", "edt_conf_enum_bbclassic", "edt_conf_enum_bbosd"]
},
"propertyOrder" : 7
}
},
@@ -1109,8 +1112,8 @@
"type" : "integer",
"title" : "edt_conf_general_priority_title",
"minimum" : 100,
"maximum" : 2000000000,
"default" : 800,
"maximum" : 253,
"default" : 200,
"propertyOrder" : 3
}
},
@@ -1150,8 +1153,8 @@
"type" : "integer",
"title" : "edt_conf_general_priority_title",
"minimum" : 100,
"maximum" : 2000000000,
"default" : 800,
"maximum" : 253,
"default" : 200,
"propertyOrder" : 4
},
"timeout" :

View File

@@ -610,6 +610,48 @@ void JsonClientConnection::handleServerInfoCommand(const QJsonObject&, const QSt
}
}
if(priorityInfo.componentId == 9)
{
QJsonObject LEDcolor;
// add RGB Value to Array
QJsonArray RGBValue;
RGBValue.append(priorityInfo.ledColors.begin()->red);
RGBValue.append(priorityInfo.ledColors.begin()->green);
RGBValue.append(priorityInfo.ledColors.begin()->blue);
LEDcolor.insert("RGB", RGBValue);
uint16_t Hue;
float Saturation, Luminace;
// add HSL Value to Array
QJsonArray HSLValue;
ColorSys::rgb2hsl(priorityInfo.ledColors.begin()->red,
priorityInfo.ledColors.begin()->green,
priorityInfo.ledColors.begin()->blue,
Hue, Saturation, Luminace);
HSLValue.append(Hue);
HSLValue.append(Saturation);
HSLValue.append(Luminace);
LEDcolor.insert("HSL", HSLValue);
// add HEX Value to Array ["HEX Value"]
QJsonArray HEXValue;
std::stringstream hex;
hex << "0x"
<< std::uppercase << std::setw(2) << std::setfill('0')
<< std::hex << unsigned(priorityInfo.ledColors.begin()->red)
<< std::uppercase << std::setw(2) << std::setfill('0')
<< std::hex << unsigned(priorityInfo.ledColors.begin()->green)
<< std::uppercase << std::setw(2) << std::setfill('0')
<< std::hex << unsigned(priorityInfo.ledColors.begin()->blue);
HEXValue.append(QString::fromStdString(hex.str()));
LEDcolor.insert("HEX", HEXValue);
item["value"] = LEDcolor;
}
// priorities[priorities.size()] = item;
priorities.append(item);
}
@@ -679,87 +721,6 @@ void JsonClientConnection::handleServerInfoCommand(const QJsonObject&, const QSt
}
info["effects"] = effects;
// collect active effect info
QJsonArray activeEffects;
const std::list<ActiveEffectDefinition> & activeEffectsDefinitions = _hyperion->getActiveEffects();
for (const ActiveEffectDefinition & activeEffectDefinition : activeEffectsDefinitions)
{
if (activeEffectDefinition.priority != PriorityMuxer::LOWEST_PRIORITY -1)
{
QJsonObject activeEffect;
activeEffect["script"] = activeEffectDefinition.script;
activeEffect["name"] = activeEffectDefinition.name;
activeEffect["priority"] = activeEffectDefinition.priority;
activeEffect["timeout"] = activeEffectDefinition.timeout;
activeEffect["args"] = activeEffectDefinition.args;
activeEffects.append(activeEffect);
}
}
info["activeEffects"] = activeEffects;
// collect active static led color
QJsonArray activeLedColors;
const Hyperion::InputInfo & priorityInfo = _hyperion->getPriorityInfo(_hyperion->getCurrentPriority());
if (priorityInfo.priority != std::numeric_limits<int>::max())
{
QJsonObject LEDcolor;
// check if all LEDs has the same Color
if (std::all_of(priorityInfo.ledColors.begin(), priorityInfo.ledColors.end(), [&](ColorRgb color)
{
return ((color.red == priorityInfo.ledColors.begin()->red) &&
(color.green == priorityInfo.ledColors.begin()->green) &&
(color.blue == priorityInfo.ledColors.begin()->blue));
} ))
{
// check if LED Color not Black (0,0,0)
if ((priorityInfo.ledColors.begin()->red +
priorityInfo.ledColors.begin()->green +
priorityInfo.ledColors.begin()->blue != 0))
{
// add RGB Value to Array
QJsonArray RGBValue;
RGBValue.append(priorityInfo.ledColors.begin()->red);
RGBValue.append(priorityInfo.ledColors.begin()->green);
RGBValue.append(priorityInfo.ledColors.begin()->blue);
LEDcolor.insert("RGB Value", RGBValue);
uint16_t Hue;
float Saturation, Luminace;
// add HSL Value to Array
QJsonArray HSLValue;
ColorSys::rgb2hsl(priorityInfo.ledColors.begin()->red,
priorityInfo.ledColors.begin()->green,
priorityInfo.ledColors.begin()->blue,
Hue, Saturation, Luminace);
HSLValue.append(Hue);
HSLValue.append(Saturation);
HSLValue.append(Luminace);
LEDcolor.insert("HSL Value", HSLValue);
// add HEX Value to Array ["HEX Value"]
QJsonArray HEXValue;
std::stringstream hex;
hex << "0x"
<< std::uppercase << std::setw(2) << std::setfill('0')
<< std::hex << unsigned(priorityInfo.ledColors.begin()->red)
<< std::uppercase << std::setw(2) << std::setfill('0')
<< std::hex << unsigned(priorityInfo.ledColors.begin()->green)
<< std::uppercase << std::setw(2) << std::setfill('0')
<< std::hex << unsigned(priorityInfo.ledColors.begin()->blue);
HEXValue.append(QString::fromStdString(hex.str()));
LEDcolor.insert("HEX Value", HEXValue);
activeLedColors.append(LEDcolor);
}
}
}
info["activeLedColor"] = activeLedColors;
// get available led devices
QJsonObject ledDevices;

View File

@@ -12,6 +12,8 @@
},
"priority": {
"type": "integer",
"minimum" : 1,
"maximum" : 253,
"required": true
}
},

View File

@@ -12,6 +12,8 @@
},
"priority": {
"type": "integer",
"minimum" : 1,
"maximum" : 253,
"required": true
},
"duration": {

View File

@@ -12,6 +12,8 @@
},
"priority": {
"type": "integer",
"minimum" : 1,
"maximum" : 253,
"required": true
},
"duration": {

View File

@@ -12,6 +12,8 @@
},
"priority": {
"type": "integer",
"minimum" : 1,
"maximum" : 253,
"required": true
},
"duration": {

View File

@@ -11,7 +11,9 @@
"type" : "integer"
},
"priority": {
"type": "integer"
"type": "integer",
"minimum" : 0,
"maximum" : 255
},
"auto": {
"type": "boolean"

View File

@@ -5,7 +5,7 @@
"output": {
"type": "string",
"title":"edt_dev_spec_outputPath_title",
"default":"/dev/ttyACM0",
"default":"/dev/ttyUSB0",
"propertyOrder" : 1
},
"rate": {

View File

@@ -9,7 +9,7 @@
"propertyOrder" : 1
},
"port" : {
"type": "integer",
"type": "number",
"title":"edt_dev_spec_port_title",
"default": 7890,
"propertyOrder" : 2

View File

@@ -25,6 +25,9 @@
"title":"edt_dev_spec_whiteLedAlgor_title",
"enum" : ["subtract_minimum","sub_min_warm_adjust","white_off"],
"default": "subtract_minimum",
"options" : {
"enum_titles" : ["edt_dev_enum_subtract_minimum", "edt_dev_enum_sub_min_warm_adjust", "edt_dev_enum_white_off"]
},
"propertyOrder" : 4
}
},

View File

@@ -31,6 +31,9 @@
"title":"edt_dev_spec_whiteLedAlgor_title",
"enum" : ["subtract_minimum","sub_min_warm_adjust","white_off"],
"default": "subtract_minimum",
"options" : {
"enum_titles" : ["edt_dev_enum_subtract_minimum", "edt_dev_enum_sub_min_warm_adjust", "edt_dev_enum_white_off"]
},
"propertyOrder" : 4
}
},

View File

@@ -110,7 +110,7 @@ void QJsonSchemaChecker::validate(const QJsonValue & value, const QJsonObject &s
else if (attribute == "id")
; // references have already been collected
else if (attribute == "title" || attribute == "description" || attribute == "default" || attribute == "format"
|| attribute == "defaultProperties" || attribute == "propertyOrder" || attribute == "append" || attribute == "step" || attribute == "access")
|| attribute == "defaultProperties" || attribute == "propertyOrder" || attribute == "append" || attribute == "step" || attribute == "access" || attribute == "options")
; // nothing to do.
else
{