forked from amkovkov/GranuSightSoftware2
feat: SeparatorCalibration View and ViewModel
This commit is contained in:
@@ -103,6 +103,7 @@ public class CameraService : IDisposable
|
||||
public bool IsImageCapturing { get; private set; } = false;
|
||||
public List<FrameBuffer> ViewFinderBufferQueue { get; private set; } = new List<FrameBuffer>();
|
||||
public CameraServiceConfiguration Configuration => _configuration;
|
||||
public bool ViewFinderStarted { get; private set; } = false;
|
||||
|
||||
public CameraService(ILogger<CameraService> logger, CameraServiceConfiguration? configuration = null, bool autoInitialize = false)
|
||||
{
|
||||
@@ -315,7 +316,7 @@ public class CameraService : IDisposable
|
||||
throw new Exception($"Error while camera start {result}");
|
||||
}
|
||||
|
||||
_logger.LogInformation("Camera settings: \n{}", GetSettings(4));
|
||||
_logger.LogDebug("Camera settings: \n{}", GetSettings(4));
|
||||
|
||||
_state |= State.CameraStarted;
|
||||
}
|
||||
@@ -840,6 +841,8 @@ public class CameraService : IDisposable
|
||||
_viewFinderRequestCompletedHandler is not null)
|
||||
throw new InvalidOperationException();
|
||||
|
||||
ViewFinderStarted = true;
|
||||
|
||||
_viewFinderTimer = new System.Timers.Timer()
|
||||
{
|
||||
Interval = 1000 / _configuration.ViewFinderFps,
|
||||
@@ -919,9 +922,11 @@ public class CameraService : IDisposable
|
||||
}
|
||||
public void StopViewFinder()
|
||||
{
|
||||
ViewFinderStarted = false;
|
||||
_viewFinderTimer?.Stop();
|
||||
_viewFinderTimer?.Dispose();
|
||||
_viewFinderTimer = null;
|
||||
_viewFinderTimerElapsed = null;
|
||||
_camera?.RequestCompleted -= _viewFinderRequestCompletedHandler;
|
||||
_viewFinderRequestCompletedHandler = null;
|
||||
lock (ViewFinderBufferQueue)
|
||||
|
||||
Reference in New Issue
Block a user