Bugfixes.

This commit is contained in:
Blaz Kristan 2021-12-03 21:09:53 +01:00
parent 737151ba09
commit 5c7e3c6bab
13 changed files with 2944 additions and 2287 deletions

View File

@ -1020,8 +1020,8 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Noise 4",
"Colortwinkles",
"Lake",
"Meteor",
"Meteor Smooth",
"Meteor@!,Trail length;!,!,;!",
"Meteor Smooth@!,Trail length;!,!,;!",
"Railway",
"Ripple",
"Twinklefox",

View File

@ -543,6 +543,7 @@ void serializeConfig() {
hw_led["cct"] = correctWB;
hw_led[F("cr")] = cctFromRgb;
hw_led[F("cb")] = strip.cctBlending;
hw_led[F("rgbwm")] = Bus::getAutoWhiteMode();
JsonArray hw_led_ins = hw_led.createNestedArray("ins");
@ -562,7 +563,6 @@ void serializeConfig() {
ins["type"] = bus->getType() & 0x7F;
ins["ref"] = bus->isOffRefreshRequired();
ins[F("rgbw")] = bus->isRgbw();
ins[F("rgbwm")] = bus->getAutoWhiteMode();
}
// button(s)

View File

@ -525,15 +525,7 @@ img {
z-index: -1;
--bg: var(--c-f);
}
/*
#rwrap .sliderdisplay,
#gwrap .sliderdisplay,
#bwrap .sliderdisplay,
#wwrap .sliderdisplay,
#vwrap .sliderdisplay,
#kwrap .sliderdisplay,
#wbal .sliderdisplay,
*/
#Colors .sliderdisplay {
height: 28px;
top: 0; bottom: 0;
@ -580,15 +572,7 @@ input[type=range] {
background-color: transparent;
cursor: pointer;
}
/*
#rwrap input[type=range],
#gwrap input[type=range],
#bwrap input[type=range],
#wwrap input[type=range],
#vwrap input[type=range],
#kwrap input[type=range],
#wbal input[type=range],
*/
#Colors input[type=range] {
width: 252px;
margin: 0;
@ -625,30 +609,12 @@ input[type=range]::-moz-range-thumb {
background: var(--c-f);
transform: translateY(5px);
}
/*
#rwrap input[type=range]::-webkit-slider-thumb,
#gwrap input[type=range]::-webkit-slider-thumb,
#bwrap input[type=range]::-webkit-slider-thumb,
#wwrap input[type=range]::-webkit-slider-thumb,
#vwrap input[type=range]::-webkit-slider-thumb,
#kwrap input[type=range]::-webkit-slider-thumb,
#wbal input[type=range]::-webkit-slider-thumb,
*/
#Colors input[type=range]::-webkit-slider-thumb {
height: 18px;
width: 18px;
border: 2px solid #000;
margin-top: 5px;
}
/*
#rwrap input[type=range]::-moz-range-thumb,
#gwrap input[type=range]::-moz-range-thumb,
#bwrap input[type=range]::-moz-range-thumb,
#wwrap input[type=range]::-moz-range-thumb,
#vwrap input[type=range]::-moz-range-thumb,
#kwrap input[type=range]::-moz-range-thumb,
#wbal input[type=range]::-moz-range-thumb,
*/
#Colors input[type=range]::-moz-range-thumb {
border: 2px solid var(--c-1);
}
@ -661,15 +627,6 @@ input[type=range]::-moz-range-thumb {
width: 230px;
position: relative;
}
/*
#rwrap .sliderwrap,
#gwrap .sliderwrap,
#bwrap .sliderwrap,
#wwrap .sliderwrap,
#vwrap .sliderwrap,
#kwrap .sliderwrap,
#wbal .sliderwrap,
*/
#Colors .sliderwrap {
width: 260px;
margin: 10px 0 0;

View File

