[WIP] Status bar

This commit is contained in:
2026-08-19 10:04:36 +02:00
parent d303f0767a
commit 3c307da0ca
5 changed files with 68 additions and 6 deletions
@@ -502,6 +502,8 @@ namespace PamhagenSysCtrl.Windows {
foreach (var n in Graph.Nodes) {
if (n is Pump p) {
p.Highlight = null;
} else if (n is PipeJoin j) {
j.Highlight = null;
}
}
@@ -593,7 +595,12 @@ namespace PamhagenSysCtrl.Windows {
}
public void OnUpdate(object? sender, PlantEventArgs? evt) {
if (sender is not PamhagenPlant plant) return;
if (App.Plant is PamhagenPlant p) {
Status_Connection.Text = $"Ja ({p.PlcPortName}" + (p.LastRttNs != null ? $", {p.LastRttNs / 1000000.0:N0} ms" : "") + ")";
Status_Plc.Text = $"{p.LastPlcStatus?.Mode} ({p.LastPlcStatus?.Flags:X3}) / {p.LastPlcError?.GetName()} ({(int?)p.LastPlcError:0000})";
Status_CompressedAir.Text = Enumerable.Range(1, 57).Any(p.IsValveClosed) ? "Ein" : Enumerable.Range(1, 57).Any(p.WantValveClosed) ? "Aus" : "?";
Status_ValvesOpen.Text = Enumerable.Range(1, 57).Count(p.IsValveOpen) + " / " + Enumerable.Range(1, 57).Count(p.WantValveOpen) + " / 57";
}
UpdateScheme(Mouse.GetPosition(SchemeCanvas), Mouse.LeftButton == MouseButtonState.Pressed);
}