[WIP] XBE-24

This commit is contained in:
lorenz.stechauner committed 2026-09-12 21:43:20 +02:00
1 parent d950e3511f
commit 22ff5d28f5
6 files changed
+340 -39

No files matched your search

+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);