Skip to content

Commit e48dd7c

Browse files
committed
rolling 20211106
1 parent 020e93b commit e48dd7c

File tree

15 files changed

+56
-818
lines changed

15 files changed

+56
-818
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ In other cases you can contact the developer via email: <img src="https://raw.gi
4949

5050

5151

52+
##### Rolling (2021-11-06)
53+
54+
* External LEDs: change control mode (problem with more than 2 LEDs)
55+
56+
* Additional info into log file
57+
58+
* Bug fix: wrong number of sub digits in case analog and decimal shift
59+
60+
* Bug fix: html code
61+
62+
63+
5264
##### 9.0.0 - External Illumination (2021-10-23)
5365

5466
* Implementation of external illumination to adjust positioning, brightness and color of the illumination now individually

code/components/jomjol_controlGPIO/server_GPIO.cpp

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -405,19 +405,14 @@ bool GpioHandler::readConfig()
405405
// xDelay = 5000 / portTICK_PERIOD_MS;
406406
// printf("main: sleep for : %ldms\n", (long) xDelay);
407407

408-
SmartLed leds( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
408+
// SmartLed leds( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
409409

410410

411-
leds[ 0 ] = Rgb{ 255, 0, 0 };
412-
leds[ 1 ] = Rgb{ 255, 255, 255 };
413-
leds.show();
414-
/*
415-
// _SmartLED = new SmartLed(LEDType, LEDNumbers, gpioExtLED, 0, DoubleBuffer);
416-
_SmartLED = new SmartLed( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
417-
(*_SmartLED)[ 0 ] = Rgb{ 255, 0, 0 };
418-
(*_SmartLED)[ 1 ] = LEDColor;
419-
_SmartLED->show();
420-
*/
411+
// leds[ 0 ] = Rgb{ 255, 0, 0 };
412+
// leds[ 1 ] = Rgb{ 255, 255, 255 };
413+
// leds.show();
414+
// SmartLed leds = new SmartLed(LEDType, LEDNumbers, gpioExtLED, 0, DoubleBuffer);
415+
// _SmartLED = new SmartLed( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
421416
}
422417

423418
return true;
@@ -565,18 +560,41 @@ void GpioHandler::flashLightEnable(bool value)
565560
{
566561
if (it->second->getMode() == GPIO_PIN_MODE_EXTERNAL_FLASH_WS281X)
567562
{
563+
#ifdef __LEDGLOBAL
564+
if (leds_global == NULL) {
565+
ESP_LOGI(TAG_SERVERGPIO, "init SmartLed: LEDNumber=%d, GPIO=%d", LEDNumbers, (int)it->second->getGPIO());
566+
leds_global = new SmartLed( LEDType, LEDNumbers, it->second->getGPIO(), 0, DoubleBuffer );
567+
} else {
568+
// wait until we can update: https://github.com/RoboticsBrno/SmartLeds/issues/10#issuecomment-386921623
569+
leds_global->wait();
570+
}
571+
#else
568572
SmartLed leds( LEDType, LEDNumbers, it->second->getGPIO(), 0, DoubleBuffer );
573+
#endif
574+
569575
if (value)
570576
{
571577
for (int i = 0; i < LEDNumbers; ++i)
578+
#ifdef __LEDGLOBAL
579+
(*leds_global)[i] = LEDColor;
580+
#else
572581
leds[i] = LEDColor;
582+
#endif
573583
}
574584
else
575585
{
576586
for (int i = 0; i < LEDNumbers; ++i)
587+
#ifdef __LEDGLOBAL
588+
(*leds_global)[i] = Rgb{0, 0, 0};
589+
#else
577590
leds[i] = Rgb{0, 0, 0};
591+
#endif
578592
}
579-
leds.show();
593+
#ifdef __LEDGLOBAL
594+
leds_global->show();
595+
#else
596+
leds.show();
597+
#endif
580598
}
581599
}
582600
}

code/components/jomjol_controlGPIO/server_GPIO.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
//#include "ClassControllCamera.h"
1313

14+
#define __LEDGLOBAL
15+
1416
typedef enum {
1517
GPIO_PIN_MODE_DISABLED = 0x0,
1618
GPIO_PIN_MODE_INPUT = 0x1,
@@ -86,7 +88,9 @@ class GpioHandler {
8688
int LEDNumbers = 2;
8789
Rgb LEDColor = Rgb{ 255, 255, 255 };
8890
LedType LEDType = LED_WS2812;
89-
91+
#ifdef __LEDGLOBAL
92+
SmartLed *leds_global = NULL;
93+
#endif
9094

9195
bool readConfig();
9296
void clear();

code/components/jomjol_flowcontroll/ClassFlowPostProcessing.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,8 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
568568
time_t imagetime = 0;
569569
string rohwert;
570570

571-
// ErrorMessageText = "";
572-
573571
// Update Nachkomma, da sich beim Wechsel von CNNType Auto --> xyz auch die Nachkommastellen ändern können:
574572

575-
576-
577573
imagetime = flowMakeImage->getTimeImageTaken();
578574
if (imagetime == 0)
579575
time(&imagetime);
@@ -688,6 +684,8 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
688684
UpdatePreValueINI = true;
689685
}
690686
}
687+
string _zw = "PostProcessing - Raw: " + NUMBERS[j]->ReturnRawValue + " Value: " + NUMBERS[j]->ReturnValue + " Error: " + NUMBERS[j]->ErrorMessageText;
688+
LogFile.WriteToFile(_zw);
691689
}
692690

693691
SavePreValue();
@@ -724,8 +722,8 @@ void ClassFlowPostProcessing::UpdateNachkommaDecimalShift()
724722
{
725723
// printf("Nur digital + analog\n");
726724

727-
NUMBERS[j]->Nachkomma = NUMBERS[j]->analog_roi->ROI.size();
728725
NUMBERS[j]->DecimalShift = NUMBERS[j]->DecimalShiftInitial;
726+
NUMBERS[j]->Nachkomma = NUMBERS[j]->analog_roi->ROI.size() - NUMBERS[j]->DecimalShift;
729727

730728
if (NUMBERS[j]->isExtendedResolution && flowAnalog->isExtendedResolution()) // extended resolution ist an und soll auch bei dieser Ziffer verwendet werden
731729
NUMBERS[j]->Nachkomma = NUMBERS[j]->Nachkomma+1;

code/main/Color.cpp

Lines changed: 0 additions & 132 deletions
This file was deleted.

code/main/Color.h

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)