Add switcher
This commit is contained in:
@@ -25,6 +25,7 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
public bool AreValvesOpen(params int[] ns) => ns.All(IsValveOpen);
|
||||
public bool AreValvesClosed(params int[] ns) => ns.All(IsValveClosed);
|
||||
|
||||
public int TroughSelector => Sensors.TroughSelector;
|
||||
public bool IsA1Selected => Sensors.TroughSelector == 1;
|
||||
public bool IsA2Selected => Sensors.TroughSelector == 2;
|
||||
public FillState FillLevelA1 => Sensors.FillingLevels.A1;
|
||||
@@ -329,7 +330,7 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
set => Actuators.P4 = (value != MotorState.Halt && value != MotorState.Forward) ? throw new ArgumentException("Invalid state for P4") : value;
|
||||
}
|
||||
|
||||
public bool P5HasClearance => FillLevelT4 != FillState.Empty && (
|
||||
public bool P5HasClearance => FillLevelT5 != FillState.Empty && (
|
||||
(P5HasClearancePress1 && FillLevelPress1 != FillState.Full) ||
|
||||
(P5HasClearancePress2 && FillLevelPress2 != FillState.Full) ||
|
||||
(HasClearanceTank1(false, P5HasClearanceTanksB) && FillLevelT1 != FillState.Full) ||
|
||||
@@ -383,7 +384,7 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
}
|
||||
|
||||
public void StartTroughAuger() {
|
||||
if (!IsReblerActive || !((IsA1Selected && FillLevelA1 != FillState.Full) || (IsA2Selected && FillLevelA2 != FillState.Full)))
|
||||
if (!IsReblerActive || (IsA1Selected && FillLevelA1 == FillState.Full) || (IsA2Selected && FillLevelA2 == FillState.Full))
|
||||
throw new NoClearanceException("Schnecke Auffangwanne hat keine Freigabe");
|
||||
Actuators.TroughAuger = true;
|
||||
ActuatorsChanged = true;
|
||||
@@ -396,6 +397,7 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
|
||||
public void StartRebler() {
|
||||
Actuators.Rebler = true;
|
||||
StartAuger1();
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
@@ -427,20 +429,25 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
|
||||
public void StartBelt() {
|
||||
Actuators.Belt = true;
|
||||
StartAuger2();
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopBelt() {
|
||||
if (IsPresseQuerSchneckeActive) throw new NoClearanceException("Presse-Querschnecke aktiv");
|
||||
if (IsAuger1Active) throw new NoClearanceException("Förderschnecke 1 aktiv");
|
||||
Actuators.Belt = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartAuger1() {
|
||||
Actuators.Auger1 = true;
|
||||
StartBelt();
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopAuger1() {
|
||||
if (IsReblerActive) throw new NoClearanceException("Rebler aktiv");
|
||||
Actuators.Auger1 = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
@@ -451,22 +458,11 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
}
|
||||
|
||||
public void StopAuger2() {
|
||||
if (IsBeltActive) throw new NoClearanceException("Förderband aktiv");
|
||||
Actuators.Auger2 = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartWasteDisposal() {
|
||||
StartBelt();
|
||||
StartAuger1();
|
||||
StartAuger2();
|
||||
}
|
||||
|
||||
public void StopWasteDisposal() {
|
||||
StopBelt();
|
||||
StopAuger1();
|
||||
StopAuger2();
|
||||
}
|
||||
|
||||
public void StartGradationPump() {
|
||||
Actuators.GradationPump = true;
|
||||
ActuatorsChanged = true;
|
||||
|
||||
Reference in New Issue
Block a user