|
52 | 52 | maxL = l; // maxL - max LEDs (will serve to determine ESP >1664 == ESP32) |
53 | 53 | maxCO = o; // maxCO - max Color Order mappings |
54 | 54 | } |
| 55 | + function is8266() { return maxA == 5 && maxD == 3; } // NOTE: see const.h |
| 56 | + function is32() { return maxA == 16 && maxD == 16; } // NOTE: see const.h |
| 57 | + function isC3() { return maxA == 6 && maxD == 2; } // NOTE: see const.h |
| 58 | + function isS2() { return maxA == 8 && maxD == 12 && maxV == 4; } // NOTE: see const.h |
| 59 | + function isS3() { return maxA == 8 && maxD == 12 && maxV == 6; } // NOTE: see const.h |
55 | 60 | function pinsOK() { |
56 | 61 | var ok = true; |
57 | 62 | var nList = d.Sf.querySelectorAll("#mLC input[name^=L]"); |
|
271 | 276 | gRGBW |= hasW(t); // RGBW checkbox |
272 | 277 | gId("co"+n).style.display = (isVir(t) || isAna(t)) ? "none":"inline"; // hide color order for PWM |
273 | 278 | gId("dig"+n+"w").style.display = (isDig(t) && hasW(t)) ? "inline":"none"; // show swap channels dropdown |
274 | | - gId("dig"+n+"w").querySelector("[data-opt=CCT]").disabled = !hasCCT(t); // disable WW/CW swapping |
| 279 | + gId("dig"+n+"w").querySelector("[data-opt=CCT]").disabled = !hasCCT(t); // disable WW/CW swapping |
275 | 280 | if (!(isDig(t) && hasW(t))) d.Sf["WO"+n].value = 0; // reset swapping |
276 | 281 | gId("dig"+n+"c").style.display = (isAna(t)) ? "none":"inline"; // hide count for analog |
277 | 282 | gId("dig"+n+"r").style.display = (isVir(t)) ? "none":"inline"; // hide reversed for virtual |
|
281 | 286 | gId("dig"+n+"l").style.display = (isD2P(t) || isPWM(t)) ? "inline":"none"; // bus clock speed / PWM speed (relative) (not On/Off) |
282 | 287 | gId("rev"+n).innerHTML = isAna(t) ? "Inverted output":"Reversed"; // change reverse text for analog else (rotated 180°) |
283 | 288 | //gId("psd"+n).innerHTML = isAna(t) ? "Index:":"Start:"; // change analog start description |
| 289 | + gId("net"+n+"h").style.display = isNet(t) && !is8266() ? "block" : "none"; // show host field for network types except on ESP8266 |
| 290 | + if (!isNet(t) || is8266()) d.Sf["HS"+n].value = ""; // cleart host field if not network type or ESP8266 |
284 | 291 | }); |
285 | 292 | // display global white channel overrides |
286 | 293 | gId("wc").style.display = (gRGBW) ? 'inline':'none'; |
|
463 | 470 | <span id="p2d${s}"></span><input type="number" name="L2${s}" class="s" onchange="UI();pinUpd(this);"/> |
464 | 471 | <span id="p3d${s}"></span><input type="number" name="L3${s}" class="s" onchange="UI();pinUpd(this);"/> |
465 | 472 | <span id="p4d${s}"></span><input type="number" name="L4${s}" class="s" onchange="UI();pinUpd(this);"/> |
| 473 | +<div id="net${s}h" class="hide">Host: <input type="text" name="HS${s}" maxlength="32" pattern="[a-zA-Z0-9_\\-]*" onchange="UI()"/>.local</div> |
466 | 474 | <div id="dig${s}r" style="display:inline"><br><span id="rev${s}">Reversed</span>: <input type="checkbox" name="CV${s}"></div> |
467 | 475 | <div id="dig${s}s" style="display:inline"><br>Skip first LEDs: <input type="number" name="SL${s}" min="0" max="255" value="0" oninput="UI()"></div> |
468 | 476 | <div id="dig${s}f" style="display:inline"><br><span id="off${s}">Off Refresh</span>: <input id="rf${s}" type="checkbox" name="RF${s}"></div> |
|
479 | 487 | if (type.t != undefined && type.t != "") { |
480 | 488 | opt.setAttribute('data-type', type.t); |
481 | 489 | } |
482 | | - sel.appendChild(opt); |
| 490 | + sel.appendChild(opt); |
483 | 491 | } |
484 | 492 | } |
485 | 493 | }); |
|
586 | 594 | var cs = false; |
587 | 595 | for (var i=1; i < gEBCN("iST").length; i++) { |
588 | 596 | var s = chrID(i); |
589 | | - var p = chrID(i-1); // cover edge case 'A' previous char being '9' |
| 597 | + var p = chrID(i-1); // cover edge case 'A' previous char being '9' |
590 | 598 | var v = parseInt(gId("ls"+p).value) + parseInt(gN("LC"+p).value); |
591 | 599 | if (v != parseInt(gId("ls"+s).value)) {cs = true; startsDirty[i] = true;} |
592 | 600 | } |
|
617 | 625 |
|
618 | 626 | function receivedText(e) { |
619 | 627 | let lines = e.target.result; |
620 | | - let c = JSON.parse(lines); |
| 628 | + let c = JSON.parse(lines); |
621 | 629 | if (c.hw) { |
622 | 630 | if (c.hw.led) { |
623 | 631 | // remove all existing outputs |
|
0 commit comments