Allow different 1st segment.
This commit is contained in:
parent
ac0a853030
commit
49f79a331c
@ -696,7 +696,7 @@ function populateSegments(s)
|
||||
{
|
||||
segCount++;
|
||||
|
||||
var inst=s.seg[y];
|
||||
var inst = s.seg[y];
|
||||
let i = parseInt(inst.id);
|
||||
powered[i] = inst.on;
|
||||
if (i == lowestUnused) lowestUnused = i+1;
|
||||
@ -755,7 +755,7 @@ function populateSegments(s)
|
||||
<input type="checkbox" id="seg${i}mi" onchange="setMi(${i})" ${inst.mi ? "checked":""}>
|
||||
<span class="checkmark schk"></span>
|
||||
</label>
|
||||
${i===0 ? '<button id="btnrpt" class="btn btn-xs del" title="Repeat until end" onclick="rptSeg(0)"><i class="icons btn-icon"></i></button>' : ''}
|
||||
<div id="btn${i}rpt"></div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
@ -768,8 +768,9 @@ function populateSegments(s)
|
||||
resetUtil();
|
||||
noNewSegs = false;
|
||||
}
|
||||
if (lSeg>0 || parseInt(gId("seg0e").value)>=(ledCount-(cfg.comp.seglen?inst.start:0))) gId("btnrpt").style.display = "none";
|
||||
console.log(lSeg);
|
||||
if (!noNewSegs && (cfg.comp.seglen?parseInt(gId(`seg${lSeg}s`).value):0)+parseInt(gId(`seg${lSeg}e`).value)<ledCount) {
|
||||
gId(`btn${lSeg}rpt`).innerHTML = `<button class="btn btn-xs del" style="right:56px;" title="Repeat until end" onclick="rptSeg(${lSeg})"><i class="icons btn-icon"></i></button>`;
|
||||
}
|
||||
for (var i = 0; i <= lSeg; i++) {
|
||||
updateLen(i);
|
||||
updateTrail(gId(`seg${i}bri`));
|
||||
@ -1763,7 +1764,7 @@ function rptSeg(s)
|
||||
obj.seg.of = ofs;
|
||||
}
|
||||
obj.seg.rpt = true;
|
||||
expand(0);
|
||||
expand(s);
|
||||
requestJson(obj);
|
||||
}
|
||||
|
||||
|
1748
wled00/html_ui.h
1748
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
@ -22,13 +22,14 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
||||
stop = (len > 0) ? start + len : seg.stop;
|
||||
}
|
||||
|
||||
// multiply segment 0 (?) if requested untill all LEDs are used
|
||||
bool repeat = elem["rpt"] | false;
|
||||
if (repeat && stop>0) {
|
||||
elem.remove("id"); // remove for recursive call
|
||||
elem.remove("rpt"); // remove for recursive call
|
||||
elem.remove("n"); // remove for recursive call
|
||||
uint16_t len = stop - start;
|
||||
for (byte i=1; i<strip.getMaxSegments(); i++) {
|
||||
for (byte i=id+1; i<strip.getMaxSegments(); i++) {
|
||||
start = start + len;
|
||||
if (start >= strip.getLengthTotal()) break;
|
||||
elem["start"] = start;
|
||||
|
Loading…
Reference in New Issue
Block a user