diff --git a/assets/webconfig/js/content_leds.js b/assets/webconfig/js/content_leds.js index d4c0add2..9d364116 100644 --- a/assets/webconfig/js/content_leds.js +++ b/assets/webconfig/js/content_leds.js @@ -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 vmin=Vmin; - var vmax=vmin+ledsHDepth; + var steph = (pttrh - pttlh - (2*edgeHGap))/ledstop; + var stepv = (pttrv - pttlv)/ledstop; + for (var i = 0; i-1; --i){ - var vmin = ovl("-",(Vdiff/ledsleft*Number([i]))+edgeVGap); - var vmax = ovl("+",(Vdiff/ledsleft*Number([i]))+step+edgeVGap); + 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); } } 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-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); } }