forked from ewowi/StarBase
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming Leds to LedsLayer and listOfLeds to layers
Renamed Leds class to LedsLayer Renamed listOfLeds to layers Renamed LedLeds.h/cpp to LedLayers.h/cpp
- Loading branch information
1 parent
759e19d
commit e399dec
Showing
11 changed files
with
752 additions
and
262 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
@title StarLight | ||
@file LedLeds.cpp | ||
@file LedLayer.cpp | ||
@date 20240720 | ||
@repo https://github.com/MoonModules/StarLight | ||
@Authors https://github.com/MoonModules/StarLight/commits/main | ||
|
@@ -9,7 +9,7 @@ | |
@license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected] | ||
*/ | ||
|
||
#include "LedLeds.h" | ||
#include "LedLayer.h" | ||
#include "../Sys/SysModSystem.h" //for sys->now | ||
#ifdef STARBASE_USERMOD_MPU6050 | ||
#include "../User/UserModMPU6050.h" | ||
|
@@ -26,12 +26,12 @@ void fastled_fill_rainbow(struct CRGB * targetArray, int numToFill, unsigned8 in | |
fill_rainbow(targetArray, numToFill, initialhue, deltahue); | ||
} | ||
|
||
void Leds::triggerMapping() { | ||
void LedsLayer::triggerMapping() { | ||
doMap = true; //specify which leds to remap | ||
fixture->doMap = true; //fixture will also be remapped | ||
} | ||
|
||
unsigned16 Leds::XYZ(Coord3D pixel) { | ||
unsigned16 LedsLayer::XYZ(Coord3D pixel) { | ||
|
||
//as this is a call to a virtual function it reduces the theoretical (no show) speed by half, even if XYZ is not implemented | ||
// the real speed is hardly affected, but room for improvement! | ||
|
@@ -48,7 +48,7 @@ unsigned16 Leds::XYZ(Coord3D pixel) { | |
} | ||
|
||
// maps the virtual led to the physical led(s) and assign a color to it | ||
void Leds::setPixelColor(unsigned16 indexV, CRGB color) { | ||
void LedsLayer::setPixelColor(unsigned16 indexV, CRGB color) { | ||
if (indexV < mappingTable.size()) { | ||
switch (mappingTable[indexV].mapType) { | ||
case m_color:{ | ||
|
@@ -79,15 +79,15 @@ void Leds::setPixelColor(unsigned16 indexV, CRGB color) { | |
ppf(" dev sPC V:%d >= %d", indexV, NUM_LEDS_Max); | ||
} | ||
|
||
void Leds::setPixelColorPal(unsigned16 indexV, uint8_t palIndex, uint8_t palBri) { | ||
void LedsLayer::setPixelColorPal(unsigned16 indexV, uint8_t palIndex, uint8_t palBri) { | ||
setPixelColor(indexV, ColorFromPalette(palette, palIndex, palBri)); | ||
} | ||
|
||
void Leds::blendPixelColor(unsigned16 indexV, CRGB color, uint8_t blendAmount) { | ||
void LedsLayer::blendPixelColor(unsigned16 indexV, CRGB color, uint8_t blendAmount) { | ||
setPixelColor(indexV, blend(color, getPixelColor(indexV), blendAmount)); | ||
} | ||
|
||
CRGB Leds::getPixelColor(unsigned16 indexV) { | ||
CRGB LedsLayer::getPixelColor(unsigned16 indexV) { | ||
if (indexV < mappingTable.size()) { | ||
switch (mappingTable[indexV].mapType) { | ||
case m_onePixel: | ||
|
@@ -111,8 +111,8 @@ CRGB Leds::getPixelColor(unsigned16 indexV) { | |
} | ||
} | ||
|
||
void Leds::fadeToBlackBy(unsigned8 fadeBy) { | ||
if (projectionNr == p_None || projectionNr == p_Random || (fixture->listOfLeds.size() == 1)) { | ||
void LedsLayer::fadeToBlackBy(unsigned8 fadeBy) { | ||
if (projectionNr == p_None || projectionNr == p_Random || (fixture->layers.size() == 1)) { | ||
fastled_fadeToBlackBy(fixture->ledsP, fixture->nrOfLeds, fadeBy); | ||
} else { | ||
for (uint16_t index = 0; index < mappingTable.size(); index++) { | ||
|
@@ -123,17 +123,17 @@ void Leds::fadeToBlackBy(unsigned8 fadeBy) { | |
} | ||
} | ||
|
||
void Leds::fill_solid(const struct CRGB& color) { | ||
if (projectionNr == p_None || projectionNr == p_Random || (fixture->listOfLeds.size() == 1)) { | ||
void LedsLayer::fill_solid(const struct CRGB& color) { | ||
if (projectionNr == p_None || projectionNr == p_Random || (fixture->layers.size() == 1)) { | ||
fastled_fill_solid(fixture->ledsP, fixture->nrOfLeds, color); | ||
} else { | ||
for (uint16_t index = 0; index < mappingTable.size(); index++) | ||
setPixelColor(index, color); | ||
} | ||
} | ||
|
||
void Leds::fill_rainbow(unsigned8 initialhue, unsigned8 deltahue) { | ||
if (projectionNr == p_None || projectionNr == p_Random || (fixture->listOfLeds.size() == 1)) { | ||
void LedsLayer::fill_rainbow(unsigned8 initialhue, unsigned8 deltahue) { | ||
if (projectionNr == p_None || projectionNr == p_Random || (fixture->layers.size() == 1)) { | ||
fastled_fill_rainbow(fixture->ledsP, fixture->nrOfLeds, initialhue, deltahue); | ||
} else { | ||
CHSV hsv; | ||
|
@@ -148,7 +148,7 @@ void Leds::fill_rainbow(unsigned8 initialhue, unsigned8 deltahue) { | |
} | ||
} | ||
|
||
void PhysMap::addIndexP(Leds &leds, uint16_t indexP) { | ||
void PhysMap::addIndexP(LedsLayer &leds, uint16_t indexP) { | ||
// ppf("addIndexP i:%d t:%d", indexP, mapType); | ||
switch (mapType) { | ||
case m_color: | ||
|
Oops, something went wrong.