From fd25dcba0d70c8bcc2cc4aa36bed84ac9c339d34 Mon Sep 17 00:00:00 2001 From: Alek-ban Date: Tue, 14 Apr 2026 07:35:46 +0300 Subject: [PATCH] feat: add Camera View and ViewModel --- GSS2/ViewModels/AmineContentViewModel.cs | 6 ++- GSS2/ViewModels/Common/CameraViewModel.cs | 20 +++++++++ GSS2/Views/AmineContentView.axaml | 10 ++++- GSS2/Views/Common/CameraView.axaml | 50 +++++++++++++++++++++++ GSS2/Views/Common/CameraView.axaml.cs | 11 +++++ 5 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 GSS2/ViewModels/Common/CameraViewModel.cs create mode 100644 GSS2/Views/Common/CameraView.axaml create mode 100644 GSS2/Views/Common/CameraView.axaml.cs diff --git a/GSS2/ViewModels/AmineContentViewModel.cs b/GSS2/ViewModels/AmineContentViewModel.cs index eed08ad..98d97de 100644 --- a/GSS2/ViewModels/AmineContentViewModel.cs +++ b/GSS2/ViewModels/AmineContentViewModel.cs @@ -2,10 +2,11 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using GSS2.UI.Core.Services; -using GSS2.UI.Core.ViewModels; using GSS2.ViewModels.Common; using GSS2.ViewModels.AmineContent; +using ViewModelBase = GSS2.UI.Core.ViewModels.ViewModelBase; + namespace GSS2.ViewModels; public partial class AmineContentViewModel : ViewModelBase @@ -17,6 +18,7 @@ public partial class AmineContentViewModel : ViewModelBase [ObservableProperty] public partial ResultsViewModel Results { get; set; } [ObservableProperty] public partial SampleCalibrationViewModel SampleCalibration { get; set; } [ObservableProperty] public partial SeparatorCalibrationViewModel SeparatorCalibration { get; set; } + [ObservableProperty] public partial CameraViewModel Camera { get; set; } [ObservableProperty] public partial SystemViewModel System { get; set; } [ObservableProperty] public partial int CurrentIndex { get; set; } @@ -28,6 +30,7 @@ public partial class AmineContentViewModel : ViewModelBase ResultsViewModel results, SampleCalibrationViewModel sampleCalibration, SeparatorCalibrationViewModel separatorCalibration, + CameraViewModel camera, SystemViewModel system ) { @@ -37,6 +40,7 @@ public partial class AmineContentViewModel : ViewModelBase Results = results; SampleCalibration = sampleCalibration; SeparatorCalibration = separatorCalibration; + Camera = camera; System = system; } diff --git a/GSS2/ViewModels/Common/CameraViewModel.cs b/GSS2/ViewModels/Common/CameraViewModel.cs new file mode 100644 index 0000000..24c7ce9 --- /dev/null +++ b/GSS2/ViewModels/Common/CameraViewModel.cs @@ -0,0 +1,20 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +using GSS2.UI.Core.ViewModels; + +namespace GSS2.ViewModels.Common; + +public partial class CameraViewModel : ViewModelBase +{ + [ObservableProperty] public partial GSS2.UI.Core.ViewModels.CameraViewModel Camera { get; set; } + [ObservableProperty] public partial GSS2.UI.Core.ViewModels.IlluminatorControllerViewModel Illuminator { get; set; } + + public CameraViewModel( + GSS2.UI.Core.ViewModels.CameraViewModel camera, + GSS2.UI.Core.ViewModels.IlluminatorControllerViewModel illuminator + ) + { + Camera = camera; + Illuminator = illuminator; + } +} diff --git a/GSS2/Views/AmineContentView.axaml b/GSS2/Views/AmineContentView.axaml index 9852050..ba59aeb 100644 --- a/GSS2/Views/AmineContentView.axaml +++ b/GSS2/Views/AmineContentView.axaml @@ -34,6 +34,7 @@ + @@ -51,6 +52,7 @@ + @@ -79,8 +81,13 @@ - + + + + @@ -94,6 +101,7 @@ + diff --git a/GSS2/Views/Common/CameraView.axaml b/GSS2/Views/Common/CameraView.axaml new file mode 100644 index 0000000..a1b8d47 --- /dev/null +++ b/GSS2/Views/Common/CameraView.axaml @@ -0,0 +1,50 @@ + + + + + + + 20 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GSS2/Views/Common/CameraView.axaml.cs b/GSS2/Views/Common/CameraView.axaml.cs new file mode 100644 index 0000000..0c2edf9 --- /dev/null +++ b/GSS2/Views/Common/CameraView.axaml.cs @@ -0,0 +1,11 @@ +using Avalonia.Controls; + +namespace GSS2.Views.Common; + +public partial class CameraView : UserControl +{ + public CameraView() + { + InitializeComponent(); + } +}