2016-09-06 10:14:54 +02:00
|
|
|
|
|
|
|
var ledsCustomCfgInitialized = false;
|
2016-11-18 18:39:27 +01:00
|
|
|
var finalLedArray = [];
|
2017-04-07 21:33:40 +02:00
|
|
|
var conf_editor = null;
|
2019-09-07 01:17:26 +02:00
|
|
|
var aceEdt = null;
|
2016-09-06 10:14:54 +02:00
|
|
|
|
2016-11-30 17:32:12 +01:00
|
|
|
function round(number) {
|
|
|
|
var factor = Math.pow(10, 4);
|
|
|
|
var tempNumber = number * factor;
|
|
|
|
var roundedTempNumber = Math.round(tempNumber);
|
|
|
|
return roundedTempNumber / factor;
|
|
|
|
};
|
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
function createLedPreview(leds, origin){
|
2016-12-04 19:32:23 +01:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
if (origin == "classic"){
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#previewcreator').html($.i18n('conf_leds_layout_preview_originCL'));
|
2016-11-18 18:39:27 +01:00
|
|
|
$('#leds_preview').css("padding-top", "56.25%");
|
|
|
|
}
|
|
|
|
else if(origin == "text"){
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#previewcreator').html($.i18n('conf_leds_layout_preview_originTEXT'));
|
2016-11-18 18:39:27 +01:00
|
|
|
$('#leds_preview').css("padding-top", "56.25%");
|
|
|
|
}
|
|
|
|
else if(origin == "matrix"){
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#previewcreator').html($.i18n('conf_leds_layout_preview_originMA'));
|
2016-11-18 18:39:27 +01:00
|
|
|
$('#leds_preview').css("padding-top", "100%");
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
$('#previewledcount').html($.i18n('conf_leds_layout_preview_totalleds', leds.length));
|
2017-02-28 17:53:41 +01:00
|
|
|
$('#previewledpower').html($.i18n('conf_leds_layout_preview_ledpower', ((leds.length * 0.06)*1.1).toFixed(1)));
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
$('.st_helper').css("border", "8px solid grey");
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
var canvas_height = $('#leds_preview').innerHeight();
|
|
|
|
var canvas_width = $('#leds_preview').innerWidth();
|
2016-11-18 18:39:27 +01:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
var leds_html = "";
|
2016-11-18 18:39:27 +01:00
|
|
|
for(var idx=0; idx<leds.length; idx++)
|
|
|
|
{
|
2019-06-05 18:19:08 +02:00
|
|
|
var led = leds[idx];
|
|
|
|
var led_id='ledc_'+[idx];
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
var bgcolor = "background-color:hsla("+(idx*360/leds.length)+",100%,50%,0.75);";
|
2020-02-26 18:54:56 +01:00
|
|
|
var pos = "left:"+(led.hmin * canvas_width)+"px;"+
|
|
|
|
"top:"+(led.vmin * canvas_height)+"px;"+
|
|
|
|
"width:"+((led.hmax-led.hmin) * (canvas_width-1))+"px;"+
|
|
|
|
"height:"+((led.vmax-led.vmin) * (canvas_height-1))+"px;";
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
leds_html += '<div id="'+led_id+'" class="led" style="'+bgcolor+pos+'" title="'+idx+'"><span id="'+led_id+'_num" class="led_prev_num">'+((led.name) ? led.name : idx)+'</span></div>';
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
|
|
|
$('#leds_preview').html(leds_html);
|
2016-11-30 17:32:12 +01:00
|
|
|
$('#ledc_0').css({"background-color":"black","z-index":"12"});
|
|
|
|
$('#ledc_1').css({"background-color":"grey","z-index":"11"});
|
2016-11-18 18:39:27 +01:00
|
|
|
$('#ledc_2').css({"background-color":"#A9A9A9","z-index":"10"});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-30 17:32:12 +01:00
|
|
|
if($('#leds_prev_toggle_num').hasClass('btn-success'))
|
|
|
|
$('.led_prev_num').css("display", "inline");
|
2016-12-04 19:32:23 +01:00
|
|
|
|
2019-09-07 01:17:26 +02:00
|
|
|
// update ace Editor content
|
|
|
|
aceEdt.set(finalLedArray);
|
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function createClassicLeds(){
|
|
|
|
//get values
|
2017-02-15 15:53:35 +01:00
|
|
|
var ledstop = parseInt($("#ip_cl_top").val());
|
|
|
|
var ledsbottom = parseInt($("#ip_cl_bottom").val());
|
|
|
|
var ledsleft = parseInt($("#ip_cl_left").val());
|
|
|
|
var ledsright = parseInt($("#ip_cl_right").val());
|
|
|
|
var ledsglength = parseInt($("#ip_cl_glength").val());
|
|
|
|
var ledsgpos = parseInt($("#ip_cl_gpos").val());
|
2016-11-18 18:39:27 +01:00
|
|
|
var position = parseInt($("#ip_cl_position").val());
|
|
|
|
var reverse = $("#ip_cl_reverse").is(":checked");
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
//advanced values
|
2017-02-15 15:53:35 +01:00
|
|
|
var ledsVDepth = parseInt($("#ip_cl_vdepth").val())/100;
|
|
|
|
var ledsHDepth = parseInt($("#ip_cl_hdepth").val())/100;
|
|
|
|
var edgeVGap = parseInt($("#ip_cl_edgegap").val())/100/2;
|
|
|
|
//var cornerVGap = parseInt($("#ip_cl_cornergap").val())/100/2;
|
2020-05-20 08:36:52 +02:00
|
|
|
var overlap = $("#ip_cl_overlap").val()/100;
|
|
|
|
|
|
|
|
//trapezoid values % -> float
|
|
|
|
var ptblh = parseInt($("#ip_cl_pblh").val())/100;
|
|
|
|
var ptblv = parseInt($("#ip_cl_pblv").val())/100;
|
|
|
|
var ptbrh = parseInt($("#ip_cl_pbrh").val())/100;
|
|
|
|
var ptbrv = parseInt($("#ip_cl_pbrv").val())/100;
|
|
|
|
var pttlh = parseInt($("#ip_cl_ptlh").val())/100;
|
|
|
|
var pttlv = parseInt($("#ip_cl_ptlv").val())/100;
|
|
|
|
var pttrh = parseInt($("#ip_cl_ptrh").val())/100;
|
|
|
|
var pttrv = parseInt($("#ip_cl_ptrv").val())/100;
|
2020-05-25 21:51:11 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
//helper
|
2016-11-30 17:32:12 +01:00
|
|
|
var edgeHGap = edgeVGap/(16/9);
|
2016-11-18 18:39:27 +01:00
|
|
|
var ledArray = [];
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
function createFinalArray(array){
|
2016-11-21 22:16:57 +01:00
|
|
|
finalLedArray = [];
|
2016-11-18 18:39:27 +01:00
|
|
|
for(var i = 0; i<array.length; i++){
|
2020-02-26 18:54:56 +01:00
|
|
|
var hmin = array[i].hmin;
|
|
|
|
var hmax = array[i].hmax;
|
|
|
|
var vmin = array[i].vmin;
|
|
|
|
var vmax = array[i].vmax;
|
|
|
|
finalLedArray[i] = { "hmax": hmax, "hmin": hmin, "vmax": vmax, "vmin": vmin }
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
2016-12-08 23:39:41 +01:00
|
|
|
createLedPreview(finalLedArray, 'classic');
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
2017-02-08 14:36:28 +01:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
function rotateArray(array, times){
|
2017-02-28 17:53:41 +01:00
|
|
|
if (times > 0){
|
2016-11-18 18:39:27 +01:00
|
|
|
while( times-- ){
|
|
|
|
array.push(array.shift())
|
|
|
|
}
|
|
|
|
return array;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while( times++ ){
|
|
|
|
array.unshift(array.pop())
|
|
|
|
}
|
|
|
|
return array;
|
|
|
|
}
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
function valScan(val)
|
|
|
|
{
|
|
|
|
if(val > 1)
|
2019-06-05 18:19:08 +02:00
|
|
|
return 1;
|
2017-02-08 14:36:28 +01:00
|
|
|
if(val < 0)
|
2019-06-05 18:19:08 +02:00
|
|
|
return 0;
|
2017-02-08 14:36:28 +01:00
|
|
|
return val;
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
function ovl(scan,val)
|
|
|
|
{
|
|
|
|
if(scan == "+")
|
|
|
|
return valScan(val += overlap);
|
|
|
|
else
|
|
|
|
return valScan(val -= overlap);
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
function createLedArray(hmin, hmax, vmin, vmax){
|
2016-11-30 17:32:12 +01:00
|
|
|
hmin = round(hmin);
|
|
|
|
hmax = round(hmax);
|
|
|
|
vmin = round(vmin);
|
|
|
|
vmax = round(vmax);
|
2020-02-26 18:54:56 +01:00
|
|
|
ledArray.push({ "hmin": hmin, "hmax": hmax, "vmin": vmin, "vmax": vmax });
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
function createTopLeds(){
|
2020-05-20 08:36:52 +02:00
|
|
|
var steph = (pttrh - pttlh - (2*edgeHGap))/ledstop;
|
|
|
|
var stepv = (pttrv - pttlv)/ledstop;
|
2020-05-25 21:51:11 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
for (var i = 0; i<ledstop; i++){
|
2020-05-20 08:36:52 +02:00
|
|
|
var hmin = ovl("-",pttlh+(steph*Number([i]))+edgeHGap);
|
|
|
|
var hmax = ovl("+",pttlh+(steph*Number([i+1]))+edgeHGap);
|
|
|
|
var vmin = pttlv+(stepv*Number([i]));
|
|
|
|
var vmax = vmin + ledsHDepth;
|
2016-11-18 18:39:27 +01:00
|
|
|
createLedArray(hmin, hmax, vmin, vmax);
|
|
|
|
}
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
function createRightLeds(){
|
2020-05-20 08:36:52 +02:00
|
|
|
var steph = (ptbrh - pttrh)/ledsright;
|
|
|
|
var stepv = (ptbrv - pttrv - (2*edgeVGap))/ledsright;
|
2020-05-25 21:51:11 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
for (var i = 0; i<ledsright; i++){
|
2020-05-20 08:36:52 +02:00
|
|
|
var hmax = pttrh+(steph*Number([i+1]));
|
|
|
|
var hmin = hmax-ledsVDepth;
|
|
|
|
var vmin = ovl("-",pttrv+(stepv*Number([i]))+edgeVGap);
|
|
|
|
var vmax = ovl("+",pttrv+(stepv*Number([i+1]))+edgeVGap);
|
2019-08-25 16:32:19 +02:00
|
|
|
createLedArray(hmin, hmax, vmin, vmax);
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
function createBottomLeds(){
|
2020-05-20 08:36:52 +02:00
|
|
|
var steph = (ptbrh - ptblh - (2*edgeHGap))/ledsbottom;
|
|
|
|
var stepv = (ptbrv - ptblv)/ledsbottom;
|
2020-05-25 21:51:11 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
for (var i = ledsbottom-1; i>-1; i--){
|
2020-05-20 08:36:52 +02:00
|
|
|
var hmin = ovl("-",ptblh+(steph*Number([i]))+edgeHGap);
|
|
|
|
var hmax = ovl("+",ptblh+(steph*Number([i+1]))+edgeHGap);
|
|
|
|
var vmax= ptblv+(stepv*Number([i]));
|
|
|
|
var vmin = vmax-ledsHDepth;
|
2016-11-18 18:39:27 +01:00
|
|
|
createLedArray(hmin, hmax, vmin, vmax);
|
|
|
|
}
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2020-05-20 08:36:52 +02:00
|
|
|
function createLeftLeds(){
|
|
|
|
var steph = (ptblh - pttlh)/ledsleft;
|
|
|
|
var stepv = (ptblv - pttlv - (2*edgeVGap))/ledsleft;
|
2020-05-25 21:51:11 +02:00
|
|
|
|
2020-05-20 08:36:52 +02:00
|
|
|
for (var i = ledsleft-1; i>-1; i--){
|
|
|
|
var hmin = pttlh+(steph*Number([i]));
|
|
|
|
var hmax = hmin+ledsVDepth;
|
|
|
|
var vmin = ovl("-",pttlv+(stepv*Number([i]))+edgeVGap);
|
|
|
|
var vmax = ovl("+",pttlv+(stepv*Number([i+1]))+edgeVGap);
|
|
|
|
createLedArray(hmin, hmax, vmin, vmax);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//rectangle
|
2019-06-05 18:19:08 +02:00
|
|
|
createTopLeds();
|
2019-07-02 19:06:36 +02:00
|
|
|
createRightLeds();
|
|
|
|
createBottomLeds();
|
|
|
|
createLeftLeds();
|
2016-12-08 23:39:41 +01:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
//check led gap pos
|
|
|
|
if (ledsgpos+ledsglength > ledArray.length)
|
|
|
|
{
|
|
|
|
var mpos = Math.max(0,ledArray.length-ledsglength);
|
|
|
|
$('#ip_cl_ledsgpos').val(mpos);
|
|
|
|
ledsgpos = mpos;
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
//check led gap length
|
|
|
|
if(ledsglength >= ledArray.length)
|
|
|
|
{
|
|
|
|
$('#ip_cl_ledsglength').val(ledArray.length-1);
|
|
|
|
ledsglength = ledArray.length-ledsglength-1;
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
if(ledsglength != 0){
|
2017-01-17 21:53:35 +01:00
|
|
|
ledArray.splice(ledsgpos, ledsglength);
|
2016-12-08 23:39:41 +01:00
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
if (position != 0){
|
2016-12-08 23:39:41 +01:00
|
|
|
rotateArray(ledArray, position);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (reverse)
|
|
|
|
ledArray.reverse();
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-12-08 23:39:41 +01:00
|
|
|
createFinalArray(ledArray);
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function createMatrixLeds(){
|
|
|
|
// Big thank you to RanzQ (Juha Rantanen) from Github for this script
|
|
|
|
// https://raw.githubusercontent.com/RanzQ/hyperion-audio-effects/master/matrix-config.js
|
2016-12-04 19:32:23 +01:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
//get values
|
2017-01-17 21:53:35 +01:00
|
|
|
var ledshoriz = parseInt($("#ip_ma_ledshoriz").val());
|
|
|
|
var ledsvert = parseInt($("#ip_ma_ledsvert").val());
|
2016-11-18 18:39:27 +01:00
|
|
|
var cabling = $("#ip_ma_cabling").val();
|
|
|
|
//var order = $("#ip_ma_order").val();
|
|
|
|
var start = $("#ip_ma_start").val();
|
|
|
|
|
|
|
|
var parallel = false
|
|
|
|
var leds = []
|
2017-01-17 21:53:35 +01:00
|
|
|
var hblock = 1.0 / ledshoriz
|
|
|
|
var vblock = 1.0 / ledsvert
|
2016-11-18 18:39:27 +01:00
|
|
|
|
|
|
|
if (cabling == "parallel"){
|
|
|
|
parallel = true
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds led to the hyperion config led array
|
|
|
|
* @param {Number} x Horizontal position in matrix
|
|
|
|
* @param {Number} y Vertical position in matrix
|
|
|
|
*/
|
2019-08-25 16:32:19 +02:00
|
|
|
function addLed (x, y) {
|
2016-11-18 18:39:27 +01:00
|
|
|
var hscanMin = x * hblock
|
|
|
|
var hscanMax = (x + 1) * hblock
|
|
|
|
var vscanMin = y * vblock
|
|
|
|
var vscanMax = (y + 1) * vblock
|
|
|
|
|
2016-11-30 17:32:12 +01:00
|
|
|
hscanMin = round(hscanMin);
|
|
|
|
hscanMax = round(hscanMax);
|
|
|
|
vscanMin = round(vscanMin);
|
|
|
|
vscanMax = round(vscanMax);
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
leds.push({
|
2020-02-26 18:54:56 +01:00
|
|
|
hmin: hscanMin,
|
|
|
|
hmax: hscanMax,
|
|
|
|
vmin: vscanMin,
|
|
|
|
vmax: vscanMax
|
2016-11-18 18:39:27 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
var startYX = start.split('-')
|
2017-01-17 21:53:35 +01:00
|
|
|
var startX = startYX[1] === 'right' ? ledshoriz - 1 : 0
|
|
|
|
var startY = startYX[0] === 'bottom' ? ledsvert - 1 : 0
|
|
|
|
var endX = startX === 0 ? ledshoriz - 1 : 0
|
|
|
|
var endY = startY === 0 ? ledsvert - 1 : 0
|
2016-11-18 18:39:27 +01:00
|
|
|
var forward = startX < endX
|
|
|
|
|
|
|
|
var downward = startY < endY
|
|
|
|
|
|
|
|
var x, y
|
|
|
|
|
|
|
|
for (y = startY; downward && y <= endY || !downward && y >= endY; y += downward ? 1 : -1) {
|
|
|
|
for (x = startX; forward && x <= endX || !forward && x >= endX; x += forward ? 1 : -1) {
|
2019-08-25 16:32:19 +02:00
|
|
|
addLed(x, y)
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
|
|
|
if (!parallel) {
|
|
|
|
forward = !forward
|
|
|
|
var tmp = startX
|
|
|
|
startX = endX
|
|
|
|
endX = tmp
|
|
|
|
}
|
|
|
|
}
|
2016-11-21 22:16:57 +01:00
|
|
|
finalLedArray =[];
|
2016-11-18 18:39:27 +01:00
|
|
|
finalLedArray = leds
|
|
|
|
createLedPreview(leds, 'matrix');
|
|
|
|
}
|
2016-09-06 10:14:54 +02:00
|
|
|
|
2020-02-23 00:51:58 +01:00
|
|
|
function migrateLedConfig(slConfig){
|
|
|
|
|
|
|
|
var newLedConfig = {classic:{}, matrix:{}};
|
|
|
|
|
|
|
|
//Default Classic layout
|
|
|
|
newLedConfig.classic = {
|
|
|
|
"top" : 8,
|
|
|
|
"bottom" : 8,
|
|
|
|
"left" : 5,
|
|
|
|
"right" : 5,
|
|
|
|
"glength" : 0,
|
|
|
|
"gpos" : 0,
|
|
|
|
"position" : 0,
|
|
|
|
"reverse" : false,
|
|
|
|
"hdepth" : 8,
|
|
|
|
"vdepth" : 5,
|
|
|
|
"overlap" : 0,
|
|
|
|
"edgegap" : 0
|
|
|
|
}
|
|
|
|
|
|
|
|
//Move Classic layout
|
|
|
|
newLedConfig.classic.top = slConfig.top;
|
|
|
|
newLedConfig.classic.bottom = slConfig.bottom;
|
|
|
|
newLedConfig.classic.left = slConfig.left;
|
|
|
|
newLedConfig.classic.right = slConfig.right;
|
|
|
|
newLedConfig.classic.glength = slConfig.glength;
|
|
|
|
newLedConfig.classic.position = slConfig.position;
|
|
|
|
newLedConfig.classic.reverse = slConfig.reverse;
|
|
|
|
newLedConfig.classic.hdepth = slConfig.hdepth;
|
|
|
|
newLedConfig.classic.vdepth = slConfig.vdepth;
|
|
|
|
newLedConfig.classic.overlap = slConfig.overlap;
|
|
|
|
|
|
|
|
//Default Matrix layout
|
|
|
|
newLedConfig["matrix"] = { "ledshoriz": 10,
|
|
|
|
"ledsvert" : 10,
|
|
|
|
"cabling" : "snake",
|
|
|
|
"start" : "top-left"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Persit new structure
|
|
|
|
requestWriteConfig({ledConfig:newLedConfig})
|
|
|
|
return newLedConfig
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function isEmpty(obj) {
|
|
|
|
for(var key in obj) {
|
|
|
|
if(obj.hasOwnProperty(key))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-09-06 10:14:54 +02:00
|
|
|
$(document).ready(function() {
|
2017-01-17 21:53:35 +01:00
|
|
|
// translate
|
2016-12-04 19:32:23 +01:00
|
|
|
performTranslation();
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
//add intros
|
2019-06-05 18:19:08 +02:00
|
|
|
if(window.showOptHelp)
|
2017-02-08 14:36:28 +01:00
|
|
|
{
|
|
|
|
createHintH("intro", $.i18n('conf_leds_device_intro'), "leddevice_intro");
|
|
|
|
createHintH("intro", $.i18n('conf_leds_layout_intro'), "layout_intro");
|
|
|
|
$('#led_vis_help').html('<div><div class="led_ex" style="background-color:black;margin-right:5px;margin-top:3px"></div><div style="display:inline-block;vertical-align:top">'+$.i18n('conf_leds_layout_preview_l1')+'</div></div><div class="led_ex" style="background-color:grey;margin-top:3px;margin-right:2px"></div><div class="led_ex" style="background-color: rgb(169, 169, 169);margin-right:5px;margin-top:3px;"></div><div style="display:inline-block;vertical-align:top">'+$.i18n('conf_leds_layout_preview_l2')+'</div>');
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
var slConfig = window.serverConfig.ledConfig;
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2020-02-23 00:51:58 +01:00
|
|
|
//Check, if structure is not aligned to expected -> migrate structure
|
2020-05-25 21:51:11 +02:00
|
|
|
|
2020-02-23 00:51:58 +01:00
|
|
|
if ( isEmpty(slConfig.classic) )
|
2017-02-15 15:53:35 +01:00
|
|
|
{
|
2020-02-23 00:51:58 +01:00
|
|
|
slConfig = migrateLedConfig( slConfig );
|
|
|
|
}
|
|
|
|
|
|
|
|
//restore ledConfig - Classic
|
|
|
|
for(var key in slConfig.classic)
|
|
|
|
{
|
|
|
|
if(typeof(slConfig.classic[key]) === "boolean")
|
|
|
|
$('#ip_cl_'+key).prop('checked', slConfig.classic[key]);
|
2017-02-15 15:53:35 +01:00
|
|
|
else
|
2020-02-23 00:51:58 +01:00
|
|
|
$('#ip_cl_'+key).val(slConfig.classic[key]);
|
|
|
|
}
|
|
|
|
|
|
|
|
//restore ledConfig - Matrix
|
|
|
|
for(var key in slConfig.matrix)
|
|
|
|
{
|
|
|
|
if(typeof(slConfig.matrix[key]) === "boolean")
|
|
|
|
$('#ip_ma_'+key).prop('checked', slConfig.matrix[key]);
|
|
|
|
else
|
|
|
|
$('#ip_ma_'+key).val(slConfig.matrix[key]);
|
2017-02-15 15:53:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function saveValues()
|
|
|
|
{
|
2020-02-23 00:51:58 +01:00
|
|
|
var ledConfig = {classic:{}, matrix:{}};
|
|
|
|
|
|
|
|
for(var key in slConfig.classic)
|
|
|
|
{
|
|
|
|
if(typeof(slConfig.classic[key]) === "boolean")
|
|
|
|
ledConfig.classic[key] = $('#ip_cl_'+key).is(':checked');
|
|
|
|
else if(Number.isInteger(slConfig.classic[key]))
|
|
|
|
ledConfig.classic[key] = parseInt($('#ip_cl_'+key).val());
|
|
|
|
else
|
|
|
|
ledConfig.classic[key] = $('#ip_cl_'+key).val();
|
|
|
|
}
|
|
|
|
|
|
|
|
for(var key in slConfig.matrix)
|
2017-02-15 15:53:35 +01:00
|
|
|
{
|
2020-02-23 00:51:58 +01:00
|
|
|
if(typeof(slConfig.matrix[key]) === "boolean")
|
|
|
|
ledConfig.matrix[key] = $('#ip_ma_'+key).is(':checked');
|
|
|
|
else if(Number.isInteger(slConfig.matrix[key]))
|
|
|
|
ledConfig.matrix[key] = parseInt($('#ip_ma_'+key).val());
|
2017-02-15 15:53:35 +01:00
|
|
|
else
|
2020-02-23 00:51:58 +01:00
|
|
|
ledConfig.matrix[key] = $('#ip_ma_'+key).val();
|
2017-02-15 15:53:35 +01:00
|
|
|
}
|
2020-02-23 00:51:58 +01:00
|
|
|
requestWriteConfig({ledConfig});
|
2017-02-15 15:53:35 +01:00
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
// check access level and adjust ui
|
|
|
|
if(storedAccess == "default")
|
|
|
|
{
|
|
|
|
$('#texfield_panel').toggle(false);
|
|
|
|
$('#previewcreator').toggle(false);
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-04-07 21:33:40 +02:00
|
|
|
//Wiki link
|
|
|
|
$('#leds_wl').append('<p style="font-weight:bold">'+$.i18n('general_wiki_moreto',$.i18n('conf_leds_nav_label_ledlayout'))+buildWL("user/moretopics/ledarea","Wiki")+'</p>');
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
// bind change event to all inputs
|
2016-11-18 18:39:27 +01:00
|
|
|
$('.ledCLconstr').bind("change", function() {
|
2017-02-28 17:53:41 +01:00
|
|
|
valValue(this.id,this.value,this.min,this.max);
|
2016-11-18 18:39:27 +01:00
|
|
|
createClassicLeds();
|
|
|
|
});
|
2017-01-17 21:53:35 +01:00
|
|
|
|
2016-11-18 18:39:27 +01:00
|
|
|
$('.ledMAconstr').bind("change", function() {
|
2017-02-28 17:53:41 +01:00
|
|
|
valValue(this.id,this.value,this.min,this.max);
|
2016-11-18 18:39:27 +01:00
|
|
|
createMatrixLeds();
|
|
|
|
});
|
2017-02-28 17:53:41 +01:00
|
|
|
|
|
|
|
// v4 of json schema with diff required assignment - remove when hyperion schema moved to v4
|
2020-02-26 18:54:56 +01:00
|
|
|
var ledschema = { "items": { "additionalProperties": false, "required": ["hmin", "hmax", "vmin", "vmax"], "properties": { "name": { "type": "string" }, "colorOrder": { "enum": ["rgb", "bgr", "rbg", "brg", "gbr", "grb"], "type": "string" }, "hmin": { "maximum": 1, "minimum": 0, "type": "number" }, "hmax": { "maximum": 1, "minimum": 0, "type": "number" }, "vmin": { "maximum": 1, "minimum": 0, "type": "number" }, "vmax": { "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "type": "array" };
|
2017-02-28 17:53:41 +01:00
|
|
|
//create jsonace editor
|
2019-09-07 01:17:26 +02:00
|
|
|
aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
|
2017-02-28 17:53:41 +01:00
|
|
|
mode: 'code',
|
|
|
|
schema: ledschema,
|
|
|
|
onChange: function(){
|
|
|
|
var success = true;
|
|
|
|
try{
|
|
|
|
aceEdt.get();
|
|
|
|
}
|
|
|
|
catch(err)
|
|
|
|
{
|
|
|
|
success = false;
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
if(success)
|
|
|
|
{
|
|
|
|
$('#leds_custom_updsim').attr("disabled", false);
|
|
|
|
$('#leds_custom_save').attr("disabled", false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$('#leds_custom_updsim').attr("disabled", true);
|
|
|
|
$('#leds_custom_save').attr("disabled", true);
|
|
|
|
}
|
|
|
|
}
|
2019-06-05 18:19:08 +02:00
|
|
|
}, window.serverConfig.leds);
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
//TODO: HACK! No callback for schema validation - Add it!
|
|
|
|
setInterval(function(){
|
|
|
|
if($('#aceedit table').hasClass('jsoneditor-text-errors'))
|
|
|
|
{
|
|
|
|
$('#leds_custom_updsim').attr("disabled", true);
|
|
|
|
$('#leds_custom_save').attr("disabled", true);
|
2016-11-18 18:39:27 +01:00
|
|
|
}
|
2019-06-05 18:19:08 +02:00
|
|
|
},1000);
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
$('.jsoneditor-menu').toggle();
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
// leds to finalLedArray
|
2019-06-05 18:19:08 +02:00
|
|
|
finalLedArray = window.serverConfig.leds;
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
// create and update editor
|
|
|
|
$("#leddevices").off().on("change", function() {
|
2019-06-05 18:19:08 +02:00
|
|
|
var generalOptions = window.serverSchema.properties.device;
|
2019-07-02 19:06:36 +02:00
|
|
|
|
2020-07-12 20:27:56 +02:00
|
|
|
// Modified schema entry "hardwareLedCount" in generalOptions to minimum LedCount
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
var ledType = $(this).val();
|
2019-07-02 19:06:36 +02:00
|
|
|
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
//philipshueentertainment backward fix
|
|
|
|
if(ledType == "philipshueentertainment") ledType = "philipshue";
|
|
|
|
|
|
|
|
var specificOptions = window.serverSchema.properties.alldevices[ledType];
|
2017-02-08 14:36:28 +01:00
|
|
|
conf_editor = createJsonEditor('editor_container', {
|
|
|
|
generalOptions : generalOptions,
|
|
|
|
specificOptions : specificOptions,
|
|
|
|
});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
var values_general = {};
|
|
|
|
var values_specific = {};
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
var isCurrentDevice = (window.serverConfig.device.type == ledType);
|
2017-02-08 14:36:28 +01:00
|
|
|
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
for(var key in window.serverConfig.device) {
|
|
|
|
if (key != "type" && key in generalOptions.properties) values_general[key] = window.serverConfig.device[key];
|
2017-02-08 14:36:28 +01:00
|
|
|
};
|
|
|
|
conf_editor.getEditor("root.generalOptions").setValue( values_general );
|
|
|
|
|
|
|
|
if (isCurrentDevice)
|
2016-09-07 20:10:37 +02:00
|
|
|
{
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
var specificOptions_val = conf_editor.getEditor("root.specificOptions").getValue();
|
2017-02-08 14:36:28 +01:00
|
|
|
for(var key in specificOptions_val){
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
values_specific[key] = (key in window.serverConfig.device) ? window.serverConfig.device[key] : specificOptions_val[key];
|
2017-02-08 14:36:28 +01:00
|
|
|
};
|
|
|
|
conf_editor.getEditor("root.specificOptions").setValue( values_specific );
|
|
|
|
};
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
// change save button state based on validation result
|
|
|
|
conf_editor.validate().length ? $('#btn_submit_controller').attr('disabled', true) : $('#btn_submit_controller').attr('disabled', false);
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-04-07 21:33:40 +02:00
|
|
|
// led controller sepecific wizards
|
2020-05-25 21:51:11 +02:00
|
|
|
$('#btn_wiz_holder').html("");
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
$('#btn_led_device_wiz').off();
|
|
|
|
|
|
|
|
if(ledType == "philipshue") {
|
|
|
|
$('#root_specificOptions_useEntertainmentAPI').bind("change", function() {
|
|
|
|
var ledWizardType = (this.checked) ? "philipshueentertainment" : ledType;
|
|
|
|
var data = { type: ledWizardType };
|
|
|
|
var hue_title = (this.checked) ? 'wiz_hue_e_title' : 'wiz_hue_title';
|
|
|
|
changeWizard(data, hue_title, startWizardPhilipsHue);
|
|
|
|
});
|
|
|
|
$("#root_specificOptions_useEntertainmentAPI").trigger("change");
|
|
|
|
}
|
2020-07-12 20:27:56 +02:00
|
|
|
/*
|
|
|
|
else if(ledType == "wled") {
|
|
|
|
var ledWizardType = (this.checked) ? "wled" : ledType;
|
|
|
|
var data = { type: ledWizardType };
|
|
|
|
var wled_title = 'wiz_wled_title';
|
|
|
|
changeWizard(data, wled_title, startWizardWLED);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
else if(ledType == "yeelight") {
|
|
|
|
var ledWizardType = (this.checked) ? "yeelight" : ledType;
|
|
|
|
var data = { type: ledWizardType };
|
|
|
|
var yeelight_title = 'wiz_yeelight_title';
|
|
|
|
changeWizard(data, yeelight_title, startWizardYeelight);
|
|
|
|
}
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
|
|
|
|
function changeWizard(data, hint, fn) {
|
|
|
|
$('#btn_wiz_holder').html("")
|
|
|
|
createHint("wizard", $.i18n(hint), "btn_wiz_holder","btn_led_device_wiz");
|
|
|
|
$('#btn_led_device_wiz').off().on('click', data , fn);
|
|
|
|
}
|
2016-09-07 20:10:37 +02:00
|
|
|
});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
//philipshueentertainment backward fix
|
|
|
|
if(window.serverConfig.device.type == "philipshueentertainment") window.serverConfig.device.type = "philipshue";
|
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
// create led device selection
|
2019-06-05 18:19:08 +02:00
|
|
|
var ledDevices = window.serverInfo.ledDevices.available;
|
|
|
|
var devRPiSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'ws2812spi'];
|
|
|
|
var devRPiPWM = ['ws281x'];
|
|
|
|
var devRPiGPIO = ['piblaster'];
|
2020-07-12 20:27:56 +02:00
|
|
|
var devNET = ['atmoorb', 'fadecandy', 'philipshue', 'nanoleaf', 'tinkerforge', 'tpm2net', 'udpe131', 'udpartnet', 'udph801', 'udpraw', 'wled', 'yeelight'];
|
2019-06-05 18:19:08 +02:00
|
|
|
var devUSB = ['adalight', 'dmx', 'atmo', 'hyperionusbasp', 'lightpack', 'multilightpack', 'paintpack', 'rawhid', 'sedu', 'tpm2', 'karate'];
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
var optArr = [[]];
|
|
|
|
optArr[1]=[];
|
|
|
|
optArr[2]=[];
|
|
|
|
optArr[3]=[];
|
|
|
|
optArr[4]=[];
|
|
|
|
optArr[5]=[];
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
for (var idx=0; idx<ledDevices.length; idx++)
|
2017-02-08 14:36:28 +01:00
|
|
|
{
|
|
|
|
if($.inArray(ledDevices[idx], devRPiSPI) != -1)
|
|
|
|
optArr[0].push(ledDevices[idx]);
|
|
|
|
else if($.inArray(ledDevices[idx], devRPiPWM) != -1)
|
|
|
|
optArr[1].push(ledDevices[idx]);
|
|
|
|
else if($.inArray(ledDevices[idx], devRPiGPIO) != -1)
|
|
|
|
optArr[2].push(ledDevices[idx]);
|
|
|
|
else if($.inArray(ledDevices[idx], devNET) != -1)
|
|
|
|
optArr[3].push(ledDevices[idx]);
|
|
|
|
else if($.inArray(ledDevices[idx], devUSB) != -1)
|
|
|
|
optArr[4].push(ledDevices[idx]);
|
|
|
|
else
|
|
|
|
optArr[5].push(ledDevices[idx]);
|
|
|
|
}
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
$("#leddevices").append(createSel(optArr[0], $.i18n('conf_leds_optgroup_RPiSPI')));
|
|
|
|
$("#leddevices").append(createSel(optArr[1], $.i18n('conf_leds_optgroup_RPiPWM')));
|
|
|
|
$("#leddevices").append(createSel(optArr[2], $.i18n('conf_leds_optgroup_RPiGPIO')));
|
|
|
|
$("#leddevices").append(createSel(optArr[3], $.i18n('conf_leds_optgroup_network')));
|
|
|
|
$("#leddevices").append(createSel(optArr[4], $.i18n('conf_leds_optgroup_usb')));
|
|
|
|
$("#leddevices").append(createSel(optArr[5], $.i18n('conf_leds_optgroup_debug')));
|
2019-09-07 01:17:26 +02:00
|
|
|
$("#leddevices").val(window.serverConfig.device.type);
|
2017-02-08 14:36:28 +01:00
|
|
|
$("#leddevices").trigger("change");
|
2016-09-07 20:10:37 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
// validate textfield and update preview
|
2016-11-18 18:39:27 +01:00
|
|
|
$("#leds_custom_updsim").off().on("click", function() {
|
2017-02-28 17:53:41 +01:00
|
|
|
createLedPreview(aceEdt.get(), 'text');
|
2016-09-06 10:14:54 +02:00
|
|
|
});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
// save led config and saveValues - passing textfield
|
|
|
|
$("#btn_ma_save, #btn_cl_save").off().on("click", function() {
|
2017-01-19 17:51:11 +01:00
|
|
|
requestWriteConfig({"leds" :finalLedArray});
|
2017-01-17 21:53:35 +01:00
|
|
|
saveValues();
|
|
|
|
});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-28 17:53:41 +01:00
|
|
|
// save led config from textfield
|
2016-09-09 18:59:58 +02:00
|
|
|
$("#leds_custom_save").off().on("click", function() {
|
2017-02-28 17:53:41 +01:00
|
|
|
requestWriteConfig(JSON.parse('{"leds" :'+aceEdt.getText()+'}'));
|
|
|
|
saveValues();
|
2016-09-06 10:14:54 +02:00
|
|
|
});
|
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
// toggle led numbers
|
2016-11-30 17:32:12 +01:00
|
|
|
$('#leds_prev_toggle_num').off().on("click", function() {
|
|
|
|
$('.led_prev_num').toggle();
|
|
|
|
toggleClass('#leds_prev_toggle_num', "btn-danger", "btn-success");
|
|
|
|
});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
// open checklist
|
|
|
|
$('#leds_prev_checklist').off().on("click", function() {
|
2017-02-26 20:55:41 +01:00
|
|
|
var liList = [$.i18n('conf_leds_layout_checkp1'),$.i18n('conf_leds_layout_checkp3'),$.i18n('conf_leds_layout_checkp2'),$.i18n('conf_leds_layout_checkp4')];
|
2017-02-08 14:36:28 +01:00
|
|
|
var ul = document.createElement("ul");
|
|
|
|
ul.className = "checklist"
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
for(var i = 0; i<liList.length; i++)
|
|
|
|
{
|
|
|
|
var li = document.createElement("li");
|
|
|
|
li.innerHTML = liList[i];
|
|
|
|
ul.appendChild(li);
|
|
|
|
}
|
|
|
|
showInfoDialog('checklist', "", ul);
|
|
|
|
});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
// nav
|
2016-09-09 18:59:58 +02:00
|
|
|
$('#leds_cfg_nav a[data-toggle="tab"]').off().on('shown.bs.tab', function (e) {
|
2016-09-06 10:14:54 +02:00
|
|
|
var target = $(e.target).attr("href") // activated tab
|
2016-09-07 20:10:37 +02:00
|
|
|
if (target == "#menu_gencfg" && !ledsCustomCfgInitialized)
|
2016-09-06 10:14:54 +02:00
|
|
|
{
|
2016-12-21 18:24:03 +01:00
|
|
|
$('#leds_custom_updsim').trigger('click');
|
2016-09-06 10:14:54 +02:00
|
|
|
ledsCustomCfgInitialized = true;
|
|
|
|
}
|
|
|
|
});
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2017-01-17 21:53:35 +01:00
|
|
|
// save led device config
|
2016-09-13 11:51:16 +02:00
|
|
|
$("#btn_submit_controller").off().on("click", function(event) {
|
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
var ledDevice = $("#leddevices").val();
|
|
|
|
var result = {device:{}};
|
2019-08-25 16:32:19 +02:00
|
|
|
|
2019-06-05 18:19:08 +02:00
|
|
|
var general = conf_editor.getEditor("root.generalOptions").getValue();
|
|
|
|
var specific = conf_editor.getEditor("root.specificOptions").getValue();
|
2016-09-13 11:51:16 +02:00
|
|
|
for(var key in general){
|
|
|
|
result.device[key] = general[key];
|
|
|
|
}
|
|
|
|
|
|
|
|
for(var key in specific){
|
|
|
|
result.device[key] = specific[key];
|
|
|
|
}
|
|
|
|
result.device.type=ledDevice;
|
|
|
|
requestWriteConfig(result)
|
|
|
|
});
|
|
|
|
|
2017-02-08 14:36:28 +01:00
|
|
|
removeOverlay();
|
2016-09-06 10:14:54 +02:00
|
|
|
});
|