feat: SeparatorCalibration View and ViewModel

This commit is contained in:
2026-04-14 16:18:13 +03:00
parent bb930aac88
commit 7a42ff5f3c
11 changed files with 1106 additions and 27 deletions
+6 -1
View File
@@ -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)