@@ -29,14 +29,14 @@ namespace PamhagenSysCtrl {
|
||||
if (App.Plant == null || sender is not Button b) return;
|
||||
var i = int.Parse($"{b.Content}"[1..]);
|
||||
if (i == 58) {
|
||||
if (App.Plant.WantMW1Selected) {
|
||||
if (App.Plant.State.MW1_WantSelected) {
|
||||
App.Plant.SelectMW2();
|
||||
} else {
|
||||
App.Plant.SelectMW1();
|
||||
}
|
||||
} else if (i > 57) {
|
||||
return;
|
||||
} else if (App.Plant.WantValveOpen(i)) {
|
||||
} else if (App.Plant.State.Valve_WantOpen(i)) {
|
||||
App.Plant.CloseV(i);
|
||||
} else {
|
||||
App.Plant.OpenV(i);
|
||||
@@ -60,8 +60,8 @@ namespace PamhagenSysCtrl {
|
||||
if (sender is not PamhagenPlant plant) return;
|
||||
|
||||
for (int i = 1; i <= 58; i++) {
|
||||
var target = plant.WantValveClosed(i);
|
||||
var actual = plant.IsValveClosed(i);
|
||||
var target = plant.State.Valve_WantClosed(i);
|
||||
var actual = plant.State.Valve_IsClosed(i);
|
||||
if (ValvePanel.Children[i - 1] is not Button b)
|
||||
continue;
|
||||
b.BorderBrush = target ? Brushes.DarkRed : Brushes.DarkGreen;
|
||||
@@ -69,98 +69,97 @@ namespace PamhagenSysCtrl {
|
||||
b.Background = actual ? Brushes.MistyRose : Brushes.MintCream;
|
||||
}
|
||||
|
||||
ReblerButton.BorderBrush = plant.IsReblerActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
ReblerButton.Foreground = plant.IsReblerActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
ReblerButton.Background = plant.IsReblerActive ? Brushes.MintCream: Brushes.MistyRose;
|
||||
ReblerButton.BorderBrush = plant.State.Rebler_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
ReblerButton.Foreground = plant.State.Rebler_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
ReblerButton.Background = plant.State.Rebler_IsActive ? Brushes.MintCream: Brushes.MistyRose;
|
||||
|
||||
TroughAugerButton.BorderBrush = plant.IsTroughAugerActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
TroughAugerButton.Foreground = plant.IsTroughAugerActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
TroughAugerButton.Background = plant.IsTroughAugerActive ? Brushes.MintCream : Brushes.MistyRose;
|
||||
TroughAugerButton.BorderBrush = plant.State.TroughAuger_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
TroughAugerButton.Foreground = plant.State.TroughAuger_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
TroughAugerButton.Background = plant.State.TroughAuger_IsActive ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
StirrerMW1Button.BorderBrush = plant.IsStirrerMW1Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW1Button.Foreground = plant.IsStirrerMW1Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW1Button.Background = plant.IsStirrerMW1Active ? Brushes.MintCream : Brushes.MistyRose;
|
||||
StirrerMW1Button.BorderBrush = plant.State.MW1_Stirrer_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW1Button.Foreground = plant.State.MW1_Stirrer_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW1Button.Background = plant.State.MW1_Stirrer_IsActive ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
StirrerMW2Button.BorderBrush = plant.IsStirrerMW2Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW2Button.Foreground = plant.IsStirrerMW2Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW2Button.Background = plant.IsStirrerMW2Active ? Brushes.MintCream : Brushes.MistyRose;
|
||||
StirrerMW2Button.BorderBrush = plant.State.MW2_Stirrer_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW2Button.Foreground = plant.State.MW2_Stirrer_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
StirrerMW2Button.Background = plant.State.MW2_Stirrer_IsActive ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
Auger1Button.BorderBrush = plant.IsAuger1Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger1Button.Foreground = plant.IsAuger1Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger1Button.Background = plant.IsAuger1Active ? Brushes.MintCream : Brushes.MistyRose;
|
||||
Auger1Button.BorderBrush = plant.State.Auger1_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger1Button.Foreground = plant.State.Auger1_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger1Button.Background = plant.State.Auger1_IsActive ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
Auger2Button.BorderBrush = plant.IsAuger2Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger2Button.Foreground = plant.IsAuger2Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger2Button.Background = plant.IsAuger2Active ? Brushes.MintCream : Brushes.MistyRose;
|
||||
Auger2Button.BorderBrush = plant.State.Auger2_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger2Button.Foreground = plant.State.Auger2_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger2Button.Background = plant.State.Auger2_IsActive ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
Auger3Button.BorderBrush = plant.IsAuger3Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger3Button.Foreground = plant.IsAuger3Active ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger3Button.Background = plant.IsAuger3Active ? Brushes.MintCream : Brushes.MistyRose;
|
||||
Auger3Button.BorderBrush = plant.State.Auger3_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger3Button.Foreground = plant.State.Auger3_IsActive ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
Auger3Button.Background = plant.State.Auger3_IsActive ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
MP1BackwardButton.BorderBrush = plant.MP1 == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1BackwardButton.Foreground = plant.MP1 == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1BackwardButton.Background = plant.MP1 == MotorState.Backward ? Brushes.MintCream : Brushes.WhiteSmoke;
|
||||
MP1HaltButton.BorderBrush = plant.MP1 == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP1HaltButton.Foreground = plant.MP1 == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP1HaltButton.Background = plant.MP1 == MotorState.Halt ? Brushes.MistyRose : Brushes.WhiteSmoke;
|
||||
MP1ForwardButton.BorderBrush = plant.MP1 == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1ForwardButton.Foreground = plant.MP1 == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1ForwardButton.Background = plant.MP1 == MotorState.Forward ? Brushes.MintCream: Brushes.WhiteSmoke;
|
||||
MP1BackwardButton.BorderBrush = plant.State.MP1_State == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1BackwardButton.Foreground = plant.State.MP1_State == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1BackwardButton.Background = plant.State.MP1_State == MotorState.Backward ? Brushes.MintCream : Brushes.WhiteSmoke;
|
||||
MP1HaltButton.BorderBrush = plant.State.MP1_State == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP1HaltButton.Foreground = plant.State.MP1_State == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP1HaltButton.Background = plant.State.MP1_State == MotorState.Halt ? Brushes.MistyRose : Brushes.WhiteSmoke;
|
||||
MP1ForwardButton.BorderBrush = plant.State.MP1_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1ForwardButton.Foreground = plant.State.MP1_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP1ForwardButton.Background = plant.State.MP1_State == MotorState.Forward ? Brushes.MintCream: Brushes.WhiteSmoke;
|
||||
|
||||
MP2BackwardButton.BorderBrush = plant.MP2 == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2BackwardButton.Foreground = plant.MP2 == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2BackwardButton.Background = plant.MP2 == MotorState.Backward ? Brushes.MintCream : Brushes.WhiteSmoke;
|
||||
MP2HaltButton.BorderBrush = plant.MP2 == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP2HaltButton.Foreground = plant.MP2 == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP2HaltButton.Background = plant.MP2 == MotorState.Halt ? Brushes.MistyRose : Brushes.WhiteSmoke;
|
||||
MP2ForwardButton.BorderBrush = plant.MP2 == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2ForwardButton.Foreground = plant.MP2 == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2ForwardButton.Background = plant.MP2 == MotorState.Forward ? Brushes.MintCream : Brushes.WhiteSmoke;
|
||||
MP2BackwardButton.BorderBrush = plant.State.MP2_State == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2BackwardButton.Foreground = plant.State.MP2_State == MotorState.Backward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2BackwardButton.Background = plant.State.MP2_State == MotorState.Backward ? Brushes.MintCream : Brushes.WhiteSmoke;
|
||||
MP2HaltButton.BorderBrush = plant.State.MP2_State == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP2HaltButton.Foreground = plant.State.MP2_State == MotorState.Halt ? Brushes.DarkRed : Brushes.SlateGray;
|
||||
MP2HaltButton.Background = plant.State.MP2_State == MotorState.Halt ? Brushes.MistyRose : Brushes.WhiteSmoke;
|
||||
MP2ForwardButton.BorderBrush = plant.State.MP2_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2ForwardButton.Foreground = plant.State.MP2_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.SlateGray;
|
||||
MP2ForwardButton.Background = plant.State.MP2_State == MotorState.Forward ? Brushes.MintCream : Brushes.WhiteSmoke;
|
||||
|
||||
P12Button.BorderBrush = plant.P12 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P12Button.Foreground = plant.P12 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P12Button.Background = plant.P12 == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
P12Button.BorderBrush = plant.State.P12_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P12Button.Foreground = plant.State.P12_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P12Button.Background = plant.State.P12_State == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
P3Button.BorderBrush = plant.P3 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P3Button.Foreground = plant.P3 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P3Button.Background = plant.P3 == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
P3Button.BorderBrush = plant.State.P3_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P3Button.Foreground = plant.State.P3_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P3Button.Background = plant.State.P3_State == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
P4Button.BorderBrush = plant.P4 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P4Button.Foreground = plant.P4 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P4Button.Background = plant.P4 == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
P4Button.BorderBrush = plant.State.P4_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P4Button.Foreground = plant.State.P4_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P4Button.Background = plant.State.P4_State == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
P5Button.BorderBrush = plant.P5 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P5Button.Foreground = plant.P5 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P5Button.Background = plant.P5 == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
P5Button.BorderBrush = plant.State.P5_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P5Button.Foreground = plant.State.P5_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P5Button.Background = plant.State.P5_State == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
P6Button.BorderBrush = plant.P6 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P6Button.Foreground = plant.P6 == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P6Button.Background = plant.P6 == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
P6Button.BorderBrush = plant.State.P6_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P6Button.Foreground = plant.State.P6_State == MotorState.Forward ? Brushes.DarkGreen : Brushes.DarkRed;
|
||||
P6Button.Background = plant.State.P6_State == MotorState.Forward ? Brushes.MintCream : Brushes.MistyRose;
|
||||
|
||||
Status.Text = $"""
|
||||
Gradation °Oe: {plant.GradationOe:N2}
|
||||
Presse Querschnecke: {plant.PresseQuerSchnecke}
|
||||
Presse Querschnecke: {plant.State.PressCrossAuger_State}
|
||||
Füllstände:
|
||||
Maischewanne 1: {plant.FillLevelMW1} (ausgewählt: {plant.WantMW1Selected}, Status: {plant.IsMW1Selected})
|
||||
Maischewanne 2: {plant.FillLevelMW2} (ausgewählt: {plant.WantMW2Selected}, Status: {plant.IsMW2Selected})
|
||||
Presse 1: {plant.Press1HasClearance}
|
||||
Presse 2: {plant.Press2HasClearance}
|
||||
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}
|
||||
Maischewanne 1: {plant.State.MW2_FillLevel} (ausgewählt: {plant.State.MW1_WantSelected}, Status: {plant.State.MW1_IsSelected})
|
||||
Maischewanne 2: {plant.State.MW2_FillLevel} (ausgewählt: {plant.State.MW2_WantSelected}, Status: {plant.State.MW2_IsSelected})
|
||||
Presse 1: {plant.State.Press1_HasClearance}
|
||||
Presse 2: {plant.State.Press2_HasClearance}
|
||||
Tank 1: {plant.State.T1_FillLevel}
|
||||
Tank 2: {plant.State.T2_FillLevel}
|
||||
Tank 3: {plant.State.T3_FillLevel}
|
||||
Tank 4: {plant.State.T4_FillLevel}
|
||||
Tank 5: {plant.State.T5_FillLevel}
|
||||
Tank 6: {plant.State.T6_FillLevel}
|
||||
Tank 7: {plant.State.T7_FillLevel}
|
||||
Tank 8: {plant.State.T8_FillLevel}
|
||||
Tank 9: {plant.State.T9_FillLevel}
|
||||
""";
|
||||
}
|
||||
|
||||
private void TroughAugerButton_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.IsTroughAugerActive) {
|
||||
if (App.Plant.State.TroughAuger_IsActive) {
|
||||
App.Plant.StopTroughAuger();
|
||||
} else {
|
||||
App.Plant.StartTroughAuger();
|
||||
@@ -173,7 +172,7 @@ namespace PamhagenSysCtrl {
|
||||
private void ReblerButton_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.IsReblerActive) {
|
||||
if (App.Plant.State.Rebler_IsActive) {
|
||||
App.Plant.StopRebler();
|
||||
} else {
|
||||
App.Plant.StartRebler();
|
||||
@@ -186,7 +185,7 @@ namespace PamhagenSysCtrl {
|
||||
private void StirrerMW1Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.IsStirrerMW1Active) {
|
||||
if (App.Plant.State.MW1_Stirrer_IsActive) {
|
||||
App.Plant.StopStirrerMW1();
|
||||
} else {
|
||||
App.Plant.StartStirrerMW1();
|
||||
@@ -199,7 +198,7 @@ namespace PamhagenSysCtrl {
|
||||
private void StirrerMW2Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.IsStirrerMW2Active) {
|
||||
if (App.Plant.State.MW2_Stirrer_IsActive) {
|
||||
App.Plant.StopStirrerMW2();
|
||||
} else {
|
||||
App.Plant.StartStirrerMW2();
|
||||
@@ -212,7 +211,7 @@ namespace PamhagenSysCtrl {
|
||||
private void Auger1Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.IsAuger1Active) {
|
||||
if (App.Plant.State.Auger1_IsActive) {
|
||||
App.Plant.StopAuger1();
|
||||
} else {
|
||||
App.Plant.StartAuger1();
|
||||
@@ -225,7 +224,7 @@ namespace PamhagenSysCtrl {
|
||||
private void Auger2Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.IsAuger2Active) {
|
||||
if (App.Plant.State.Auger2_IsActive) {
|
||||
App.Plant.StopAuger2();
|
||||
} else {
|
||||
App.Plant.StartAuger2();
|
||||
@@ -238,7 +237,7 @@ namespace PamhagenSysCtrl {
|
||||
private void Auger3Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.IsAuger3Active) {
|
||||
if (App.Plant.State.Auger3_IsActive) {
|
||||
App.Plant.StopAuger3();
|
||||
} else {
|
||||
App.Plant.StartAuger3();
|
||||
@@ -306,10 +305,10 @@ namespace PamhagenSysCtrl {
|
||||
private void P12Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.P12 == MotorState.Forward) {
|
||||
App.Plant.StopP12();
|
||||
if (App.Plant.State.P12_IsActive) {
|
||||
App.Plant.DisableP12();
|
||||
} else {
|
||||
App.Plant.StartP12();
|
||||
App.Plant.EnableP12();
|
||||
}
|
||||
} catch (NoClearanceException exc) {
|
||||
MessageBox.Show($"{exc.Message}", "Keine Freigabe", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
@@ -319,10 +318,10 @@ namespace PamhagenSysCtrl {
|
||||
private void P3Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.P3 == MotorState.Forward) {
|
||||
App.Plant.StopP3();
|
||||
if (App.Plant.State.P3_IsActive) {
|
||||
App.Plant.DisableP3();
|
||||
} else {
|
||||
App.Plant.StartP3();
|
||||
App.Plant.EnableP3();
|
||||
}
|
||||
} catch (NoClearanceException exc) {
|
||||
MessageBox.Show($"{exc.Message}", "Keine Freigabe", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
@@ -332,10 +331,10 @@ namespace PamhagenSysCtrl {
|
||||
private void P4Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.P4 == MotorState.Forward) {
|
||||
App.Plant.StopP4();
|
||||
if (App.Plant.State.P4_IsActive) {
|
||||
App.Plant.DisableP4();
|
||||
} else {
|
||||
App.Plant.StartP4();
|
||||
App.Plant.EnableP4();
|
||||
}
|
||||
} catch (NoClearanceException exc) {
|
||||
MessageBox.Show($"{exc.Message}", "Keine Freigabe", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
@@ -345,10 +344,10 @@ namespace PamhagenSysCtrl {
|
||||
private void P5Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.P5 == MotorState.Forward) {
|
||||
App.Plant.StopP5();
|
||||
if (App.Plant.State.P5_IsActive) {
|
||||
App.Plant.DisableP5();
|
||||
} else {
|
||||
App.Plant.StartP5();
|
||||
App.Plant.EnableP5();
|
||||
}
|
||||
} catch (NoClearanceException exc) {
|
||||
MessageBox.Show($"{exc.Message}", "Keine Freigabe", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
@@ -358,10 +357,10 @@ namespace PamhagenSysCtrl {
|
||||
private void P6Button_Click(object? sender, RoutedEventArgs? evt) {
|
||||
if (App.Plant == null) return;
|
||||
try {
|
||||
if (App.Plant.P6 == MotorState.Forward) {
|
||||
App.Plant.StopP6();
|
||||
if (App.Plant.State.P6_IsActive) {
|
||||
App.Plant.DisableP6();
|
||||
} else {
|
||||
App.Plant.StartP6();
|
||||
App.Plant.EnableP6();
|
||||
}
|
||||
} catch (NoClearanceException exc) {
|
||||
MessageBox.Show($"{exc.Message}", "Keine Freigabe", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using PamhagenSysCtrl.Helpers;
|
||||
using PamhagenSysCtrl.Helpers.Pipeline;
|
||||
using PamhagenSysCtrl.Helpers.Plc;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -385,7 +386,7 @@ namespace PamhagenSysCtrl.Windows {
|
||||
App.Plant?.StartRebler();
|
||||
}
|
||||
} else if (c is Switcher switcher) {
|
||||
if (App.Plant?.WantMW1Selected ?? false) {
|
||||
if (App.Plant?.State.MW1_WantSelected ?? false) {
|
||||
App.Plant?.SelectMW2();
|
||||
} else {
|
||||
App.Plant?.SelectMW1();
|
||||
@@ -425,33 +426,33 @@ namespace PamhagenSysCtrl.Windows {
|
||||
}
|
||||
} else if (pump == Graph.P12) {
|
||||
if (pump.IsActive) {
|
||||
App.Plant?.StopP12();
|
||||
App.Plant?.DisableP12();
|
||||
} else {
|
||||
App.Plant?.StartP12();
|
||||
App.Plant?.EnableP12();
|
||||
}
|
||||
} else if (pump == Graph.P3) {
|
||||
if (pump.IsActive) {
|
||||
App.Plant?.StopP3();
|
||||
App.Plant?.DisableP3();
|
||||
} else {
|
||||
App.Plant?.StartP3();
|
||||
App.Plant?.EnableP3();
|
||||
}
|
||||
} else if (pump == Graph.P4) {
|
||||
if (pump.IsActive) {
|
||||
App.Plant?.StopP4();
|
||||
App.Plant?.DisableP4();
|
||||
} else {
|
||||
App.Plant?.StartP4();
|
||||
App.Plant?.EnableP4();
|
||||
}
|
||||
} else if (pump == Graph.P5) {
|
||||
if (pump.IsActive) {
|
||||
App.Plant?.StopP5();
|
||||
App.Plant?.DisableP5();
|
||||
} else {
|
||||
App.Plant?.StartP5();
|
||||
App.Plant?.EnableP5();
|
||||
}
|
||||
} else if (pump == Graph.P6) {
|
||||
if (pump.IsActive) {
|
||||
App.Plant?.StopP6();
|
||||
App.Plant?.DisableP6();
|
||||
} else {
|
||||
App.Plant?.StartP6();
|
||||
App.Plant?.EnableP6();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,14 +498,14 @@ namespace PamhagenSysCtrl.Windows {
|
||||
}
|
||||
}
|
||||
|
||||
SetFastSelectButton(FastSelectButton_EntryTrough_Start, App.Plant?.IsTroughAugerActive ?? false ? 1 : 0, !(App.Plant?.TroughAugerHasClearance ?? false));
|
||||
SetFastSelectButton(FastSelectButton_EntryTrough_Stop, App.Plant?.IsTroughAugerActive ?? false ? 0 : 2);
|
||||
SetFastSelectButton(FastSelectButton_MW1, App.Plant?.IsMW1Selected ?? false ? 1 : 0);
|
||||
SetFastSelectButton(FastSelectButton_MW2, App.Plant?.IsMW2Selected ?? false ? 1 : 0);
|
||||
SetFastSelectButton(FastSelectButton_MP1_Forward, App.Plant?.MP1 == MotorState.Forward ? 1 : 0, !(App.Plant?.MP1HasClearance ?? false));
|
||||
SetFastSelectButton(FastSelectButton_MP1_Stop, App.Plant?.MP1 == MotorState.Halt ? 2 : 0);
|
||||
SetFastSelectButton(FastSelectButton_MP2_Forward, App.Plant?.MP2 == MotorState.Forward ? 1 : 0, !(App.Plant?.MP2HasClearance ?? false));
|
||||
SetFastSelectButton(FastSelectButton_MP2_Stop, App.Plant?.MP2 == MotorState.Halt ? 2 : 0);
|
||||
SetFastSelectButton(FastSelectButton_EntryTrough_Start, App.Plant?.State.TroughAuger_IsActive ?? false ? 1 : 0, !(App.Plant?.State.TroughAuger_HasClearance ?? false));
|
||||
SetFastSelectButton(FastSelectButton_EntryTrough_Stop, App.Plant?.State.TroughAuger_IsActive ?? false ? 0 : 2);
|
||||
SetFastSelectButton(FastSelectButton_MW1, App.Plant?.State.MW1_IsSelected?? false ? 1 : 0);
|
||||
SetFastSelectButton(FastSelectButton_MW2, App.Plant?.State.MW2_IsSelected ?? false ? 1 : 0);
|
||||
SetFastSelectButton(FastSelectButton_MP1_Forward, App.Plant?.State.MP1_State == MotorState.Forward ? 1 : 0, !(App.Plant?.State.MP1_HasClearance ?? false));
|
||||
SetFastSelectButton(FastSelectButton_MP1_Stop, App.Plant?.State.MP1_State == MotorState.Halt ? 2 : 0);
|
||||
SetFastSelectButton(FastSelectButton_MP2_Forward, App.Plant?.State.MP2_State == MotorState.Forward ? 1 : 0, !(App.Plant?.State.MP2_HasClearance ?? false));
|
||||
SetFastSelectButton(FastSelectButton_MP2_Stop, App.Plant?.State.MP2_State == MotorState.Halt ? 2 : 0);
|
||||
|
||||
_hover = Graph.GetHover(pos.X, pos.Y, RoundedScale);
|
||||
var hoverButtons = FastSelectPaths.Where(b => b.Key.IsMouseOver).ToDictionary();
|
||||
@@ -585,8 +586,8 @@ namespace PamhagenSysCtrl.Windows {
|
||||
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";
|
||||
Status_CompressedAir.Text = Enumerable.Range(1, 57).Any(p.State.Valve_IsClosed) ? "Ein" : Enumerable.Range(1, 57).Any(p.State.Valve_WantClosed) ? "Aus" : "?";
|
||||
Status_ValvesOpen.Text = Enumerable.Range(1, 57).Count(p.State.Valve_IsOpen) + " / " + Enumerable.Range(1, 57).Count(p.State.Valve_WantOpen) + " / 57";
|
||||
}
|
||||
UpdateScheme(Mouse.GetPosition(SchemeCanvas), Mouse.LeftButton == MouseButtonState.Pressed);
|
||||
}
|
||||
@@ -611,7 +612,7 @@ namespace PamhagenSysCtrl.Windows {
|
||||
foreach (var src in sources) {
|
||||
var paths = new List<Path>();
|
||||
foreach (var sink in sinks) {
|
||||
paths.AddRange(Graph.GetPaths(src, sink, null, (n) => n is not ISink && (n is not ControlledValve v || p.WantValveOpen(v.Nr))));
|
||||
paths.AddRange(Graph.GetPaths(src, sink, null, (n) => n is not ISink && (n is not ControlledValve v || p.State.Valve_WantOpen(v.Nr))));
|
||||
}
|
||||
if (paths.Count == 1)
|
||||
yield return paths.First();
|
||||
|
||||
Reference in New Issue
Block a user