|
40 | 40 | if (nm=="L0" || nm=="L1" || nm=="L2" || nm=="L3") { |
41 | 41 | var n = LCs[i].name.substring(2); |
42 | 42 | var t = parseInt(d.getElementsByName("LT"+n)[0].value, 10); // LED type SELECT |
43 | | - if (t<16) continue; |
| 43 | + if (t>=80) continue; |
44 | 44 | } |
45 | 45 | //check for pin conflicts |
46 | 46 | if (nm=="L0" || nm=="L1" || nm=="L2" || nm=="L3" || nm=="L4" || nm=="RL" || nm=="BT" || nm=="IR") |
|
105 | 105 | } |
106 | 106 | //returns mem usage |
107 | 107 | function getMem(t, len, p0) { |
108 | | - if (t > 15 && t < 32) { |
| 108 | + if (t < 32) { |
109 | 109 | if (maxM < 10000 && p0==3) { //8266 DMA uses 5x the mem |
110 | 110 | if (t > 29) return len*20; //RGBW |
111 | 111 | return len*15; |
|
137 | 137 | if (s[i].name.substring(0,2)=="LT") { |
138 | 138 | var n = s[i].name.substring(2); |
139 | 139 | var t = parseInt(s[i].value,10); |
140 | | - gId("p0d"+n).innerHTML = (t>=10 && t<=15) ? "IP address:" : (t > 49) ? "Data GPIO:" : (t >41) ? "GPIOs:" : "GPIO:"; |
141 | | - gId("p1d"+n).innerHTML = (t > 49) ? "Clk GPIO:" : ""; |
| 140 | + gId("p0d"+n).innerHTML = (t>=80 && t<96) ? "IP address:" : (t > 49) ? "Data GPIO:" : (t >41) ? "GPIOs:" : "GPIO:"; |
| 141 | + gId("p1d"+n).innerHTML = (t> 49 && t<64) ? "Clk GPIO:" : ""; |
142 | 142 | var LK = d.getElementsByName("L1"+n)[0]; // clock pin |
143 | 143 |
|
144 | 144 | memu += getMem(t, d.getElementsByName("LC"+n)[0].value, d.getElementsByName("L0"+n)[0].value); // calc memory |
|
147 | 147 | for (p=1; p<5; p++) { |
148 | 148 | var LK = d.getElementsByName("L"+p+n)[0]; // secondary pins |
149 | 149 | if (!LK) continue; |
150 | | - if (((t>=10 && t<=15) && p<4) || (t>49 && p==1) || (t>41 && t < 50 && (p+40 < t))) // TYPE_xxxx values from const.h |
| 150 | + if (((t>=80 && t<96) && p<4) || (t>49 && p==1) || (t>41 && t < 50 && (p+40 < t))) // TYPE_xxxx values from const.h |
151 | 151 | { |
152 | 152 | // display pin field |
153 | 153 | LK.style.display = "inline"; |
|
163 | 163 | if (t > 31 && t < 48) d.getElementsByName("LC"+n)[0].value = 1; // for sanity change analog count just to 1 LED |
164 | 164 | } |
165 | 165 | isRGBW |= (t == 30 || t == 31 || (t > 40 && t < 46 && t != 43)); // RGBW checkbox, TYPE_xxxx values from const.h |
166 | | - gId("co"+n).style.display = (t<16 || t == 41 || t == 42) ? "none":"inline"; // hide color order for PWM W & WW/CW |
| 166 | + gId("co"+n).style.display = ((t>=80 && t<96) || t == 41 || t == 42) ? "none":"inline"; // hide color order for PWM W & WW/CW |
167 | 167 | gId("dig"+n+"c").style.display = (t > 40 && t < 48) ? "none":"inline"; // hide count for analog |
168 | | - gId("dig"+n+"r").style.display = (t<16) ? "none":"inline"; // hide reversed for virtual |
169 | | - gId("dig"+n+"s").style.display = (t<16 || (t > 40 && t < 48)) ? "none":"inline"; // hide skip 1st for virtual & analog |
| 168 | + gId("dig"+n+"r").style.display = (t>=80 && t<96) ? "none":"inline"; // hide reversed for virtual |
| 169 | + gId("dig"+n+"s").style.display = ((t>=80 && t<96) || (t > 40 && t < 48)) ? "none":"inline"; // hide skip 1st for virtual & analog |
170 | 170 | gId("rev"+n).innerHTML = (t > 40 && t < 48) ? "Inverted output":"Reversed (rotated 180°)"; // change reverse text for analog |
171 | 171 | gId("psd"+n).innerHTML = (t > 40 && t < 48) ? "Index:":"Start:"; // change analog start description |
172 | 172 | } |
|
193 | 193 | if (s+c > sLC) sLC = s+c; |
194 | 194 | if(c>maxLC)maxLC=c; |
195 | 195 | var t = parseInt(d.getElementsByName("LT"+n)[0].value); // LED type SELECT |
196 | | - if (t>16) sPC+=c; //virtual out busses do not count towards physical LEDs |
| 196 | + if (t<80) sPC+=c; //virtual out busses do not count towards physical LEDs |
197 | 197 | } // increase led count |
198 | 198 | continue; |
199 | 199 | } |
|
205 | 205 | // ignore IP address (stored in pins for virtual busses) |
206 | 206 | if (nm=="L0" || nm=="L1" || nm=="L2" || nm=="L3") { |
207 | 207 | var t = parseInt(d.getElementsByName("LT"+n)[0].value); // LED type SELECT |
208 | | - if (t<16) { |
| 208 | + if (t>=80) { |
209 | 209 | LCs[i].max = 255; |
210 | 210 | LCs[i].min = 0; |
211 | 211 | continue; // do not check conflicts |
|
226 | 226 | if (n2.substring(0,1)==="L") { |
227 | 227 | var m = LCs[j].name.substring(2); |
228 | 228 | var t2 = parseInt(d.getElementsByName("LT"+m)[0].value, 10); |
229 | | - if (t2<16) continue; |
| 229 | + if (t2>=80) continue; |
230 | 230 | } |
231 | 231 | if (LCs[j].value!="" && LCs[j].value!="-1") p.push(parseInt(LCs[j].value,10)); // add current pin |
232 | 232 | } |
|
278 | 278 | if (isNaN(v)) return 0; |
279 | 279 | return v; |
280 | 280 | } |
281 | | - function addLEDs(n) |
| 281 | + function addLEDs(n,init=true) |
282 | 282 | { |
283 | | - if (n>1) {maxB=n; gId("+").style.display="inline"; return;} |
284 | | - |
285 | 283 | var o = d.getElementsByClassName("iST"); |
286 | 284 | var i = o.length; |
287 | 285 |
|
|
307 | 305 | <option value="43">PWM RGB</option> |
308 | 306 | <option value="44">PWM RGBW</option> |
309 | 307 | <option value="45">PWM RGBWC</option> |
310 | | -<option value="10">DDP RGB (network)</option> |
311 | | -<!--option value="11">E1.31 RGB (network)</option--> |
312 | | -<!--option value="12">ArtNet RGB (network)</option--> |
| 308 | +<option value="80">DDP RGB (network)</option> |
| 309 | +<!--option value="81">E1.31 RGB (network)</option--> |
| 310 | +<!--option value="82">ArtNet RGB (network)</option--> |
313 | 311 | </select> |
314 | 312 | <div id="co${i}" style="display:inline">Color Order: |
315 | 313 | <select name="CO${i}"> |
|
342 | 340 | gId("+").style.display = (i<maxB-1) ? "inline":"none"; |
343 | 341 | gId("-").style.display = (i>0) ? "inline":"none"; |
344 | 342 |
|
345 | | - UI(); |
| 343 | + if (!init) UI(); |
346 | 344 | } |
347 | 345 | function addBtn(i,p,t) { |
348 | 346 | var c = gId("btns").innerHTML; |
|
393 | 391 | function GetV() |
394 | 392 | { |
395 | 393 | //values injected by server while sending HTML |
396 | | - d.um_p=[6,7,8,9,10,11];bLimits(3,4096,4000,1664);d.Sf.MS.checked=0;addLEDs(1);d.Sf.L00.value=2;d.Sf.LC0.value=29;d.Sf.LT0.value=22;d.Sf.CO0.value=0;d.Sf.LS0.value=0;d.Sf.CV0.checked=0;d.Sf.SL0.checked=0;d.Sf.MA.value=850;d.Sf.LA.value=0;d.Sf.CA.value=56;d.Sf.AW.value=3;d.Sf.BO.checked=1;d.Sf.BP.value=80;d.Sf.GB.checked=0;d.Sf.GC.checked=1;d.Sf.TF.checked=1;d.Sf.TD.value=700;d.Sf.PF.checked=0;d.Sf.BF.value=100;d.Sf.TB.value=0;d.Sf.TL.value=60;d.Sf.TW.value=0;d.Sf.PB.selectedIndex=0;d.Sf.RL.value=12;d.Sf.RM.checked=1;addBtn(0,0,0);addBtn(1,-1,0);d.Sf.TT.value=32;d.Sf.IR.value=-1;d.Sf.IT.value=0; |
| 394 | + //d.um_p=[6,7,8,9,10,11,1];bLimits(3,4096,4000,1664);d.Sf.MS.checked=1;addLEDs(1);d.Sf.L00.value=2;d.Sf.LC0.value=30;d.Sf.LT0.value=22;d.Sf.CO0.value=0;d.Sf.LS0.value=15;d.Sf.CV0.checked=1;d.Sf.SL0.checked=0;addLEDs(1);d.Sf.L01.value=10;d.Sf.L11.value=10;d.Sf.L21.value=1;d.Sf.L31.value=10;d.Sf.LC1.value=60;d.Sf.LT1.value=80;d.Sf.CO1.value=1;d.Sf.LS1.value=0;d.Sf.CV1.checked=0;d.Sf.SL1.checked=0;d.Sf.MA.value=850;d.Sf.LA.value=0;d.Sf.CA.value=56;d.Sf.AW.value=3;d.Sf.BO.checked=1;d.Sf.BP.value=80;d.Sf.GB.checked=0;d.Sf.GC.checked=1;d.Sf.TF.checked=1;d.Sf.TD.value=700;d.Sf.PF.checked=0;d.Sf.BF.value=100;d.Sf.TB.value=0;d.Sf.TL.value=60;d.Sf.TW.value=0;d.Sf.PB.selectedIndex=0;d.Sf.RL.value=12;d.Sf.RM.checked=1;addBtn(0,0,0);addBtn(1,-1,0);d.Sf.TT.value=32;d.Sf.IR.value=-1;d.Sf.IT.value=0; |
397 | 395 | } |
398 | 396 | </script> |
399 | 397 | <style> |
@@ -437,8 +435,8 @@ <h2>LED & Hardware setup</h2> |
437 | 435 | <h3>Hardware setup</h3> |
438 | 436 | <div id="mLC">LED outputs:</div> |
439 | 437 | <hr style="width:260px"> |
440 | | - <button type="button" id="+" onclick="addLEDs(1)" style="display:none;border-radius:20px;height:36px;">+</button> |
441 | | - <button type="button" id="-" onclick="addLEDs(-1)" style="display:none;border-radius:20px;width:36px;height:36px;">-</button><br> |
| 438 | + <button type="button" id="+" onclick="addLEDs(1,false)" style="display:none;border-radius:20px;height:36px;">+</button> |
| 439 | + <button type="button" id="-" onclick="addLEDs(-1,false)" style="display:none;border-radius:20px;width:36px;height:36px;">-</button><br> |
442 | 440 | LED Memory Usage: <span id="m0">0</span> / <span id="m1">?</span> B<br> |
443 | 441 | <div id="dbar" style="display:inline-block; width: 100px; height: 10px; border-radius: 20px;"></div><br> |
444 | 442 | <div id="ledwarning" style="color: orange; display: none;"> |
|
0 commit comments