@ -49,22 +49,21 @@
<div id="Colors" class="tabcontent">
<div id="picker" class="noslide"></div>
<div id="vwrap">
<p class="labels hd">Value</p>
<!--p class="labels hd">Value</p-->
<div class="sliderwrap il">
<input id="sliderV" class="noslide" oninput="fromV()" onchange="setColor(0)" max="100" min="0" type="range" value="100" step="any" />
<div class="sliderdisplay"></div>
</div><br>
</div>
<div id="kwrap">
<p class="labels hd">White from K</p>
<!--p class="labels hd">Temperature</p-->
<div class="sliderwrap il">
<!--input id="sliderK" class="noslide" oninput="fromK()" onchange="setBalance(Math.trunc((parseInt(this.value)-2400)/32))" max="10060" min="1900" type="range" value="5964" /-->
<input id="sliderK" class="noslide" oninput="fromK()" onchange="setColor(0)" max="10091" min="1900" type="range" value="6550" />
<div class="sliderdisplay"></div>
</div>
</div>
<div id="rgbwrap">
<p class="labels">RGB color</p>
<p class="labels hd">RGB color</p>
<div id="rwrap" class="il">
<div class="sliderwrap il">
<input id="sliderR" class="noslide" oninput="fromRgb()" onchange="setColor(0)" max="255" min="0" type="range" value="128" />

View File

