Change confusing logic

This commit is contained in:
Thinner77 2024-05-02 21:30:55 +02:00
parent 7645ebb526
commit f06203672e
2 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ MFGrabber::MFGrabber()
, _currentFrame(0)
, _noSignalThresholdColor(ColorRgb{0,0,0})
, _signalDetectionEnabled(true)
, _noSignalDetected(false)
, _noSignalDetected(true)
, _initialized(false)
, _reload(false)
, _x_frac_min(0.25)
@ -580,7 +580,7 @@ void MFGrabber::newThreadFrame(Image<ColorRgb> image)
{
if (_noSignalCounter >= _noSignalCounterThreshold)
{
_noSignalDetected = true;
_noSignalDetected = false;
Info(_log, "Signal detected");
}
@ -593,7 +593,7 @@ void MFGrabber::newThreadFrame(Image<ColorRgb> image)
}
else if (_noSignalCounter == _noSignalCounterThreshold)
{
_noSignalDetected = false;
_noSignalDetected = true;
Info(_log, "Signal lost");
}
}

View File

@ -81,7 +81,7 @@ V4L2Grabber::V4L2Grabber()
, _noSignalThresholdColor(ColorRgb{0,0,0})
, _standbyActivated(false)
, _signalDetectionEnabled(true)
, _noSignalDetected(false)
, _noSignalDetected(true)
, _noSignalCounter(0)
, _brightness(0)
, _contrast(0)
@ -1060,7 +1060,7 @@ void V4L2Grabber::newThreadFrame(Image<ColorRgb> image)
{
if (_noSignalCounter >= _noSignalCounterThreshold)
{
_noSignalDetected = true;
_noSignalDetected = false;
Info(_log, "Signal detected");
}
@ -1073,7 +1073,7 @@ void V4L2Grabber::newThreadFrame(Image<ColorRgb> image)
}
else if (_noSignalCounter == _noSignalCounterThreshold)
{
_noSignalDetected = false;
_noSignalDetected = true;
Info(_log, "Signal lost");
}
}