Skip to content

Commit

Permalink
Bugfix add indexP to mappingTable
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed Jul 26, 2024
1 parent 85f3e97 commit 9bd1210
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
20 changes: 14 additions & 6 deletions src/App/LedFixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ void Fixture::projectAndMap() {

uint16_t nrOfLogical = 0;
uint16_t nrOfPhysical = 0;
uint16_t nrOfPhysicalM = 0;
uint16_t nrOfColor = 0;
uint16_t nrOfColorPal = 0;

if (leds->projectionNr == p_Random || leds->projectionNr == p_None) {

Expand All @@ -222,29 +225,34 @@ void Fixture::projectAndMap() {

//debug info + summary values
for (PhysMap &map:leds->mappingTable) {
// ppf("i: %d t:%d\n", nrOfLogical, map.mapType);
switch (map.mapType) {
case m_color:
nrOfColor++;
break;
case m_onePixel:
// ppf("ledV %d mapping: #ledsP : %d\n", nrOfLogical, map.indexP);
// ppf("ledV %d mapping =1: #ledsP : %d\n", nrOfLogical, map.indexP);
nrOfPhysical++;
break;
case m_morePixels:
// ppf("ledV %d mapping: #ledsP :", nrOfLogical);
// ppf("ledV %d mapping >1: #ledsP :", nrOfLogical);

for (uint16_t indexP: leds->mappingTableIndexes[map.indexes]) {
// ppf(" %d", indexP);
nrOfPhysical++;
ppf(" %d", indexP);
nrOfPhysicalM++;
}
// ppf("\n");
break;
case m_colorPal:
nrOfColorPal++;
break;
}
nrOfLogical++;
// else
// ppf("ledV %d no mapping\n", x);
}
}

ppf("projectAndMap leds[%d] V:%d x %d x %d -> %d (v:%d - p:%d)\n", rowNr, leds->size.x, leds->size.y, leds->size.z, leds->nrOfLeds, nrOfLogical, nrOfPhysical);
ppf("projectAndMap leds[%d] V:%d x %d x %d -> %d (v:%d - p:%d pm:%d c:%d cp:%d)\n", rowNr, leds->size.x, leds->size.y, leds->size.z, leds->nrOfLeds, nrOfLogical, nrOfPhysical, nrOfPhysicalM, nrOfColor, nrOfColorPal);

// mdl->setValueV("ledsSize", rowNr, "%d x %d x %d = %d", leds->size.x, leds->size.y, leds->size.z, leds->nrOfLeds);
char buf[32];
Expand Down
4 changes: 2 additions & 2 deletions src/App/LedLeds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ void PhysMap::addIndexP(Leds &leds, uint16_t indexP) {
switch (mapType) {
case m_color:
// case m_rgbColor:
indexP = indexP;
this->indexP = indexP;
mapType = m_onePixel;
break;
case m_onePixel: {
uint16_t oldIndexP = indexP;
uint16_t oldIndexP = this->indexP;
std::vector<uint16_t> newVector;
newVector.push_back(oldIndexP);
newVector.push_back(indexP);
Expand Down
4 changes: 2 additions & 2 deletions src/App/LedLeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ struct PhysMap {
mapType = m_color; // the default until indexP is added
}

void addIndexP(Leds &leds, uint16_t indexP); // addIndexP: temp method until all effects have been converted to Palette / 2 byte mapping mode
void addIndexP(Leds &leds, uint16_t indexP);

}; // 4 bytes
}; // 2 bytes

class Projection; //forward for cached virtual class methods!

Expand Down

0 comments on commit 9bd1210

Please sign in to comment.