@ -1306,6 +1306,7 @@ function setSliderAndColorControl(idx/*, extra*/)
// set html color items on/off
var cslLabel = '';
var sep = '';
var hide = true;
for (let i=0; i<gId("csl").children.length; i++) {
var btn = gId("csl" + i);
// if no controlDefined or coOnOff has a value
@ -1322,13 +1323,23 @@ function setSliderAndColorControl(idx/*, extra*/)
else if (i==0) btn.innerHTML = "Fx";
else if (i==1) btn.innerHTML = "Bg";
else btn.innerHTML = "Cs";
hide = false;
} else if (!controlDefined /*|| paOnOff.length>0*/) { // if no controls then all buttons should be shown for color 1..3
btn.style.display = "inline";
btn.innerHTML = `${i+1}`;
hide = false;
} else {
btn.style.display = "none";
}
}
var ccfg = cfg.comp.colors;
gId("picker").style.display = hide && ccfg.picker ? "none" : "block";
gId("vwrap").style.display = hide && ccfg.picker ? "none" : "block";
gId("kwrap").style.display = hide && ccfg.picker && cct ? "none" : "block";
gId("wwrap").style.display = hide ? "none" : "block";
gId("wbal").style.display = hide && !cct ? "none" : "block";
gId("rgbwrap").style.display = hide && ccfg.rgb ? "none" : "block";
gId("qcs-w").style.display = hide && ccfg.quick ? "none" : "block";
gId("cslLabel").innerHTML = cslLabel;
// set palette on/off
@ -1982,14 +1993,16 @@ function delP(i) {
function selectSlot(b)
{
csel = b;
var cd = gId('csl').children;
for (let i = 0; i < cd.length; i++) cd[i].classList.remove('xxs-w');
cd[b].classList.add('xxs-w');
cpick.color.set(cd[b].style.backgroundColor);
setPicker(cd[b].style.backgroundColor);
gId('sliderW').value = whites[b];
updatePSliders();
}
//set the color from a hex string. Used by quick color selectors
var lasth = 0;
function pC(col)
{
@ -2001,7 +2014,7 @@ function pC(col)
} while (Math.abs(col.h - lasth) < 50);
lasth = col.h;
}
cpick.color.set(col);
setPicker(col);
setColor(0);
}
@ -2026,8 +2039,8 @@ function updatePSliders() {
var hsv = {"h":cpick.color.hue,"s":cpick.color.saturation,"v":100};
var c = iro.Color.hsvToRgb(hsv);
var cs = 'rgb('+c.r+','+c.g+','+c.b+')';
//v.parentNode.getElementsByClassName('sliderdisplay')[0].style.setProperty('--bg',cs);
v.nextElementSibling.style.backgroundImage = `linear-gradient(90deg, #000 0%, ${cs})`;
//v.parentNode.getElementsByClassName('sliderdisplay')[0].style.setProperty('--bg',cs);
//updateTrail(v);
//update Kelvin slider
@ -2044,14 +2057,20 @@ function fromHex()
var str = gId('hexc').value;
whites[csel] = parseInt(str.substring(6), 16);
try {
cpick.color.set("#" + str.substring(0,6));
setPicker("#" + str.substring(0,6));
} catch (e) {
cpick.color.set("#ffaa00");
setPicker("#ffaa00");
}
if (isNaN(whites[csel])) whites[csel] = 0;
setColor(2);
}
function setPicker(rgb) {
var c = new iro.Color(rgb);
if (c.value > 0) cpick.color.set(c);
else cpick.color.setChannel('hsv', 'v', 0);
}
function fromV()
{
cpick.color.setChannel('hsv', 'v', d.getElementById('sliderV').value);
@ -2067,14 +2086,14 @@ function fromRgb()
var r = gId('sliderR').value;
var g = gId('sliderG').value;
var b = gId('sliderB').value;
cpick.color.set(`rgb(${r},${g},${b})`);
setPicker(`rgb(${r},${g},${b})`);
}
//sr 0: from RGB sliders, 1: from picker, 2: from hex
function setColor(sr)
{
var cd = gId('csl').children; // color slots
if (sr == 1 && cd[csel].style.backgroundColor == 'rgb(0,0,0)') cpick.color.setChannel('hsv', 'v', 100);
if (sr == 1 && cd[csel].style.backgroundColor == "rgb(0, 0, 0)") cpick.color.setChannel('hsv', 'v', 100); // watch out for spaces!!!
cd[csel].style.backgroundColor = cpick.color.rgbString;
if (sr != 2) whites[csel] = parseInt(gId('sliderW').value);
var col = cpick.color.rgb;
@ -2231,11 +2250,13 @@ function formatArr(pl) {
function expand(i,a=false)
{
var seg = gId('seg' +i);
/*
if (!a) {
var j = i>100 ? 100 : 0;
var l = i>100 ? expanded.length : 100;
for (; j<l; j++) if (i!=j && expanded[j]) expand(j,true); // collapse all expanded elements
}
*/
expanded[i] = !expanded[i];
seg.style.display = (expanded[i]) ? "block":"none";
gId('sege' +i).style.transform = (expanded[i]) ? "rotate(180deg)":"rotate(0deg)";

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -87,7 +87,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
char cv[4] = "CV"; cv[2] = 48+s; cv[3] = 0; //strip reverse
char sl[4] = "SL"; sl[2] = 48+s; sl[3] = 0; //skip 1st LED
char rf[4] = "RF"; rf[2] = 48+s; rf[3] = 0; //refresh required
char aw[4] = "AW"; aw[2] = 48+s; aw[3] = 0; //auto white calculate mode
if (!request->hasArg(lp)) {
DEBUG_PRINTLN(F("No data.")); break;
}

View File

@ -281,6 +281,7 @@ void handleNotifications()
//apply effects from notification
if (version < 200 && (receiveNotificationEffects || !someSel))
{
if (currentPlaylist>=0) unloadPlaylist();
if (udpIn[8] < strip.getModeCount()) effectCurrent = udpIn[8];
effectSpeed = udpIn[9];
if (version > 2) effectIntensity = udpIn[16];

View File

@ -50,6 +50,7 @@ void parseNumber(const char* str, byte* val, byte minv, byte maxv)
bool getVal(JsonVariant elem, byte* val, byte vmin, byte vmax) {
if (elem.is<int>()) {
if (elem < 0) return false; //ignore e.g. {"ps":-1}
*val = elem;
return true;
} else if (elem.is<const char*>()) {

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2111301
#define VERSION 2112031
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG

View File

@ -348,7 +348,6 @@ void getSettingsJS(byte subPage, char* dest)
char cv[4] = "CV"; cv[2] = 48+s; cv[3] = 0; //strip reverse
char sl[4] = "SL"; sl[2] = 48+s; sl[3] = 0; //skip 1st LED
char rf[4] = "RF"; rf[2] = 48+s; rf[3] = 0; //off refresh
char aw[4] = "AW"; aw[2] = 48+s; aw[3] = 0; //auto white channel calculation
oappend(SET_F("addLEDs(1);"));
uint8_t pins[5];
uint8_t nPins = bus->getPins(pins);
@ -363,7 +362,6 @@ void getSettingsJS(byte subPage, char* dest)
sappend('c',cv,bus->reversed);
sappend('c',sl,bus->skippedLeds());
sappend('c',rf,bus->isOffRefreshRequired());
sappend('v',aw,bus->getAutoWhiteMode());
}
sappend('v',SET_F("MA"),strip.ablMilliampsMax);
sappend('v',SET_F("LA"),strip.milliampsPerLed);