From fcfdfeca418450d583d4eb674bb1636949cf48fa Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 10 Sep 2014 12:05:49 +0200 Subject: [PATCH] - COmponent properties 'Position' --> 'Idx0' or 'Idx1' - process data logging, RegulVal position logging - changes for I11+I12, NOK yet --- .../BenchControl/Elde/FlowMeter/FlowMeter.cs | 6 +-- .../Elde/FlowMeter/FlowMeterCfg.cs | 14 +++---- .../Elde/FlowMeter/FlowMeterCfgCtrl.cs | 4 +- .../BenchControl/Elde/FlowMeter/ReadFlowOp.cs | 2 +- .../Elde/PressureMeter/PressureMeter.cs | 8 ++-- .../Elde/PressureMeter/PressureMeterCfg.cs | 16 ++++---- .../PressureMeter/PressureMeterCfgCtrl.cs | 4 +- .../Elde/PressureMeter/ReadPressureOp.cs | 5 ++- .../Elde/RegulValve/ChangeValvePositionOp.cs | 2 +- .../Elde/RegulValve/RegulValve.cs | 15 ++++--- .../Elde/RegulValve/RegulValveCfg.cs | 17 ++++---- .../Elde/RegulValve/RegulValveCfgCtrl.cs | 4 +- .../BenchControl/Elde/RegulValve/SetFlowOp.cs | 4 +- .../RegulValve/SetRegulValvePositionOp.cs | 2 +- .../BenchControl/Elde/StartMeasurementOp.cs | 4 +- .../BenchControl/Elde/TempMeter/ReadTempOp.cs | 5 ++- .../BenchControl/Elde/TempMeter/TempMeter.cs | 16 ++++---- .../Elde/TempMeter/TempMeterCfg.cs | 14 +++---- .../Elde/TempMeter/TempMeterCfgCtrl.cs | 4 +- .../BenchControl/GenericDevices/IFlowMeter.cs | 2 +- .../GenericDevices/IRegulValve.cs | 8 ++++ .../BenchControl/Sequences/SequenceBase.cs | 40 +++++++++---------- .../BenchControl/StateMachine.cs | 2 +- .../FixedStartMassCollectionSeq.cs | 19 ++++++++- .../FlyingStartCollectionMethodSeq.cs | 24 +++++++++-- .../ReferenceFlowmeterCalibrationSeq.cs | 25 ++++++++++-- 26 files changed, 165 insertions(+), 101 deletions(-) diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeter.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeter.cs index 2ff61a6ca..7d59cca11 100644 --- a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeter.cs +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeter.cs @@ -14,7 +14,7 @@ namespace TBF.BenchControl.Elde.FlowMeter private static readonly ILog log = LogManager.GetLogger(typeof(FlowMeter)); public override string ToString() { - return string.Format("FlowMeter({0},{1})", Name, Position); + return string.Format("FlowMeter({0},{1})", Name, Idx1); } public static void ResetStaticProperties() { } @@ -23,7 +23,7 @@ namespace TBF.BenchControl.Elde.FlowMeter public Generic.IComponentCfg Cfg { get { return flowMeterCfg; } } public string Name { get { return flowMeterCfg.Name; } } - public int Position { get { return flowMeterCfg.Position; } } + public int Idx1 { get { return flowMeterCfg.Idx1; } } public IList Corrections { get { return flowMeterCfg.Corrections; } } public readonly ControlBoardDev ControlBoard; @@ -40,7 +40,7 @@ namespace TBF.BenchControl.Elde.FlowMeter if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); nominalFlow = cfg.NominalFlow; - ControlBoard.EtCalib[Position] = NominalFlow; + ControlBoard.EtCalib[Idx1] = NominalFlow; /// Prepare data for SendCalibData() control board component method diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs index 58519eb3e..c27f6de6e 100644 --- a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfg.cs @@ -7,7 +7,7 @@ namespace TBF.BenchControl.Elde.FlowMeter { public class FlowMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg { - public int Position; /// 1..5 + public int Idx1; /// 1..5 public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz @@ -20,23 +20,23 @@ namespace TBF.BenchControl.Elde.FlowMeter /// Flow meter configuration parameters /// /// Flow meter name - /// Position on the control board 1..5 - public FlowMeterCfg(IComponentFactory factory, string name, string parentName, int position, float nominalFlow) + /// Position on the control board 1..5 + public FlowMeterCfg(IComponentFactory factory, string name, string parentName, int idx1, float nominalFlow) : base(factory, name, parentName) { - if (position < 1 || position > 5) throw new ArgumentOutOfRangeException("position"); - this.Position = position; + if (idx1 < 0 || idx1 > 5) throw new ArgumentOutOfRangeException("idx1"); + this.Idx1 = idx1; this.NominalFlow = nominalFlow; } public IComponentCfg Clone() { - return new FlowMeterCfg(Factory, Name, ParentName, Position, NominalFlow); + return new FlowMeterCfg(Factory, Name, ParentName, Idx1, NominalFlow); } public string ToString(int i) { - return string.Format("position={0}, nominalFlow={1}", Position, NominalFlow); + return string.Format("idx1={0}, nominalFlow={1}", Idx1, NominalFlow); } public TBF.Entities.Component CreateDbEntity() diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.cs index 42a0aa92f..11dca31a7 100644 --- a/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/FlowMeterCfgCtrl.cs @@ -53,7 +53,7 @@ namespace TBF.BenchControl.Elde.FlowMeter classNameLabel.Text = config.Factory.ClassName; nameTextBox.Text = config.Name; parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; - positionTextBox.Text = config.Position.ToString(); + positionTextBox.Text = config.Idx1.ToString(); nominalFlowTextBox.Text = config.NominalFlow.ToString(); } @@ -95,7 +95,7 @@ namespace TBF.BenchControl.Elde.FlowMeter config.Name = nameTextBox.Text; config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; - config.Position = int.Parse(positionTextBox.Text); + config.Idx1 = int.Parse(positionTextBox.Text); Utils.TryParseUFloat(nominalFlowTextBox.Text, out config.NominalFlow); } } diff --git a/TestBenchFramework/BenchControl/Elde/FlowMeter/ReadFlowOp.cs b/TestBenchFramework/BenchControl/Elde/FlowMeter/ReadFlowOp.cs index 2068e23b8..c593b6dfe 100644 --- a/TestBenchFramework/BenchControl/Elde/FlowMeter/ReadFlowOp.cs +++ b/TestBenchFramework/BenchControl/Elde/FlowMeter/ReadFlowOp.cs @@ -25,7 +25,7 @@ namespace TBF.BenchControl.Elde.FlowMeter { if (flowMeter == null) throw new ArgumentNullException("flowMeter"); this.controlBoard = flowMeter.ControlBoard; - this.flowMeterNr = flowMeter.Position; + this.flowMeterNr = flowMeter.Idx1; this.eventDone = eventDone; this.flow = flow; diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeter.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeter.cs index e9fbfbf16..853c3ed46 100644 --- a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeter.cs +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeter.cs @@ -15,7 +15,7 @@ namespace TBF.BenchControl.Elde.PressureMeter private static readonly ILog log = LogManager.GetLogger(typeof(PressureMeter)); public override string ToString() { - return string.Format("PressureMeter({0},{1})", Name, Index); + return string.Format("PressureMeter({0},{1})", Name, Idx0); } public static void ResetStaticProperties() { } @@ -28,7 +28,7 @@ namespace TBF.BenchControl.Elde.PressureMeter public readonly ControlBoardDev ControlBoard; - public readonly int Index; /// 0..3 + public readonly int Idx0; /// 0..3 public readonly byte RS485Address; /// 0..255 public PressureMeter(PressureMeterCfg cfg, IList components) @@ -39,11 +39,11 @@ namespace TBF.BenchControl.Elde.PressureMeter ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); - Index = cfg.Position; + Idx0 = cfg.Idx0; RS485Address = cfg.RS485Address; /// Prepare data for SendCalibData() control board component method - ControlBoard.MeretRS485Address[Index] = RS485Address; + ControlBoard.MeretRS485Address[Idx0] = RS485Address; log.Debug(this.ToString()); } diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfg.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfg.cs index 61ee4e6ea..3e34ef317 100644 --- a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfg.cs +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfg.cs @@ -7,8 +7,8 @@ namespace TBF.BenchControl.Elde.PressureMeter { public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg { - public int Position; /// 0..7 - public byte RS485Address; /// 0..255 + public int Idx0; /// 0..3 + public byte RS485Address; /// 0..255 /// Parameterless constructor public PressureMeterCfg() @@ -18,14 +18,14 @@ namespace TBF.BenchControl.Elde.PressureMeter /// Regulation valve configuration parameters /// /// Regulation valve name - /// Position on the control board 1..5 + /// Position on the control board 0..3 /// 0..1023 /// 0..1023 - public PressureMeterCfg(IComponentFactory factory, string name, string parentName, int index, byte rs485Address) + public PressureMeterCfg(IComponentFactory factory, string name, string parentName, int idx0, byte rs485Address) : base(factory, name, parentName) { - if (index < 0 || index > 7) throw new ArgumentOutOfRangeException("Position"); - this.Position = index; + if (idx0 < 0 || idx0 > 3) throw new ArgumentOutOfRangeException("Index (0-based)"); + this.Idx0 = idx0; if (rs485Address < 0 || rs485Address > 255) throw new ArgumentOutOfRangeException("RS485Address"); this.RS485Address = rs485Address; @@ -33,12 +33,12 @@ namespace TBF.BenchControl.Elde.PressureMeter public IComponentCfg Clone() { - return new PressureMeterCfg(Factory, Name, ParentName, Position, RS485Address); + return new PressureMeterCfg(Factory, Name, ParentName, Idx0, RS485Address); } public string ToString(int i) { - return string.Format("index={0}, RS485 address={1}", Position, RS485Address); + return string.Format("idx0={0}, RS485 address={1}", Idx0, RS485Address); } public TBF.Entities.Component CreateDbEntity() diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.cs index 0bf078eee..407c7e60d 100644 --- a/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/PressureMeterCfgCtrl.cs @@ -52,7 +52,7 @@ namespace TBF.BenchControl.Elde.PressureMeter componentNameLabel.Text = config.Factory.ClassName; nameTextBox.Text = config.Name; parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; - positionTextBox.Text = config.Position.ToString(); + positionTextBox.Text = config.Idx0.ToString(); rs485AddressTextBox.Text = config.RS485Address.ToString(); } @@ -93,7 +93,7 @@ namespace TBF.BenchControl.Elde.PressureMeter config.Name = nameTextBox.Text; config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; - config.Position = int.Parse(positionTextBox.Text); + config.Idx0 = int.Parse(positionTextBox.Text); config.RS485Address = (byte)int.Parse(rs485AddressTextBox.Text); } } diff --git a/TestBenchFramework/BenchControl/Elde/PressureMeter/ReadPressureOp.cs b/TestBenchFramework/BenchControl/Elde/PressureMeter/ReadPressureOp.cs index 62ebb3cd6..16ec05464 100644 --- a/TestBenchFramework/BenchControl/Elde/PressureMeter/ReadPressureOp.cs +++ b/TestBenchFramework/BenchControl/Elde/PressureMeter/ReadPressureOp.cs @@ -25,7 +25,7 @@ namespace TBF.BenchControl.Elde.PressureMeter { if (pressureMeter == null) throw new ArgumentNullException("pressureMeter"); this.controlBoardDev = pressureMeter.ControlBoard; - this.pressureMeterNr = pressureMeter.Index; + this.pressureMeterNr = pressureMeter.Idx0; this.eventDone = eventDone; this.pressure = pressure; @@ -39,7 +39,8 @@ namespace TBF.BenchControl.Elde.PressureMeter /// Start this operation public void Start() { - } + pressure.Val = controlBoardDev.Pressure(pressureMeterNr); + } /// Run this operation /// diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs index 594b4d44c..80426ba41 100644 --- a/TestBenchFramework/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/ChangeValvePositionOp.cs @@ -39,7 +39,7 @@ namespace TBF.BenchControl.Elde.RegulValve this.regulValve = regulValve as RegulValve; if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); - this.regulValveNr = this.regulValve.Position; + this.regulValveNr = this.regulValve.Idx1; this.timePulseSec = timePulseSec; diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValve.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValve.cs index 2c11bf0bf..4a2d33625 100644 --- a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValve.cs +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValve.cs @@ -15,7 +15,7 @@ namespace TBF.BenchControl.Elde.RegulValve private static readonly ILog log = LogManager.GetLogger(typeof(RegulValve)); public override string ToString() { - return string.Format("RegulationValve({0},{1})", Name, Position); + return string.Format("RegulationValve({0},{1})", Name, Idx1); } public static void ResetStaticProperties() { } @@ -30,11 +30,16 @@ namespace TBF.BenchControl.Elde.RegulValve readonly ControlBoardDev controlBoard; - public readonly int Position; /// 0..7 + public readonly int Idx1; /// 1..7 public readonly int DacValueClosed; /// 0..1023 public readonly int DacValueOpen; /// 0..1023 public readonly int StableTime; /// 0=200ms, step=50ms, max. 1500ms (max.26) public readonly int FlowStableSec; /// 0..60 sec + /// + public float Position + { + get { return controlBoard.RValvePosition(Idx1); } + } public RegulValve(RegulValveCfg cfg, IList components) { @@ -44,7 +49,7 @@ namespace TBF.BenchControl.Elde.RegulValve controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent"); - this.Position = cfg.Position; + this.Idx1 = cfg.Idx1; this.DacValueClosed = cfg.DacValueClosed; this.DacValueOpen = cfg.DacValueOpen; this.StableTime = cfg.StableTime; @@ -52,8 +57,8 @@ namespace TBF.BenchControl.Elde.RegulValve this.dict = new Dictionary(); - this.controlBoard.RegValveCalib[Position - 1, 0] = (uint)DacValueClosed; - this.controlBoard.RegValveCalib[Position - 1, 1] = (uint)DacValueOpen; + this.controlBoard.RegValveCalib[Idx1 - 1, 0] = (uint)DacValueClosed; + this.controlBoard.RegValveCalib[Idx1 - 1, 1] = (uint)DacValueOpen; log.Debug(this.ToString()); } diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs index 36325da01..bd3a0f311 100644 --- a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfg.cs @@ -10,7 +10,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// /// Stored parameters /// - public int Position; /// 0..7 + public int Idx1; /// 1..7 public int DacValueClosed; /// 0..1023 public int DacValueOpen; /// 0..1023 public int PidCoef; /// 1..100 @@ -26,6 +26,7 @@ namespace TBF.BenchControl.Elde.RegulValve /// Parameterless constructor public RegulValveCfg() { + Idx1 = 1; StableTimeMs = 500; FlowStableSec = 5; } @@ -33,19 +34,19 @@ namespace TBF.BenchControl.Elde.RegulValve /// Regulation valve configuration parameters /// /// Regulation valve name - /// Position on the control board 0..7 + /// Position on the control board 0..7 /// 0..1023 /// 0..1023 /// 1..100 - public RegulValveCfg(IComponentFactory factory, string name, string parentName, int position, int dacValueClosed, int dacValueOpen, int pidCoef, int stableTimeMs, bool storedPositionReuse, int flowStableSec) + public RegulValveCfg(IComponentFactory factory, string name, string parentName, int idx1, int dacValueClosed, int dacValueOpen, int pidCoef, int stableTimeMs, bool storedPositionReuse, int flowStableSec) : base(factory, name, parentName) { - if (position < 0 || position > 7) throw new ArgumentOutOfRangeException("position"); + if (idx1 < 1 || idx1 > 7) throw new ArgumentOutOfRangeException("position"); if (dacValueClosed < 0 || dacValueClosed > 1023) throw new ArgumentOutOfRangeException("dacValueOpen"); if (dacValueOpen < 0 || dacValueOpen > 1023) throw new ArgumentOutOfRangeException("dacValueOpen"); if (pidCoef < 1 || pidCoef > 100) throw new ArgumentOutOfRangeException("pidCoef"); - this.Position = position; + this.Idx1 = idx1; this.DacValueClosed = dacValueClosed; this.DacValueOpen = dacValueOpen; this.PidCoef = pidCoef; @@ -56,13 +57,13 @@ namespace TBF.BenchControl.Elde.RegulValve public IComponentCfg Clone() { - return new RegulValveCfg(Factory, Name, ParentName, Position, DacValueClosed, DacValueOpen, PidCoef, StableTimeMs, StoredPositionReuse, FlowStableSec); + return new RegulValveCfg(Factory, Name, ParentName, Idx1, DacValueClosed, DacValueOpen, PidCoef, StableTimeMs, StoredPositionReuse, FlowStableSec); } public string ToString(int i) { - return string.Format("position={0}, DAC-closed={1}, DAC-open={2}, PID={3}, posReuse={4}, flowStableSec={5}", - Position, DacValueClosed, DacValueOpen, PidCoef, StoredPositionReuse, FlowStableSec); + return string.Format("idx1={0}, DA-closed={1}, DA-open={2}, PID={3}, stabT={4}ms, posReuse={5}, flowStable={6}s", + Idx1, DacValueClosed, DacValueOpen, PidCoef, StableTimeMs, StoredPositionReuse, FlowStableSec); } public TBF.Entities.Component CreateDbEntity() diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs index da0856635..34c868369 100644 --- a/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/RegulValveCfgCtrl.cs @@ -52,7 +52,7 @@ namespace TBF.BenchControl.Elde.RegulValve classNameLabel.Text = config.Factory.ClassName; nameTextBox.Text = config.Name; parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; - positionTextBox.Text = config.Position.ToString(); + positionTextBox.Text = config.Idx1.ToString(); dacClosedTextBox.Text = config.DacValueClosed.ToString(); dacOpenTextBox.Text = config.DacValueOpen.ToString(); pidCoefTextBox.Text = config.PidCoef.ToString(); @@ -124,7 +124,7 @@ namespace TBF.BenchControl.Elde.RegulValve config.Name = nameTextBox.Text; config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; - config.Position = int.Parse(positionTextBox.Text); + config.Idx1 = int.Parse(positionTextBox.Text); config.DacValueClosed = int.Parse(dacClosedTextBox.Text); config.DacValueOpen = int.Parse(dacOpenTextBox.Text); config.PidCoef = int.Parse(pidCoefTextBox.Text); diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs index cc2a022d9..9c8c4fb78 100644 --- a/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/SetFlowOp.cs @@ -66,11 +66,11 @@ namespace TBF.BenchControl.Elde.RegulValve this.regulValve = regulValve as Elde.RegulValve.RegulValve; if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); - this.regulValveNr = this.regulValve.Position; + this.regulValveNr = this.regulValve.Idx1; this.flowMeter = flowMeter as Elde.FlowMeter.FlowMeter; if (flowMeter == null) throw new ArgumentNullException("flowMeter in null or not Elde"); - this.flowMeterNr = this.flowMeter.Position; + this.flowMeterNr = this.flowMeter.Idx1; this.reqFlowLo = requiredFlowLo; this.reqFlowHi = requiredFlowHi; diff --git a/TestBenchFramework/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs b/TestBenchFramework/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs index ecd8d5638..804877c57 100644 --- a/TestBenchFramework/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs +++ b/TestBenchFramework/BenchControl/Elde/RegulValve/SetRegulValvePositionOp.cs @@ -43,7 +43,7 @@ namespace TBF.BenchControl.Elde.RegulValve this.regulValve = regulValve as RegulValve; if (regulValve == null) throw new ArgumentNullException("regValve is null or not Elde"); - this.regulValveNr = this.regulValve.Position; + this.regulValveNr = this.regulValve.Idx1; this.posLoPct = posLoPct; this.posHiPct = posHiPct; diff --git a/TestBenchFramework/BenchControl/Elde/StartMeasurementOp.cs b/TestBenchFramework/BenchControl/Elde/StartMeasurementOp.cs index 117229073..284fed251 100644 --- a/TestBenchFramework/BenchControl/Elde/StartMeasurementOp.cs +++ b/TestBenchFramework/BenchControl/Elde/StartMeasurementOp.cs @@ -6,7 +6,7 @@ namespace TBF.BenchControl.Elde public class StartMeasurementOp : IOperation { private static readonly ILog log = LogManager.GetLogger(typeof(StartMeasurementOp)); - public override string ToString() { return string.Format("StartMeasurementOp(ref={0},pulses={1})", flowMeter.Position, refPulses); } + public override string ToString() { return string.Format("StartMeasurementOp(ref={0},pulses={1})", flowMeter.Idx1, refPulses); } /// Set by the constructor readonly ControlBoardDev controlBoard; @@ -44,7 +44,7 @@ namespace TBF.BenchControl.Elde /// Start this operation public void Start() { - controlBoard.SendCommand(Command.Start, flowMeter.Position, controlBoard.RRoute, refPulses, testMethod, + controlBoard.SendCommand(Command.Start, flowMeter.Idx1, controlBoard.RRoute, refPulses, testMethod, filterConstant, 20, 0, StopDevs.None); } diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/ReadTempOp.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/ReadTempOp.cs index f1c176ff9..b472bd642 100644 --- a/TestBenchFramework/BenchControl/Elde/TempMeter/ReadTempOp.cs +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/ReadTempOp.cs @@ -25,7 +25,7 @@ namespace TBF.BenchControl.Elde.TempMeter { if (tempMeter == null) throw new ArgumentNullException("tempMeter"); this.controlBoardDev = tempMeter.ControlBoard; - this.tempMeterNr = tempMeter.Index; + this.tempMeterNr = tempMeter.Idx0; this.temp = temp; this.eventDone = eventDone; log.Debug(this.ToString()); @@ -38,7 +38,8 @@ namespace TBF.BenchControl.Elde.TempMeter /// Start this operation public void Start() { - } + temp.Val = controlBoardDev.Temperature(tempMeterNr); + } /// Run this operation /// diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeter.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeter.cs index 7a6ae68bb..f24956521 100644 --- a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeter.cs +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeter.cs @@ -15,7 +15,7 @@ namespace TBF.BenchControl.Elde.TempMeter private static readonly ILog log = LogManager.GetLogger(typeof(TempMeter)); public override string ToString() { - return string.Format("TempMeter({0},{1})", Name, Index); + return string.Format("TempMeter({0},{1})", Name, Idx0); } public static void ResetStaticProperties() { } @@ -27,7 +27,7 @@ namespace TBF.BenchControl.Elde.TempMeter public readonly ControlBoardDev ControlBoard; - public readonly int Index; /// 0..7 + public readonly int Idx0; /// 0..7 public readonly float A1; public readonly float A2; public readonly float A3; @@ -42,7 +42,7 @@ namespace TBF.BenchControl.Elde.TempMeter ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components); if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent"); - Index = cfg.Position; + Idx0 = cfg.Idx0; A1 = cfg.A1; A2 = cfg.A2; A3 = cfg.A3; @@ -50,11 +50,11 @@ namespace TBF.BenchControl.Elde.TempMeter A5 = cfg.A5; /// Prepare data for SendCalibData() control board component method - ControlBoard.TempCalibData[Index, 0] = A1; - ControlBoard.TempCalibData[Index, 1] = A2; - ControlBoard.TempCalibData[Index, 2] = A3; - ControlBoard.TempCalibData[Index, 3] = A4; - ControlBoard.TempCalibData[Index, 4] = A5; + ControlBoard.TempCalibData[Idx0, 0] = A1; + ControlBoard.TempCalibData[Idx0, 1] = A2; + ControlBoard.TempCalibData[Idx0, 2] = A3; + ControlBoard.TempCalibData[Idx0, 3] = A4; + ControlBoard.TempCalibData[Idx0, 4] = A5; log.Debug(this.ToString()); } diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfg.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfg.cs index cb7dc18c6..cdcdd0392 100644 --- a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfg.cs +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfg.cs @@ -7,7 +7,7 @@ namespace TBF.BenchControl.Elde.TempMeter { public class TempMeterCfg : ComponentCfgBase, IChildComponentCfg { - public int Position; /// 0..7 + public int Idx0; /// 0..7 public float A1; public float A2; @@ -23,17 +23,17 @@ namespace TBF.BenchControl.Elde.TempMeter /// Temperature meter configuration parameters /// /// Temperature meter name - /// Position on the control board 0..7 + /// Position on the control board 0..7 /// A1 /// A2 /// A3 /// A4 /// A5 - public TempMeterCfg(IComponentFactory factory, string name, string parentName, int index, float a1, float a2, float a3, float a4, float a5) + public TempMeterCfg(IComponentFactory factory, string name, string parentName, int idx0, float a1, float a2, float a3, float a4, float a5) : base(factory, name, parentName) { - if (index < 0 || index > 7) throw new ArgumentOutOfRangeException("position"); - this.Position = index; + if (idx0 < 0 || idx0 > 7) throw new ArgumentOutOfRangeException("position"); + this.Idx0 = idx0; this.A1 = a1; this.A2 = a2; @@ -48,12 +48,12 @@ namespace TBF.BenchControl.Elde.TempMeter public IComponentCfg Clone() { - return new TempMeterCfg(Factory, Name, ParentName, Position, A1, A2, A3, A4, A5); + return new TempMeterCfg(Factory, Name, ParentName, Idx0, A1, A2, A3, A4, A5); } public string ToString(int i) { - return string.Format("index={0}, A1={1}, A2={2}, A3={3}, A4={4}, A5={5}", Position, A1, A2, A3, A4, A5); + return string.Format("idx0={0}, A1={1}, A2={2}, A3={3}, A4={4}, A5={5}", Idx0, A1, A2, A3, A4, A5); } public TBF.Entities.Component CreateDbEntity() diff --git a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.cs b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.cs index c5f3ec2aa..912f4379b 100644 --- a/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.cs +++ b/TestBenchFramework/BenchControl/Elde/TempMeter/TempMeterCfgCtrl.cs @@ -53,7 +53,7 @@ namespace TBF.BenchControl.Elde.TempMeter classNameLabel.Text = config.Factory.ClassName; nameTextBox.Text = config.Name; parentNameComboBox.Text = string.IsNullOrEmpty(config.ParentName) ? "---" : config.ParentName; - positionTextBox.Text = config.Position.ToString(); + positionTextBox.Text = config.Idx0.ToString(); a1TextBox.Text = config.A1.ToString(); a2TextBox.Text = config.A2.ToString(); a3TextBox.Text = config.A3.ToString(); @@ -129,7 +129,7 @@ namespace TBF.BenchControl.Elde.TempMeter config.Name = nameTextBox.Text; config.ParentName = parentNameComboBox.Text.Equals("---") ? string.Empty : parentNameComboBox.Text; - config.Position = int.Parse(positionTextBox.Text); + config.Idx0 = int.Parse(positionTextBox.Text); bool updateOk = Utils.TryParseEFloat(a1TextBox.Text, out config.A1) && Utils.TryParseEFloat(a2TextBox.Text, out config.A2) && Utils.TryParseEFloat(a3TextBox.Text, out config.A3) && diff --git a/TestBenchFramework/BenchControl/GenericDevices/IFlowMeter.cs b/TestBenchFramework/BenchControl/GenericDevices/IFlowMeter.cs index afafd398e..36ea71893 100644 --- a/TestBenchFramework/BenchControl/GenericDevices/IFlowMeter.cs +++ b/TestBenchFramework/BenchControl/GenericDevices/IFlowMeter.cs @@ -17,7 +17,7 @@ namespace TBF.BenchControl.GenericDevices /// /// 1 based index of the reference flowmeter /// - int Position { get; } + int Idx1 { get; } /// /// Measurement correction table diff --git a/TestBenchFramework/BenchControl/GenericDevices/IRegulValve.cs b/TestBenchFramework/BenchControl/GenericDevices/IRegulValve.cs index 4a98d21f4..ac4548e56 100644 --- a/TestBenchFramework/BenchControl/GenericDevices/IRegulValve.cs +++ b/TestBenchFramework/BenchControl/GenericDevices/IRegulValve.cs @@ -7,6 +7,14 @@ namespace TBF.BenchControl.GenericDevices { public interface IRegulValve : IComponent { + /// + /// Regulation valve position 0.0 .. 100.0 % + /// + float Position { get; } + + /// + /// Dictionary for position re-use + /// IDictionary Dict { get; } /// diff --git a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs index e93ccbd55..5235571ca 100644 --- a/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs +++ b/TestBenchFramework/BenchControl/Sequences/SequenceBase.cs @@ -128,9 +128,9 @@ namespace TBF.BenchControl.Sequences #region Temperature_Pressure_Humidity - protected static FloatBox tempIn = new FloatBox() { Name = "Temperature In", Format = "F1" }; - protected static FloatBox tempOut = new FloatBox() { Name = "Temperature Out", Format = "F1" }; - protected static FloatBox tempDiv = new FloatBox() { Name = "Temperature Div", Format = "F1" }; + protected static FloatBox tempIn = new FloatBox() { Name = "Temperature In", Format = "F2" }; + protected static FloatBox tempOut = new FloatBox() { Name = "Temperature Out", Format = "F2" }; + protected static FloatBox tempDiv = new FloatBox() { Name = "Temperature Div", Format = "F2" }; protected static FloatBox pressIn = new FloatBox() { Name = "Pressure In", Format = "F3", Factor = 0.01f }; protected static FloatBox pressOut = new FloatBox() { Name = "Pressure Out", Format = "F3", Factor = 0.01f }; protected static FloatBox airTemperature = new FloatBox() { Name = "Ambient Temperature", Format = "F1" }; @@ -255,17 +255,18 @@ namespace TBF.BenchControl.Sequences { logger.Info(Environment.NewLine); if (sectionName != null) logger.Info(sectionName); - logger.Info("Time Flow Test time Et.vol T.in Tou Tdi Pin Pou Mass VolMM Tam Ham. Pam Rv"); + logger.Info("Time Flow TstTime Et.count Et.vol Tin Tout Tdiv Pin Pout Mass VolMM Tamb Hamb Pamb Rv"); logger.Info(Environment.NewLine); } public void LogProcessData(ILog logger) { - logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14}", - DateTime.Now.ToShortTimeString(), + logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15}", + DateTime.Now.ToLongTimeString(), refFlow, - "Test time", - Formulas.VolumeFromPulses(refCount.Val, 1.0f / ltrPerRefPulse), + StateMachine.ControlBoard.TTime.ToString("F3"), + StateMachine.ControlBoard.EtPulses(0), + Formulas.VolumeFromPulses(StateMachine.ControlBoard.EtPulses(0), 1.0f / ltrPerRefPulse).ToString("F3"), tempIn, tempOut, tempDiv, @@ -276,7 +277,7 @@ namespace TBF.BenchControl.Sequences airTemperature, airHumidity, airPressure, - "Rv"); + outPath.RegulValve.Position.ToString("F1")); } @@ -563,21 +564,21 @@ namespace TBF.BenchControl.Sequences ticTac = !ticTac; State.Create("Read water meters") .AddOperation(checkUiOp) - .AddOperation(realTest ? processDataLoggingOp : null) .AddOperations(measureOperations) .AddOperation(ticTac ? readRegisters1 : readRegisters2) - .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn, Event.TempInDone)) - .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut, Event.TempOutDone)) - .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv, Event.TempDivDone)) - .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn, Event.PressureInDone)) - .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut, Event.PressureOutDone)) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) .AddOperation(realTest ? outPath.Balance.ReadMassOp(ref mass) : null) .AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp()) .AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null) .AddOperation(realTest ? (ticTac ? queryEnd1 : queryEnd2) : null) - .EnterState(); + .AddOperation(realTest ? processDataLoggingOp : null) + .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -585,12 +586,7 @@ namespace TBF.BenchControl.Sequences if (e.Contains(Event.UiCmdStop)) return Event.UiCmdStop; if (e.Contains(Event.MeasurementCompleted)) return Event.MeasurementCompleted; } - while ( !e.Contains(Event.TempInDone) || - !e.Contains(Event.TempOutDone) || - !e.Contains(Event.TempDivDone) || - !e.Contains(Event.PressureInDone) || - !e.Contains(Event.PressureOutDone) || - (realTest && !e.Contains(Event.BalanceDone)) || + while ( (realTest && !e.Contains(Event.BalanceDone)) || !e.Contains(Event.ReadAllRegistersDone)); return Event.Done; diff --git a/TestBenchFramework/BenchControl/StateMachine.cs b/TestBenchFramework/BenchControl/StateMachine.cs index e476d0e8f..e75ef0f71 100644 --- a/TestBenchFramework/BenchControl/StateMachine.cs +++ b/TestBenchFramework/BenchControl/StateMachine.cs @@ -474,7 +474,7 @@ namespace TBF.BenchControl SequenceBase.LtrPerRefPulse = new float[SequenceBase.ReferenceFlowmetersCount]; foreach (var flowmtr in SequenceBase.FlowMeters) { - int ix = flowmtr.Position; + int ix = flowmtr.Idx1; if (ix > 0 && ix <= SequenceBase.ReferenceFlowmetersCount) { SequenceBase.LtrPerRefPulse[ix - 1] = flowmtr.NominalFlow / 7200.0f; diff --git a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 11e7391ff..b8591e3d1 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -159,9 +159,18 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection //------------------------------------------------ State.Create("FlyingStartCollectionMethod : Measuring the start mass") .AddOperation(checkUiOp) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .AddOperation((StateMachine.Ambient != null) + ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null) .AddOperations(measureOperations) .AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5)) - .EnterState(); + .AddOperation(cBrd.UpdateTankWeightOp()) + .AddOperation(processDataLoggingOp) + .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -256,8 +265,16 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection //------------------------------------------------ State.Create("FlyingStartCollectionMethod : Measuring the end mass") .AddOperation(checkUiOp) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .AddOperation((StateMachine.Ambient != null) + ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null) .AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5)) .AddOperation(cBrd.UpdateTankWeightOp()) + .AddOperation(processDataLoggingOp) .EnterState(); do { diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs index 59d716b19..378c57007 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartCollectionMethod/FlyingStartCollectionMethodSeq.cs @@ -40,6 +40,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod /// float timeSec = 3600.0f * timeHr; /// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow)); int totalPulses = (int)(7200.0f * test.Volume / outPath.FlowMeter.NominalFlow); /// Nominal flow in [m3/h] + + /// Double total pulses for 'added' flowmeters + if (outPath.FlowMeter.Cfg.Name.Contains("+")) { totalPulses *= 2; } ltrPerRefPulse = outPath.FlowMeter.NominalFlow / 7200.0f; /// [ltr/pulse] /// @@ -160,10 +163,18 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod //------------------------------------------------ State.Create("FlyingStartCollectionMethod : Measuring the start mass") .AddOperation(checkUiOp) - .AddOperation(processDataLoggingOp) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .AddOperation((StateMachine.Ambient != null) + ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null) .AddOperations(measureOperations) .AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5)) - .EnterState(); + .AddOperation(cBrd.UpdateTankWeightOp()) + .AddOperation(processDataLoggingOp) + .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -262,9 +273,16 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod //------------------------------------------------ State.Create("FlyingStartCollectionMethod : Measuring the end mass") .AddOperation(checkUiOp) - .AddOperation(processDataLoggingOp) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .AddOperation((StateMachine.Ambient != null) + ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null) .AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5)) .AddOperation(cBrd.UpdateTankWeightOp()) + .AddOperation(processDataLoggingOp) .EnterState(); do { diff --git a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs index 14d7fd626..59d2ba444 100644 --- a/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/ReferenceFlowmeterCalibration/ReferenceFlowmeterCalibrationSeq.cs @@ -151,8 +151,17 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration //------------------------------------------------ State.Create("ReferenceFlowmeterCalibration : Measuring the start mass") .AddOperation(checkUiOp) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .AddOperation((StateMachine.Ambient != null) + ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null) .AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5)) - .EnterState(); + .AddOperation(cBrd.UpdateTankWeightOp()) + .AddOperation(processDataLoggingOp) + .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -246,8 +255,16 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration //------------------------------------------------ State.Create("ReferenceFlowmeterCalibration : Measuring the end mass") .AddOperation(checkUiOp) + .AddOperation(benchPath.TempIn.ReadTempOp(ref tempIn)) + .AddOperation(benchPath.TempOut.ReadTempOp(ref tempOut)) + .AddOperation(outPath.TempDiv.ReadTempOp(ref tempDiv)) + .AddOperation(benchPath.PressIn.ReadPressureOp(ref pressIn)) + .AddOperation(benchPath.PressOut.ReadPressureOp(ref pressOut)) + .AddOperation((StateMachine.Ambient != null) + ? StateMachine.Ambient.ReadAmbientOp(airTemperature, airPressure, airHumidity) : null) .AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5)) .AddOperation(cBrd.UpdateTankWeightOp()) + .AddOperation(processDataLoggingOp) .EnterState(); do { @@ -291,10 +308,10 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV; /// Update flowmeter constant with the measured one - if (outPath.FlowMeter.Position > 0 && outPath.FlowMeter.Position <= ReferenceFlowmetersCount) + if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount) { - LtrPerRefPulse[outPath.FlowMeter.Position - 1] = tstRslt.ConstMaster; - log.InfoFormat("Updating LtrPerRefPulse[{0}] = {1}", outPath.FlowMeter.Position - 1, tstRslt.ConstMaster); + LtrPerRefPulse[outPath.FlowMeter.Idx1 - 1] = tstRslt.ConstMaster; + log.InfoFormat("Updating LtrPerRefPulse[{0}] = {1}", outPath.FlowMeter.Idx1 - 1, tstRslt.ConstMaster); } } tstRslt.TimeDivStart0 = 0;