Skip to content

Commit

Permalink
dmx_htm_fixes (Aircoookie#1070)
Browse files Browse the repository at this point in the history
* Update cdata.js

* Update html_settings.h

* Update settings.htm

* Update settings_dmx.htm

* Add %DMXMENU% to cdata.js

* Fix single % being treated as template in settings.htm

Co-authored-by: cschwinne <[email protected]>
  • Loading branch information
jbucky86 and Aircoookie authored Aug 3, 2020
1 parent 42397a0 commit 47f24ac
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tools/cdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ writeChunks(
append: ")=====",
method: "plaintext",
filter: "html-minify",
mangle: (str) =>
str
.replace("%", "%%")
.replace(/User Interface\<\/button\>\<\/form\>/gms, "User Interface\<\/button\>\<\/form\>%DMXMENU%"),
},
{
file: "settings_wifi.htm",
Expand Down
7 changes: 5 additions & 2 deletions wled00/data/settings_dmx.htm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
function S(){GCH(15);GetV();mMap();}function H(){window.open("https://github.com/Aircoookie/WLED/wiki/DMX");}function B(){window.history.back();}
function GetV(){}
</script>
<style>
@import url("style.css");
</style>
</head>
<body onload="S()">
<form id="form_s" name="Sf" method="post">
Expand All @@ -48,9 +51,9 @@ <h2>Imma firin ma lazer (if it has DMX support)</h2><!-- TODO: Change to somethi
<div id="gapwarning" style="color: orange; display: none;">WARNING: Channel gap is lower than channels per fixture.<br />This will cause overlap.</div>
<button type="button" onclick="location.href='/dmxmap';">DMX Map</button><br>
DMX fixtures start LED: <input type="number" min="0" max="1500" name="SL">
<h3>channel functions</h3>
<h3>Channel functions</h3>
<div id="dmxchannels"></div>
<hr><button type="button" onclick="B()">Back</button><button type="submit">Save</button>
</form>
</body>
</html>
</html>
4 changes: 4 additions & 0 deletions wled00/dmx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void initDMX() {
dmx.init(512); // initialize with bus length
}

#if (LEDPIN == 2)
#pragma message "Pin conflict compiling with DMX and LEDs on pin 2. Please set a different LEDPIN."
#endif

#else
void handleDMX() {}
void initDMX() {}
Expand Down
22 changes: 11 additions & 11 deletions wled00/html_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const char PAGE_settingsCss[] PROGMEM = R"=====(<style>body{font-family:Verdana,
// Autogenerated from wled00/data/settings.htm, do not edit!!
const char PAGE_settings[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"><title>WLED Settings</title><style>
body{text-align:center;background:#222;height:100;margin:0}html{--h:11.55vh}button{background:#333;color:#fff;font-family:Verdana,Helvetica,sans-serif;border:.3ch solid #333;display:inline-block;font-size:8vmin;height:var(--h);width:95%;margin-top:2.4vh}
body{text-align:center;background:#222;height:100;margin:0}html{--h:11.55vh}button{background:#333;color:#fff;font-family:Verdana,Helvetica,sans-serif;border:.3ch solid #333;display:inline-block;font-size:8vmin;height:var(--h);width:95%%;margin-top:2.4vh}
</style><script>
function BB(){window.frameElement&&(document.getElementById("b").style.display="none",document.documentElement.style.setProperty("--h","13.86vh"))}
</script></head><body onload="BB()"><form action="/"><button type="submit"
id="b">Back</button></form><form action="/settings/wifi"><button type="submit">
WiFi Setup</button></form><form action="/settings/leds"><button type="submit">
LED Preferences</button></form><form action="/settings/ui"><button
type="submit">User Interface</button></form><form action="/settings/sync">
type="submit">User Interface</button></form>%DMXMENU%<form action="/settings/sync">
<button type="submit">Sync Interfaces</button></form><form
action="/settings/time"><button type="submit">Time & Macros</button></form><form
action="/settings/sec"><button type="submit">Security & Updates</button></form>
Expand Down Expand Up @@ -136,14 +136,14 @@ onclick="B()">Back</button><button type="submit">Save</button></form></body>
const char PAGE_settings_dmx[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta name="viewport" content="width=500"><meta
charset="utf-8"><title>DMX Settings</title><script>
function GCH(n){for(d=document,d.getElementById("dmxchannels").innerHTML+="",i=0;i<n;i++)d.getElementById("dmxchannels").innerHTML+="<span id=CH"+(i+1)+"s >Channel "+(i+1)+": <select name=CH"+(i+1)+' id="CH'+(i+1)+'"><option value=0>Set to 0</option><option value=1>Red</option><option value=2>Green</option><option value=3>Blue</option><option value=4>White</option><option value=5>Shutter (Brightness)</option><option value=6>Set to 255</option></select></span><br />\n'}function mMap(){for(d=document,numCh=document.Sf.CN.value,numGap=document.Sf.CG.value,parseInt(numCh)>parseInt(numGap)?d.getElementById("gapwarning").style.display="block":d.getElementById("gapwarning").style.display="none",i=0;i<15;i++)i>=numCh?(d.getElementById("CH"+(i+1)+"s").style.opacity="0.5",d.getElementById("CH"+(i+1)).disabled=!0):(d.getElementById("CH"+(i+1)+"s").style.opacity="1",d.getElementById("CH"+(i+1)).disabled=!1)}function S(){GCH(15),GetV(),mMap()}function H(){window.open("https://github.com/Aircoookie/WLED/wiki/DMX")}function B(){window.history.back()}function GetV() {var d=document;
</head><body onload="S()"><form id="form_s" name="Sf" method="post">
<div class="helpB"><button type="button" onclick="H()">?</button></div><button
type="button" onclick="B()">Back</button><button type="submit">Save</button><hr>
<h2>Imma firin ma lazer (if it has DMX support)</h2>Proxy Universe <input
name="PU" type="number" min="0" max="63999" required>
from E1.31 to DMX (0=disabled)<br><i>
This will disable the LED data output to DMX configurable below</i><br><br><i>
Number of fixtures is taken from LED config page</i><br>
%CSS%%SCSS%</head><body onload="S()"><form
id="form_s" name="Sf" method="post"><div class="helpB"><button type="button"
onclick="H()">?</button></div><button type="button" onclick="B()">Back</button>
<button type="submit">Save</button><hr><h2>
Imma firin ma lazer (if it has DMX support)</h2>Proxy Universe <input name="PU"
type="number" min="0" max="63999" required> from E1.31 to DMX (0=disabled)<br>
<i>This will disable the LED data output to DMX configurable below</i><br><br>
<i>Number of fixtures is taken from LED config page</i><br>
Channels per fixture (15 max): <input type="number" min="1" max="15" name="CN"
maxlength="2" onchange="mMap()"><br>Start channel: <input type="number" min="1"
max="512" name="CS" maxlength="2"><br>Spacing between start channels: <input
Expand All @@ -153,7 +153,7 @@ info</a> ]<br><div id="gapwarning" style="color:orange;display:none">
WARNING: Channel gap is lower than channels per fixture.<br>
This will cause overlap.</div><button type="button"
onclick='location.href="/dmxmap"'>DMX Map</button><br>DMX fixtures start LED:
<input type="number" min="0" max="1500" name="SL"><h3>channel functions</h3><div
<input type="number" min="0" max="1500" name="SL"><h3>Channel functions</h3><div
id="dmxchannels"></div><hr><button type="button" onclick="B()">Back</button>
<button type="submit">Save</button></form></body></html>)=====";

Expand Down

0 comments on commit 47f24ac

Please sign in to comment.