修复了设备在启动和停止时的一些逻辑错误。

This commit is contained in:
2025-07-16 13:15:29 +08:00
parent b742067c39
commit 7e02255bdb
6 changed files with 479 additions and 343 deletions

View File

@@ -79,10 +79,10 @@ public partial class App : Application
{
Host.Services.GetRequiredService<MqttBackgroundService>().StartService();
}
if (connectionSettings.EnableOpcUaService)
{
Host.Services.GetRequiredService<OpcUaBackgroundService>().StartService();
}
// if (connectionSettings.EnableOpcUaService)
// {
// Host.Services.GetRequiredService<OpcUaBackgroundService>().StartService();
// }
}
protected override async void OnExit(ExitEventArgs e)
@@ -101,6 +101,7 @@ public partial class App : Application
services.AddSingleton<IDialogService, DialogService>();
services.AddSingleton<GrowlNotificationService>();
services.AddHostedService<S7BackgroundService>();
services.AddHostedService<OpcUaBackgroundService>();
services.AddSingleton<MqttBackgroundService>();
services.AddSingleton<OpcUaBackgroundService>();