forked from amkovkov/GranuSightSoftware2
1) remove unused components: camera view (due it causes segmentation faults), compute resources and all related, illuminator controller (due in useless without camera view), image storage service, temperature and humidity service 2) database schema - reduce tables references, features storing in records themselves in compressed form, add records creation and editing date and time, add separator comment column 3) analysis - rework of pipeline and ui, now database storing only raw data and all display values calculated from it 4) lights service - add reconnection if disconnected 5) add width and height command line arguments 6) fix some typos and other issues
52 lines
2.3 KiB
C#
52 lines
2.3 KiB
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using GSS2.UI.Core.Services;
|
|
using GSS2.Views;
|
|
using GSS2.ViewModels;
|
|
|
|
namespace GSS2;
|
|
|
|
public static class DependencyInjectionHelper
|
|
{
|
|
public static IServiceCollection AddViewsAndModels(this IServiceCollection services) =>
|
|
services
|
|
.AddSingleton<DependencyInjectionViewLocator>((services) =>
|
|
new DependencyInjectionViewLocator(
|
|
services.GetRequiredService<ILogger<DependencyInjectionViewLocator>>(),
|
|
services
|
|
)
|
|
)
|
|
.AddSingleton<NavigationService>((_) => new NavigationService(Application.Current?.ApplicationLifetime))
|
|
|
|
// Главные
|
|
.AddSingleton<MainViewModel>()
|
|
.AddSingleton<MainView>()
|
|
// Основные
|
|
.AddSingleton<AmineContentViewModel>()
|
|
.AddSingleton<AmineContentView>()
|
|
// Core
|
|
.AddSingleton<GSS2.UI.Core.ViewModels.MainWindowViewModel>()
|
|
// База
|
|
.AddSingleton<ViewModels.DeleteConfirmViewModel>()
|
|
.AddSingleton<ViewModels.NumericKeyboardViewModel>()
|
|
.AddSingleton<Views.DeleteConfirmView>()
|
|
.AddSingleton<Views.NumericKeyboardView>()
|
|
// Общие
|
|
.AddSingleton<ViewModels.Common.SystemViewModel>()
|
|
// .AddSingleton<ViewModels.Common.CameraViewModel>()
|
|
// .AddSingleton<Views.Common.SystemView>()
|
|
// .AddSingleton<Views.Common.CameraView>()
|
|
// AmineContent
|
|
.AddSingleton<ViewModels.AmineContent.StartViewModel>()
|
|
.AddSingleton<ViewModels.AmineContent.AnalysisViewModel>()
|
|
.AddSingleton<ViewModels.AmineContent.SampleCalibrationViewModel>()
|
|
.AddSingleton<ViewModels.AmineContent.SeparatorCalibrationViewModel>()
|
|
.AddSingleton<ViewModels.AmineContent.BrandCalibrationViewModel>()
|
|
.AddSingleton<Views.AmineContent.StartView>()
|
|
.AddSingleton<Views.AmineContent.AnalysisView>()
|
|
.AddSingleton<Views.AmineContent.SampleCalibrationView>()
|
|
.AddSingleton<Views.AmineContent.SeparatorCalibrationView>()
|
|
.AddSingleton<Views.AmineContent.BrandCalibrationView>();
|
|
}
|