forked from amkovkov/GranuSightSoftware2
fix: typos
TOO many typos
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Text.Json;
|
||||
|
||||
using GSS2.Core.Extentions;
|
||||
using GSS2.Core.Extensions;
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace GSS2.Core.Extentions;
|
||||
namespace GSS2.Core.Extensions;
|
||||
|
||||
public static class ConfiurationSectionExtensions
|
||||
public static class ConfigurationSectionExtensions
|
||||
{
|
||||
public static Dictionary<string, string> AsDictionary(this IConfigurationSection values)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections;
|
||||
|
||||
namespace GSS2.Core.Extentions;
|
||||
namespace GSS2.Core.Extensions;
|
||||
|
||||
public static class EnumerableExtensions
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using Microsoft.Extensions.Configuration;
|
||||
|
||||
using LibCameraSharp;
|
||||
|
||||
using GSS2.Core.Extentions;
|
||||
using GSS2.Core.Extensions;
|
||||
using GSS2.Core.Abstractions;
|
||||
using GSS2.Core.Helpers;
|
||||
|
||||
@@ -96,7 +96,7 @@ public class CameraService : IDisposable
|
||||
private List<MappedBuffer>? _imageCaptureMappedBuffers;
|
||||
private System.Timers.Timer? _viewFinderTimer = null;
|
||||
private System.Timers.ElapsedEventHandler? _viewFinderTimerElapsed = null;
|
||||
private EventHandler<Camera.RequestCompletedEventArgs>? _viewFinderRequestComplitedHandler = null;
|
||||
private EventHandler<Camera.RequestCompletedEventArgs>? _viewFinderRequestCompletedHandler = null;
|
||||
private readonly CancellationTokenSource _disposeCts = new CancellationTokenSource();
|
||||
private readonly Dictionary<string, object> _cameraHardSettings = new Dictionary<string, object>();
|
||||
|
||||
@@ -403,7 +403,7 @@ public class CameraService : IDisposable
|
||||
cts.Task.WaitAsync(cancellationToken).GetAwaiter().GetResult();
|
||||
_camera.RequestCompleted -= RequestCompleted;
|
||||
|
||||
_logger.LogDebug("Request complited: \n\tResult: {} \n\tStatus: {} \n\tCookie: {} \n\tSequence: {} \n\tHasPendingBuffers: {}", result, request.Status, request.Cookie, request.Sequence, request.HasPendingBuffers);
|
||||
_logger.LogDebug("Request completed: \n\tResult: {} \n\tStatus: {} \n\tCookie: {} \n\tSequence: {} \n\tHasPendingBuffers: {}", result, request.Status, request.Cookie, request.Sequence, request.HasPendingBuffers);
|
||||
_logger.LogDebug("Request buffer: \n\tStatus: {} \n\tCookie: {} \n\tSequence: {} \n\tTimestamp: {}", buffer.Metadata.Status, buffer.Cookie, buffer.Metadata.Sequence, buffer.Metadata.Timestamp);
|
||||
_logger.LogDebug("Request buffer planes: ");
|
||||
foreach (var (i, plane) in buffer.Metadata.Planes.Enumerate())
|
||||
@@ -452,7 +452,7 @@ public class CameraService : IDisposable
|
||||
cts.Task.WaitAsync(cancellationToken).GetAwaiter().GetResult();
|
||||
_camera.RequestCompleted -= RequestCompleted;
|
||||
|
||||
_logger.LogDebug("Request complited: \n\tResult: {} \n\tStatus: {}\n\tCookie: {}\n\tSequence: {}\n\tHasPendingBuffers: {}", result, request.Status, request.Cookie, request.Sequence, request.HasPendingBuffers);
|
||||
_logger.LogDebug("Request completed: \n\tResult: {} \n\tStatus: {}\n\tCookie: {}\n\tSequence: {}\n\tHasPendingBuffers: {}", result, request.Status, request.Cookie, request.Sequence, request.HasPendingBuffers);
|
||||
_logger.LogDebug("Request buffer: \n\tStatus: {} \n\tCookie: {} \n\tSequence: {} \n\tTimestamp: {}", buffer.Metadata.Status, buffer.Cookie, buffer.Metadata.Sequence, buffer.Metadata.Timestamp);
|
||||
foreach (var (i, plane) in buffer.Metadata.Planes.Enumerate())
|
||||
_logger.LogDebug("Plane[{}]: bytes used: 0x{:X}", i, plane.BytesUsed);
|
||||
@@ -705,7 +705,7 @@ public class CameraService : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
_logger.LogDebug("Request complited: \n\tStatus: {}\n\tCookie: {}\n\tSequence: {}\n\tHasPendingBuffers: {}", e.Request.Status, e.Request.Cookie, e.Request.Sequence, e.Request.HasPendingBuffers);
|
||||
_logger.LogDebug("Request completed: \n\tStatus: {}\n\tCookie: {}\n\tSequence: {}\n\tHasPendingBuffers: {}", e.Request.Status, e.Request.Cookie, e.Request.Sequence, e.Request.HasPendingBuffers);
|
||||
_logger.LogDebug("Request buffer: \n\tStatus: {} \n\tCookie: {} \n\tSequence: {} \n\tTimestamp: {}", buffer.Metadata.Status, buffer.Cookie, buffer.Metadata.Sequence, buffer.Metadata.Timestamp);
|
||||
_logger.LogDebug("Request buffer planes: ");
|
||||
foreach (var (i, plane) in buffer.Metadata.Planes.Enumerate())
|
||||
@@ -759,7 +759,7 @@ public class CameraService : IDisposable
|
||||
}
|
||||
_logger.LogDebug("{} request(s) queued", requests.Count());
|
||||
await cts.Task.WaitAsync(effectiveCancellationToken);
|
||||
_logger.LogDebug("{} request(s) compilted", requests.Count());
|
||||
_logger.LogDebug("{} request(s) completed", requests.Count());
|
||||
_camera.RequestCompleted -= RequestCompleted;
|
||||
|
||||
foreach (var key in fdsData.Keys)
|
||||
@@ -837,7 +837,7 @@ public class CameraService : IDisposable
|
||||
throw new InvalidOperationException("ViewFinderFrameBufferAllocator not initialized");
|
||||
if (_viewFinderTimer is not null ||
|
||||
_viewFinderTimerElapsed is not null ||
|
||||
_viewFinderRequestComplitedHandler is not null)
|
||||
_viewFinderRequestCompletedHandler is not null)
|
||||
throw new InvalidOperationException();
|
||||
|
||||
_viewFinderTimer = new System.Timers.Timer()
|
||||
@@ -858,12 +858,12 @@ public class CameraService : IDisposable
|
||||
if (ea.Request.Cookie != 2)
|
||||
return;
|
||||
var buffer = ea.Request.FindBuffer(_viewFinderStream);
|
||||
// _logger.LogInformation("Complited request for frame buffer {}", buffer);
|
||||
// _logger.LogInformation("Completed request for frame buffer {}", buffer);
|
||||
lock (ViewFinderBufferQueue)
|
||||
ViewFinderBufferQueue.Add(buffer);
|
||||
}
|
||||
_viewFinderRequestComplitedHandler = RequestCompleted;
|
||||
_camera.RequestCompleted += _viewFinderRequestComplitedHandler;
|
||||
_viewFinderRequestCompletedHandler = RequestCompleted;
|
||||
_camera.RequestCompleted += _viewFinderRequestCompletedHandler;
|
||||
|
||||
void TimerElapsed(object? sender, System.Timers.ElapsedEventArgs ea)
|
||||
{
|
||||
@@ -911,8 +911,8 @@ public class CameraService : IDisposable
|
||||
_viewFinderTimer.Dispose();
|
||||
_viewFinderTimer = null;
|
||||
_viewFinderTimerElapsed = null;
|
||||
_camera.RequestCompleted -= _viewFinderRequestComplitedHandler;
|
||||
_viewFinderRequestComplitedHandler = null;
|
||||
_camera.RequestCompleted -= _viewFinderRequestCompletedHandler;
|
||||
_viewFinderRequestCompletedHandler = null;
|
||||
lock (ViewFinderBufferQueue)
|
||||
ViewFinderBufferQueue.Clear();
|
||||
}
|
||||
@@ -922,8 +922,8 @@ public class CameraService : IDisposable
|
||||
_viewFinderTimer?.Stop();
|
||||
_viewFinderTimer?.Dispose();
|
||||
_viewFinderTimer = null;
|
||||
_camera?.RequestCompleted -= _viewFinderRequestComplitedHandler;
|
||||
_viewFinderRequestComplitedHandler = null;
|
||||
_camera?.RequestCompleted -= _viewFinderRequestCompletedHandler;
|
||||
_viewFinderRequestCompletedHandler = null;
|
||||
lock (ViewFinderBufferQueue)
|
||||
ViewFinderBufferQueue.Clear();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Globalization;
|
||||
|
||||
using GSS2.Core.Extentions;
|
||||
using GSS2.Core.Extensions;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ComputeResourcesService
|
||||
}
|
||||
private CpuUsage GetCpuUsage()
|
||||
{
|
||||
static (double usage, long idle, long total) ParceLines(string line, (long idle, long total)? prev)
|
||||
static (double usage, long idle, long total) ParseLines(string line, (long idle, long total)? prev)
|
||||
{
|
||||
var parts = line.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
long user = long.Parse(parts[1]);
|
||||
@@ -82,7 +82,7 @@ public class ComputeResourcesService
|
||||
if (lines.Count() == 0)
|
||||
return new CpuUsage(0, new List<double>());
|
||||
|
||||
var (allUsage, allIdle, allTotal) = ParceLines(lines.First(), _prevAll);
|
||||
var (allUsage, allIdle, allTotal) = ParseLines(lines.First(), _prevAll);
|
||||
_prevAll = (allIdle, allTotal);
|
||||
|
||||
var coreUsages = new List<double>();
|
||||
@@ -93,7 +93,7 @@ public class ComputeResourcesService
|
||||
_prevCores = new Dictionary<int, (long idle, long total)?>();
|
||||
if (!_prevCores.ContainsKey(i))
|
||||
_prevCores.Add(i, null);
|
||||
var (coreUsage, coreIdle, coreTotal) = ParceLines(line, _prevCores[i]);
|
||||
var (coreUsage, coreIdle, coreTotal) = ParseLines(line, _prevCores[i]);
|
||||
_prevCores[i] = (coreIdle, coreTotal);
|
||||
coreUsages.Add(coreUsage);
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ public class IlluminatorService : IDisposable
|
||||
private readonly GpioPin _uv365Relay;
|
||||
private readonly GpioPin _fanRelay;
|
||||
|
||||
public event EventHandler<double>? WhiteIntencityChanged;
|
||||
public event EventHandler<double>? Uv254IntencityChanged;
|
||||
public event EventHandler<double>? Uv365IntencityChanged;
|
||||
public event EventHandler<double>? WhiteIntensityChanged;
|
||||
public event EventHandler<double>? Uv254IntensityChanged;
|
||||
public event EventHandler<double>? Uv365IntensityChanged;
|
||||
|
||||
public IlluminatorService(ILogger<IlluminatorService> logger, IlluminatorServiceConfiguration? configuration = null)
|
||||
{
|
||||
@@ -125,17 +125,17 @@ public class IlluminatorService : IDisposable
|
||||
if (white is not null)
|
||||
{
|
||||
_whitePwm.DutyCycle = CalculateDuty(white.Value, _configuration.MaxWhitePwmDuty);
|
||||
WhiteIntencityChanged?.Invoke(this, white.Value);
|
||||
WhiteIntensityChanged?.Invoke(this, white.Value);
|
||||
}
|
||||
if (uv365 is not null)
|
||||
{
|
||||
_uv365Pwm.DutyCycle = CalculateDuty(uv365.Value, _configuration.MaxUv365PwmDuty);
|
||||
Uv365IntencityChanged?.Invoke(this, uv365.Value);
|
||||
Uv365IntensityChanged?.Invoke(this, uv365.Value);
|
||||
}
|
||||
if (uv254 is not null)
|
||||
{
|
||||
_uv254Pwm.DutyCycle = CalculateDuty(uv254.Value, _configuration.MaxUv254PwmDuty);
|
||||
Uv254IntencityChanged?.Invoke(this, uv254.Value);
|
||||
Uv254IntensityChanged?.Invoke(this, uv254.Value);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
@@ -15,7 +15,7 @@ public static class ControlValueHelper
|
||||
{ typeof(ushort ), (obj, _) => Parse<ushort>(obj, ushort.TryParse) },
|
||||
{ typeof(uint ), (obj, _) => Parse<uint >(obj, uint .TryParse) },
|
||||
{ typeof(int ), ParseInt },
|
||||
// int - особый случай потому что он может использовать ControlId.Enumerators для прообразования стокового "enum" в значение
|
||||
// int - особый случай потому что он может использовать ControlId.Enumerators для преобразования строкового "enum" в значение
|
||||
{ typeof(Rectangle), ParseRectangle },
|
||||
{ typeof(Size ), ParseSize },
|
||||
{ typeof(Point ), ParsePoint }
|
||||
|
||||
Reference in New Issue
Block a user