rolling 20211106

This commit is contained in:
jomjol
2021-11-06 22:46:16 +01:00
parent 020e93bca2
commit e48dd7c4c4
15 changed files with 56 additions and 818 deletions

View File

@@ -405,19 +405,14 @@ bool GpioHandler::readConfig()
// xDelay = 5000 / portTICK_PERIOD_MS;
// printf("main: sleep for : %ldms\n", (long) xDelay);
SmartLed leds( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
// SmartLed leds( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
leds[ 0 ] = Rgb{ 255, 0, 0 };
leds[ 1 ] = Rgb{ 255, 255, 255 };
leds.show();
/*
// _SmartLED = new SmartLed(LEDType, LEDNumbers, gpioExtLED, 0, DoubleBuffer);
_SmartLED = new SmartLed( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
(*_SmartLED)[ 0 ] = Rgb{ 255, 0, 0 };
(*_SmartLED)[ 1 ] = LEDColor;
_SmartLED->show();
*/
// leds[ 0 ] = Rgb{ 255, 0, 0 };
// leds[ 1 ] = Rgb{ 255, 255, 255 };
// leds.show();
// SmartLed leds = new SmartLed(LEDType, LEDNumbers, gpioExtLED, 0, DoubleBuffer);
// _SmartLED = new SmartLed( LED_WS2812, 2, GPIO_NUM_12, 0, DoubleBuffer );
}
return true;
@@ -565,18 +560,41 @@ void GpioHandler::flashLightEnable(bool value)
{
if (it->second->getMode() == GPIO_PIN_MODE_EXTERNAL_FLASH_WS281X)
{
#ifdef __LEDGLOBAL
if (leds_global == NULL) {
ESP_LOGI(TAG_SERVERGPIO, "init SmartLed: LEDNumber=%d, GPIO=%d", LEDNumbers, (int)it->second->getGPIO());
leds_global = new SmartLed( LEDType, LEDNumbers, it->second->getGPIO(), 0, DoubleBuffer );
} else {
// wait until we can update: https://github.com/RoboticsBrno/SmartLeds/issues/10#issuecomment-386921623
leds_global->wait();
}
#else
SmartLed leds( LEDType, LEDNumbers, it->second->getGPIO(), 0, DoubleBuffer );
#endif
if (value)
{
for (int i = 0; i < LEDNumbers; ++i)
#ifdef __LEDGLOBAL
(*leds_global)[i] = LEDColor;
#else
leds[i] = LEDColor;
#endif
}
else
{
for (int i = 0; i < LEDNumbers; ++i)
#ifdef __LEDGLOBAL
(*leds_global)[i] = Rgb{0, 0, 0};
#else
leds[i] = Rgb{0, 0, 0};
#endif
}
leds.show();
#ifdef __LEDGLOBAL
leds_global->show();
#else
leds.show();
#endif
}
}
}

View File

@@ -11,6 +11,8 @@
//#include "ClassControllCamera.h"
#define __LEDGLOBAL
typedef enum {
GPIO_PIN_MODE_DISABLED = 0x0,
GPIO_PIN_MODE_INPUT = 0x1,
@@ -86,7 +88,9 @@ private:
int LEDNumbers = 2;
Rgb LEDColor = Rgb{ 255, 255, 255 };
LedType LEDType = LED_WS2812;
#ifdef __LEDGLOBAL
SmartLed *leds_global = NULL;
#endif
bool readConfig();
void clear();

View File

@@ -568,12 +568,8 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
time_t imagetime = 0;
string rohwert;
// ErrorMessageText = "";
// Update Nachkomma, da sich beim Wechsel von CNNType Auto --> xyz auch die Nachkommastellen ändern können:
imagetime = flowMakeImage->getTimeImageTaken();
if (imagetime == 0)
time(&imagetime);
@@ -688,6 +684,8 @@ bool ClassFlowPostProcessing::doFlow(string zwtime)
UpdatePreValueINI = true;
}
}
string _zw = "PostProcessing - Raw: " + NUMBERS[j]->ReturnRawValue + " Value: " + NUMBERS[j]->ReturnValue + " Error: " + NUMBERS[j]->ErrorMessageText;
LogFile.WriteToFile(_zw);
}
SavePreValue();
@@ -724,8 +722,8 @@ void ClassFlowPostProcessing::UpdateNachkommaDecimalShift()
{
// printf("Nur digital + analog\n");
NUMBERS[j]->Nachkomma = NUMBERS[j]->analog_roi->ROI.size();
NUMBERS[j]->DecimalShift = NUMBERS[j]->DecimalShiftInitial;
NUMBERS[j]->Nachkomma = NUMBERS[j]->analog_roi->ROI.size() - NUMBERS[j]->DecimalShift;
if (NUMBERS[j]->isExtendedResolution && flowAnalog->isExtendedResolution()) // extended resolution ist an und soll auch bei dieser Ziffer verwendet werden
NUMBERS[j]->Nachkomma = NUMBERS[j]->Nachkomma+1;