Fixes after testing live
This commit is contained in:
@@ -15,13 +15,10 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
protected PamhagenPlc.ActuatorStates Actuators;
|
||||
protected PamhagenPlc.SensorStates Sensors;
|
||||
|
||||
protected bool GetDS(int n) => Sensors.GetDS(n >= 1 && n <= 60 ? n : throw new ArgumentException("Invalid value for n: 1 <= #DS <= 60"));
|
||||
protected bool GetV(int n) => Actuators.GetV(n >= 1 && n <= 60 ? n : throw new ArgumentException("Invalid value for n: 1 <= #V <= 60"));
|
||||
|
||||
public bool IsValveClosed(int n) => GetDS(n);
|
||||
public bool IsValveOpen(int n) => !IsValveClosed(n);
|
||||
public bool WantValveClosed(int n) => GetV(n);
|
||||
public bool WantValveOpen(int n) => !WantValveClosed(n);
|
||||
public bool IsValveClosed(int n) => Sensors.GetDS(n);
|
||||
public bool WantValveClosed(int n) => !WantValveOpen(n);
|
||||
public bool WantValveOpen(int n) => Actuators.GetV(n);
|
||||
|
||||
public bool IsA1Selected => Sensors.TroughSelector == 1;
|
||||
public bool IsA2Selected => Sensors.TroughSelector == 2;
|
||||
@@ -149,10 +146,10 @@ namespace PamhagenSysCtrl.Helpers {
|
||||
}
|
||||
|
||||
|
||||
public void OpenV(int n) => SetV(n, false);
|
||||
public void CloseV(int n) => SetV(n, true);
|
||||
public void OpenV(int n) => SetV(n, true);
|
||||
public void CloseV(int n) => SetV(n, false);
|
||||
|
||||
public void SetV(int n, bool val) {
|
||||
protected void SetV(int n, bool val) {
|
||||
if (n < 1 || n > 60) throw new ArgumentException("Invalid value for n: 1 <= #V <= 60");
|
||||
Actuators.SetV(n, val);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user