kopia lustrzana https://github.com/Aircoookie/WLED
Added `mi` property to APIs
rodzic
b50e798d55
commit
c1cab30daf
|
@ -2,6 +2,13 @@
|
|||
|
||||
### Development versions after 0.10.0 release
|
||||
|
||||
#### Build 2008070
|
||||
|
||||
- Added segment mirroring (`mi` property) (#1017)
|
||||
- Fixed DMX settings page not displayed (#1070)
|
||||
- Fixed ArtNet multi universe and improve code style (#1076)
|
||||
- Renamed global var `local` to `localTime` (#1078)
|
||||
|
||||
#### Build 2007190
|
||||
|
||||
- Fixed hostname containing illegal characters (#1035)
|
||||
|
|
|
@ -267,10 +267,9 @@ class WS2812FX {
|
|||
uint16_t virtualLength()
|
||||
{
|
||||
uint16_t groupLen = groupLength();
|
||||
uint16_t vLength;
|
||||
vLength = (length() + groupLen - 1) / groupLen;
|
||||
uint16_t vLength = (length() + groupLen - 1) / groupLen;
|
||||
if (options & MIRROR)
|
||||
vLength /= 2; // divide by 2 if mirror; leaves a blank LED in the middle if length is odd
|
||||
vLength = (vLength + 1) /2; // divide by 2 if mirror, leave at least a signle LED
|
||||
return vLength;
|
||||
}
|
||||
} segment;
|
||||
|
|
|
@ -180,9 +180,11 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w)
|
|||
#ifdef WLED_CUSTOM_LED_MAPPING
|
||||
if (indexSet < customMappingSize) indexSet = customMappingTable[indexSet];
|
||||
#endif
|
||||
if (indexSetRev >= SEGMENT.start && indexSetRev < SEGMENT.stop) bus->SetPixelColor(indexSet + skip, col);
|
||||
if (IS_MIRROR) //set the corresponding mirrored pixel
|
||||
bus->SetPixelColor(SEGMENT.stop - (indexSet + skip) + SEGMENT.start - 1, col);
|
||||
if (indexSetRev >= SEGMENT.start && indexSetRev < SEGMENT.stop) {
|
||||
bus->SetPixelColor(indexSet + skip, col);
|
||||
if (IS_MIRROR) //set the corresponding mirrored pixel
|
||||
bus->SetPixelColor(SEGMENT.stop - (indexSet + skip) + SEGMENT.start - 1, col);
|
||||
}
|
||||
}
|
||||
} else { //live data, etc.
|
||||
if (reverseMode) i = _length - 1 - i;
|
||||
|
|
|
@ -59,6 +59,7 @@ void deserializeSegment(JsonObject elem, byte it)
|
|||
//if (pal != seg.palette && pal < strip.getPaletteCount()) strip.setPalette(pal);
|
||||
seg.setOption(SEG_OPTION_SELECTED, elem["sel"] | seg.getOption(SEG_OPTION_SELECTED));
|
||||
seg.setOption(SEG_OPTION_REVERSED, elem["rev"] | seg.getOption(SEG_OPTION_REVERSED));
|
||||
seg.setOption(SEG_OPTION_MIRROR , elem["mi"] | seg.getOption(SEG_OPTION_MIRROR ));
|
||||
|
||||
//temporary, strip object gets updated via colorUpdated()
|
||||
if (id == strip.getMainSegmentId()) {
|
||||
|
@ -215,12 +216,13 @@ void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id)
|
|||
}
|
||||
}
|
||||
|
||||
root["fx"] = seg.mode;
|
||||
root["sx"] = seg.speed;
|
||||
root["ix"] = seg.intensity;
|
||||
root["fx"] = seg.mode;
|
||||
root["sx"] = seg.speed;
|
||||
root["ix"] = seg.intensity;
|
||||
root["pal"] = seg.palette;
|
||||
root["sel"] = seg.isSelected();
|
||||
root["rev"] = seg.getOption(SEG_OPTION_REVERSED);
|
||||
root["mi"] = seg.getOption(SEG_OPTION_MIRROR);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -647,6 +647,10 @@ bool handleSet(AsyncWebServerRequest *request, const String& req)
|
|||
pos = req.indexOf("RV=");
|
||||
if (pos > 0) strip.getSegment(main).setOption(SEG_OPTION_REVERSED, req.charAt(pos+3) != '0');
|
||||
|
||||
//Segment reverse
|
||||
pos = req.indexOf("MI=");
|
||||
if (pos > 0) strip.getSegment(main).setOption(SEG_OPTION_MIRROR, req.charAt(pos+3) != '0');
|
||||
|
||||
//Segment brightness/opacity
|
||||
pos = req.indexOf("SB=");
|
||||
if (pos > 0) {
|
||||
|
|
Ładowanie…
Reference in New Issue