测试完成OpcUa后台服务功能

This commit is contained in:
2025-09-04 21:38:56 +08:00
parent 4e73488e8f
commit d23c8bbd90
3 changed files with 67 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ using DMS.Application.Services.Processors;
using DMS.Core.Interfaces;
using DMS.Core.Interfaces.Repositories;
using DMS.Core.Interfaces.Services;
using DMS.Infrastructure.Configuration;
using DMS.Infrastructure.Configurations;
using DMS.Infrastructure.Data;
using DMS.Infrastructure.Interfaces.Services;
@@ -109,9 +110,13 @@ public partial class App : System.Windows.Application
});
// 注册数据处理服务和处理器
services.AddHostedService<OpcUaBackgroundService>();
services.Configure<DMS.Infrastructure.Configuration.OpcUaServiceOptions>(options => { });
// services.AddHostedService<OpcUaBackgroundService>();
services.Configure<OpcUaServiceOptions>(options => { });
// 注册服务
services.AddSingleton<IOpcUaServiceManager, OpcUaServiceManager>();
// 注册后台服务
services.AddHostedService<OptimizedOpcUaBackgroundService>();
services.AddSingleton<IDataProcessingService, DataProcessingService>();
services.AddHostedService(provider => (DataProcessingService)provider.GetRequiredService<IDataProcessingService>());
services.AddSingleton<CheckValueChangedProcessor>();
@@ -155,6 +160,10 @@ public partial class App : System.Windows.Application
// 注册WPF中的服务
services.AddSingleton<DataServices>();
// 注册视图模型
services.AddSingleton<SplashViewModel>();
services.AddSingleton<MainViewModel>();