@@ -81,14 +81,29 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
|
||||
protected static void OnUpdate(object? sender, PlantEventArgs evt) {
|
||||
if (sender is not PamhagenPlant p) return;
|
||||
|
||||
if (p.IsPresseQuerSchneckeActive && !p.IsAuger2Active) p.StartAuger2();
|
||||
if (p.IsReblerActive && !p.IsAuger1Active) p.StartAuger1();
|
||||
if (p.IsAuger1Active && !p.IsAuger2Active) p.StartAuger2();
|
||||
if (p.IsAuger2Active && !p.IsAuger3Active) p.StartAuger3();
|
||||
|
||||
if (p.IsTroughAugerActive && (!p.IsReblerActive || (p.IsMWSelected && p.FillLevelMW1 == FillState.Full) || (p.IsMW2Selected && p.FillLevelMW2 == FillState.Full)))
|
||||
p.StopTroughAuger();
|
||||
|
||||
if (p.IsMP1Active && !p.MP1HasClearance) p.StopMP1();
|
||||
if (p.IsMP2Active && !p.MP2HasClearance) p.StopMP2();
|
||||
|
||||
if (p.IsMP1Active && p.FillLevelMW1 >= FillState.Half && !p.IsStirrerMW1Active) {
|
||||
p.StartStirrerMW1();
|
||||
} else if (p.IsStirrerMW1Active && (!p.IsMP1Active || p.FillLevelMW1 < FillState.Half)) {
|
||||
p.StopStirrerMW1();
|
||||
}
|
||||
if (p.IsMP2Active && p.FillLevelMW2 >= FillState.Half && !p.IsStirrerMW2Active) {
|
||||
p.StartStirrerMW2();
|
||||
} else if (p.IsStirrerMW2Active && (!p.IsMP2Active || p.FillLevelMW2 < FillState.Half)) {
|
||||
p.StopStirrerMW2();
|
||||
}
|
||||
|
||||
if (p.IsP12Active && !p.P12HasClearance) p.StopP12();
|
||||
if (p.IsP3Active && !p.P3HasClearance) p.StopP3();
|
||||
if (p.IsP4Active && !p.P4HasClearance) p.StopP4();
|
||||
@@ -484,35 +499,43 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
|
||||
public void StartMP1Forward() {
|
||||
if (!MP1HasClearance) throw new NoClearanceException("MP1 hat keine Freigabe");
|
||||
if (Actuators.MP1 == MotorState.Backward) throw new NoClearanceException("MP1 läuft bereits (zurück)");
|
||||
Actuators.MP1 = MotorState.Forward;
|
||||
if (FillLevelMW1 >= FillState.Half) StartStirrerMW1();
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartMP1Backward() {
|
||||
if (!MP1HasClearance) throw new NoClearanceException("MP1 hat keine Freigabe");
|
||||
if (Actuators.MP1 == MotorState.Forward) throw new NoClearanceException("MP1 läuft bereits (vor)");
|
||||
Actuators.MP1 = MotorState.Backward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopMP1() {
|
||||
Actuators.MP1 = MotorState.Halt;
|
||||
StopStirrerMW1();
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartMP2Forward() {
|
||||
if (!MP2HasClearance) throw new NoClearanceException("MP2 hat keine Freigabe");
|
||||
if (Actuators.MP2 == MotorState.Backward) throw new NoClearanceException("MP2 läuft bereits (zurück)");
|
||||
Actuators.MP2 = MotorState.Forward;
|
||||
if (FillLevelMW2 >= FillState.Half) StartStirrerMW2();
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartMP2Backward() {
|
||||
if (!MP2HasClearance) throw new NoClearanceException("MP2 hat keine Freigabe");
|
||||
if (Actuators.MP2 == MotorState.Forward) throw new NoClearanceException("MP2 läuft bereits (vor)");
|
||||
Actuators.MP2 = MotorState.Backward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopMP2() {
|
||||
Actuators.MP2 = MotorState.Halt;
|
||||
StopStirrerMW1();
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user