Using freeze instead of power for segment.
Fix for missing udp.cpp
This commit is contained in:
parent
6079effae3
commit
b583def913
@ -131,7 +131,7 @@ void WS2812FX::service() {
|
||||
|
||||
for(uint8_t i=0; i < MAX_NUM_SEGMENTS; i++)
|
||||
{
|
||||
if (realtimeMode && useMainSegmentOnly && i == getMainSegmentId()) continue;
|
||||
//if (realtimeMode && useMainSegmentOnly && i == getMainSegmentId()) continue;
|
||||
|
||||
_segment_index = i;
|
||||
|
||||
|
@ -864,6 +864,18 @@ input[type=number]::-webkit-outer-spin-button {
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
.frz {
|
||||
left: 36px;
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
cursor: pointer;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.expanded .frz {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.check, .radio {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
|
@ -566,6 +566,7 @@ function populateInfo(i)
|
||||
function populateSegments(s)
|
||||
{
|
||||
var cn = "";
|
||||
let li = lastinfo;
|
||||
segCount = 0; lowestUnused = 0; lSeg = 0;
|
||||
|
||||
for (var y = 0; y < (s.seg||[]).length; y++)
|
||||
@ -584,6 +585,7 @@ function populateSegments(s)
|
||||
<input type="checkbox" id="seg${i}sel" onchange="selSeg(${i})" ${inst.sel ? "checked":""}>
|
||||
<span class="checkmark schk"></span>
|
||||
</label>
|
||||
<i class="icons e-icon frz" id="seg${i}frz" onclick="event.preventDefault();tglFreeze(${i});">&#x${inst.frz ? (li.live && li.liveseg==i?'e410':'e0e8') : 'e325'};</i>
|
||||
<div class="segname">
|
||||
<div class="segntxt" onclick="selSegEx(${i})">${inst.n ? inst.n : "Segment "+i}</div>
|
||||
<i class="icons edit-icon ${expanded[i] ? "expanded":""}" id="seg${i}nedit" onclick="tglSegn(${i})"></i>
|
||||
@ -964,7 +966,7 @@ function updateUI()
|
||||
|
||||
function displayRover(i,s)
|
||||
{
|
||||
d.getElementById('rover').style.transform = (i.live && s.lor == 0) ? "translateY(0px)":"translateY(100%)";
|
||||
d.getElementById('rover').style.transform = (i.live && s.lor == 0 && i.liveseg<0) ? "translateY(0px)":"translateY(100%)";
|
||||
var sour = i.lip ? i.lip:""; if (sour.length > 2) sour = " from " + sour;
|
||||
d.getElementById('lv').innerHTML = `WLED is receiving live ${i.lm} data${sour}`;
|
||||
d.getElementById('roverstar').style.display = (i.live && s.lor) ? "block":"none";
|
||||
@ -1643,7 +1645,7 @@ function setSegBri(s){
|
||||
function tglFreeze(s=null)
|
||||
{
|
||||
var obj = {"seg": {"frz": "t"}}; // toggle
|
||||
if (s!==null) obj.id = s;
|
||||
if (s!==null) obj.seg.id = s;
|
||||
requestJson(obj);
|
||||
}
|
||||
|
||||
@ -1696,8 +1698,6 @@ function setIntensity() {
|
||||
|
||||
function setLor(i) {
|
||||
var obj = {"lor": i};
|
||||
// allow canceling live mode (if sender crashes)
|
||||
if (i===0 && lastinfo.live && ["","Hyperion","UDP"].includes(lastinfo.lm)) { obj.live = false; obj.v = true; }
|
||||
requestJson(obj);
|
||||
}
|
||||
|
||||
|
3614
wled00/html_ui.h
3614
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
@ -228,8 +228,8 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
||||
}
|
||||
strip.setPixelSegment(oldSegId);
|
||||
strip.trigger();
|
||||
} else if (!elem["frz"] && iarr.isNull()) { //return to regular effect
|
||||
seg.setOption(SEG_OPTION_FREEZE, false);
|
||||
// } else if (!elem["frz"] && iarr.isNull()) { //return to regular effect
|
||||
// seg.setOption(SEG_OPTION_FREEZE, false);
|
||||
}
|
||||
// send UDP if not in preset and something changed that is not just selection
|
||||
//if (!presetId && (seg.differs(prev) & 0x7F)) stateChanged = true;
|
||||
@ -464,7 +464,7 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
|
||||
udpn["send"] = notifyDirect;
|
||||
udpn["recv"] = receiveNotifications;
|
||||
|
||||
root[F("lor")] = realtimeOverride || (realtimeMode && useMainSegmentOnly);
|
||||
root[F("lor")] = realtimeOverride;
|
||||
}
|
||||
|
||||
root[F("mainseg")] = strip.getMainSegmentId();
|
||||
@ -537,7 +537,8 @@ void serializeInfo(JsonObject root)
|
||||
root[F("name")] = serverDescription;
|
||||
root[F("udpport")] = udpPort;
|
||||
root["live"] = (bool)realtimeMode;
|
||||
root[F("mso")] = useMainSegmentOnly; // using main segment only for live
|
||||
root[F("liveseg")] = useMainSegmentOnly ? strip.getMainSegmentId() : -1; // if using main segment only for live
|
||||
//root[F("mso")] = useMainSegmentOnly; // using main segment only for live
|
||||
|
||||
switch (realtimeMode) {
|
||||
case REALTIME_MODE_INACTIVE: root["lm"] = ""; break;
|
||||
|
@ -140,17 +140,31 @@ void notify(byte callMode, bool followUp)
|
||||
|
||||
void realtimeLock(uint32_t timeoutMs, byte md)
|
||||
{
|
||||
if (!realtimeMode && !realtimeOverride){
|
||||
uint16_t totalLen = strip.getLengthTotal();
|
||||
for (uint16_t i = 0; i < totalLen; i++)
|
||||
{
|
||||
strip.setPixelColor(i,0,0,0,0);
|
||||
if (!realtimeMode) {
|
||||
uint16_t stop, start;
|
||||
if (useMainSegmentOnly) {
|
||||
WS2812FX::Segment& mainseg = strip.getMainSegment();
|
||||
start = mainseg.start;
|
||||
stop = mainseg.stop;
|
||||
mainseg.setOption(SEG_OPTION_FREEZE, true, strip.getMainSegmentId());
|
||||
} else {
|
||||
start = 0;
|
||||
stop = strip.getLengthTotal();
|
||||
}
|
||||
// clear strip/segment
|
||||
if (useMainSegmentOnly || !realtimeOverride) for (uint16_t i = start; i < stop; i++) strip.setPixelColor(i,0,0,0,0);
|
||||
// if WLED was off and using main segment only, turn non-main segments off
|
||||
if (useMainSegmentOnly && bri == 0) {
|
||||
for (uint8_t s=0; s < strip.getMaxSegments(); s++) {
|
||||
if (s != strip.getMainSegmentId()) strip.getSegment(s).setOption(SEG_OPTION_ON, false, s);
|
||||
else strip.getSegment(s).setOption(SEG_OPTION_ON, true, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (realtimeTimeout != UINT32_MAX) {
|
||||
realtimeTimeout = millis() + timeoutMs;
|
||||
if (timeoutMs == 255001 || timeoutMs == 65000) realtimeTimeout = UINT32_MAX;
|
||||
else realtimeTimeout = millis() + timeoutMs;
|
||||
}
|
||||
// if strip is off (bri==0) and not already in RTM
|
||||
if (briT == 0 && !realtimeMode) {
|
||||
|
Loading…
Reference in New Issue
Block a user