1.0.5
This commit is contained in:
@@ -128,7 +128,7 @@ public abstract class BaseRecognitionControl: IRecognitionControl
|
||||
SessionEnded = DateTime.Now
|
||||
});
|
||||
_loadingService.StopLoading($"Stopping {_settings.CameraName}");
|
||||
|
||||
IsPaused=false; // ensure paused is reset
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
@@ -141,6 +141,8 @@ public abstract class BaseRecognitionControl: IRecognitionControl
|
||||
IsPaused = false;
|
||||
}
|
||||
|
||||
int _errorsInSequence = 0;
|
||||
|
||||
private async Task Loop(CancellationToken token)
|
||||
{
|
||||
|
||||
@@ -149,7 +151,7 @@ public abstract class BaseRecognitionControl: IRecognitionControl
|
||||
{
|
||||
if (IsPaused)
|
||||
{
|
||||
await Task.Delay(100, token);
|
||||
await Task.Delay(100, token).ConfigureAwait(false);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -165,6 +167,18 @@ public abstract class BaseRecognitionControl: IRecognitionControl
|
||||
Thread.Sleep(_settings.MinimumProcessingTime - (int)processed.Value.processingTime.Milliseconds);
|
||||
}
|
||||
|
||||
if (processed.Value.errorNames.Length > 0)
|
||||
{
|
||||
_errorsInSequence++;
|
||||
if (_errorsInSequence >= _settings.ErrorsInSequenceAlarm)
|
||||
{
|
||||
ErrorsInSequenceAlarm(new ErrorsInSequenceEvent(){Errors = _errorsInSequence});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_errorsInSequence = 0;
|
||||
}
|
||||
|
||||
var processingResult = new ImageProcessedEvent()
|
||||
{
|
||||
@@ -188,6 +202,7 @@ public abstract class BaseRecognitionControl: IRecognitionControl
|
||||
}
|
||||
|
||||
public event Action<ImageProcessedEvent> ImageProcessed = delegate { };
|
||||
public event Action<SessionStartedEvent>? SessionStarted = delegate { };
|
||||
public event Action<SessionEndedEvent>? SessionEnded = delegate { };
|
||||
public event Action<SessionStartedEvent> SessionStarted = delegate { };
|
||||
public event Action<SessionEndedEvent> SessionEnded = delegate { };
|
||||
public event Action<ErrorsInSequenceEvent> ErrorsInSequenceAlarm = delegate { };
|
||||
}
|
||||
Reference in New Issue
Block a user