mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
feat: Add Trapezoid to LED Layout (#791)
* Update schema-ledConfig.json
extend schema with corner points (vertcal and horizontal values in percent)
* Update conf_leds.html
input fields for corner points
* Update content_leds.js
add corner values and calculation of led rows
* Update de.json
german title for corners
* CHanges 26.12.2019 Correction and PowerOff add
* GrabberFix PiCam
* VType as QString
* Unused variable deletet
* Missing new paramneters for GrabberFix
* Error json
* JSon error by user
* Crosscompile SutnikElf frok
* Warning unused variable
* Revert "Crosscompile SutnikElf frok"
This reverts commit 443fe80090
.
* Fixing a linting error
* Adding Grabber Override Names
* Adding more Grabber Fix translations
* Missed one
* remove V4L2 Grabber Fix and Power Button from Dashboard
Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
* Setting some limits to the trapezoid
Co-authored-by: SputnikElf <58911932+SputnikElf@users.noreply.github.com>
Co-authored-by: SputnikElf <sputnikelf@gmx.de>
Co-authored-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
@@ -89,7 +89,7 @@ $(document).ready( function() {
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px"><a target="_blank" href="' + window.latestVersion.html_url + '">'+$.i18n('dashboard_infobox_message_updatewarning', window.latestVersion.tag_name) + '</a></div>');
|
||||
else
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
86
assets/webconfig/js/content_leds.js
Normal file → Executable file
86
assets/webconfig/js/content_leds.js
Normal file → Executable file
@@ -75,8 +75,18 @@ function createClassicLeds(){
|
||||
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;
|
||||
var overlap = $("#ip_cl_overlap").val()/4000;
|
||||
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;
|
||||
|
||||
//helper
|
||||
var edgeHGap = edgeVGap/(16/9);
|
||||
//var cornerHGap = cornerVGap/(16/9);
|
||||
@@ -142,61 +152,59 @@ function createClassicLeds(){
|
||||
}
|
||||
|
||||
function createTopLeds(){
|
||||
var step=(Hmax-Hmin)/ledstop;
|
||||
//if(cornerVGap != '0')
|
||||
// step=(Hmax-Hmin-(cornerHGap*2))/ledstop;
|
||||
|
||||
var vmin=Vmin;
|
||||
var vmax=vmin+ledsHDepth;
|
||||
var steph = (pttrh - pttlh - (2*edgeHGap))/ledstop;
|
||||
var stepv = (pttrv - pttlv)/ledstop;
|
||||
|
||||
for (var i = 0; i<ledstop; i++){
|
||||
var hmin = ovl("-",(Hdiff/ledstop*Number([i]))+edgeHGap);
|
||||
var hmax = ovl("+",(Hdiff/ledstop*Number([i]))+step+edgeHGap);
|
||||
createLedArray(hmin, hmax, vmin, vmax);
|
||||
}
|
||||
}
|
||||
|
||||
function createLeftLeds(){
|
||||
var step=(Vmax-Vmin)/ledsleft;
|
||||
//if(cornerVGap != '0')
|
||||
// step=(Vmax-Vmin-(cornerVGap*2))/ledsleft;
|
||||
|
||||
var hmin=Hmin;
|
||||
var hmax=hmin+ledsVDepth;
|
||||
for (var i = ledsleft-1; i>-1; --i){
|
||||
var vmin = ovl("-",(Vdiff/ledsleft*Number([i]))+edgeVGap);
|
||||
var vmax = ovl("+",(Vdiff/ledsleft*Number([i]))+step+edgeVGap);
|
||||
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;
|
||||
createLedArray(hmin, hmax, vmin, vmax);
|
||||
}
|
||||
}
|
||||
|
||||
function createRightLeds(){
|
||||
var step=(Vmax-Vmin)/ledsright;
|
||||
//if(cornerVGap != '0')
|
||||
// step=(Vmax-Vmin-(cornerVGap*2))/ledsright;
|
||||
|
||||
var hmax=Hmax;
|
||||
var hmin=hmax-ledsVDepth;
|
||||
var steph = (ptbrh - pttrh)/ledsright;
|
||||
var stepv = (ptbrv - pttrv - (2*edgeVGap))/ledsright;
|
||||
|
||||
for (var i = 0; i<ledsright; i++){
|
||||
var vmin = ovl("-",(Vdiff/ledsright*Number([i]))+edgeVGap);
|
||||
var vmax = ovl("+",(Vdiff/ledsright*Number([i]))+step+edgeVGap);
|
||||
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);
|
||||
createLedArray(hmin, hmax, vmin, vmax);
|
||||
}
|
||||
}
|
||||
|
||||
function createBottomLeds(){
|
||||
var step=(Hmax-Hmin)/ledsbottom;
|
||||
//if(cornerVGap != '0')
|
||||
// step=(Hmax-Hmin-(cornerHGap*2))/ledsbottom;
|
||||
|
||||
var vmax=Vmax;
|
||||
var vmin=vmax-ledsHDepth;
|
||||
var steph = (ptbrh - ptblh - (2*edgeHGap))/ledsbottom;
|
||||
var stepv = (ptbrv - ptblv)/ledsbottom;
|
||||
|
||||
for (var i = ledsbottom-1; i>-1; i--){
|
||||
var hmin = ovl("-",(Hdiff/ledsbottom*Number([i]))+edgeHGap);
|
||||
var hmax = ovl("+",(Hdiff/ledsbottom*Number([i]))+step+edgeHGap);
|
||||
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;
|
||||
createLedArray(hmin, hmax, vmin, vmax);
|
||||
}
|
||||
}
|
||||
|
||||
function createLeftLeds(){
|
||||
var steph = (ptblh - pttlh)/ledsleft;
|
||||
var stepv = (ptblv - pttlv - (2*edgeVGap))/ledsleft;
|
||||
|
||||
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
|
||||
createTopLeds();
|
||||
createRightLeds();
|
||||
createBottomLeds();
|
||||
|
Reference in New Issue
Block a user