Fix belts/augers
Test / Run tests (push) Successful in 32s

This commit is contained in:
2026-08-06 22:08:44 +02:00
parent b85d1d8afd
commit e6b97ccf33
6 changed files with 57 additions and 57 deletions
+20 -20
View File
@@ -53,10 +53,10 @@ namespace PamhagenSysCtrl.Helpers {
public bool IsReblerActive => Actuators.Rebler;
public bool IsStirrerMW1Active => Actuators.StirrerMW1;
public bool IsStirrerMW2Active => Actuators.StirrerMW2;
public bool IsBeltActive => Actuators.Belt;
public bool IsAuger1Active => Actuators.Auger1;
public bool IsAuger2Active => Actuators.Auger2;
public bool IsWasteDisposalActive => IsBeltActive || IsAuger1Active || IsAuger2Active;
public bool IsAuger3Active => Actuators.Auger3;
public bool IsWasteDisposalActive => IsAuger1Active || IsAuger2Active || IsAuger3Active;
public bool IsGradationPumpActive => Actuators.GradationPump;
public bool IsMP1Active => Actuators.MP1 == MotorState.Forward || Actuators.MP1 == MotorState.Backward;
@@ -78,10 +78,10 @@ namespace PamhagenSysCtrl.Helpers {
protected static void OnUpdate(object? sender, PlantEventArgs evt) {
if (sender is not PamhagenPlant p) return;
if (p.IsPresseQuerSchneckeActive && !p.IsBeltActive) p.StartBelt();
if (p.IsPresseQuerSchneckeActive && !p.IsAuger2Active) p.StartAuger2();
if (p.IsReblerActive && !p.IsAuger1Active) p.StartAuger1();
if (p.IsAuger1Active && !p.IsBeltActive) p.StartBelt();
if (p.IsBeltActive && !p.IsAuger2Active) p.StartAuger2();
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();
@@ -427,22 +427,9 @@ namespace PamhagenSysCtrl.Helpers {
ActuatorsChanged = true;
}
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();
StartAuger2();
ActuatorsChanged = true;
}
@@ -454,15 +441,28 @@ namespace PamhagenSysCtrl.Helpers {
public void StartAuger2() {
Actuators.Auger2 = true;
StartAuger3();
ActuatorsChanged = true;
}
public void StopAuger2() {
if (IsBeltActive) throw new NoClearanceException("Förderband aktiv");
if (IsPresseQuerSchneckeActive) throw new NoClearanceException("Presse-Querschnecke aktiv");
if (IsAuger1Active) throw new NoClearanceException("Förderschnecke 1 aktiv");
Actuators.Auger2 = false;
ActuatorsChanged = true;
}
public void StartAuger3() {
Actuators.Auger3 = true;
ActuatorsChanged = true;
}
public void StopAuger3() {
if (IsAuger2Active) throw new NoClearanceException("Förderschnecke 2 aktiv");
Actuators.Auger3 = false;
ActuatorsChanged = true;
}
public void StartGradationPump() {
Actuators.GradationPump = true;
ActuatorsChanged = true;