[WIP] XBE-24
Test / Run tests (push) Failing after 35s

This commit is contained in:
2026-09-11 23:09:26 +02:00
parent 82d7a5b626
commit 4071cc2f2c
6 changed files with 343 additions and 66 deletions
+2 -6
View File
@@ -36,15 +36,11 @@ namespace PamhagenSysCtrl {
protected override async void OnStartup(StartupEventArgs evt) {
Version = new Version(typeof(App).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion.Split('+')[0] ?? "0.0.0");
Plant = new(Config.PlcPort);
try {
Plant = new(Config.PlcPort);
await Plant.StartThread();
} catch (Exception exc) {
Plant?.Dispose();
Plant = null;
var str = $"Beim Aufbauen einer Verbindung zur SPS ist ein Fehler aufgetreten:\n\n{exc.GetType().Name}: {exc.Message}";
if (exc.InnerException != null) str += $"\n\n{exc.InnerException.GetType().Name}: {exc.InnerException.Message}";
MessageBox.Show(str, "SPS-Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
// TODO
}
base.OnStartup(evt);