Fix things after testing with virtual serial port

This commit is contained in:
2026-07-07 15:28:50 +02:00
parent 08d12d5307
commit fdb7976dda
4 changed files with 45 additions and 14 deletions
+3
View File
@@ -15,5 +15,8 @@
<Grid x:Name="ButtonPanel" Margin="5,50,5,5">
</Grid>
<TextBlock x:Name="Status"
Margin="500,50,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"/>
</Grid>
</Window>
+21 -1
View File
@@ -24,7 +24,8 @@ namespace PamhagenSysCtrl {
borderStyle.Setters.Add(new Setter(Border.CornerRadiusProperty, new CornerRadius(5)));
b.Resources.Add(typeof(Border), borderStyle);
b.Click += (sender, evt) => {
if (App.Plant == null) return;
if (App.Plant == null || sender is not Button b) return;
var i = int.Parse($"{b.Content}"[1..]);
if (App.Plant.WantValveOpen(i)) {
App.Plant.CloseV(i);
} else {
@@ -62,6 +63,25 @@ namespace PamhagenSysCtrl {
b.Foreground = target ? Brushes.DarkRed : Brushes.Black;
b.Background = actual ? Brushes.MistyRose : Brushes.WhiteSmoke;
}
Status.Text = $"""
Gradation °Oe: {plant.GradationOe:N2}
Presse Querschnecke: {plant.PresseQuerSchnecke}
Füllstände:
Wanne A1: {plant.FillLevelA1} (ausgewählt: {plant.WantA1Selected}, Status: {plant.IsA1Selected})
Wanne A2: {plant.FillLevelA2} (ausgewählt: {plant.WantA2Selected}, Status: {plant.IsA2Selected})
Presse 1: {plant.FillLevelPress1}
Presse 2: {plant.FillLevelPress2}
Tank 1: {plant.FillLevelT1}
Tank 2: {plant.FillLevelT2}
Tank 3: {plant.FillLevelT3}
Tank 4: {plant.FillLevelT4}
Tank 5: {plant.FillLevelT5}
Tank 6: {plant.FillLevelT6}
Tank 7: {plant.FillLevelT7}
Tank 8: {plant.FillLevelT8}
Tank 9: {plant.FillLevelT9}
""";
}
}
}