Bugfixes and remove CommitChanges()
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using PamhagenSysCtrl.Helpers.Pipeline;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
|
||||
namespace PamhagenSysCtrl.Helpers {
|
||||
@@ -140,10 +139,6 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
}
|
||||
}
|
||||
|
||||
public void CommitChanges() {
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
protected bool HasWTClearanceAA =>
|
||||
(AreValvesOpen(12) && AreValvesClosed(15, 16, 20)) || // bypass
|
||||
(AreValvesOpen(15, 18, 16) && AreValvesClosed(11, 12, 14, 17, 19, 20)) || // WT1
|
||||
@@ -372,76 +367,92 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
protected void SetV(int n, bool val) {
|
||||
if (n < 1 || n > 57) throw new ArgumentException("Invalid value for n: 1 <= #V <= 57");
|
||||
Actuators.SetV(n, val);
|
||||
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void SelectA1() {
|
||||
Actuators.SetV(58, true);
|
||||
//if (IsReblerActive) Actuators.StirrerA1 = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void SelectA2() {
|
||||
Actuators.SetV(58, false);
|
||||
//if (IsReblerActive) Actuators.StirrerA2 = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartTroughAuger() {
|
||||
if (!IsReblerActive || !((IsA1Selected && FillLevelA1 != FillState.Full) || (IsA2Selected && FillLevelA2 != FillState.Full)))
|
||||
throw new NoClearanceException("Schnecke Auffangwanne hat keine Freigabe");
|
||||
Actuators.TroughAuger = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopTroughAuger() {
|
||||
Actuators.TroughAuger = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartRebler() {
|
||||
Actuators.Rebler = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopRebler() {
|
||||
StopTroughAuger();
|
||||
Actuators.Rebler = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartStirrerA1() {
|
||||
Actuators.StirrerA1 = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopStirrerA1() {
|
||||
Actuators.StirrerA1 = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartStirrerA2() {
|
||||
Actuators.StirrerA2 = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopStirrerA2() {
|
||||
Actuators.StirrerA2 = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartBelt() {
|
||||
Actuators.Belt = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopBelt() {
|
||||
Actuators.Belt = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartAuger1() {
|
||||
Actuators.Auger1 = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopAuger1() {
|
||||
Actuators.Auger1 = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartAuger2() {
|
||||
Actuators.Auger2 = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopAuger2() {
|
||||
Actuators.Auger2 = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartWasteDisposal() {
|
||||
@@ -458,83 +469,101 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
|
||||
public void StartGradationPump() {
|
||||
Actuators.GradationPump = true;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopGradationPump() {
|
||||
Actuators.GradationPump = false;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartMP1Forward() {
|
||||
if (!MP1HasClearance) throw new NoClearanceException("MP1 hat keine Freigabe");
|
||||
Actuators.MP1 = MotorState.Forward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartMP1Backward() {
|
||||
if (!MP1HasClearance) throw new NoClearanceException("MP1 hat keine Freigabe");
|
||||
Actuators.MP1 = MotorState.Backward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopMP1() {
|
||||
Actuators.MP1 = MotorState.Halt;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartMP2Forward() {
|
||||
if (!MP2HasClearance) throw new NoClearanceException("MP2 hat keine Freigabe");
|
||||
Actuators.MP2 = MotorState.Forward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartMP2Backward() {
|
||||
if (!MP2HasClearance) throw new NoClearanceException("MP2 hat keine Freigabe");
|
||||
Actuators.MP2 = MotorState.Backward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopMP2() {
|
||||
Actuators.MP2 = MotorState.Halt;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartP12() {
|
||||
if (!P12HasClearance) throw new NoClearanceException("P1/2 hat keine Freigabe");
|
||||
Actuators.P12 = MotorState.Forward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopP12() {
|
||||
Actuators.P12 = MotorState.Halt;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartP3() {
|
||||
if (!P3HasClearance) throw new NoClearanceException("P3 hat keine Freigabe");
|
||||
Actuators.P3 = MotorState.Forward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopP3() {
|
||||
Actuators.P3 = MotorState.Halt;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartP4() {
|
||||
if (!P4HasClearance) throw new NoClearanceException("P4 hat keine Freigabe");
|
||||
Actuators.P4 = MotorState.Forward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopP4() {
|
||||
Actuators.P4 = MotorState.Halt;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartP5() {
|
||||
if (!P5HasClearance) throw new NoClearanceException("P5 hat keine Freigabe");
|
||||
Actuators.P5 = MotorState.Forward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopP5() {
|
||||
Actuators.P5 = MotorState.Halt;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StartP6() {
|
||||
if (!P6HasClearance) throw new NoClearanceException("P6 hat keine Freigabe");
|
||||
Actuators.P6 = MotorState.Forward;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
|
||||
public void StopP6() {
|
||||
Actuators.P6 = MotorState.Halt;
|
||||
ActuatorsChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user