forked from amkovkov/GranuSightSoftware2
chore: move CameraView logic to itself
This commit is contained in:
+37
-37
@@ -1,49 +1,49 @@
|
||||
using System.Drawing;
|
||||
// using System.Drawing;
|
||||
|
||||
using GSS2.Core.Analysis.AmineContent.Database;
|
||||
using GSS2.Core.Hardware;
|
||||
// using GSS2.Core.Analysis.AmineContent.Database;
|
||||
// using GSS2.Core.Hardware;
|
||||
|
||||
namespace GSS2.Test;
|
||||
// namespace GSS2.Test;
|
||||
|
||||
public class Worker(
|
||||
ILogger<Worker> logger,
|
||||
IHostApplicationLifetime applicationLifetime,
|
||||
AmineContentCalibrationContext amineCalibrationContext,
|
||||
AmineContentResultsContext amineResultsContext,
|
||||
LightsService lightsService,
|
||||
IlluminatorService illuminatorService,
|
||||
CameraService cameraService
|
||||
) : BackgroundService
|
||||
{
|
||||
private readonly ILogger<Worker> _logger = logger;
|
||||
private readonly IHostApplicationLifetime _applicationLifetime = applicationLifetime;
|
||||
private readonly AmineContentCalibrationContext _amineCalibrationContext = amineCalibrationContext;
|
||||
private readonly AmineContentResultsContext _amineResultsContext = amineResultsContext;
|
||||
private readonly LightsService _lightsService = lightsService;
|
||||
private readonly IlluminatorService _illuminatorService = illuminatorService;
|
||||
private readonly CameraService _cameraService = cameraService;
|
||||
// public class Worker(
|
||||
// ILogger<Worker> logger,
|
||||
// IHostApplicationLifetime applicationLifetime,
|
||||
// AmineContentCalibrationContext amineCalibrationContext,
|
||||
// AmineContentResultsContext amineResultsContext,
|
||||
// LightsService lightsService,
|
||||
// IlluminatorService illuminatorService,
|
||||
// CameraService cameraService
|
||||
// ) : BackgroundService
|
||||
// {
|
||||
// private readonly ILogger<Worker> _logger = logger;
|
||||
// private readonly IHostApplicationLifetime _applicationLifetime = applicationLifetime;
|
||||
// private readonly AmineContentCalibrationContext _amineCalibrationContext = amineCalibrationContext;
|
||||
// private readonly AmineContentResultsContext _amineResultsContext = amineResultsContext;
|
||||
// private readonly LightsService _lightsService = lightsService;
|
||||
// private readonly IlluminatorService _illuminatorService = illuminatorService;
|
||||
// private readonly CameraService _cameraService = cameraService;
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_cameraService.Test();
|
||||
// protected override async Task ExecuteAsync(CancellationToken cancellationToken)
|
||||
// {
|
||||
// // _cameraService.Test();
|
||||
|
||||
// _ = _lightsService.Run(cancellationToken);
|
||||
// _ = _lightsService.SnowfallAsync(0.3, 1, Color.Aqua, cancellationToken);
|
||||
// // _ = _lightsService.Run(cancellationToken);
|
||||
// // _ = _lightsService.SnowfallAsync(0.3, 1, Color.Aqua, cancellationToken);
|
||||
|
||||
// _illuminatorService.SetIntensity(0.01, 0, 0);
|
||||
// _illuminatorService.TurnOn();
|
||||
// // _illuminatorService.SetIntensity(0.01, 0, 0);
|
||||
// // _illuminatorService.TurnOn();
|
||||
|
||||
// await Task.Delay(1000);
|
||||
// // await Task.Delay(1000);
|
||||
|
||||
// var img = await _cameraService.CaptureImage(cancellationToken, 50);
|
||||
// // img?.SaveImage("IMAGE.png");
|
||||
// // var img = await _cameraService.CaptureImage(cancellationToken, 50);
|
||||
// // // img?.SaveImage("IMAGE.png");
|
||||
|
||||
// await Task.Delay(1000);
|
||||
// // await Task.Delay(1000);
|
||||
|
||||
// _illuminatorService.TurnOff();
|
||||
// // _illuminatorService.TurnOff();
|
||||
|
||||
// await _lightsService.DisconnectAsync(cancellationToken);
|
||||
// // await _lightsService.DisconnectAsync(cancellationToken);
|
||||
|
||||
applicationLifetime.StopApplication();
|
||||
}
|
||||
}
|
||||
// applicationLifetime.StopApplication();
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user