IRegisterReader extended, ReadReferenceForRegisterOp removed, ReadRegisteOp integrated into RegisterReader class, ProcessTabPages updated.
This commit is contained in:
parent
7534fc7c24
commit
3946d26cb4
8
TODO.txt
8
TODO.txt
@ -1,6 +1,4 @@
|
||||
iPerl:
|
||||
- naimplementovat Spooler pre OracleDB
|
||||
- updatovat progress bary pre iPerl comm.
|
||||
- neukladat process data pre UnknownPcbNr... vodomery
|
||||
|
||||
- log pre pevny start, podobne (zarazky) ako pre letmy
|
||||
@ -10,12 +8,10 @@ iPerl:
|
||||
- v iPerlCommunication ponukat stringy v drop-down menu
|
||||
- na Process obrazovke posunut stupacku a rezervoar uplne doprava
|
||||
|
||||
- ked su Q3 part 1 a Q3 part 2 neda sa vybrat cez UI Q3 part 2
|
||||
|
||||
- export the DB (=make a backup of configuration) from TBF program
|
||||
|
||||
|
||||
|
||||
- IRegisterReader: int Position readonly property
|
||||
- IRegisterReader: TestCompleted() implementation and use.
|
||||
|
||||
- 'publish' a 'evaluate' pre vsetky metody
|
||||
- prechadzat na double (results)
|
||||
|
||||
@ -27,7 +27,17 @@ namespace TBF.BenchControl.Cameras.CameraRoi
|
||||
readonly GenericDevices.ICamera camera;
|
||||
public GenericDevices.ICamera Camera { get { return camera; } }
|
||||
|
||||
public float PulsesPerLtr { get { return cameraRoiCfg.ProcParams.GradPerLtr; } }
|
||||
public double PulsesPerLtr { get { return (double)cameraRoiCfg.ProcParams.GradPerLtr; } }
|
||||
public double LtrsPerPulse { get { return ltrsPerPulse; } }
|
||||
readonly double ltrsPerPulse;
|
||||
|
||||
public int WMPulses { get { return wmPulses; } }
|
||||
public int WMRefPulses { get { return wmRefPulses; } }
|
||||
public double WMVolume { get { return ltrsPerPulse * (double)wmPulses; } }
|
||||
|
||||
int wmPulses;
|
||||
int wmRefPulses;
|
||||
|
||||
|
||||
public CameraRoi()
|
||||
{
|
||||
@ -37,6 +47,7 @@ namespace TBF.BenchControl.Cameras.CameraRoi
|
||||
: base(cfg)
|
||||
{
|
||||
cameraRoiCfg = cfg;
|
||||
ltrsPerPulse = (PulsesPerLtr <= float.Epsilon) ? 0 : (1 / PulsesPerLtr);
|
||||
|
||||
if (cfg.DebugLevel != DebugMode.Off)
|
||||
{
|
||||
@ -50,6 +61,17 @@ namespace TBF.BenchControl.Cameras.CameraRoi
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
wmPulses = 0;
|
||||
wmRefPulses = 0;
|
||||
}
|
||||
|
||||
public void TestCompleted()
|
||||
{
|
||||
/// TODO: Implement
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone, Event.Error
|
||||
/// </summary>
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
{
|
||||
public class ReadReferenceForRegisterOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReadReferenceForRegisterOp));
|
||||
public override string ToString() { return string.Format("ReadWaterMeterOp(.,{0},.)", eventDone); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly Event eventDone;
|
||||
IntBox pulses;
|
||||
|
||||
/// <summary>
|
||||
/// Events: or Error
|
||||
/// </summary>
|
||||
/// <param name="register">Flow meter reference</param>
|
||||
/// <param name="flow">Reference to the measured flow variable, value is in bar</param>
|
||||
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
||||
public ReadReferenceForRegisterOp(RegisterReader register, ref IntBox pulses, Event eventDone)
|
||||
{
|
||||
if (register == null) throw new ArgumentNullException("register");
|
||||
this.controlBoard = register.ControlBoard;
|
||||
this.eventDone = eventDone;
|
||||
this.pulses = pulses;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
public ReadReferenceForRegisterOp(RegisterReader register, ref IntBox pulses)
|
||||
: this(register, ref pulses, Event.ReadReferenceDone)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>
|
||||
/// Event.FlowInDone or Event.FlowOutDone
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
pulses.Val = controlBoard.EtPulses(0);
|
||||
return eventDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
{
|
||||
public class ReadRegisterOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReadRegisterOp));
|
||||
public override string ToString() { return string.Format("ReadRegisterOp({0})", reader.Name); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly RegisterReader reader;
|
||||
IntBox pulses;
|
||||
IntBox refPulses;
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone or Event.Error
|
||||
/// </summary>
|
||||
/// <param name="reader">Register reader reference</param>
|
||||
/// <param name="pulses">Reference to a field with the water meter pulses</param>
|
||||
public ReadRegisterOp(GenericDevices.IRegisterReader reader, ref IntBox pulses)
|
||||
{
|
||||
this.reader = reader as RegisterReader;
|
||||
if (reader == null) throw new ArgumentNullException("reader is null or it is not Elde");
|
||||
|
||||
this.pulses = pulses;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone or Event.Error
|
||||
/// </summary>
|
||||
/// <param name="reader">Register reader reference</param>
|
||||
/// <param name="pulses">Reference to a Box with the water meter pulses</param>
|
||||
/// <param name="refPulses">Reference to a Box with the reference flow meter pulses synchronized with the water meter</param>
|
||||
public ReadRegisterOp(GenericDevices.IRegisterReader reader, ref IntBox pulses, ref IntBox refPulses)
|
||||
: this(reader, ref pulses)
|
||||
{
|
||||
this.refPulses = refPulses;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
private void ReadPulses()
|
||||
{
|
||||
pulses.Val = (int)(reader.EndWMState - reader.BeginWMState); /// TODO: replace 0
|
||||
if (refPulses != null)
|
||||
{
|
||||
refPulses.Val = (int)reader.ControlBoard.EtPulses(0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
ReadPulses();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>eventDone</returns>
|
||||
public Event Run()
|
||||
{
|
||||
ReadPulses();
|
||||
return Event.ReadRegisterDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -8,7 +8,7 @@ using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
{
|
||||
public class RegisterReader : ComponentBase, GenericDevices.IRegisterReader
|
||||
public class RegisterReader : ComponentBase, GenericDevices.IRegisterReader, IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RegisterReader));
|
||||
public override string ToString() { return string.Format("FixedStartRegisterReader({0})", Cfg.ToString(1)); }
|
||||
@ -18,56 +18,103 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
public float BeginWMState;
|
||||
public float EndWMState;
|
||||
|
||||
public float PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
||||
public double PulsesPerLtr { get { return (double)registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
||||
public double LtrsPerPulse { get { return ltrsPerPulse; } }
|
||||
readonly double ltrsPerPulse;
|
||||
|
||||
public int WMPulses { get { return wmPulses; } }
|
||||
public int WMRefPulses { get { return wmRefPulses; } }
|
||||
public double WMVolume { get { return ltrsPerPulse * (double)wmPulses; } }
|
||||
|
||||
int wmPulses;
|
||||
int wmRefPulses;
|
||||
IntBox pulsesBox;
|
||||
IntBox refPulsesBox;
|
||||
|
||||
readonly ControlBoardDev controlBoard;
|
||||
|
||||
public readonly ControlBoardDev ControlBoard;
|
||||
|
||||
public RegisterReader()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
public RegisterReader(RegisterReaderCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
registerReaderCfg = cfg;
|
||||
ltrsPerPulse = (cfg.ProcParams.PulsesPerLtr <= float.Epsilon) ? 0 : (1 / cfg.ProcParams.PulsesPerLtr);
|
||||
|
||||
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
/// Prepare data for SendCalibData() control board component method
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
wmPulses = 0;
|
||||
wmRefPulses = 0;
|
||||
}
|
||||
|
||||
public void TestCompleted()
|
||||
{
|
||||
ReadPulses();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone, Event.Error
|
||||
/// </summary>
|
||||
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <param name="pulsesBox">Reference to a variable for the water meter pulses</param>
|
||||
/// <returns>ReadWaterMeter instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadRegisterOp(ref IntBox pulses)
|
||||
public IOperation ReadRegisterOp(ref IntBox pulsesBox)
|
||||
{
|
||||
return new ReadRegisterOp(this, ref pulses);
|
||||
this.pulsesBox = pulsesBox;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone, Event.Error
|
||||
/// </summary>
|
||||
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <param name="pulses">Reference to a variable for the related reference flowmeter pulses</param>
|
||||
/// <param name="pulsesBox">Reference to a variable for the water meter pulses</param>
|
||||
/// <param name="refPulsesBox">Reference to a variable for the related reference flowmeter pulses</param>
|
||||
/// <returns>Reference to operation object instance</returns>
|
||||
public IOperation ReadRegisterOp(ref IntBox pulses, ref IntBox refPulses)
|
||||
public IOperation ReadRegisterOp(ref IntBox pulsesBox, ref IntBox refPulsesBox)
|
||||
{
|
||||
return new ReadRegisterOp(this, ref pulses, ref refPulses);
|
||||
this.pulsesBox = pulsesBox;
|
||||
this.refPulsesBox = refPulsesBox;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: ReadReferenceDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <returns>Reference to operation object instance</returns>
|
||||
public IOperation ReadReferenceForRegisterOp(ref IntBox pulses, ref IntBox refPulses)
|
||||
{
|
||||
return new ReadReferenceForRegisterOp(this, ref pulses);
|
||||
}
|
||||
|
||||
private void ReadPulses()
|
||||
{
|
||||
wmPulses = (int)(EndWMState - BeginWMState); /// TODO: replace 0
|
||||
wmRefPulses = (int)controlBoard.EtPulses(0);
|
||||
|
||||
pulsesBox.Val = wmPulses;
|
||||
if (refPulsesBox != null) refPulsesBox.Val = wmRefPulses;
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
ReadPulses();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>eventDone</returns>
|
||||
public Event Run()
|
||||
{
|
||||
ReadPulses();
|
||||
return Event.ReadRegisterDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,62 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Elde.RegisterReader
|
||||
{
|
||||
public class ReadReferenceForRegisterOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReadReferenceForRegisterOp));
|
||||
public override string ToString() { return string.Format("ReadWaterMeterOp(.,{0},{1},.)", eventDone, registerNr); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly int registerNr; /// 1 .. nr.watermeters
|
||||
readonly Event eventDone;
|
||||
IntBox pulses;
|
||||
|
||||
/// <summary>
|
||||
/// Events: or Error
|
||||
/// </summary>
|
||||
/// <param name="register">Flow meter reference</param>
|
||||
/// <param name="flow">Reference to the measured flow variable, value is in bar</param>
|
||||
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
|
||||
public ReadReferenceForRegisterOp(RegisterReader register, ref IntBox pulses, Event eventDone)
|
||||
{
|
||||
if (register == null) throw new ArgumentNullException("register");
|
||||
this.controlBoard = register.ControlBoard;
|
||||
this.registerNr = register.Position;
|
||||
this.eventDone = eventDone;
|
||||
this.pulses = pulses;
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
public ReadReferenceForRegisterOp(RegisterReader register, ref IntBox pulses)
|
||||
: this(register, ref pulses, Event.ReadReferenceDone)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>
|
||||
/// Event.FlowInDone or Event.FlowOutDone
|
||||
/// </returns>
|
||||
public Event Run()
|
||||
{
|
||||
pulses.Val = (int)controlBoard.EtPulses(registerNr);
|
||||
return eventDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,103 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using log4net;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Elde.RegisterReader
|
||||
{
|
||||
public class ReadRegisterOp : IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(ReadRegisterOp));
|
||||
public override string ToString() { return string.Format("ReadRegisterOp({0})", reader.Name); }
|
||||
|
||||
/// Set by the constructor
|
||||
readonly RegisterReader reader;
|
||||
|
||||
IntBox pulses;
|
||||
int lastPulses;
|
||||
bool lastPulsesValid;
|
||||
|
||||
IntBox refPulses;
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone or Event.Error
|
||||
/// </summary>
|
||||
/// <param name="reader">Register reader reference</param>
|
||||
/// <param name="pulses">Reference to a field with the water meter pulses</param>
|
||||
public ReadRegisterOp(GenericDevices.IRegisterReader reader, ref IntBox pulses)
|
||||
{
|
||||
this.reader = reader as RegisterReader;
|
||||
if (reader == null) throw new ArgumentNullException("reader is null or it is not Elde");
|
||||
|
||||
this.pulses = pulses;
|
||||
lastPulsesValid = false;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone or Event.Error
|
||||
/// </summary>
|
||||
/// <param name="reader">Register reader reference</param>
|
||||
/// <param name="pulses">Reference to a Box with the water meter pulses</param>
|
||||
/// <param name="refPulses">Reference to a Box with the reference flow meter pulses synchronized with the water meter</param>
|
||||
public ReadRegisterOp(GenericDevices.IRegisterReader reader, ref IntBox pulses, ref IntBox refPulses)
|
||||
: this(reader, ref pulses)
|
||||
{
|
||||
this.refPulses = refPulses;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
private void ReadPulses()
|
||||
{
|
||||
if (!lastPulsesValid)
|
||||
{
|
||||
lastPulses = (int)reader.ControlBoard.WMeterPulses(reader.Position);
|
||||
lastPulsesValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
UInt16 lowerWord = reader.ControlBoard.WMeterPulses(reader.Position);
|
||||
int uncorrected = (int)(((uint)lastPulses & 0xFFFF0000) | lowerWord);
|
||||
if (Math.Abs(uncorrected - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected;
|
||||
}
|
||||
else if (Math.Abs(uncorrected + 65536 - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected + 65536;
|
||||
}
|
||||
else if (Math.Abs(uncorrected - 65536 - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected - 65536;
|
||||
}
|
||||
}
|
||||
pulses.Val = lastPulses;
|
||||
|
||||
if (refPulses != null)
|
||||
{
|
||||
refPulses.Val = (int)reader.ControlBoard.EtPulses(reader.Position);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
ReadPulses();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>eventDone</returns>
|
||||
public Event Run()
|
||||
{
|
||||
ReadPulses();
|
||||
return Event.ReadRegisterDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -8,7 +8,7 @@ using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Elde.RegisterReader
|
||||
{
|
||||
public class RegisterReader : ComponentBase, GenericDevices.IRegisterReader
|
||||
public class RegisterReader : ComponentBase, GenericDevices.IRegisterReader, IOperation
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RegisterReader));
|
||||
public override string ToString() { return string.Format("RegisterReader({0})", Cfg.ToString(1)); }
|
||||
@ -16,57 +16,133 @@ namespace TBF.BenchControl.Elde.RegisterReader
|
||||
readonly RegisterReaderCfg registerReaderCfg;
|
||||
|
||||
public int Position { get { return registerReaderCfg.Position; } } /// 1 .. inf
|
||||
public float PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
||||
///
|
||||
public double PulsesPerLtr { get { return (double)registerReaderCfg.ProcParams.PulsesPerLtr; } }
|
||||
public double LtrsPerPulse { get { return ltrsPerPulse; } }
|
||||
readonly double ltrsPerPulse;
|
||||
|
||||
public readonly ControlBoardDev ControlBoard;
|
||||
public int WMPulses { get { return wmPulses; } }
|
||||
public int WMRefPulses { get { return wmRefPulses; } }
|
||||
public double WMVolume { get { return ltrsPerPulse * (double)wmPulses; } }
|
||||
|
||||
int wmPulses;
|
||||
int wmRefPulses;
|
||||
IntBox pulsesBox;
|
||||
IntBox refPulsesBox;
|
||||
|
||||
/// <summary> This is to cope with counter overflow </summary>
|
||||
int lastPulses;
|
||||
bool lastPulsesValid;
|
||||
|
||||
readonly ControlBoardDev controlBoard;
|
||||
|
||||
|
||||
public RegisterReader()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
public RegisterReader(RegisterReaderCfg cfg, IList<Generic.IComponent> components)
|
||||
: base(cfg)
|
||||
{
|
||||
registerReaderCfg = cfg;
|
||||
ltrsPerPulse = (cfg.ProcParams.PulsesPerLtr <= float.Epsilon) ? 0 : (1 / cfg.ProcParams.PulsesPerLtr);
|
||||
|
||||
ControlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (ControlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
controlBoard = (ControlBoardDev)TbfComponents.FindComponent(cfg.ParentName, components);
|
||||
if (controlBoard == null) throw new Exception("Cannot find " + Name + " parent");
|
||||
|
||||
/// Prepare data for SendCalibData() control board component method
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
wmPulses = 0;
|
||||
wmRefPulses = 0;
|
||||
lastPulsesValid = false;
|
||||
}
|
||||
|
||||
public void TestCompleted()
|
||||
{
|
||||
ReadPulses();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone, Event.Error
|
||||
/// </summary>
|
||||
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <param name="pulsesBox">Reference to a variable for the water meter pulses</param>
|
||||
/// <returns>ReadWaterMeter instance reference casted to IOperaton</returns>
|
||||
public IOperation ReadRegisterOp(ref IntBox pulses)
|
||||
public IOperation ReadRegisterOp(ref IntBox pulsesBox)
|
||||
{
|
||||
return new ReadRegisterOp(this, ref pulses);
|
||||
this.pulsesBox = pulsesBox;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: Event.ReadRegisterDone, Event.Error
|
||||
/// </summary>
|
||||
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <param name="pulses">Reference to a variable for the related reference flowmeter pulses</param>
|
||||
/// <param name="pulsesBox">Reference to a variable for the water meter pulses</param>
|
||||
/// <param name="refPulsesBox">Reference to a variable for the related reference flowmeter pulses</param>
|
||||
/// <returns>Reference to operation object instance</returns>
|
||||
public IOperation ReadRegisterOp(ref IntBox pulses, ref IntBox refPulses)
|
||||
public IOperation ReadRegisterOp(ref IntBox pulsesBox, ref IntBox refPulsesBox)
|
||||
{
|
||||
return new ReadRegisterOp(this, ref pulses, ref refPulses);
|
||||
this.pulsesBox = pulsesBox;
|
||||
this.refPulsesBox = refPulsesBox;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: ReadReferenceDone, Error
|
||||
/// </summary>
|
||||
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <returns>Reference to operation object instance</returns>
|
||||
public IOperation ReadReferenceForRegisterOp(ref IntBox pulses, ref IntBox refPulses)
|
||||
{
|
||||
return new ReadReferenceForRegisterOp(this, ref pulses);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadPulses()
|
||||
{
|
||||
if (!lastPulsesValid)
|
||||
{
|
||||
lastPulses = (int)controlBoard.WMeterPulses(Position);
|
||||
lastPulsesValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
UInt16 lowerWord = controlBoard.WMeterPulses(Position);
|
||||
int uncorrected = (int)(((uint)lastPulses & 0xFFFF0000) | lowerWord);
|
||||
if (Math.Abs(uncorrected - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected;
|
||||
}
|
||||
else if (Math.Abs(uncorrected + 65536 - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected + 65536;
|
||||
}
|
||||
else if (Math.Abs(uncorrected - 65536 - lastPulses) <= Int16.MaxValue)
|
||||
{
|
||||
lastPulses = uncorrected - 65536;
|
||||
}
|
||||
}
|
||||
|
||||
wmPulses = lastPulses;
|
||||
wmRefPulses = (int)controlBoard.EtPulses(Position);
|
||||
|
||||
pulsesBox.Val = wmPulses;
|
||||
if (refPulsesBox != null) refPulsesBox.Val = wmRefPulses;
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
lastPulsesValid = false;
|
||||
ReadPulses();
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>eventDone</returns>
|
||||
public Event Run()
|
||||
{
|
||||
ReadPulses();
|
||||
return Event.ReadRegisterDone;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,9 +8,19 @@ namespace TBF.BenchControl.GenericDevices
|
||||
{
|
||||
public interface IRegisterReader : IComponent
|
||||
{
|
||||
float PulsesPerLtr { get; }
|
||||
double PulsesPerLtr { get; } /// Entered by users in configuration
|
||||
double LtrsPerPulse { get; } /// To calculate the volume from WMPulses
|
||||
|
||||
int WMPulses { get; } /// Counted pulses of the water meter
|
||||
double WMVolume { get; } /// Counted volume of the water metter
|
||||
int WMRefPulses { get; } /// 'Gated' reference pulses of the water meters
|
||||
|
||||
void Clear(); /// To be used at the beginning of a test
|
||||
|
||||
void TestCompleted(); /// To be used when the test is completed ...
|
||||
/// ... for more accurate WMPulses, WMRefPulses calculation
|
||||
|
||||
IOperation ReadRegisterOp(ref IntBox pulses);
|
||||
IOperation ReadRegisterOp(ref IntBox pulses, ref IntBox refPulses);
|
||||
IOperation ReadReferenceForRegisterOp(ref IntBox pulses, ref IntBox refPulses);
|
||||
}
|
||||
}
|
||||
|
||||
@ -513,12 +513,14 @@ namespace TBF.BenchControl.Sequences
|
||||
if (testMethodSequence != null && testMethodSequence.CanTest(StateMachine.Procedure.MetersKind))
|
||||
{
|
||||
StateMachine.LoadTestParams(test);
|
||||
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
||||
|
||||
if (BenchInfo != null && sensPath.RegisterReaders != null)
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
if (rr is WaterMeters.iPerl.WaterMeter)
|
||||
(rr as WaterMeters.iPerl.WaterMeter).BenchName = BenchInfo.TestBenchName;
|
||||
if ((rr is WaterMeters.iPerl.WaterMeter) && (BenchInfo != null))
|
||||
{
|
||||
(rr as WaterMeters.iPerl.WaterMeter).BenchName = BenchInfo.TestBenchName;
|
||||
}
|
||||
}
|
||||
|
||||
e = testMethodSequence.Execute(test);
|
||||
@ -570,13 +572,15 @@ namespace TBF.BenchControl.Sequences
|
||||
if (testMethodSequence != null && testMethodSequence.CanTest(StateMachine.Procedure.MetersKind))
|
||||
{
|
||||
StateMachine.LoadTestParams(test);
|
||||
ProcessData.RegisterReaders = sensPath.RegisterReaders;
|
||||
|
||||
if (BenchInfo != null && sensPath.RegisterReaders != null)
|
||||
{
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
if (rr is WaterMeters.iPerl.WaterMeter)
|
||||
(rr as WaterMeters.iPerl.WaterMeter).BenchName = BenchInfo.TestBenchName;
|
||||
}
|
||||
foreach (var rr in sensPath.RegisterReaders)
|
||||
{
|
||||
if ((rr is WaterMeters.iPerl.WaterMeter) && (BenchInfo != null))
|
||||
{
|
||||
(rr as WaterMeters.iPerl.WaterMeter).BenchName = BenchInfo.TestBenchName;
|
||||
}
|
||||
}
|
||||
|
||||
e = testMethodSequence.Execute(test);
|
||||
|
||||
|
||||
@ -8,31 +8,61 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
public static IBenchInfo BenchInfo;
|
||||
|
||||
public static FloatBox AmbientTemp = new FloatBox() { Name = "Ambient Temperature", Format = "F1" }; /// [Celsius]
|
||||
public static FloatBox AmbientTemp = new FloatBox() { Name = "Ambient Temperature", Format = "F1" }; /// [Celsius]
|
||||
public static FloatBox AmbientPressure = new FloatBox() { Name = "Ambient Pressure", Format = "F1" };
|
||||
public static FloatBox AmbientHumidity = new FloatBox() { Name = "Ambient Humidity", Format = "F1" }; /// [%]
|
||||
public static FloatBox TempIn = new FloatBox() { Name = "Temperature In", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox TempOut = new FloatBox() { Name = "Temperature Out", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox TempDiv = new FloatBox() { Name = "Temperature Div", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox AmbientHumidity = new FloatBox() { Name = "Ambient Humidity", Format = "F1" }; /// [%]
|
||||
public static FloatBox TempIn = new FloatBox() { Name = "Temperature In", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox TempOut = new FloatBox() { Name = "Temperature Out", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox TempDiv = new FloatBox() { Name = "Temperature Div", Format = "F2" }; /// [Celsius]
|
||||
public static FloatBox PressureUp = new FloatBox() { Name = "Pressure In", Format = "F3", Factor = 0.01f };
|
||||
public static FloatBox PressureDown = new FloatBox() { Name = "Pressure Out", Format = "F3", Factor = 0.01f };
|
||||
|
||||
public static IntBox RefCount = new IntBox() { Name = "RefCount" };
|
||||
public static FloatBox RefFreq = new FloatBox() { Name = "RefFreq", Format = "F2" };
|
||||
public static FloatBox RefFlow = new FloatBox() { Name = "RefFlow", Format = "F2" }; /// [m3/h]
|
||||
public static float LtrPerRefPulse; /// to calculate ref. volume
|
||||
|
||||
public static FloatBox Mass = new FloatBox() { Name = "Mass", Format = "F3" }; /// [kg]
|
||||
public static FloatBox StartMass = new FloatBox() { Name = "Start Mass", Format = "F3" }; /// [kg]
|
||||
public static FloatBox EndMass = new FloatBox() { Name = "End Mass", Format = "F3" }; /// [kg]
|
||||
public static float LtrPerRefPulse; /// to calculate the ref.volume
|
||||
public static IntBox RefCount = new IntBox() { Name = "RefCount" };
|
||||
public static FloatBox RefFreq = new FloatBox() { Name = "RefFreq", Format = "F2" };
|
||||
public static FloatBox RefFlow = new FloatBox() { Name = "RefFlow", Format = "F2" }; /// [m3/h]
|
||||
|
||||
public static FloatBox Mass = new FloatBox() { Name = "Mass", Format = "F3" }; /// [kg]
|
||||
public static FloatBox StartMass = new FloatBox() { Name = "Start Mass", Format = "F3" }; /// [kg]
|
||||
public static FloatBox EndMass = new FloatBox() { Name = "End Mass", Format = "F3" }; /// [kg]
|
||||
|
||||
public static DateTime TestStartTime;
|
||||
public static DateTime TestEndTime;
|
||||
|
||||
|
||||
public static Results.BatchResults BatchRslts;
|
||||
|
||||
|
||||
public static IRegisterReader[] RegisterReaders;
|
||||
///
|
||||
static ProcessData()
|
||||
{
|
||||
///
|
||||
/// RegisterReaders should never be null, RegisterReader.Length should be Config.Data.WMsCount
|
||||
/// RegisterReader[i] where i = 0..Config.Data.WMsCount-1 may be null and should always be tested
|
||||
///
|
||||
RegisterReaders = new IRegisterReader[Config.Data.WMsCount];
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// To clear process values at the beginning of each test
|
||||
/// </summary>
|
||||
protected void ClearProcessValues()
|
||||
{
|
||||
for (int i = 0; i < RegisterReaders.Length; i++)
|
||||
{
|
||||
if (RegisterReaders[i] != null) RegisterReaders[i].Clear();
|
||||
}
|
||||
|
||||
RefCount.Clear();
|
||||
RefFreq.Clear();
|
||||
RefFlow.Clear();
|
||||
Mass.Clear();
|
||||
StartMass.Clear();
|
||||
EndMass.Clear();
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Statistics of 'continuous' variables (temperature, pressure, flow, etc.)
|
||||
///
|
||||
|
||||
@ -86,30 +86,6 @@ namespace TBF.BenchControl.Sequences
|
||||
protected static FloatBox[] WMVolumes;
|
||||
protected static FloatBox[] WMErrors;
|
||||
|
||||
/// <summary>
|
||||
/// To clear process values at the beginning of each test
|
||||
/// </summary>
|
||||
protected void ClearProcessValues()
|
||||
{
|
||||
//if (WMPulses != null) { for (int i = 0; i < WMPulses.Length; i++) WMPulses[i] = 0; }
|
||||
//if (WMRefPulses != null) { for (int i = 0; i < WMRefPulses.Length; i++) WMPulses[i] = 0; }
|
||||
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||
{
|
||||
WMPulses[i] = 0;
|
||||
WMPulses[i] = 0;
|
||||
WMVolumes[i].Clear();
|
||||
WMErrors[i].Clear();
|
||||
}
|
||||
|
||||
RefCount.Clear();
|
||||
RefFreq.Clear();
|
||||
RefFlow.Clear();
|
||||
Mass.Clear();
|
||||
StartMass.Clear();
|
||||
EndMass.Clear();
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Process data logging
|
||||
|
||||
@ -306,17 +306,17 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
||||
if (meterRslt != null && regReader != null)
|
||||
{
|
||||
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||
meterRslt.PulsesMeter = Convert.ToDouble(WMPulses[i]);
|
||||
meterRslt.PulsesMaster = Convert.ToDouble(WMRefPulses[i]);
|
||||
meterRslt.VolumeStart = 0; /// liter
|
||||
meterRslt.VolumeEnd = 0; /// liter
|
||||
meterRslt.VolumeMeter = (meterRslt.PulsesPerLiter <= float.Epsilon) ? 0 : meterRslt.PulsesMeter / meterRslt.PulsesPerLiter;
|
||||
meterRslt.VolumeRef = tstRslt.ConstMaster * meterRslt.PulsesMaster; /// liter
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
meterRslt.TestDone = meterRslt.Passed;
|
||||
meterRslt.PulsesMeter = Convert.ToDouble(WMPulses[i]);
|
||||
meterRslt.PulsesMaster = Convert.ToDouble(WMRefPulses[i]);
|
||||
meterRslt.VolumeStart = 0; /// liter
|
||||
meterRslt.VolumeEnd = 0; /// liter
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||
meterRslt.TestDone = meterRslt.Passed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -412,13 +412,11 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
meterRslt.PulsesMeter = (isAux == 0 && testParams.SupressTrills) ? 0 : Convert.ToDouble(WMPulses[2 * i + isAux]);
|
||||
meterRslt.PulsesMaster = Convert.ToDouble(WMRefPulses[2 * i + isAux]);
|
||||
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.VolumeStart = 0;
|
||||
meterRslt.VolumeEnd = 0;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
|
||||
meterRslt.VolumeMeter = (regReader.PulsesPerLtr <= float.Epsilon)
|
||||
? 0 : meterRslt.PulsesMeter / meterRslt.PulsesPerLiter;
|
||||
meterRslt.TestTime = tstRslt.TestTime;
|
||||
meterRslt.VolumeStart = 0;
|
||||
meterRslt.VolumeEnd = 0;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
|
||||
if (meterRslt.PulsesMaster != 0)
|
||||
{
|
||||
|
||||
@ -587,15 +587,14 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
/// Optionally supress pulses from the large water meter
|
||||
meterRslt.PulsesMeter = (isAux == 0 && testParams.SupressTrills) ? 0 : Convert.ToDouble(WMPulses[2 * i + isAux]);
|
||||
|
||||
meterRslt.PulsesMaster = Convert.ToDouble(WMRefPulses[2 * i + isAux]);
|
||||
meterRslt.TestTime = cBrd.TTime;
|
||||
meterRslt.VolumeStart = 0;
|
||||
meterRslt.VolumeEnd = 0;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
|
||||
meterRslt.VolumeMeter = (regReader.PulsesPerLtr <= float.Epsilon)
|
||||
? 0 : meterRslt.PulsesMeter / meterRslt.PulsesPerLiter;
|
||||
meterRslt.PulsesMaster = Convert.ToDouble(WMRefPulses[2 * i + isAux]);
|
||||
meterRslt.TestTime = cBrd.TTime;
|
||||
meterRslt.VolumeStart = 0;
|
||||
meterRslt.VolumeEnd = 0;
|
||||
meterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
///
|
||||
if (meterRslt.PulsesMaster != 0)
|
||||
{
|
||||
meterRslt.VolumeMeter *= (tstRslt.PulsesMaster / meterRslt.PulsesMaster);
|
||||
|
||||
@ -285,8 +285,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
||||
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
|
||||
meterRslt.VolumeStart = 0;
|
||||
meterRslt.VolumeEnd = 0;
|
||||
meterRslt.VolumeMeter = (meterRslt.PulsesPerLiter <= float.Epsilon) ? 0 : meterRslt.PulsesMeter / meterRslt.PulsesPerLiter;
|
||||
meterRslt.VolumeRef = tstRslt.ConstMaster * meterRslt.PulsesMaster; /// liter
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
|
||||
}
|
||||
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
|
||||
@ -470,10 +470,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||
else
|
||||
{
|
||||
meterRslt.TestTime = tstRslt.TestTime; /// TODO: Malo by sa citat z dosky
|
||||
meterRslt.VolumeStart = 0; /// liter
|
||||
meterRslt.VolumeEnd = 0; /// liter
|
||||
meterRslt.VolumeMeter = (meterRslt.PulsesPerLiter <= float.Epsilon) ? 0 : meterRslt.PulsesMeter / meterRslt.PulsesPerLiter;
|
||||
meterRslt.VolumeRef = tstRslt.ConstMaster * meterRslt.PulsesMaster; /// liter
|
||||
meterRslt.VolumeStart = 0; /// liter
|
||||
meterRslt.VolumeEnd = 0; /// liter
|
||||
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
|
||||
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
|
||||
}
|
||||
|
||||
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||
|
||||
@ -29,7 +29,9 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
public int MuxBoardNr { get { return iPerlCfg.MuxBoardNr; } }
|
||||
public int Group { get { return iPerlCfg.Group; } }
|
||||
|
||||
public float PulsesPerLtr { get { return iPerlCfg.ProcParams.PulsesPerLtr; } }
|
||||
public double PulsesPerLtr { get { return (double)iPerlCfg.ProcParams.PulsesPerLtr; } }
|
||||
public double LtrsPerPulse { get { return ltrsPerPulse; } }
|
||||
readonly double ltrsPerPulse;
|
||||
|
||||
/// <summary>WaterMeter producer</summary>
|
||||
public string Producer { get { return iPerlCfg.ProcParams.Producer; } }
|
||||
@ -119,6 +121,20 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
public double NominalTestFlow; /// liter per hour
|
||||
|
||||
|
||||
///
|
||||
/// Required for IRegisterReader interface
|
||||
///
|
||||
public int WMPulses { get { return wmPulses; } }
|
||||
public int WMRefPulses { get { return wmRefPulses; } }
|
||||
public double WMVolume { get { return wmVolume; } }
|
||||
public double WMTestTime { get { return wmTestTime; } }
|
||||
|
||||
double wmVolume;
|
||||
int wmPulses;
|
||||
int wmRefPulses;
|
||||
double wmTestTime;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// New calibration factor calculated from the original factor (argument)
|
||||
/// and results of the last test.
|
||||
@ -282,6 +298,8 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
ClearData();
|
||||
|
||||
iPerlCfg = cfg;
|
||||
ltrsPerPulse = (cfg.ProcParams.PulsesPerLtr <= float.Epsilon) ? 0 : (1 / cfg.ProcParams.PulsesPerLtr);
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
@ -429,16 +447,23 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Events: ReadReferenceDone, Error
|
||||
/// Clear data/counters related to a specific tests
|
||||
/// </summary>
|
||||
/// <param name="pulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <param name="refPulses">Reference to a variable for the water meter pulses</param>
|
||||
/// <returns>Reference to operation object instance</returns>
|
||||
public IOperation ReadReferenceForRegisterOp(ref Boxes.IntBox pulses, ref Boxes.IntBox refPulses)
|
||||
public void Clear()
|
||||
{
|
||||
this.pulses = pulses;
|
||||
this.refPulses = refPulses;
|
||||
return this;
|
||||
sampleNr = 0;
|
||||
|
||||
volumeLtr = 0;
|
||||
volumeLtr0 = 0;
|
||||
timestampSec = 0;
|
||||
timestampSec0 = 0;
|
||||
|
||||
ReadPulses();
|
||||
}
|
||||
|
||||
public void TestCompleted()
|
||||
{
|
||||
/// TODO: Implement
|
||||
}
|
||||
|
||||
|
||||
@ -447,6 +472,8 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
Clear();
|
||||
|
||||
/// Reset opto data
|
||||
optoDataCount = 0;
|
||||
TestStartTelegramIx = 0;
|
||||
@ -469,14 +496,6 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
flowNr,
|
||||
StateMachine.CycleStartHH_MI_SS);
|
||||
|
||||
sampleNr = 0;
|
||||
|
||||
volumeLtr = 0;
|
||||
volumeLtr0 = 0;
|
||||
timestampSec = 0;
|
||||
timestampSec0 = 0;
|
||||
|
||||
ReadPulses();
|
||||
StartParsingOptoSerialPort();
|
||||
}
|
||||
|
||||
@ -561,9 +580,14 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
||||
|
||||
void ReadPulses()
|
||||
{
|
||||
pulses.Val = (int)((volumeLtr - volumeLtr0) * (double)PulsesPerLtr + 0.5);
|
||||
if (timeSec != null) timeSec.Val = timestampSec - timestampSec0;
|
||||
if (refPulses != null) refPulses.Val = StateMachine.ControlBoard.EtPulses(0);
|
||||
wmVolume = volumeLtr - volumeLtr0;
|
||||
wmPulses = (int)(wmVolume * (double)PulsesPerLtr + 0.5);
|
||||
wmRefPulses = StateMachine.ControlBoard.EtPulses(0);
|
||||
wmTestTime = timestampSec - timestampSec0;
|
||||
|
||||
pulses.Val = wmPulses;
|
||||
if (refPulses != null) refPulses.Val = wmRefPulses;
|
||||
if (timeSec != null) timeSec.Val = wmTestTime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -400,63 +400,82 @@ namespace TBF.Screens
|
||||
|
||||
massLabel.Text = ProcessData.Mass.ToString();
|
||||
|
||||
///
|
||||
/// Available when setting the flow
|
||||
///
|
||||
refFreqLabel.Text = ProcessData.RefFreq.ToString();
|
||||
refFlowLabel.Text = Utils.FloatToStr(ProcessData.RefFlow.Val, 4);
|
||||
|
||||
|
||||
///
|
||||
/// Available during a test
|
||||
///
|
||||
refPulsesLabel.Text = ProcessData.RefCount.ToString();
|
||||
double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefCount.Val;
|
||||
|
||||
float massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val;
|
||||
massDiffLabel.Text = massDiff.ToString("F3");
|
||||
float volumeCtv = 1001.03f * massDiff / (float)TBF.BenchControl.Formulas.WaterDensityFromTemp(ProcessData.TempOut.Val);
|
||||
volumeCtvLabel.Text = volumeCtv.ToString("F2");
|
||||
double refError = TBF.BenchControl.Formulas.ErrorFromVolumes(refVolume, volumeCtv);
|
||||
refErrorLabel.Text = refError.ToString("F3");
|
||||
|
||||
if (currentMetersKind == MetersKind.Single)
|
||||
if (args.TestPhase == Config.Entities.Progress.FlowSetting)
|
||||
{
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
///
|
||||
/// Available when setting the flow
|
||||
///
|
||||
refFreqLabel.Text = ProcessData.RefFreq.ToString();
|
||||
refFlowLabel.Text = Utils.FloatToStr(ProcessData.RefFlow.Val, 4);
|
||||
}
|
||||
|
||||
if (args.TestPhase == Config.Entities.Progress.FlowSetting ||
|
||||
args.TestPhase == Config.Entities.Progress.Test)
|
||||
{
|
||||
///
|
||||
/// Available during a test
|
||||
///
|
||||
refPulsesLabel.Text = ProcessData.RefCount.ToString();
|
||||
double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefCount.Val;
|
||||
|
||||
float massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val;
|
||||
massDiffLabel.Text = massDiff.ToString("F3");
|
||||
float volumeCtv = 1001.03f * massDiff / (float)TBF.BenchControl.Formulas.WaterDensityFromTemp(ProcessData.TempOut.Val);
|
||||
volumeCtvLabel.Text = volumeCtv.ToString("F2");
|
||||
double refError = TBF.BenchControl.Formulas.ErrorFromVolumes(refVolume, volumeCtv);
|
||||
refErrorLabel.Text = refError.ToString("F3");
|
||||
|
||||
if (currentMetersKind == MetersKind.Single)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length); i++)
|
||||
{
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentMetersKind == MetersKind.Combined)
|
||||
{
|
||||
for (int compMtr = 0; compMtr < Config.Data.CompoundWMsCount; compMtr++)
|
||||
{
|
||||
int end = Math.Min(2 * compMtr + 2, Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length));
|
||||
|
||||
double compoundVolume = 0;
|
||||
for (int i = 2 * compMtr; i < end; i++)
|
||||
{
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
compoundVolume += rr.WMVolume;
|
||||
}
|
||||
}
|
||||
|
||||
volume1zLabel.Text = compoundVolume.ToString("F1");
|
||||
error1zLabel.Text = BenchControl.Formulas.ErrorFromVolumes(compoundVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentMetersKind == MetersKind.Combined)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
/// TODO: Reimplement
|
||||
//volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
||||
//error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
|
||||
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
|
||||
//{
|
||||
// //if (pumpOn != args.PumpOn)
|
||||
// //{
|
||||
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
|
||||
// // else pumpPictureBox.Image = System.Resources.
|
||||
// //}
|
||||
// pumpOn = args.PumpOn;
|
||||
// diverterToTank = args.DivToTank;
|
||||
// Invalidate();
|
||||
//}
|
||||
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
|
||||
//{
|
||||
// //if (pumpOn != args.PumpOn)
|
||||
// //{
|
||||
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
|
||||
// // else pumpPictureBox.Image = System.Resources.
|
||||
// //}
|
||||
// pumpOn = args.PumpOn;
|
||||
// diverterToTank = args.DivToTank;
|
||||
// Invalidate();
|
||||
//}
|
||||
}
|
||||
|
||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||
|
||||
@ -456,26 +456,41 @@ namespace TBF.Screens
|
||||
|
||||
if (currentMetersKind == MetersKind.Single)
|
||||
{
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length); i++)
|
||||
{
|
||||
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentMetersKind == MetersKind.Combined)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (int compMtr = 0; compMtr < Config.Data.CompoundWMsCount; compMtr++)
|
||||
{
|
||||
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
int end = Math.Min(2 * compMtr+2, Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length));
|
||||
|
||||
//volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
||||
//error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||
double compoundVolume = 0;
|
||||
for (int i = 2 * compMtr; i < end; i++)
|
||||
{
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
compoundVolume += rr.WMVolume;
|
||||
}
|
||||
}
|
||||
|
||||
volume1zLabel.Text = compoundVolume.ToString("F1");
|
||||
error1zLabel.Text = BenchControl.Formulas.ErrorFromVolumes(compoundVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -20,6 +20,15 @@ namespace TBF.Screens
|
||||
|
||||
MetersKind currentMetersKind;
|
||||
|
||||
int textBoxesCount;
|
||||
|
||||
Label[] sensor;
|
||||
Label[] pulses;
|
||||
Label[] refPulses;
|
||||
Label[] volume;
|
||||
Label[] error;
|
||||
Label[] passed;
|
||||
|
||||
bool pumpOn = true;
|
||||
bool diverterToTank = true;
|
||||
|
||||
@ -32,6 +41,13 @@ namespace TBF.Screens
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
textBoxesCount = 6;
|
||||
sensor = new Label[] { sensor1Label, sensor2Label, sensor3Label, sensor4Label, sensor5Label, sensor6Label };
|
||||
pulses = new Label[] { pulses1Label, pulses2Label, pulses3Label, pulses4Label, pulses5Label, pulses6Label };
|
||||
refPulses = new Label[] { refPulses1Label, refPulses2Label, refPulses3Label, refPulses4Label, refPulses5Label, refPulses6Label };
|
||||
volume = new Label[] { volume1Label, volume2Label, volume3Label, volume4Label, volume5Label, volume6Label };
|
||||
error = new Label[] { error1Label, error2Label, error3Label, error4Label, error5Label, error6Label };
|
||||
|
||||
Bridge.ProcedureSelectedHandler += delegate(object sndr, ProcedureSelectedEventArgs args)
|
||||
{
|
||||
if (InvokeRequired)
|
||||
@ -355,112 +371,98 @@ namespace TBF.Screens
|
||||
|
||||
void OnProcessDataChanged(object sender, ProcessDataEventArgs args)
|
||||
{
|
||||
/// Top part
|
||||
//airTempLabel.Text = args.AmbientTemp.ToString();
|
||||
//airPressLabel.Text = args.AmbientPressure.ToString();
|
||||
//airHumiLabel.Text = args.AmbientHumidity.ToString();
|
||||
///
|
||||
/// Always available
|
||||
///
|
||||
airTempLabel.Text = ProcessData.AmbientTemp.ToString();
|
||||
airPressLabel.Text = ProcessData.AmbientPressure.ToString();
|
||||
airHumiLabel.Text = ProcessData.AmbientHumidity.ToString();
|
||||
|
||||
//refPulsesLabel.Text = args.RefPulses.ToString();
|
||||
//refFreqLabel.Text = args.FlowMtrFreq.ToString();
|
||||
//refFlowLabel.Text = Utils.FloatToStr(args.Flow.Val, 4);
|
||||
//refVolumeLabel.Text = args.Volume.ToString();
|
||||
tInLabel.Text = ProcessData.TempIn.ToString();
|
||||
tOutLabel.Text = ProcessData.TempOut.ToString();
|
||||
tDivLabel.Text = ProcessData.TempDiv.ToString();
|
||||
|
||||
//regValvePosLabel.Text = args.RegValvePos.ToString();
|
||||
//tDivLabel.Text = args.Tdiv.ToString();
|
||||
prInLabel.Text = ProcessData.PressureUp.ToString();
|
||||
prOutLabel.Text = ProcessData.PressureDown.ToString();
|
||||
|
||||
/// Bottom part
|
||||
/// TODO: Reimplement
|
||||
//pulses1Label.Text = args.TestResult.Meters[0].PulsesMeter.ToString();
|
||||
//refPulses1Label.Text = args.TestResult.Meters[0].PulsesMaster.ToString();
|
||||
//volume1Label.Text = args.TestResult.Meters[0].VolumeMeter.ToString();
|
||||
//error1Label.Text = args.TestResult.Meters[0].VolumeErrorPct.ToString("F2");
|
||||
massLabel.Text = ProcessData.Mass.ToString();
|
||||
|
||||
if (Config.Data.WMsCount >= 2)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses2Label.Text = args.TestResult.Meters[1].PulsesMeter.ToString();
|
||||
//refPulses2Label.Text = args.TestResult.Meters[1].PulsesMaster.ToString();
|
||||
//volume2Label.Text = args.TestResult.Meters[1].VolumeMeter.ToString();
|
||||
//error2Label.Text = args.TestResult.Meters[1].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
if (currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 2)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
||||
//error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
|
||||
if ((currentMetersKind == MetersKind.Single && Config.Data.WMsCount >= 3) ||
|
||||
(currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 4))
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses3Label.Text = args.TestResult.Meters[2].PulsesMeter.ToString();
|
||||
//refPulses3Label.Text = args.TestResult.Meters[2].PulsesMaster.ToString();
|
||||
//volume3Label.Text = args.TestResult.Meters[2].VolumeMeter.ToString();
|
||||
//error3Label.Text = args.TestResult.Meters[2].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
if (Config.Data.WMsCount >= 4)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses4Label.Text = args.TestResult.Meters[3].PulsesMeter.ToString();
|
||||
//refPulses4Label.Text = args.TestResult.Meters[3].PulsesMaster.ToString();
|
||||
//volume4Label.Text = args.TestResult.Meters[3].VolumeMeter.ToString();
|
||||
//error4Label.Text = args.TestResult.Meters[3].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
if (currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 4)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//volume2zLabel.Text = args.TestResult.CombinedMeters[1].VolumeMeter.ToString();
|
||||
//error2zLabel.Text = args.TestResult.CombinedMeters[1].VolumeErrorPct.ToString("F2");
|
||||
if (args.TestPhase == Config.Entities.Progress.FlowSetting)
|
||||
{
|
||||
///
|
||||
/// Available when setting the flow
|
||||
///
|
||||
refFreqLabel.Text = ProcessData.RefFreq.ToString();
|
||||
refFlowLabel.Text = Utils.FloatToStr(ProcessData.RefFlow.Val, 4);
|
||||
}
|
||||
|
||||
if ((currentMetersKind == MetersKind.Single && Config.Data.WMsCount >= 5) ||
|
||||
(currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 6))
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses5Label.Text = args.TestResult.Meters[4].PulsesMeter.ToString();
|
||||
//refPulses5Label.Text = args.TestResult.Meters[4].PulsesMaster.ToString();
|
||||
//volume5Label.Text = args.TestResult.Meters[4].VolumeMeter.ToString();
|
||||
//error5Label.Text = args.TestResult.Meters[4].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
if (Config.Data.WMsCount >= 6)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses6Label.Text = args.TestResult.Meters[5].PulsesMeter.ToString();
|
||||
//refPulses6Label.Text = args.TestResult.Meters[5].PulsesMaster.ToString();
|
||||
//volume6Label.Text = args.TestResult.Meters[5].VolumeMeter.ToString();
|
||||
//error6Label.Text = args.TestResult.Meters[5].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
if (currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 6)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//volume3zLabel.Text = args.TestResult.CombinedMeters[2].VolumeMeter.ToString();
|
||||
//error3zLabel.Text = args.TestResult.CombinedMeters[2].VolumeErrorPct.ToString("F2");
|
||||
if (args.TestPhase == Config.Entities.Progress.FlowSetting ||
|
||||
args.TestPhase == Config.Entities.Progress.Test)
|
||||
{
|
||||
///
|
||||
/// Available during a test
|
||||
///
|
||||
refPulsesLabel.Text = ProcessData.RefCount.ToString();
|
||||
double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefCount.Val;
|
||||
|
||||
float massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val;
|
||||
massDiffLabel.Text = massDiff.ToString("F3");
|
||||
float volumeCtv = 1001.03f * massDiff / (float)TBF.BenchControl.Formulas.WaterDensityFromTemp(ProcessData.TempOut.Val);
|
||||
volumeCtvLabel.Text = volumeCtv.ToString("F2");
|
||||
double refError = TBF.BenchControl.Formulas.ErrorFromVolumes(refVolume, volumeCtv);
|
||||
refErrorLabel.Text = refError.ToString("F3");
|
||||
|
||||
if (currentMetersKind == MetersKind.Single)
|
||||
{
|
||||
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length); i++)
|
||||
{
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentMetersKind == MetersKind.Combined)
|
||||
{
|
||||
for (int compMtr = 0; compMtr < Config.Data.CompoundWMsCount; compMtr++)
|
||||
{
|
||||
int end = Math.Min(2 * compMtr + 2, Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length));
|
||||
|
||||
double compoundVolume = 0;
|
||||
for (int i = 2 * compMtr; i < end; i++)
|
||||
{
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
compoundVolume += rr.WMVolume;
|
||||
}
|
||||
}
|
||||
|
||||
volume1zLabel.Text = compoundVolume.ToString("F1");
|
||||
error1zLabel.Text = BenchControl.Formulas.ErrorFromVolumes(compoundVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//tInLabel.Text = args.Tin.ToString();
|
||||
//tOutLabel.Text = args.Tout.ToString();
|
||||
//prInLabel.Text = args.Pin.ToString();
|
||||
//prOutLabel.Text = args.Pout.ToString();
|
||||
|
||||
//massLabel.Text = args.Mass.ToString();
|
||||
|
||||
//if (args.Mass.Valid && args.StartMass.Valid)
|
||||
//{
|
||||
// massDiffLabel.Text = (args.Mass.Val - args.StartMass.Val).ToString(args.Mass.Format);
|
||||
//}
|
||||
|
||||
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
|
||||
//{
|
||||
// //if (pumpOn != args.PumpOn)
|
||||
// //{
|
||||
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
|
||||
// // else pumpPictureBox.Image = System.Resources.
|
||||
// //}
|
||||
// pumpOn = args.PumpOn;
|
||||
// diverterToTank = args.DivToTank;
|
||||
// Invalidate();
|
||||
//}
|
||||
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
|
||||
//{
|
||||
// //if (pumpOn != args.PumpOn)
|
||||
// //{
|
||||
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
|
||||
// // else pumpPictureBox.Image = System.Resources.
|
||||
// //}
|
||||
// pumpOn = args.PumpOn;
|
||||
// diverterToTank = args.DivToTank;
|
||||
// Invalidate();
|
||||
//}
|
||||
}
|
||||
|
||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||
|
||||
@ -670,8 +670,6 @@
|
||||
<DependentUpon>EntryFormCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\DataEntry\WMStates\EntryFormFactory.cs" />
|
||||
<Compile Include="BenchControl\Elde\FixedStartRegisterReader\ReadReferenceForRegisterOp.cs" />
|
||||
<Compile Include="BenchControl\Elde\FixedStartRegisterReader\ReadRegisterOp.cs" />
|
||||
<Compile Include="BenchControl\Elde\FixedStartRegisterReader\RegisterReader.cs" />
|
||||
<Compile Include="BenchControl\Elde\FixedStartRegisterReader\RegisterReaderCfg.cs" />
|
||||
<Compile Include="BenchControl\Elde\FixedStartRegisterReader\RegisterReaderCfgCtrl.cs">
|
||||
@ -753,8 +751,6 @@
|
||||
<Compile Include="BenchControl\Elde\PressureMeter\PressureMeterCfgCtrl.Designer.cs">
|
||||
<DependentUpon>PressureMeterCfgCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Elde\RegisterReader\ReadReferenceForRegisterOp.cs" />
|
||||
<Compile Include="BenchControl\Elde\RegisterReader\ReadRegisterOp.cs" />
|
||||
<Compile Include="BenchControl\Elde\Pump\Pump.cs" />
|
||||
<Compile Include="BenchControl\Elde\Pump\PumpCfg.cs" />
|
||||
<Compile Include="BenchControl\Elde\Pump\PumpCfgCtrl.cs">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user