Set pixel limit by bus type
This commit is contained in:
@@ -127,6 +127,7 @@ class Bus {
|
|||||||
inline bool isOk() { return _valid; }
|
inline bool isOk() { return _valid; }
|
||||||
inline bool isOffRefreshRequired() { return _needsRefresh; }
|
inline bool isOffRefreshRequired() { return _needsRefresh; }
|
||||||
bool containsPixel(uint16_t pix) { return pix >= _start && pix < _start+_len; }
|
bool containsPixel(uint16_t pix) { return pix >= _start && pix < _start+_len; }
|
||||||
|
virtual uint16_t getMaxPixels() { return MAX_LEDS_PER_BUS; };
|
||||||
|
|
||||||
virtual bool hasRGB() {
|
virtual bool hasRGB() {
|
||||||
if ((_type >= TYPE_WS2812_1CH && _type <= TYPE_WS2812_WWA) || _type == TYPE_ANALOG_1CH || _type == TYPE_ANALOG_2CH || _type == TYPE_ONOFF) return false;
|
if ((_type >= TYPE_WS2812_1CH && _type <= TYPE_WS2812_WWA) || _type == TYPE_ANALOG_1CH || _type == TYPE_ANALOG_2CH || _type == TYPE_ONOFF) return false;
|
||||||
@@ -296,6 +297,7 @@ class BusNetwork : public Bus {
|
|||||||
public:
|
public:
|
||||||
BusNetwork(BusConfig &bc);
|
BusNetwork(BusConfig &bc);
|
||||||
|
|
||||||
|
uint16_t getMaxPixels() override { return 4096; };
|
||||||
bool hasRGB() { return true; }
|
bool hasRGB() { return true; }
|
||||||
bool hasWhite() { return _rgbw; }
|
bool hasWhite() { return _rgbw; }
|
||||||
|
|
||||||
|
|||||||
@@ -60,10 +60,14 @@
|
|||||||
x.style.animation = 'none';
|
x.style.animation = 'none';
|
||||||
timeout = setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2900);
|
timeout = setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2900);
|
||||||
}
|
}
|
||||||
function bLimits(b,v,p,m,l) {
|
function bLimits(b,v,m,l) {
|
||||||
maxB = b; maxV = v; maxM = m; maxPB = p; maxL = l;
|
maxB = b; maxV = v; maxM = m; maxL = l;
|
||||||
}
|
}
|
||||||
function pinsOK() {
|
function setPixelLimit(i, max) {
|
||||||
|
var lc = d.getElementsByName("LC"+i)[0];
|
||||||
|
lc.max = max;
|
||||||
|
}
|
||||||
|
function pinsOK() {
|
||||||
var LCs = d.getElementsByTagName("input");
|
var LCs = d.getElementsByTagName("input");
|
||||||
for (i=0; i<LCs.length; i++) {
|
for (i=0; i<LCs.length; i++) {
|
||||||
var nm = LCs[i].name.substring(0,2);
|
var nm = LCs[i].name.substring(0,2);
|
||||||
|
|||||||
@@ -411,7 +411,6 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W
|
|||||||
oappend(SET_F("bLimits("));
|
oappend(SET_F("bLimits("));
|
||||||
oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(",");
|
oappend(itoa(WLED_MAX_BUSSES,nS,10)); oappend(",");
|
||||||
oappend(itoa(WLED_MIN_VIRTUAL_BUSSES,nS,10)); oappend(",");
|
oappend(itoa(WLED_MIN_VIRTUAL_BUSSES,nS,10)); oappend(",");
|
||||||
oappend(itoa(MAX_LEDS_PER_BUS,nS,10)); oappend(",");
|
|
||||||
oappend(itoa(MAX_LED_MEMORY,nS,10)); oappend(",");
|
oappend(itoa(MAX_LED_MEMORY,nS,10)); oappend(",");
|
||||||
oappend(itoa(MAX_LEDS,nS,10));
|
oappend(itoa(MAX_LEDS,nS,10));
|
||||||
oappend(SET_F(");"));
|
oappend(SET_F(");"));
|
||||||
@@ -475,6 +474,11 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sappend('v',sp,speed);
|
sappend('v',sp,speed);
|
||||||
|
|
||||||
|
oappend(SET_F("setPixelLimit("));
|
||||||
|
oappendi(s); oappend(SET_F(","));
|
||||||
|
oappendi(bus->getMaxPixels()); oappend(SET_F(");"));
|
||||||
|
|
||||||
}
|
}
|
||||||
sappend('v',SET_F("MA"),strip.ablMilliampsMax);
|
sappend('v',SET_F("MA"),strip.ablMilliampsMax);
|
||||||
sappend('v',SET_F("LA"),strip.milliampsPerLed);
|
sappend('v',SET_F("LA"),strip.milliampsPerLed);
|
||||||
|
|||||||
Reference in New Issue
Block a user