(1) filters[] initialized earlier in test method sequences, (2) filters and shortPulses used in SetFlowOp(.), ver. 2.18.1206
This commit is contained in:
parent
1e97a26863
commit
d0bba74dff
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
@ -58,9 +58,9 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, DoubleBox measuredFlow, int timeout)
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout)
|
||||
{
|
||||
return new SetFlowOp(this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout);
|
||||
return new SetFlowOp(this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -74,9 +74,9 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
{
|
||||
return new SetFlowOp(this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, true);
|
||||
return new SetFlowOp(this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -48,7 +48,7 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
/// <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(IRegulValve regulValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, DoubleBox measuredFlow, int timeout, bool leaveMeasurementRunning)
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout, bool leaveMeasurementRunning)
|
||||
{
|
||||
this.regulValve = regulValve as RegulValve;
|
||||
if (this.regulValve == null) throw new ArgumentNullException("regValve is null or not Dummy.RegulValve");
|
||||
@ -73,8 +73,8 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, DoubleBox measuredFlow, int timeout)
|
||||
: this(regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, false)
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout)
|
||||
: this(regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout, false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -83,8 +83,8 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, DoubleBox measuredFlow)
|
||||
: this(regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, int.MaxValue, false)
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow)
|
||||
: this(regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, int.MaxValue, false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -154,9 +154,10 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// <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, DoubleBox measuredFlow, int timeout)
|
||||
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses,
|
||||
DoubleBox measuredFlow, int timeout)
|
||||
{
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, RegulValveCfg.ReTryCommands, timeout);
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, RegulValveCfg.ReTryCommands, timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -169,9 +170,10 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses,
|
||||
DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
{
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, RegulValveCfg.ReTryCommands, timeout, true);
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, RegulValveCfg.ReTryCommands, timeout, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -26,7 +26,9 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
readonly double requiredFlowHi;
|
||||
readonly double reqFlowAve;
|
||||
readonly float pidCoef;
|
||||
readonly int timeout;
|
||||
readonly int[] filters;
|
||||
readonly int shortPulses;
|
||||
readonly int timeout;
|
||||
readonly bool leaveMeasurementRunning;
|
||||
readonly bool reTryCommands;
|
||||
|
||||
@ -78,9 +80,8 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// <param name="timeout">Timeout for the flow setting in [s]</param>
|
||||
/// <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 regulValve, IFlowMeter flowMeter,
|
||||
double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox flowBox,
|
||||
bool reTryCmds, int timeout, bool leaveMeasurementRunning)
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regulValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox flowBox, bool reTryCmds, int timeout, bool leaveMeasurementRunning)
|
||||
{
|
||||
if (controlBoard == null) throw new ArgumentNullException("ctrlBoard");
|
||||
this.controlBoard = controlBoard;
|
||||
@ -99,6 +100,8 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
this.requiredFlowLo = (0.7 * requiredFlowLo) + (0.3 * this.reqFlowAve); /// Move the lower limit 15% of the range up
|
||||
this.requiredFlowHi = (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;
|
||||
|
||||
if (flowBox == null) throw new ArgumentNullException("flowBox");
|
||||
this.flowBox = flowBox;
|
||||
@ -116,9 +119,9 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// Set required water flow - Do not leave the measurement running.
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter,
|
||||
double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox flowbox, bool reTryCmds, int timeout)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, flowbox, reTryCmds, timeout, false)
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox flowbox, bool reTryCmds, int timeout)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, flowbox, reTryCmds, timeout, false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -126,9 +129,9 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
/// Set required water flow - No timeout.
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter,
|
||||
double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox flowbox, bool reTryCmds)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, flowbox, reTryCmds, int.MaxValue, false)
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox flowbox, bool reTryCmds)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, flowbox, reTryCmds, int.MaxValue, false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -205,8 +208,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
StopDevs sd = 0;
|
||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, controlBoard.Route,
|
||||
int.MaxValue, int.MaxValue, tm,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
|
||||
int.MaxValue, int.MaxValue, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
@ -254,8 +256,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
StopDevs sd = 0;
|
||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, controlBoard.Route,
|
||||
int.MaxValue, int.MaxValue, tm,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
|
||||
int.MaxValue, int.MaxValue, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
return Event.None;
|
||||
}
|
||||
else if (opState == OpState.ValveMoveToPosition1)
|
||||
@ -456,8 +457,7 @@ namespace TBF.BenchControl.Elde.RegulValve
|
||||
TestMethods tm = 0;
|
||||
StopDevs sd = StopDevs.RegValveRegulation;
|
||||
controlBoard.SendCommand(Command.Stop, flowMeter.Idx1, controlBoard.Route,
|
||||
50000, 50000, tm,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
|
||||
50000, 50000, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,9 +60,10 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
/// <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, DoubleBox measuredFlow, int timeout)
|
||||
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout)
|
||||
{
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, RegulValveCfg.ReTryCommands, timeout);
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, RegulValveCfg.ReTryCommands, timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -75,9 +76,10 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
public IOperation SetFlowAndMeasureOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
{
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, RegulValveCfg.ReTryCommands, timeout, true);
|
||||
return new SetFlowOp(ControlBoard, this, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, RegulValveCfg.ReTryCommands, timeout, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -26,6 +26,8 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
readonly double finalReqFlowHi;
|
||||
readonly double reqFlowAve;
|
||||
readonly float pidCoef;
|
||||
readonly int[] filters;
|
||||
readonly int shortPulses;
|
||||
readonly int timeout;
|
||||
readonly bool leaveMeasurementRunning;
|
||||
readonly bool reTryCommands;
|
||||
@ -78,7 +80,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
/// <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 _regulValve, IFlowMeter flowMeter,
|
||||
double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox measuredFlow,
|
||||
double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow,
|
||||
bool reTryCmds, int timeout, bool leaveMeasurementRunning)
|
||||
{
|
||||
if (controlBoard == null) throw new ArgumentNullException("ctrlBoard");
|
||||
@ -108,6 +110,8 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
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.reTryCommands = reTryCmds;
|
||||
|
||||
@ -122,9 +126,9 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
/// Set required water flow - Do not leave the measurement running.
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter,
|
||||
double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox measuredFlow, bool reTryCmds, int timeout)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, reTryCmds, timeout, false)
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, bool reTryCmds, int timeout)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, reTryCmds, timeout, false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -132,9 +136,9 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
/// Set required water flow - No timeout.
|
||||
/// Events: FlowSet
|
||||
/// </summary>
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter,
|
||||
double requiredFlowLo, double requiredFlowHi, float pidCoef, DoubleBox measuredFlow, bool reTryCmds)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, reTryCmds, int.MaxValue, false)
|
||||
public SetFlowOp(ControlBoardDev controlBoard, IRegulValve regValve, IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, bool reTryCmds)
|
||||
: this(controlBoard, regValve, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, reTryCmds, int.MaxValue, false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -215,8 +219,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
StopDevs sd = 0;
|
||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
|
||||
int.MaxValue, int.MaxValue, tm,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
|
||||
int.MaxValue, int.MaxValue, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
@ -266,8 +269,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
StopDevs sd = 0;
|
||||
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
|
||||
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
|
||||
int.MaxValue, int.MaxValue, tm,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
|
||||
int.MaxValue, int.MaxValue, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
log.DebugFormat(" return Event.None");
|
||||
return Event.None;
|
||||
}
|
||||
@ -484,8 +486,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
|
||||
TestMethods tm = 0;
|
||||
StopDevs sd = StopDevs.RegValveRegulation;
|
||||
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route,
|
||||
50000, 50000, tm,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
|
||||
50000, 50000, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
|
||||
log.WarnFormat("Stop() SendCommand(Stop, {0}, ...)", flowMeterNr);
|
||||
}
|
||||
|
||||
@ -73,10 +73,10 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
public IOperation SetFlowOp(GenericDevices.IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi,
|
||||
float pidCoef, DoubleBox measuredFlow, int timeout)
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout)
|
||||
{
|
||||
return new SetFlowOp(controlBoard, regulValve, fixedRV, fixedPctLo, fixedPctHi,
|
||||
flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout);
|
||||
flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -90,10 +90,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, DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow, int timeout, float filterConstant)
|
||||
{
|
||||
return new SetFlowOp(controlBoard, regulValve, fixedRV, fixedPctLo, fixedPctHi,
|
||||
flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, true);
|
||||
flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, filters, shortPulses, measuredFlow, timeout, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -30,6 +30,8 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
|
||||
readonly double finalReqFlowHi;
|
||||
readonly double reqFlowAve;
|
||||
readonly float pidCoef;
|
||||
readonly int[] filters;
|
||||
readonly int shortPulses;
|
||||
readonly int timeout;
|
||||
readonly bool leaveMeasurementRunning;
|
||||
|
||||
@ -77,7 +79,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, DoubleBox measuredFlow,
|
||||
IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses, DoubleBox measuredFlow,
|
||||
int timeout, bool leaveMeasurementRunning)
|
||||
{
|
||||
if (controlBoard == null) throw new ArgumentNullException("ctrlBoard");
|
||||
@ -114,6 +116,8 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
|
||||
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;
|
||||
@ -128,8 +132,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, DoubleBox measuredFlow, int timeout)
|
||||
: this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, timeout, false)
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
@ -138,8 +142,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, DoubleBox measuredFlow)
|
||||
: this(controlBoard, regValve, fixedRV, fixedPctLo, fixedPctHi, flowMeter, requiredFlowLo, requiredFlowHi, pidCoef, measuredFlow, int.MaxValue, false)
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
@ -220,8 +224,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,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
|
||||
int.MaxValue, int.MaxValue, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
@ -375,8 +378,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
|
||||
TestMethods tm = 0;
|
||||
StopDevs sd = StopDevs.RegValveRegulation;
|
||||
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route,
|
||||
50000, 50000, tm,
|
||||
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, 20, 0, sd);
|
||||
50000, 50000, tm, filters, (int)pidCoef, shortPulses, sd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <param name="measuredFlow">Measured flow [m3/h]</param>
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
IOperation SetFlowOp(IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef,
|
||||
IOperation SetFlowOp(IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses,
|
||||
DoubleBox measuredFlow, int timeout);
|
||||
|
||||
/// <summary>
|
||||
@ -54,7 +54,7 @@ namespace TBF.BenchControl.GenericDevices
|
||||
/// <param name="timeout">Timeout in [s]</param>
|
||||
/// <param name="filter">Passed to SendCommand() as argument filterContant</param>
|
||||
/// <returns>SetFlowOp instance</returns>
|
||||
IOperation SetFlowAndMeasureOp(IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef,
|
||||
IOperation SetFlowAndMeasureOp(IFlowMeter flowMeter, double requiredFlowLo, double requiredFlowHi, float pidCoef, int[] filters, int shortPulses,
|
||||
DoubleBox measuredFlow, int timeout, float filter);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -57,9 +57,6 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
{
|
||||
float simulatedError = 4.5f; /// %
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
|
||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
||||
{
|
||||
@ -81,10 +78,27 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -204,7 +218,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -266,22 +280,15 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -31,6 +31,19 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IScale scale = outPath.Scale as IScale;
|
||||
if (scale == null)
|
||||
{
|
||||
@ -178,22 +191,15 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
@ -237,7 +243,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec, (float)test.TolerRed))
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -442,7 +448,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -464,7 +470,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_detected, qto_detected, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_detected, qto_detected, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
//.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue))
|
||||
.EnterState();
|
||||
do {
|
||||
|
||||
@ -51,10 +51,27 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -87,9 +104,6 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
||||
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
|
||||
|
||||
Event retVal = Event.Done;
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
|
||||
//====================================
|
||||
loop:
|
||||
/// Read pressure and temperature once before calling Bridge.OnTestSelected(...)
|
||||
@ -139,7 +153,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -205,22 +219,15 @@ namespace TBF.BenchControl.TestMethods.Endurance
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -31,27 +31,11 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
||||
HeatMeters.TestParams heatMetersTestParams,
|
||||
Config.Entities.DebugMode debugLevel)
|
||||
{
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (eldeRR != null && eldeRR.Position >= 1 && eldeRR.Position <= 8)
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IScale scale = outPath.Scale as IScale;
|
||||
if (scale == null)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Missing_a_scale);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop
|
||||
}
|
||||
|
||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||
@ -71,16 +55,30 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
||||
if (rangeIx == -1)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -321,7 +319,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do {
|
||||
|
||||
@ -66,6 +66,20 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -210,7 +224,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
State.Create("FixedStartAdvanced : Setting the flow")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -256,22 +270,15 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -350,7 +350,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do {
|
||||
|
||||
@ -331,7 +331,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do {
|
||||
|
||||
@ -272,7 +272,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
@ -36,7 +36,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
return Simulate(test, repetitionNr, isLastRepetition, compoundTestParams, heatMetersTestParams, debugLevel);
|
||||
}
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
|
||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
||||
@ -55,15 +54,31 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
if (rangeIx == -1)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
|
||||
return new List<Event> { Event.ConfigurationError }; /// or Event.UiCmdStop ???
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -76,8 +91,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
|
||||
|
||||
Event retVal = Event.Done;
|
||||
|
||||
LtrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
||||
int totalPulses = (int)(test.Volume / LtrPerRefPulse + 0.5f);
|
||||
|
||||
@ -199,7 +212,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do {
|
||||
@ -300,22 +313,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -39,15 +39,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
|
||||
}
|
||||
|
||||
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
|
||||
IScale scale = outPath.Scale as IScale;
|
||||
if (scale == null)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Missing_a_scale);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
||||
@ -66,23 +63,37 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
|
||||
if (rangeIx == -1)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
}
|
||||
|
||||
if (test.Volume > scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
e.Add(Event.UiCmdStop);
|
||||
return e;
|
||||
}
|
||||
new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -95,8 +106,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
|
||||
|
||||
Event retVal = Event.Done;
|
||||
|
||||
float nextTestVolume = (singleTestParams != null) ? singleTestParams.NextTestVolume
|
||||
: ((compoundTestParams != null) ? compoundTestParams.NextTestVolume
|
||||
: heatMetersTestParams.NextTestVolume);
|
||||
@ -289,7 +298,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do {
|
||||
@ -389,22 +398,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
|
||||
///
|
||||
|
||||
/// Find successfully detected ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -33,15 +33,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
|
||||
HeatMeters.TestParams heatMetersTestParams,
|
||||
Config.Entities.DebugMode debugLevel)
|
||||
{
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
|
||||
IScale scale = outPath.Scale as IScale;
|
||||
if (scale == null)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Missing_a_scale);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
||||
@ -60,17 +57,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
|
||||
if (rangeIx == -1)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
}
|
||||
|
||||
if (test.Volume > scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
e.Add(Event.UiCmdStop);
|
||||
return e;
|
||||
}
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
|
||||
string vlvName = (singleTestParams != null) ? singleTestParams.ValveName
|
||||
@ -80,8 +75,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
|
||||
if (compareValve == null)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Missing_a_valve_for_comparative_method);
|
||||
e.Add(Event.UiCmdStop);
|
||||
return e;
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
int stabTime = (singleTestParams != null) ? singleTestParams.StabTime
|
||||
@ -93,10 +87,26 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
|
||||
DoubleBox measuredRefMass = new DoubleBox();
|
||||
|
||||
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -109,8 +119,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
|
||||
|
||||
Event retVal = Event.Done;
|
||||
|
||||
FloatBox switchTimeStart = new FloatBox(0.001f); /// in seconds, initial value is 1 ms
|
||||
FloatBox switchTimeEnd = new FloatBox(0.001f); /// in seconds, initial value is 1 ms
|
||||
|
||||
@ -295,7 +303,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
do {
|
||||
@ -396,22 +404,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
|
||||
///
|
||||
|
||||
/// Find successfully detected ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -40,15 +40,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
|
||||
}
|
||||
|
||||
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
|
||||
IScale scale = outPath.Scale as IScale;
|
||||
if (scale == null)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Missing_a_scale);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
int rangeIx = 0; /// Default range, used for non-Elde flowmeters
|
||||
if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter)
|
||||
@ -67,9 +64,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
|
||||
if (rangeIx == -1)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
}
|
||||
|
||||
float volumeToTank = (singleTestParams != null) ? singleTestParams.VolumeToTank
|
||||
@ -77,20 +73,33 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
|
||||
if (volumeToTank > scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Volume_to_tank_exceeds_the_scale_capacity);
|
||||
e.Add(Event.UiCmdStop);
|
||||
return e;
|
||||
new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
if (volumeToTank > test.Volume)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Volume_to_tank_is_larger_then_the_test_volume);
|
||||
e.Add(Event.UiCmdStop);
|
||||
return e;
|
||||
new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
@ -291,7 +300,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
|
||||
//------------------------------------------------
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
@ -393,22 +402,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
|
||||
///
|
||||
|
||||
/// Find successfully detected ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -75,6 +75,18 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
return new List<Event> { Event.UiCmdStop };
|
||||
}
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
@ -278,7 +290,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
//------------------------------------------------
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(heatMetersPromptOp)
|
||||
.EnterState();
|
||||
@ -380,21 +392,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
///
|
||||
|
||||
/// Find successfully detected ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
|
||||
@ -35,13 +35,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
|
||||
return Simulate(test, repetitionNr, isLastRepetition, singleTestParams, compoundTestParams);
|
||||
}
|
||||
|
||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||
|
||||
if ((outPath.Scale == null) || !(outPath.Scale is IVolumeMeter))
|
||||
{
|
||||
Bridge.OnError(this, Strings.Missing_a_tank_with_volume_measurement);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
IVolumeMeter tank = outPath.Scale as IVolumeMeter;
|
||||
|
||||
@ -64,23 +62,37 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
|
||||
if (rangeIx == -1)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Flow_meter_temperature_range_does_not_fit_this_test_conditions);
|
||||
e.Add(Event.ConfigurationError); /// or Event.UiCmdStop
|
||||
return e;
|
||||
}
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
}
|
||||
|
||||
if (test.Volume > outPath.Scale.Capacity * Constants.TankFullFactor)
|
||||
{
|
||||
Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity);
|
||||
e.Add(Event.UiCmdStop);
|
||||
return e;
|
||||
}
|
||||
return new List<Event> { Event.ConfigurationError };
|
||||
}
|
||||
|
||||
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Event retVal = Event.Done;
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -93,8 +105,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold1.ReadTempOp(ref TempRefLo1));
|
||||
if (heatMetersPath != null) readTempPressOps.Add(heatMetersPath.TMeterRefCold2.ReadTempOp(ref TempRefLo2));
|
||||
|
||||
Event retVal = Event.Done;
|
||||
|
||||
FloatBox switchTimeStart = new FloatBox(0.001f); /// in seconds, initial value is 1 ms
|
||||
FloatBox switchTimeEnd = new FloatBox(0.001f); /// in seconds, initial value is 1 ms
|
||||
|
||||
@ -222,7 +232,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -277,22 +287,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection
|
||||
///
|
||||
|
||||
/// Find successfully detected ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -84,6 +84,20 @@ namespace TBF.BenchControl.TestMethods.PulsesTest
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -202,7 +216,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTest
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -264,22 +278,15 @@ namespace TBF.BenchControl.TestMethods.PulsesTest
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -85,6 +85,20 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -204,7 +218,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -266,22 +280,15 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
|
||||
@ -25,6 +25,20 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
processDataLoggingOp = null;
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -129,7 +143,7 @@ namespace TBF.BenchControl.TestMethods.RoiDetection
|
||||
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec))
|
||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
@ -37,10 +37,25 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
|
||||
return new List<Event> { Event.Done };
|
||||
}
|
||||
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||
|
||||
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
if (sensPath != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader eldeRR = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if ((eldeRR != null) && (eldeRR.Position >= 1) && (eldeRR.Position <= 8))
|
||||
{
|
||||
filters[eldeRR.Position - 1] = eldeRR.Filter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IList<IOperation> readTempPressOps = new List<IOperation>();
|
||||
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
|
||||
if (benchPath.TempMtrDown != null) readTempPressOps.Add(benchPath.TempMtrDown.ReadTempOp(ref TempDown));
|
||||
@ -100,22 +115,15 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
|
||||
///
|
||||
|
||||
/// Find ROI-s
|
||||
int[] filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
IList<GenericDevices.IRoi> rois = new List<GenericDevices.IRoi>();
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
TBF.BenchControl.Elde.RegisterReader.RegisterReader regr = rr as TBF.BenchControl.Elde.RegisterReader.RegisterReader;
|
||||
if (regr != null)
|
||||
GenericDevices.IRoi cameraRoI = rr as GenericDevices.IRoi;
|
||||
if ((cameraRoI != null) && cameraRoI.Detected)
|
||||
{
|
||||
if (regr.Position >= 1 && regr.Position <= 8) { filters[regr.Position - 1] = regr.Filter; }
|
||||
rois.Add(cameraRoI);
|
||||
}
|
||||
|
||||
GenericDevices.IRoi roi = rr as GenericDevices.IRoi;
|
||||
if (roi != null && roi.Detected)
|
||||
{
|
||||
rois.Add(roi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Find cameras
|
||||
IList<GenericDevices.ICamera> cameras = new List<GenericDevices.ICamera>();
|
||||
@ -163,7 +171,7 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperations(readTempPressOps)
|
||||
.AddOperations(measureOperations)
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, FlowSettingTimeoutSec, (float)test.TolerRed))
|
||||
.AddOperation(outPath.RegulValve.SetFlowAndMeasureOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, filters, (test.TolerRed == 0) ? 0 : 1, RefFlow, FlowSettingTimeoutSec, (float)test.TolerRed))
|
||||
.EnterState();
|
||||
do {
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
|
||||
@ -52,28 +52,27 @@ namespace TBF.Forms
|
||||
passedCountLabel.Text = string.Format("{0}: {1}", Strings.Passed, PassedCount);
|
||||
failedCountLabel.Text = string.Format("{0}: {1}", Strings.Failed, FailedCount);
|
||||
|
||||
#if MUNICH
|
||||
sentCheckBox.Text = Strings.Printed;
|
||||
sentCheckBox.Checked = Sent;
|
||||
sendReloadButton.Enabled = true; /// 'Print again' function always available
|
||||
sendReloadButton.Text = reloadEn ? Strings.Restore : Strings.Print_again;
|
||||
#elif ORACLE_DB
|
||||
sentCheckBox.Text = Strings.Sent;
|
||||
sentCheckBox.Checked = Sent;
|
||||
sendReloadButton.Enabled = (mode != PreviousResultsMode.Show) || !Sent;
|
||||
switch (mode)
|
||||
{
|
||||
case PreviousResultsMode.Show: sendReloadButton.Text = Strings.Save_again; break;
|
||||
case PreviousResultsMode.Reload: sendReloadButton.Text = Strings.Restore; break;
|
||||
case PreviousResultsMode.Fix: sendReloadButton.Text = Strings.Fix; break;
|
||||
}
|
||||
showButton.Text = Strings.Show;
|
||||
#if MUNICH
|
||||
if (mode == PreviousResultsMode.Show) sendReloadButton.Text = Strings.Print_again;
|
||||
sentCheckBox.Text = Strings.Printed;
|
||||
sentCheckBox.Checked = Sent;
|
||||
sendReloadButton.Enabled = true; /// 'Print again' function always available
|
||||
#elif ORACLE_DB
|
||||
sentCheckBox.Text = Strings.Sent;
|
||||
sentCheckBox.Checked = Sent;
|
||||
sendReloadButton.Enabled = (mode != PreviousResultsMode.Show) || !Sent;
|
||||
#else
|
||||
sentCheckBox.Visible = false;
|
||||
sendReloadButton.Enabled = reloadEn;
|
||||
sendReloadButton.Visible = reloadEn;
|
||||
sendReloadButton.Text = Strings.Restore;
|
||||
sendReloadButton.Enabled = (mode != PreviousResultsMode.Show);
|
||||
sendReloadButton.Visible = (mode != PreviousResultsMode.Show);
|
||||
#endif
|
||||
showButton.Text = Strings.Show;
|
||||
}
|
||||
|
||||
public void UpdateSentState(bool sent)
|
||||
@ -103,6 +102,7 @@ namespace TBF.Forms
|
||||
{
|
||||
parent.OnReload(this, new PreviousResultIdEventArgs(BatchNr));
|
||||
}
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
else if (mode == PreviousResultsMode.Fix)
|
||||
{
|
||||
/// Access only to thise who manage production tracing
|
||||
@ -115,6 +115,7 @@ namespace TBF.Forms
|
||||
|
||||
parent.OnReloadAndFix(this, new PreviousResultIdEventArgs(BatchNr));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.18.1205.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1205.0")]
|
||||
[assembly: AssemblyVersion("2.18.1206.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1206.0")]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -31,7 +31,7 @@ namespace Users
|
||||
Metrologists,
|
||||
CalibrationSpecialists,
|
||||
Administrators, // application / network / database administrator
|
||||
#if TURA_IPERL
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
TraceabilityManagement,
|
||||
#endif
|
||||
NrOfGroups, // Number of groups (this is not a GroupID)
|
||||
@ -55,7 +55,7 @@ namespace Users
|
||||
case GID.Metrologists: return Strings.metrologist;
|
||||
case GID.CalibrationSpecialists: return Strings.calibration_specialist;
|
||||
case GID.Administrators: return Strings.administrator;
|
||||
#if TURA_IPERL
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
case GID.TraceabilityManagement: return "správca sledovania vyroby";
|
||||
#endif
|
||||
default: return Strings.invalid;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user