mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Update content_leds.js
add corner values and calculation of led rows
This commit is contained in:
parent
28bb5950e6
commit
aa5d2bd758
@ -75,7 +75,16 @@ 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;
|
||||
//corner values %
|
||||
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);
|
||||
@ -142,57 +151,53 @@ function createClassicLeds(){
|
||||
}
|
||||
|
||||
function createTopLeds(){
|
||||
var step=(Hmax-Hmin)/ledstop;
|
||||
//if(cornerVGap != '0')
|
||||
// step=(Hmax-Hmin-(cornerHGap*2))/ledstop;
|
||||
var steph = (pttrh - pttlh - (2*edgeHGap))/ledstop;
|
||||
var stepv = (pttrv - pttlv)/ledstop;
|
||||
|
||||
var vmin=Vmin;
|
||||
var vmax=vmin+ledsHDepth;
|
||||
for (var i = 0; i<ledstop; i++){
|
||||
var hmin = ovl("-",(Hdiff/ledstop*Number([i]))+edgeHGap);
|
||||
var hmax = ovl("+",(Hdiff/ledstop*Number([i]))+step+edgeHGap);
|
||||
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 createLeftLeds(){
|
||||
var step=(Vmax-Vmin)/ledsleft;
|
||||
//if(cornerVGap != '0')
|
||||
// step=(Vmax-Vmin-(cornerVGap*2))/ledsleft;
|
||||
var steph = (ptblh - pttlh)/ledsleft;
|
||||
var stepv = (ptblv - pttlv - (2*edgeVGap))/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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
function createRightLeds(){
|
||||
var step=(Vmax-Vmin)/ledsright;
|
||||
//if(cornerVGap != '0')
|
||||
// step=(Vmax-Vmin-(cornerVGap*2))/ledsright;
|
||||
var steph = (ptbrh - pttrh)/ledsright;
|
||||
var stepv = (ptbrv - pttrv - (2*edgeVGap))/ledsright;
|
||||
|
||||
var hmax=Hmax;
|
||||
var hmin=hmax-ledsVDepth;
|
||||
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 steph = (ptbrh - ptblh - (2*edgeHGap))/ledsbottom;
|
||||
var stepv = (ptbrv - ptblv)/ledsbottom;
|
||||
|
||||
var vmax=Vmax;
|
||||
var vmin=vmax-ledsHDepth;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user