Elde interface : filters, pidCoef and shortPulses are set by SetFilterPidShortPulses( ) only.

This commit is contained in:
Milan Hanajik
2019-05-10 16:28:18 +02:00
parent 6b42dd091f
commit 7724c004a0
33 changed files with 288 additions and 306 deletions
@@ -72,11 +72,10 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
/// <param name="measuredFlow">Measured flow [m3/h]</param>
/// <param name="timeout">Timeout in [s]</param>
/// <returns>SetFlowOp instance</returns>
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout)
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, int timeout)
{
return new SetFlowOp(controlBoard, regulValve, fixedRV, fixedPctLo, fixedPctHi,
flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout);
flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout);
}
/// <summary>
@@ -90,10 +89,10 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
/// <param name="timeout">Timeout in [s]</param>
/// <returns>SetFlowOp instance</returns>
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout, float filterConstant)
DoubleBox measuredFlow, int timeout, float filterConstant)
{
return new SetFlowOp(controlBoard, regulValve, fixedRV, fixedPctLo, fixedPctHi,
flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout, true);
flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, true);
}
/// <summary>
@@ -14,7 +14,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
private static readonly ILog log = LogManager.GetLogger(typeof(SetFlowOp));
public override string ToString()
{
return string.Format("SetFlowOp({0}, Qfrom={1}, Qto={2}, PID={3})", regulValve.Name, finalReqFlowLo, finalReqFlowHi, pidCoef);
return string.Format("SetFlowOp({0}, Qfrom={1}, Qto={2})", regulValve.Name, finalReqFlowLo, finalReqFlowHi);
}
/// Set by the constructor
@@ -29,9 +29,6 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
readonly double finalReqFlowLo;
readonly double finalReqFlowHi;
readonly double reqFlowAve;
readonly float pidCoef;
readonly int[] filters;
readonly int shortPulses;
readonly int timeout;
readonly bool leaveMeasurementRunning;
@@ -79,7 +76,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
/// <param name="leaveMeasurementRunning">true = Leave the measurement running after op. stop</param>
/// <remarks>Only Elde.Valve flow are used, other flow on the lists are ignored</remarks>
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regV, IRegulValve fxdRV, float fxdPctLo, float fxdPctHi,
IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow,
IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow,
int timeout, bool leaveMeasurementRunning)
{
if (controlBoard == null) throw new ArgumentNullException("ctrlBoard");
@@ -115,9 +112,6 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
this.reqFlowAve = (requiredFlowLo + requiredFlowHi) / 2;
this.finalReqFlowLo = (0.7 * requiredFlowLo) + (0.3 * this.reqFlowAve); /// Move the lower limit 15% of the range up
this.finalReqFlowHi = (0.7 * requiredFlowHi) + (0.3 * this.reqFlowAve); /// Move the upper limit 15% of the range down
this.pidCoef = pidCoef;
this.filters = filters;
this.shortPulses = shortPulses;
this.measuredFlow = measuredFlow;
this.timeout = timeout;
@@ -132,8 +126,8 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
/// Events: FlowSet
/// </summary>
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IRegulValve fixedRV, float fixedPctLo, float fixedPctHi,
IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout)
: this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout, false)
IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow, int timeout)
: this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, timeout, false)
{
}
@@ -142,8 +136,8 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
/// Events: FlowSet
/// </summary>
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IRegulValve fixedRV, float fixedPctLo, float fixedPctHi,
IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow)
: this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, int.MaxValue, false)
IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, DoubleBox measuredFlow)
: this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, measuredFlow, int.MaxValue, false)
{
}
@@ -224,7 +218,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
StopDevs sd = 0;
// '_regulValve.RegulValveTandemCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
int.MaxValue, int.MaxValue, tm, filters, (int)pidCoef, shortPulses, sd);
int.MaxValue, int.MaxValue, tm, sd);
}
/// <summary>Run this operation</summary>
@@ -377,8 +371,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
/// Stop measurement
TestMethods tm = 0;
StopDevs sd = StopDevs.RegValveRegulation;
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route,
50000, 50000, tm, filters, (int)pidCoef, shortPulses, sd);
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route, 50000, 50000, tm, sd);
}
}
}