From 821144a691d1caed61e2834fc218661bea39663e Mon Sep 17 00:00:00 2001 From: Alek-ban Date: Wed, 11 Mar 2026 12:46:21 +0300 Subject: [PATCH] fix: typos TOO many typos --- .../Abstractions/ServiceConfigurationBase.cs | 2 +- .../ConfiurationSectionExtensions.cs | 4 +- GSS2.Core/Extensions/EnumerableExtensions.cs | 2 +- GSS2.Core/Hardware/CameraService.cs | 28 +++---- GSS2.Core/Hardware/ComputeResourcesService.cs | 8 +- GSS2.Core/Hardware/IlluminatorService.cs | 12 +-- GSS2.Core/Helpers/ControlValueHelper.cs | 2 +- .../BGGR_PISP_COMP1_RAW_FrameDecoder.cs | 4 +- GSS2.Test/Program.cs | 24 +++--- GSS2.Test/ProgramCameraTuning.cs | 6 +- GSS2.Test/ProgramCapture.cs | 34 ++++----- GSS2.Test/ProgramImagesStorageClear.cs | 8 +- GSS2.UI.Core/Helpers/PointHelper.cs | 2 +- GSS2.UI.Core/SectionPanel.cs | 26 +++---- ...ineContentSeparatorCalibrationViewModel.cs | 4 +- GSS2.UI.Core/ViewModels/CameraViewModel.cs | 4 +- .../IlluminatorControllerViewModel.cs | 42 +++++----- GSS2.UI.Core/ViewModels/ResourcesViewModel.cs | 4 +- ...AmineContentSeparatorCalibrationView.axaml | 6 +- GSS2.UI.Core/Views/CameraView.axaml.cs | 76 +++++++++---------- .../Views/IlluminatorControllerView.axaml | 12 +-- GSS2.UI.Core/ZoomPanImage.cs | 20 ++--- 22 files changed, 165 insertions(+), 165 deletions(-) diff --git a/GSS2.Core/Abstractions/ServiceConfigurationBase.cs b/GSS2.Core/Abstractions/ServiceConfigurationBase.cs index 21a9fd6..335b59f 100644 --- a/GSS2.Core/Abstractions/ServiceConfigurationBase.cs +++ b/GSS2.Core/Abstractions/ServiceConfigurationBase.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Text.Json; -using GSS2.Core.Extentions; +using GSS2.Core.Extensions; using Microsoft.Extensions.Configuration; diff --git a/GSS2.Core/Extensions/ConfiurationSectionExtensions.cs b/GSS2.Core/Extensions/ConfiurationSectionExtensions.cs index b6dee81..cd58dee 100644 --- a/GSS2.Core/Extensions/ConfiurationSectionExtensions.cs +++ b/GSS2.Core/Extensions/ConfiurationSectionExtensions.cs @@ -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 AsDictionary(this IConfigurationSection values) { diff --git a/GSS2.Core/Extensions/EnumerableExtensions.cs b/GSS2.Core/Extensions/EnumerableExtensions.cs index e6edd39..fb72d91 100644 --- a/GSS2.Core/Extensions/EnumerableExtensions.cs +++ b/GSS2.Core/Extensions/EnumerableExtensions.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace GSS2.Core.Extentions; +namespace GSS2.Core.Extensions; public static class EnumerableExtensions { diff --git a/GSS2.Core/Hardware/CameraService.cs b/GSS2.Core/Hardware/CameraService.cs index 002435a..6b5aeec 100644 --- a/GSS2.Core/Hardware/CameraService.cs +++ b/GSS2.Core/Hardware/CameraService.cs @@ -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? _imageCaptureMappedBuffers; private System.Timers.Timer? _viewFinderTimer = null; private System.Timers.ElapsedEventHandler? _viewFinderTimerElapsed = null; - private EventHandler? _viewFinderRequestComplitedHandler = null; + private EventHandler? _viewFinderRequestCompletedHandler = null; private readonly CancellationTokenSource _disposeCts = new CancellationTokenSource(); private readonly Dictionary _cameraHardSettings = new Dictionary(); @@ -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(); } diff --git a/GSS2.Core/Hardware/ComputeResourcesService.cs b/GSS2.Core/Hardware/ComputeResourcesService.cs index 9f0b5d8..e4ac034 100644 --- a/GSS2.Core/Hardware/ComputeResourcesService.cs +++ b/GSS2.Core/Hardware/ComputeResourcesService.cs @@ -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()); - var (allUsage, allIdle, allTotal) = ParceLines(lines.First(), _prevAll); + var (allUsage, allIdle, allTotal) = ParseLines(lines.First(), _prevAll); _prevAll = (allIdle, allTotal); var coreUsages = new List(); @@ -93,7 +93,7 @@ public class ComputeResourcesService _prevCores = new Dictionary(); 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); } diff --git a/GSS2.Core/Hardware/IlluminatorService.cs b/GSS2.Core/Hardware/IlluminatorService.cs index 0f79c97..8610f94 100644 --- a/GSS2.Core/Hardware/IlluminatorService.cs +++ b/GSS2.Core/Hardware/IlluminatorService.cs @@ -75,9 +75,9 @@ public class IlluminatorService : IDisposable private readonly GpioPin _uv365Relay; private readonly GpioPin _fanRelay; - public event EventHandler? WhiteIntencityChanged; - public event EventHandler? Uv254IntencityChanged; - public event EventHandler? Uv365IntencityChanged; + public event EventHandler? WhiteIntensityChanged; + public event EventHandler? Uv254IntensityChanged; + public event EventHandler? Uv365IntensityChanged; public IlluminatorService(ILogger 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) diff --git a/GSS2.Core/Helpers/ControlValueHelper.cs b/GSS2.Core/Helpers/ControlValueHelper.cs index d9fa64a..c3a8cd6 100644 --- a/GSS2.Core/Helpers/ControlValueHelper.cs +++ b/GSS2.Core/Helpers/ControlValueHelper.cs @@ -15,7 +15,7 @@ public static class ControlValueHelper { typeof(ushort ), (obj, _) => Parse(obj, ushort.TryParse) }, { typeof(uint ), (obj, _) => Parse(obj, uint .TryParse) }, { typeof(int ), ParseInt }, - // int - особый случай потому что он может использовать ControlId.Enumerators для прообразования стокового "enum" в значение + // int - особый случай потому что он может использовать ControlId.Enumerators для преобразования строкового "enum" в значение { typeof(Rectangle), ParseRectangle }, { typeof(Size ), ParseSize }, { typeof(Point ), ParsePoint } diff --git a/GSS2.FrameDecoders/BGGR_PISP_COMP1_RAW_FrameDecoder.cs b/GSS2.FrameDecoders/BGGR_PISP_COMP1_RAW_FrameDecoder.cs index 2ac1ada..7fe3b06 100644 --- a/GSS2.FrameDecoders/BGGR_PISP_COMP1_RAW_FrameDecoder.cs +++ b/GSS2.FrameDecoders/BGGR_PISP_COMP1_RAW_FrameDecoder.cs @@ -131,9 +131,9 @@ public class BGGR_PISP_COMP1_RAW_FrameDecoder : IFrameDecoder // BGGR_PISP_COMP1 public Mat Decode(int width, int height, int stride, List planes, double rGain, double gGain, double bGain, int blackLevel) { - // Дектоирование этого формата состоит из двух этапов: + // Декодирование этого формата состоит из двух этапов: // 1) Распаковка исходных данных в которых каждые 8 байт представляют 8 пикселей (это не значит что 1 байт представляет 1 пиксель!) - // 2) Демозаика полученого Bayer изображения в RGB (BGR) + // 2) Демозаика полученного Bayer изображения в RGB (BGR) if (planes.Count < 1) throw new ArgumentException($"At least 1 plane expected, got {planes.Count}"); diff --git a/GSS2.Test/Program.cs b/GSS2.Test/Program.cs index c2aa190..79378b7 100644 --- a/GSS2.Test/Program.cs +++ b/GSS2.Test/Program.cs @@ -79,23 +79,23 @@ public partial class Program Description = "Output image file", DefaultValueFactory = (_) => new FileInfo("image.png") }; - private static readonly Option _captureIntencityWhite = new("--intencity-white") + private static readonly Option _captureIntensityWhite = new("--intensity-white") { - Description = "Illuminator intencity for white (from 0 to 1)", + Description = "Illuminator intensity for white (from 0 to 1)", DefaultValueFactory = (_) => 1 }; - private static readonly Option _captureIntencityUv365nm = new("--intencity-uv365nm") + private static readonly Option _captureIntensityUv365nm = new("--intensity-uv365nm") { - Description = "Illuminator intencity for UV 365 nm (from 0 to 1)", + Description = "Illuminator intensity for UV 365 nm (from 0 to 1)", DefaultValueFactory = (_) => 0 }; - private static readonly Option _captureIntencityUv254nm = new("--intencity-uv254nm") + private static readonly Option _captureIntensityUv254nm = new("--intensity-uv254nm") { - Description = "Illuminator intencity for UV 254 nm (from 0 to 1)", + Description = "Illuminator intensity for UV 254 nm (from 0 to 1)", DefaultValueFactory = (_) => 0 }; - private static readonly Command _imageStorageClearCommand = new("image-storage-clear") + private static readonly Command _imageStorageClear = new("image-storage-clear") { Description = "Clear image storage from unused images" }; @@ -126,12 +126,12 @@ public partial class Program _rootCommand.Add(_captureCommand); _captureCommand.SetAction(Capture); _captureCommand.Add(_captureOutputFile); - _captureCommand.Add(_captureIntencityWhite); - _captureCommand.Add(_captureIntencityUv365nm); - _captureCommand.Add(_captureIntencityUv254nm); + _captureCommand.Add(_captureIntensityWhite); + _captureCommand.Add(_captureIntensityUv365nm); + _captureCommand.Add(_captureIntensityUv254nm); - _rootCommand.Add(_imageStorageClearCommand); - _imageStorageClearCommand.SetAction(ImageStorageClear); + _rootCommand.Add(_imageStorageClear); + _imageStorageClear.SetAction(ImageStorageClear); Console.CancelKeyPress += new ConsoleCancelEventHandler(OnProgramShutdown); Console.WriteLine("Press Ctrl+C to shut down."); diff --git a/GSS2.Test/ProgramCameraTuning.cs b/GSS2.Test/ProgramCameraTuning.cs index 01f9a0b..a4c1439 100644 --- a/GSS2.Test/ProgramCameraTuning.cs +++ b/GSS2.Test/ProgramCameraTuning.cs @@ -108,7 +108,7 @@ public partial class Program } catch (Exception ex) { - _logger.LogError(ex, "Exception occured while image capturing"); + _logger.LogError(ex, "Exception occurred while image capturing"); break; } @@ -119,7 +119,7 @@ public partial class Program } catch (Exception ex) { - _logger.LogError(ex, "Exception occured while image saving"); + _logger.LogError(ex, "Exception occurred while image saving"); } try @@ -147,7 +147,7 @@ public partial class Program } catch (Exception ex) { - _logger.LogError(ex, "Exception occured while gains computing"); + _logger.LogError(ex, "Exception occurred while gains computing"); break; } i++; diff --git a/GSS2.Test/ProgramCapture.cs b/GSS2.Test/ProgramCapture.cs index 5933797..f8460c1 100644 --- a/GSS2.Test/ProgramCapture.cs +++ b/GSS2.Test/ProgramCapture.cs @@ -21,32 +21,32 @@ public partial class Program private readonly CameraService _cameraService; private readonly IlluminatorService _illuminatorService; private readonly FileInfo _outputFile; - private readonly double _intencityWhite; - private readonly double _intencityUv365nm; - private readonly double _intencityUv254nm; + private readonly double _intensityWhite; + private readonly double _intensityUv365nm; + private readonly double _intensityUv254nm; - public CaptureWorker(ILogger logger, IHostApplicationLifetime applicationLifetime, CameraService cameraService, IlluminatorService illuminatorService, FileInfo outputFile, double intencityWhite, double intencityUv365nm, double intencityUv254nm) + public CaptureWorker(ILogger logger, IHostApplicationLifetime applicationLifetime, CameraService cameraService, IlluminatorService illuminatorService, FileInfo outputFile, double intensityWhite, double intensityUv365nm, double intensityUv254nm) { _applicationLifetime = applicationLifetime; _logger = logger; _cameraService = cameraService; _illuminatorService = illuminatorService; _outputFile = outputFile; - _intencityWhite = intencityWhite; - _intencityUv365nm = intencityUv365nm; - _intencityUv254nm = intencityUv254nm; + _intensityWhite = intensityWhite; + _intensityUv365nm = intensityUv365nm; + _intensityUv254nm = intensityUv254nm; _logger.LogInformation("Initialized"); _logger.LogInformation("Output File: {}", _outputFile); - _logger.LogInformation("Intencity White: {}", _intencityWhite); - _logger.LogInformation("Intencity UV 365 nm: {}", _intencityUv365nm); - _logger.LogInformation("Intencity UV 254 nm: {}", _intencityUv254nm); + _logger.LogInformation("Intensity White: {}", _intensityWhite); + _logger.LogInformation("Intensity UV 365 nm: {}", _intensityUv365nm); + _logger.LogInformation("Intensity UV 254 nm: {}", _intensityUv254nm); } protected override async Task ExecuteAsync(CancellationToken stoppingToken) { _logger.LogInformation("Running camera fine tuning"); - _illuminatorService.SetIntensity(_intencityWhite, _intencityUv365nm, _intencityUv254nm); + _illuminatorService.SetIntensity(_intensityWhite, _intensityUv365nm, _intensityUv254nm); _illuminatorService.TurnOn(); Mat? image; @@ -63,7 +63,7 @@ public partial class Program } catch (Exception ex) { - _logger.LogCritical(ex, "Exception occured while image capturing"); + _logger.LogCritical(ex, "Exception occurred while image capturing"); _applicationLifetime.StopApplication(); return; } @@ -79,7 +79,7 @@ public partial class Program } catch (Exception ex) { - _logger.LogCritical(ex, "Exception occured while image saving"); + _logger.LogCritical(ex, "Exception occurred while image saving"); } _applicationLifetime.StopApplication(); @@ -89,9 +89,9 @@ public partial class Program private static void Capture(ParseResult parseResult) { var outputFile = parseResult.GetRequiredValue(_captureOutputFile); - var intencityWhite = parseResult.GetRequiredValue(_captureIntencityWhite); - var intencityUv365nm = parseResult.GetRequiredValue(_captureIntencityUv365nm); - var intencityUv254nm = parseResult.GetRequiredValue(_captureIntencityUv254nm); + var intensityWhite = parseResult.GetRequiredValue(_captureIntensityWhite); + var intensityUv365nm = parseResult.GetRequiredValue(_captureIntensityUv365nm); + var intensityUv254nm = parseResult.GetRequiredValue(_captureIntensityUv254nm); var builder = Host.CreateApplicationBuilder(); @@ -111,7 +111,7 @@ public partial class Program var applicationLifetime = services.GetRequiredService(); var cameraService = services.GetRequiredService(); var illuminatorService = services.GetRequiredService(); - return new CaptureWorker(logger, applicationLifetime, cameraService, illuminatorService, outputFile, intencityWhite, intencityUv365nm, intencityUv254nm); + return new CaptureWorker(logger, applicationLifetime, cameraService, illuminatorService, outputFile, intensityWhite, intensityUv365nm, intensityUv254nm); }); var host = builder.Build(); diff --git a/GSS2.Test/ProgramImagesStorageClear.cs b/GSS2.Test/ProgramImagesStorageClear.cs index cc80653..e609245 100644 --- a/GSS2.Test/ProgramImagesStorageClear.cs +++ b/GSS2.Test/ProgramImagesStorageClear.cs @@ -16,14 +16,14 @@ namespace GSS2.Test; public partial class Program { - private class ImagesStorateClearWorker : BackgroundService + private class ImagesStorageClearWorker : BackgroundService { - private readonly ILogger _logger; + private readonly ILogger _logger; private readonly IHostApplicationLifetime _applicationLifetime; private readonly AmineContentCalibrationContext _context; private readonly ImageStorageService _imageStorageService; - public ImagesStorateClearWorker(ILogger logger, IHostApplicationLifetime applicationLifetime, AmineContentCalibrationContext context, ImageStorageService imageStorageService) + public ImagesStorageClearWorker(ILogger logger, IHostApplicationLifetime applicationLifetime, AmineContentCalibrationContext context, ImageStorageService imageStorageService) { _logger = logger; _applicationLifetime = applicationLifetime; @@ -85,7 +85,7 @@ public partial class Program builder.Services.AddAmineContentCalibrationContext(builder.Configuration); builder.Services.AddImageStorageService(new DirectoryInfo("images")); - builder.Services.AddHostedService(); + builder.Services.AddHostedService(); var host = builder.Build(); diff --git a/GSS2.UI.Core/Helpers/PointHelper.cs b/GSS2.UI.Core/Helpers/PointHelper.cs index 6fd1673..a955296 100644 --- a/GSS2.UI.Core/Helpers/PointHelper.cs +++ b/GSS2.UI.Core/Helpers/PointHelper.cs @@ -1,6 +1,6 @@ using Avalonia; -namespace GSS2.Core.Extentions; +namespace GSS2.Core.UI.Extensions; public static class PointHelper { diff --git a/GSS2.UI.Core/SectionPanel.cs b/GSS2.UI.Core/SectionPanel.cs index 3107afe..3224b33 100644 --- a/GSS2.UI.Core/SectionPanel.cs +++ b/GSS2.UI.Core/SectionPanel.cs @@ -11,7 +11,7 @@ using Avalonia.Media; using Avalonia.Styling; using Avalonia.Threading; -using GSS2.Core.Extentions; +using GSS2.Core.Extensions; namespace GSS2.UI.Core; @@ -91,7 +91,7 @@ public class SectionPanel : Panel } - private readonly Dictionary _childIndeces = new Dictionary(); + private readonly Dictionary _childIndices = new Dictionary(); private bool _initialized = false; private int _previousIndex = 0; @@ -135,9 +135,9 @@ public class SectionPanel : Panel if (_initialized) { - _childIndeces.Clear(); + _childIndices.Clear(); foreach (var (i, child) in Children.Enumerate()) - _childIndeces.Add(child, i); + _childIndices.Add(child, i); } } panel.InvalidateArrange(); @@ -272,7 +272,7 @@ public class SectionPanel : Panel return; } - foreach (var (child, i) in _childIndeces) + foreach (var (child, i) in _childIndices) { var transform = child.RenderTransform as TranslateTransform; if (transform is null) @@ -303,13 +303,13 @@ public class SectionPanel : Panel if (!_initialized) { foreach (var (i, child) in Children.Enumerate()) - _childIndeces.Add(child, i); + _childIndices.Add(child, i); _initialized = true; } if (_previousIndex == CurrentIndex) { - foreach (var (child, i) in _childIndeces) + foreach (var (child, i) in _childIndices) { var rect = Orientation switch { @@ -334,27 +334,27 @@ public class SectionPanel : Panel { int indexSingleShift = indexShift / Math.Abs(indexShift); - var firstIndex = _childIndeces.Min(ch => ch.Value); - var lastIndex = _childIndeces.Max(ch => ch.Value); + var firstIndex = _childIndices.Min(ch => ch.Value); + var lastIndex = _childIndices.Max(ch => ch.Value); if (indexSingleShift == -1 && _previousIndex - 1 < firstIndex) { var newIndex = firstIndex - 1; - var (child, _) = _childIndeces.MaxBy(ch => ch.Value); + var (child, _) = _childIndices.MaxBy(ch => ch.Value); InstantTransform(child, -Children.Count(), size); - _childIndeces[child] = newIndex; + _childIndices[child] = newIndex; } if (indexSingleShift == 1 && _previousIndex + 1 > lastIndex) { var newIndex = lastIndex + 1; - var (child, _) = _childIndeces.MinBy(ch => ch.Value); + var (child, _) = _childIndices.MinBy(ch => ch.Value); InstantTransform(child, Children.Count(), size); - _childIndeces[child] = newIndex; + _childIndices[child] = newIndex; } List animations = new List(); diff --git a/GSS2.UI.Core/ViewModels/AmineContentSeparatorCalibrationViewModel.cs b/GSS2.UI.Core/ViewModels/AmineContentSeparatorCalibrationViewModel.cs index 0940649..19a330b 100644 --- a/GSS2.UI.Core/ViewModels/AmineContentSeparatorCalibrationViewModel.cs +++ b/GSS2.UI.Core/ViewModels/AmineContentSeparatorCalibrationViewModel.cs @@ -11,7 +11,7 @@ using Avalonia.Media.Imaging; using Avalonia.Threading; using GSS2.Core.Hardware; -using GSS2.Core.Extentions; +using GSS2.Core.Extensions; using GSS2.Core.Analysis.AmineContent.Database.Calibration; using Microsoft.EntityFrameworkCore; @@ -319,7 +319,7 @@ public partial class AmineContentSeparatorCalibrationViewModel : ViewModelBase }, cancellationToken); } - [RelayCommand] private void CencelImageCapturing() => _captureImagesTaskCts?.Cancel(); + [RelayCommand] private void CancelImageCapturing() => _captureImagesTaskCts?.Cancel(); [RelayCommand] private void ImagesSectionPrevious() => ImagesSectionCurrentIndex--; [RelayCommand] private void ImagesSectionNext() => ImagesSectionCurrentIndex++; diff --git a/GSS2.UI.Core/ViewModels/CameraViewModel.cs b/GSS2.UI.Core/ViewModels/CameraViewModel.cs index 029f635..3056bd3 100644 --- a/GSS2.UI.Core/ViewModels/CameraViewModel.cs +++ b/GSS2.UI.Core/ViewModels/CameraViewModel.cs @@ -18,7 +18,7 @@ public partial class CameraViewModel : ViewModelBase, IDisposable private readonly CameraService _cameraService; private readonly System.Timers.Timer _renderTimer; - public event EventHandler? RenderReqested; + public event EventHandler? RenderRequested; [ObservableProperty] private Color _background = Colors.Transparent; [ObservableProperty] private Stretch _stretchMode = Stretch.Uniform; @@ -34,7 +34,7 @@ public partial class CameraViewModel : ViewModelBase, IDisposable _renderTimer.Elapsed += (_, _) => { if (!_cameraService.IsImageCapturing) - RenderReqested?.Invoke(this, new EventArgs()); + RenderRequested?.Invoke(this, new EventArgs()); }; _logger.LogInformation("Initialized"); diff --git a/GSS2.UI.Core/ViewModels/IlluminatorControllerViewModel.cs b/GSS2.UI.Core/ViewModels/IlluminatorControllerViewModel.cs index 322c4f6..d64907d 100644 --- a/GSS2.UI.Core/ViewModels/IlluminatorControllerViewModel.cs +++ b/GSS2.UI.Core/ViewModels/IlluminatorControllerViewModel.cs @@ -13,13 +13,13 @@ public partial class IlluminatorControllerViewModel : ViewModelBase private readonly ILogger _logger; private readonly IlluminatorService _illuminatorService; - private bool _whiteIntencityChanging = false; - private bool _uv365IntencityChanging = false; - private bool _uv254IntencityChanging = false; + private bool _whiteIntensityChanging = false; + private bool _uv365IntensityChanging = false; + private bool _uv254IntensityChanging = false; - [ObservableProperty] private double _whiteIntencity; - [ObservableProperty] private double _uv365Intencity; - [ObservableProperty] private double _uv254Intencity; + [ObservableProperty] private double _whiteIntensity; + [ObservableProperty] private double _uv365Intensity; + [ObservableProperty] private double _uv254Intensity; [ObservableProperty] private bool _enabled; [ObservableProperty] Orientation _orientation; @@ -30,38 +30,38 @@ public partial class IlluminatorControllerViewModel : ViewModelBase _illuminatorService = illuminatorService; - WhiteIntencity = 0; - Uv365Intencity = 0; - Uv254Intencity = 0; + WhiteIntensity = 0; + Uv365Intensity = 0; + Uv254Intensity = 0; Orientation = Orientation.Horizontal; Enabled = false; _logger.LogInformation("Initialized"); } - partial void OnWhiteIntencityChanged(double value) + partial void OnWhiteIntensityChanged(double value) { - if (_whiteIntencityChanging) + if (_whiteIntensityChanging) return; - _whiteIntencityChanging = true; + _whiteIntensityChanging = true; _illuminatorService.SetIntensity(white: value); - _whiteIntencityChanging = false; + _whiteIntensityChanging = false; } - partial void OnUv365IntencityChanged(double value) + partial void OnUv365IntensityChanged(double value) { - if (_uv365IntencityChanging) + if (_uv365IntensityChanging) return; - _uv365IntencityChanging = true; + _uv365IntensityChanging = true; _illuminatorService.SetIntensity(uv365: value); - _uv365IntencityChanging = false; + _uv365IntensityChanging = false; } - partial void OnUv254IntencityChanged(double value) + partial void OnUv254IntensityChanged(double value) { - if (_uv254IntencityChanging) + if (_uv254IntensityChanging) return; - _uv254IntencityChanging = true; + _uv254IntensityChanging = true; _illuminatorService.SetIntensity(uv254: value); - _uv254IntencityChanging = false; + _uv254IntensityChanging = false; } partial void OnEnabledChanged(bool value) diff --git a/GSS2.UI.Core/ViewModels/ResourcesViewModel.cs b/GSS2.UI.Core/ViewModels/ResourcesViewModel.cs index 765639d..20037fc 100644 --- a/GSS2.UI.Core/ViewModels/ResourcesViewModel.cs +++ b/GSS2.UI.Core/ViewModels/ResourcesViewModel.cs @@ -98,7 +98,7 @@ public partial class ResourcesViewModel : ViewModelBase, IDisposable ] ); } - ResourceBarViewModel CreateBarViewModel(ILogger logger, Func, string> formater) + ResourceBarViewModel CreateBarViewModel(ILogger logger, Func, string> formatter) { return new ResourceBarViewModel( logger: logger, @@ -111,7 +111,7 @@ public partial class ResourcesViewModel : ViewModelBase, IDisposable ShowDataLabels = true, IsHoverable = false, HoverPushout = 0, - DataLabelsFormatter = formater, + DataLabelsFormatter = formatter, DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.ChartCenter, DataLabelsPaint = new SolidColorPaint(SKColors.White) }, diff --git a/GSS2.UI.Core/Views/AmineContentSeparatorCalibrationView.axaml b/GSS2.UI.Core/Views/AmineContentSeparatorCalibrationView.axaml index 7b33404..a4d4e4a 100644 --- a/GSS2.UI.Core/Views/AmineContentSeparatorCalibrationView.axaml +++ b/GSS2.UI.Core/Views/AmineContentSeparatorCalibrationView.axaml @@ -187,7 +187,7 @@ - + @@ -435,7 +435,7 @@