Merge branch 'json-mapping' into mdev
This commit is contained in:
@@ -89,6 +89,7 @@ Segment::Segment(const Segment &orig) {
|
||||
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
|
||||
if (orig._t) { _t = new Transition(orig._t->_dur, orig._t->_briT, orig._t->_cctT, orig._t->_colorT); }
|
||||
if (orig.leds && !Segment::_globalLeds) { leds = (CRGB*)malloc(sizeof(CRGB)*length()); if (leds) memcpy(leds, orig.leds, sizeof(CRGB)*length()); }
|
||||
jMap = nullptr; //WLEDSR jMap
|
||||
}
|
||||
|
||||
// move constructor
|
||||
@@ -100,6 +101,7 @@ Segment::Segment(Segment &&orig) noexcept {
|
||||
orig._dataLen = 0;
|
||||
orig._t = nullptr;
|
||||
orig.leds = nullptr;
|
||||
orig.jMap = nullptr; //WLEDSR jMap
|
||||
}
|
||||
|
||||
// copy assignment
|
||||
@@ -124,6 +126,7 @@ Segment& Segment::operator= (const Segment &orig) {
|
||||
if (orig.data) { if (allocateData(orig._dataLen)) memcpy(data, orig.data, orig._dataLen); }
|
||||
if (orig._t) { _t = new Transition(orig._t->_dur, orig._t->_briT, orig._t->_cctT, orig._t->_colorT); }
|
||||
if (orig.leds && !Segment::_globalLeds) { leds = (CRGB*)malloc(sizeof(CRGB)*length()); if (leds) memcpy(leds, orig.leds, sizeof(CRGB)*length()); }
|
||||
jMap = nullptr; //WLEDSR jMap
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -142,6 +145,7 @@ Segment& Segment::operator= (Segment &&orig) noexcept {
|
||||
orig._dataLen = 0;
|
||||
orig._t = nullptr;
|
||||
orig.leds = nullptr;
|
||||
orig.jMap = nullptr; //WLEDSR jMap
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -474,7 +478,7 @@ class JMapC {
|
||||
return 0;
|
||||
}
|
||||
private:
|
||||
DynamicJsonDocument *jMapDoc = nullptr;
|
||||
PSRAMDynamicJsonDocument *jMapDoc = nullptr;
|
||||
uint8_t scale;
|
||||
void updatejMapDoc() {
|
||||
if (jMapDoc && SEGMENT.name == nullptr) {
|
||||
@@ -484,7 +488,7 @@ class JMapC {
|
||||
|
||||
if (!jMapDoc && SEGMENT.name != nullptr && SEGMENT.map1D2D == M12_jMap) {
|
||||
Serial.println("Create jMapDoc");
|
||||
jMapDoc = new DynamicJsonDocument(5*4096);
|
||||
jMapDoc = new PSRAMDynamicJsonDocument(5*4096);
|
||||
}
|
||||
|
||||
if (jMapDoc && SEGMENT.name != nullptr && strcmp(SEGMENT.name, previousSegmentName) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user