Merge remote-tracking branch 'upstream/main' into mdev

This commit is contained in:
Ewoud
2023-01-04 13:28:46 +01:00
10 changed files with 336 additions and 326 deletions

View File

@@ -24,6 +24,7 @@
//console.log("File loaded");
GetV();
UI();
Sf.MPC.setAttribute("max",maxPanels);
});
// error event
scE.addEventListener("error", (ev) => {
@@ -44,31 +45,27 @@
loadJS(url, false); // If we set async false, file is loaded and executed, then next statement is processed
}
function UI(panels=-1) //WLEDM quick fix
{
gId("mpdiv").style.display = "block";
function UI() {
if (gId("somp").value === "0") {
gId("mpdiv").style.display = "none";
resetPanels();
return;
}
if (panels != -1) { //WLEDM quick fix
let i = gId("panels").children.length;
if (i<panels) for (let j=i; j<panels; j++) addPanel(j);
if (i>panels) for (let j=i; j>panels; j--) remPanel();
}
gId("mpdiv").style.display = "block";
}
function addPanels() {
let c = parseInt(d.Sf.MPC.value);
for (let i=0; i<c; i++) addPanel(i);
let i = gId("panels").children.length;
if (i<c) for (let j=i; j<c; j++) addPanel(j);
if (i>c) for (let j=i; j>c; j--) remPanel();
}
function addPanel(i=0) {
let p = gId("panels");
if (p.children.length >= maxPanels) return;
var pw = parseInt(d.Sf.PW.value);
var ph = parseInt(d.Sf.PH.value);
let b = `<div id="pnl${i}"><hr class="sml">Panel ${i}<br>
1<sup>st</sup> LED: <select name="P${i}B">
<option value="0">Top</option>
@@ -82,7 +79,7 @@ Orientation: <select name="P${i}V">
<option value="1">Vertical</option>
</select><br>
Serpentine: <input type="checkbox" name="P${i}S"><br>
Dimensions (WxH): <input id="P${i}W" name="P${i}W" type="number" min="1" max="128" value="8"> x <input id="P${i}H" name="P${i}H" type="number" min="1" max="128" value="8"><br>
Dimensions (WxH): <input id="P${i}W" name="P${i}W" type="number" min="1" max="128" value="${pw}"> x <input id="P${i}H" name="P${i}H" type="number" min="1" max="128" value="${ph}"><br>
Offset X:<input id="P${i}X" name="P${i}X" type="number" min="0" max="256" value="0">
Y:<input id="P${i}Y" name="P${i}Y" type="number" min="0" max="256" value="0"><br><i>(offset from top-left corner in # LEDs)</i>
</div>`;
@@ -98,22 +95,21 @@ Y:<input id="P${i}Y" name="P${i}Y" type="number" min="0" max="256" value="0"><br
function resetPanels() {
d.Sf.MPC.value = 1;
for (let e of gId("panels").children) e.remove();
for (let e of gId("panels").children) e.remove(); // to remove any leftovers
let e = gId("panels").children
for (let i = e.length; i>0; i--) e[i-1].remove();
}
/*
function btnPanel(i) {
gId("pnl_add").style.display = (i<maxPanels) ? "inline":"none";
gId("pnl_rem").style.display = (i>1) ? "inline":"none";
}
*/
function gen() {
resetPanels();
var pansH = parseInt(d.Sf.MPH.value);
var pansV = parseInt(d.Sf.MPV.value);
var c = pansH*pansV;
//maxPanels = c;
d.Sf.MPC.value = c; // number of panels
var ps = d.Sf.PS.checked;
@@ -138,7 +134,6 @@ Y:<input id="P${i}Y" name="P${i}Y" type="number" min="0" max="256" value="0"><br
}
}
}
</script>
<style>@import url("style.css");</style>
</head>
@@ -158,8 +153,8 @@ Y:<input id="P${i}Y" name="P${i}Y" type="number" min="0" max="256" value="0"><br
<hr class="sml">
<h3>Matrix Generator</h3>
Panel dimensions (WxH): <input name="PW" type="number" min="1" max="128" value="8"> x <input name="PH" type="number" min="1" max="128" value="8"><br>
Horizontal panels: <input name="MPH" type="number" min="1" max="8" value="1" oninput="UI()">
Vertical panels: <input name="MPV" type="number" min="1" max="8" value="1" oninput="UI()"><br>
Horizontal panels: <input name="MPH" type="number" min="1" max="8" value="1">
Vertical panels: <input name="MPV" type="number" min="1" max="8" value="1"><br>
1<sup>st</sup> panel: <select name="PB">
<option value="0">Top</option>
<option value="1">Bottom</option>
@@ -176,7 +171,7 @@ Y:<input id="P${i}Y" name="P${i}Y" type="number" min="0" max="256" value="0"><br
<button type="button" onclick="gen()">Populate</button>
<hr class="sml">
<h3>Panel set-up</h3>
Number of panels: <input name="MPC" type="number" min="1" max="64" value="1" oninput="UI(parseInt(this.value))"><br>
Number of panels: <input name="MPC" type="number" min="1" max="64" value="1" oninput="addPanels()"><br>
<i>A matrix is made of 1 or more physical LED panels.<br>
<!--Panels should be arranged from top-left to bottom-right order, starting with lower panel number on the left (or top if transposed).<br>-->
Each panel can be of different size and/or have different LED orientation and/or starting point and/or layout.</i><br>

View File

@@ -89,7 +89,7 @@
</div>
<h2>Security & Update setup</h2>
Settings PIN: <input type="password" id="PIN" name="PIN" size="4" maxlength="4" minlength="4" onkeydown="checkNum(this)" pattern="[0-9]*" inputmode="numeric" title="Please enter a 4 digit number"><br>
<div style="color: #fa0;">&#9888; Unencrypted transmission. Be prudent when selecting PIN, do NOT use your banking, door, SIM, etc. pin!</div><br><br>
<div style="color: #fa0;">&#9888; Unencrypted transmission. Be prudent when selecting PIN, do NOT use your banking, door, SIM, etc. pin!</div><br>
Lock wireless (OTA) software update: <input type="checkbox" name="NO"><br>
Passphrase: <input type="password" name="OP" maxlength="32"><br>
To enable OTA, for security reasons you need to also enter the correct password!<br>
@@ -120,8 +120,8 @@
(c) 2022 <a href="https://github.com/Aircoookie/WLED/compare/main...MoonModules:WLED:mdev" target="_blank">Github MoonModules WLED Commit Authors</a><br><br>
fork of <a href="https://github.com/Aircoookie/WLED/" target="_blank">WLED:</a><br>
<a href="https://github.com/Aircoookie/WLED/wiki/Contributors-and-credits" target="_blank">Contributors, dependencies and special thanks</a><br>
A huge thank you to everyone who helped me create WLED!<br>
(c) 2016-2022 Christian Schwinne <br><br>
A huge thank you to everyone who helped me create WLED!<br><br>
(c) 2016-2023 Christian Schwinne <br>
<i>Licensed under the <a href="https://github.com/Aircoookie/WLED/blob/master/LICENSE" target="_blank">MIT license</a></i><br><br>
Server message: <span class="sip"> Response error! </span><hr>
<div id="toast"></div>