DMX Support for WLED (#704)
* initial dmx setup * adds support for multiple fixtures, addr gaps, start addresses and all that good DMX stuff * removes init function. do not need. * adds some comments, removes others. words. * added menu entry and dummy HTML * added server request handler * cloned options page UI for DMX * only add code when DMX is enabled * added infobutton to HTML * DMX settings form * procedurally generated HTML form. OBACHT: Values still not coming from the EEPROM. * upped eeprom version to 15 * changed index for set to 255 to 6 because web interface wants it that way * gets values for XML from actual settings * changes the default values for dmx to blanks * reads and writes DMX settings from EEPROM (2550 - 2569) * fixes addressing bug in DMX EEPROM read * saves settings from WebUI to memory * disables DMX by default * changed a comment in the ENABLE_DMX line * makes the display of the DMX entry in settings dependant on WLED_DMX_ENABLE * adds the server listener for the DMX map * fixes a bug when selecting 255 for a channel at the dmx settings page * now actually reads the DMX settings back to the HTML UI. * cleans up a little * adds a warning message to the HTML UI when setting up defunct DMX settings * changed DMX EEPROM addressing to close a gap * basic DMX map * fixes a few styling flaws and bugs in the DMX map * changes config variables to uint16_t Co-authored-by: Aircoookie <cschwinne@gmail.com>
This commit is contained in:
@@ -15,6 +15,36 @@ const char PAGE_msg[] PROGMEM = R"=====(<!DOCTYPE html>
|
||||
<style>.bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%%;margin:0}</style></head>
|
||||
<body><h2>%MSG%</body></html>)=====";
|
||||
|
||||
//DMX channel map
|
||||
const char PAGE_dmxmap[] PROGMEM = R"=====(<!DOCTYPE html>
|
||||
<html><head><meta content='width=device-width' name='viewport'>
|
||||
<title>DMX Map</title>
|
||||
<script>function B(){window.history.back()};function RS(){window.location = "/settings";}function RP(){top.location.href="/";}function FM() {%DMXVARS%
|
||||
var dmxlabels = ["SET 0","RED","GREEN","BLUE","WHITE","SHUTTER","SET 255", "DISABLED"];
|
||||
var dmxchans = [];
|
||||
for (i=0;i<512;i++) {
|
||||
dmxchans.push(7); // set all to DISABLED
|
||||
}
|
||||
for (i=0;i<LC;i++) {
|
||||
FS = CS + (CG * i);
|
||||
for (j=0;j<CN;j++) {
|
||||
DA=FS+j;
|
||||
dmxchans[DA-1] = CH[j];
|
||||
}
|
||||
}
|
||||
DMXMap = "";
|
||||
for (i=0;i<512;i++) {
|
||||
isstart = "";
|
||||
if ((i+1) % 10 == 0) {
|
||||
isstart="S"
|
||||
}
|
||||
DMXMap += "<div class=\"anytype " + isstart + " type" + dmxchans[i] + "\">" + String(i+1) + "<br />" + dmxlabels[dmxchans[i]] + "</div>";
|
||||
}
|
||||
document.getElementById("map").innerHTML = DMXMap;
|
||||
}</script>
|
||||
<style>.anytype{border: 1px solid white; margin: 1px; float: left; width: 100px; height: 100px;}.S { margin: 0px; border: 2px solid white;} .type7{color: #888; border: 1px dotted grey;}.type6{color: #FFF;}.type4{color: #FFF; font-weight: bold; }.type3{color: #00F; font-weight: bold; }.type2{color: #0F0; font-weight: bold; }.type1{color: #F00; font-weight: bold; } .bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%%;margin:0}</style></head>
|
||||
<body onload="FM();"><div id="map">...</div></body></html>)=====";
|
||||
|
||||
|
||||
//firmware update page
|
||||
const char PAGE_update[] PROGMEM = R"=====(<!DOCTYPE html>
|
||||
|
||||
Reference in New Issue
Block a user