Skip to content

Commit

Permalink
Fix: Automatic signal detection timing (awawa-dev#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev authored and chbartsch committed Nov 29, 2022
1 parent 9d6547d commit c092064
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sources/base/DetectionAutomatic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,15 @@ bool DetectionAutomatic::checkSignal(Image<ColorRgb>& image)
bool hasSignal = (finalQuality <= _modelTolerance);

if (!hasSignal && _noSignal)
{
_onSignalTime = 0;
return false;
}
if (hasSignal && !_noSignal)
{
_offSignalTime = 0;
return true;
}

qint64 time = InternalClock::now();

Expand Down Expand Up @@ -551,6 +557,8 @@ bool DetectionAutomatic::checkSignal(Image<ColorRgb>& image)

return true;
}
else
_offSignalTime = 0;

if (hasSignal && _noSignal)
{
Expand All @@ -576,6 +584,8 @@ bool DetectionAutomatic::checkSignal(Image<ColorRgb>& image)

return false;
}
else
_onSignalTime = 0;

return true;
}
Expand Down

0 comments on commit c092064

Please sign in to comment.