Many changes, new results used, all test sequences modified, simulated tests rewritten.
This commit is contained in:
parent
494c6edf76
commit
26982a5729
1
Questions.txt
Normal file
1
Questions.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Test StartTime: when? Start of flow set or start of real test?
|
||||||
@ -8,6 +8,8 @@ namespace Results
|
|||||||
{
|
{
|
||||||
public class BatchResults
|
public class BatchResults
|
||||||
{
|
{
|
||||||
|
public readonly int WMPositionsCount;
|
||||||
|
|
||||||
public IList<Entities.TestData> TestDataList;
|
public IList<Entities.TestData> TestDataList;
|
||||||
public IList<Entities.Components> ComponentsList;
|
public IList<Entities.Components> ComponentsList;
|
||||||
public IList<Entities.WaterMeterData> WaterMeterDataList;
|
public IList<Entities.WaterMeterData> WaterMeterDataList;
|
||||||
@ -17,45 +19,38 @@ namespace Results
|
|||||||
public IDictionary<string, MeterTestRslt>[] MainMeterTestRsltsMap;
|
public IDictionary<string, MeterTestRslt>[] MainMeterTestRsltsMap;
|
||||||
public IDictionary<string, MeterTestRslt>[] AuxMeterTestRsltsMap;
|
public IDictionary<string, MeterTestRslt>[] AuxMeterTestRsltsMap;
|
||||||
|
|
||||||
private BatchResults()
|
private BatchResults(int wmPositionsCount)
|
||||||
{
|
{
|
||||||
|
WMPositionsCount = wmPositionsCount;
|
||||||
|
|
||||||
TestDataList = new List<Entities.TestData>();
|
TestDataList = new List<Entities.TestData>();
|
||||||
ComponentsList = new List<Entities.Components>();
|
ComponentsList = new List<Entities.Components>();
|
||||||
WaterMeterDataList = new List<Entities.WaterMeterData>();
|
WaterMeterDataList = new List<Entities.WaterMeterData>();
|
||||||
|
|
||||||
TestRsltsMap = new Dictionary<string, TestRslt>();
|
TestRsltsMap = new Dictionary<string, TestRslt>();
|
||||||
|
MeterTestRsltsMap = new Dictionary<string, MeterTestRslt>[WMPositionsCount];
|
||||||
|
MainMeterTestRsltsMap = new Dictionary<string, MeterTestRslt>[WMPositionsCount];
|
||||||
|
AuxMeterTestRsltsMap = new Dictionary<string, MeterTestRslt>[WMPositionsCount];
|
||||||
|
|
||||||
|
for (int wmnr = 0; wmnr < WMPositionsCount; wmnr++)
|
||||||
|
{
|
||||||
|
MeterTestRsltsMap[wmnr] = new Dictionary<string, MeterTestRslt>();
|
||||||
|
MainMeterTestRsltsMap[wmnr] = new Dictionary<string, MeterTestRslt>();
|
||||||
|
AuxMeterTestRsltsMap[wmnr] = new Dictionary<string, MeterTestRslt>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int WMPositionsCount;
|
|
||||||
|
|
||||||
public Batch Batch;
|
public Batch Batch;
|
||||||
public WaterMeter[] WaterMeters;
|
public WaterMeter[] WaterMeters;
|
||||||
public IList<TestRslt> TestRslts;
|
public IList<TestRslt> TestRslts;
|
||||||
public IList<TestRslt> MeterTestRslts;
|
public IList<TestRslt> MeterTestRslts;
|
||||||
|
|
||||||
public static BatchResults NewFromProcedure(int batchNr,
|
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, string programVer,
|
||||||
int benchId,
|
Config.Entities.Procedure procedure,
|
||||||
string user,
|
WaterMeterData[] waterMeterDatas, int[] waterMeterParts)
|
||||||
string programVer,
|
|
||||||
Config.Entities.Procedure procedure,
|
|
||||||
WaterMeterData[] waterMeterDatas,
|
|
||||||
int[] waterMeterParts)
|
|
||||||
{
|
{
|
||||||
BatchResults d = new BatchResults();
|
BatchResults d = new BatchResults(waterMeterDatas.Length);
|
||||||
|
|
||||||
d.WMPositionsCount = waterMeterDatas.Length;
|
|
||||||
///
|
|
||||||
d.MeterTestRsltsMap = new Dictionary<string, MeterTestRslt>[d.WMPositionsCount];
|
|
||||||
d.MainMeterTestRsltsMap = new Dictionary<string, MeterTestRslt>[d.WMPositionsCount];
|
|
||||||
d.AuxMeterTestRsltsMap = new Dictionary<string, MeterTestRslt>[d.WMPositionsCount];
|
|
||||||
for (int wmnr = 0; wmnr < d.WMPositionsCount; wmnr++)
|
|
||||||
{
|
|
||||||
d.MeterTestRsltsMap[wmnr] = new Dictionary<string, MeterTestRslt>();
|
|
||||||
d.MainMeterTestRsltsMap[wmnr] = new Dictionary<string, MeterTestRslt>();
|
|
||||||
d.AuxMeterTestRsltsMap[wmnr] = new Dictionary<string, MeterTestRslt>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create new batch
|
/// Create new batch
|
||||||
d.Batch = new Batch()
|
d.Batch = new Batch()
|
||||||
@ -154,6 +149,26 @@ namespace Results
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true when all tests were done
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>true = all tests done</returns>
|
||||||
|
public bool AllTestsDone()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < WMPositionsCount; i++)
|
||||||
|
{
|
||||||
|
if (WaterMeters[i] != null)
|
||||||
|
{
|
||||||
|
foreach (var mtr in WaterMeters[i].MeterTestRslts)
|
||||||
|
{
|
||||||
|
if (!mtr.TestDone) return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds non-null water meters from an array to a Batch water meters list.
|
/// Adds non-null water meters from an array to a Batch water meters list.
|
||||||
/// This method should be used when results are prepared and
|
/// This method should be used when results are prepared and
|
||||||
|
|||||||
@ -10,9 +10,10 @@ namespace Results.Entities
|
|||||||
public virtual int Id { get; protected set; }
|
public virtual int Id { get; protected set; }
|
||||||
|
|
||||||
public virtual byte CompoundMeterId { get; set; } /// 0=single, 1=compound/main, 2=compound/aux., 3=compound/overal
|
public virtual byte CompoundMeterId { get; set; } /// 0=single, 1=compound/main, 2=compound/aux., 3=compound/overal
|
||||||
public virtual double PulsesMeter { get; set; } /// # of pulses
|
public virtual double PulsesMeter { get; set; } /// # of water meter pulses
|
||||||
public virtual double PulsesMaster { get; set; }
|
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
|
||||||
public virtual double VolumeStart { get; set; } /// liter
|
public virtual double PulsesPerLiter { get; set; } /// # of water meter pulses per one liter
|
||||||
|
public virtual double VolumeStart { get; set; } /// liter
|
||||||
public virtual double VolumeEnd { get; set; } /// liter
|
public virtual double VolumeEnd { get; set; } /// liter
|
||||||
public virtual double VolumeMeter { get; set; } /// liter
|
public virtual double VolumeMeter { get; set; } /// liter
|
||||||
public virtual double VolumeRef { get; set; } /// liter
|
public virtual double VolumeRef { get; set; } /// liter
|
||||||
@ -32,7 +33,7 @@ namespace Results.Entities
|
|||||||
public virtual DateTime EndTime() { return TestRslt.EndTime; }
|
public virtual DateTime EndTime() { return TestRslt.EndTime; }
|
||||||
public virtual double FlowSetTime() { return TestRslt.FlowSetTime; }
|
public virtual double FlowSetTime() { return TestRslt.FlowSetTime; }
|
||||||
public virtual double FlowMass() { return TestRslt.FlowMass; }
|
public virtual double FlowMass() { return TestRslt.FlowMass; }
|
||||||
public virtual double FlowCTV() { return TestRslt.FlowCTV; }
|
public virtual double FlowCTV() { return TestRslt.FlowVolume; }
|
||||||
public virtual double ErrorMaster() { return TestRslt.ErrorMaster; }
|
public virtual double ErrorMaster() { return TestRslt.ErrorMaster; }
|
||||||
public virtual Components Components(){ return TestRslt.Components; }
|
public virtual Components Components(){ return TestRslt.Components; }
|
||||||
///
|
///
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Results.Entities
|
|||||||
/// Main results
|
/// Main results
|
||||||
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
|
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
|
||||||
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
|
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
|
||||||
public virtual double FlowSetTime { get; set; } /// [s] Measurement time in seconds
|
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
|
||||||
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
|
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
|
||||||
public virtual double PulsesMaster { get; set; }
|
public virtual double PulsesMaster { get; set; }
|
||||||
public virtual double ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
|
public virtual double ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
|
||||||
@ -27,13 +27,12 @@ namespace Results.Entities
|
|||||||
public virtual double MassStart { get; set; } /// [kg]
|
public virtual double MassStart { get; set; } /// [kg]
|
||||||
public virtual double MassEndRaw { get; set; } /// [kg]
|
public virtual double MassEndRaw { get; set; } /// [kg]
|
||||||
public virtual double MassEnd { get; set; } /// [kg]
|
public virtual double MassEnd { get; set; } /// [kg]
|
||||||
public virtual double MassDiff { get; set; } /// [kg]
|
|
||||||
public virtual double DensityIn { get; set; } /// [kg/m3]
|
public virtual double DensityIn { get; set; } /// [kg/m3]
|
||||||
public virtual double DensityOut { get; set; } /// [kg/m3]
|
public virtual double DensityOut { get; set; } /// [kg/m3]
|
||||||
public virtual double DensityDiv { get; set; } /// [kg/m3]
|
public virtual double DensityDiv { get; set; } /// [kg/m3]
|
||||||
public virtual double Buoyancy { get; set; }
|
public virtual double Buoyancy { get; set; }
|
||||||
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
|
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
|
||||||
public virtual double FlowCTV { get; set; } ///![m3/h] calculated from conventional true value
|
public virtual double FlowVolume { get; set; } ///![m3/h]
|
||||||
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||||
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||||
public virtual double ErrorMaster { get; set; } /// [%]
|
public virtual double ErrorMaster { get; set; } /// [%]
|
||||||
@ -80,11 +79,7 @@ namespace Results.Entities
|
|||||||
public virtual float Custom8 { get; set; }
|
public virtual float Custom8 { get; set; }
|
||||||
|
|
||||||
/// Wrappers
|
/// Wrappers
|
||||||
public virtual string Name()
|
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
|
||||||
{
|
|
||||||
if (TestData.Repeats == 1) { return TestData.Name; }
|
|
||||||
else { return string.Format("{0} ({1}/{2})", TestData.Name, RepetitionNr, TestData.Repeats); }
|
|
||||||
}
|
|
||||||
public virtual int Repeats() { return TestData.Repeats; }
|
public virtual int Repeats() { return TestData.Repeats; }
|
||||||
public virtual double Qfrom() { return TestData.Qfrom; }
|
public virtual double Qfrom() { return TestData.Qfrom; }
|
||||||
public virtual double Qto() { return TestData.Qto; }
|
public virtual double Qto() { return TestData.Qto; }
|
||||||
|
|||||||
@ -9,7 +9,8 @@ namespace Results.Entities
|
|||||||
public class WaterMeter
|
public class WaterMeter
|
||||||
{
|
{
|
||||||
public virtual int Id { get; protected set; }
|
public virtual int Id { get; protected set; }
|
||||||
public virtual string SerialNr { get; set; } /// PCB Number for iPerl water meter
|
public virtual string SerialNr { get; set; } /// Main s/n for compound meters, PCB Number for iPerl water meter
|
||||||
|
public virtual string SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
|
||||||
public virtual string PurchaseOrder { get; set; }
|
public virtual string PurchaseOrder { get; set; }
|
||||||
public virtual int WMPosition { get; set; }
|
public virtual int WMPosition { get; set; }
|
||||||
public virtual string EndState { get; set; }
|
public virtual string EndState { get; set; }
|
||||||
@ -18,7 +19,6 @@ namespace Results.Entities
|
|||||||
public virtual int YearOfProduction { get; set; }
|
public virtual int YearOfProduction { get; set; }
|
||||||
public virtual bool Passed { get; set; }
|
public virtual bool Passed { get; set; }
|
||||||
#if IPERLST
|
#if IPERLST
|
||||||
public virtual int SerialNrEx { get; set; } /// iPerl : This is the serial number assigned later
|
|
||||||
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
|
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
|
||||||
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
|
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
|
||||||
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||||
|
|||||||
@ -14,6 +14,7 @@ namespace Results.Mappings
|
|||||||
Map(x => x.CompoundMeterId);
|
Map(x => x.CompoundMeterId);
|
||||||
Map(x => x.PulsesMeter);
|
Map(x => x.PulsesMeter);
|
||||||
Map(x => x.PulsesMaster);
|
Map(x => x.PulsesMaster);
|
||||||
|
Map(x => x.PulsesPerLiter);
|
||||||
Map(x => x.VolumeStart);
|
Map(x => x.VolumeStart);
|
||||||
Map(x => x.VolumeEnd);
|
Map(x => x.VolumeEnd);
|
||||||
Map(x => x.VolumeMeter);
|
Map(x => x.VolumeMeter);
|
||||||
|
|||||||
@ -27,13 +27,12 @@ namespace Results.Mappings
|
|||||||
Map(x => x.MassStart);
|
Map(x => x.MassStart);
|
||||||
Map(x => x.MassEndRaw);
|
Map(x => x.MassEndRaw);
|
||||||
Map(x => x.MassEnd);
|
Map(x => x.MassEnd);
|
||||||
Map(x => x.MassDiff);
|
|
||||||
Map(x => x.DensityIn);
|
Map(x => x.DensityIn);
|
||||||
Map(x => x.DensityOut);
|
Map(x => x.DensityOut);
|
||||||
Map(x => x.DensityDiv);
|
Map(x => x.DensityDiv);
|
||||||
Map(x => x.Buoyancy);
|
Map(x => x.Buoyancy);
|
||||||
Map(x => x.FlowMass);
|
Map(x => x.FlowMass);
|
||||||
Map(x => x.FlowCTV);
|
Map(x => x.FlowVolume);
|
||||||
Map(x => x.VolumeCTV);
|
Map(x => x.VolumeCTV);
|
||||||
Map(x => x.VolumeMaster);
|
Map(x => x.VolumeMaster);
|
||||||
Map(x => x.ErrorMaster);
|
Map(x => x.ErrorMaster);
|
||||||
|
|||||||
@ -12,6 +12,7 @@ namespace Results.Mappings
|
|||||||
{
|
{
|
||||||
Id(x => x.Id);
|
Id(x => x.Id);
|
||||||
Map(x => x.SerialNr);
|
Map(x => x.SerialNr);
|
||||||
|
Map(x => x.SerialNrEx);
|
||||||
Map(x => x.PurchaseOrder);
|
Map(x => x.PurchaseOrder);
|
||||||
Map(x => x.WMPosition);
|
Map(x => x.WMPosition);
|
||||||
Map(x => x.EndState);
|
Map(x => x.EndState);
|
||||||
@ -20,7 +21,6 @@ namespace Results.Mappings
|
|||||||
Map(x => x.YearOfProduction);
|
Map(x => x.YearOfProduction);
|
||||||
Map(x => x.Passed);
|
Map(x => x.Passed);
|
||||||
#if IPERLST
|
#if IPERLST
|
||||||
Map(x => x.SerialNrEx);
|
|
||||||
Map(x => x.OrigCalibFactor);
|
Map(x => x.OrigCalibFactor);
|
||||||
Map(x => x.CalibFactor);
|
Map(x => x.CalibFactor);
|
||||||
Map(x =? x.Q2CorrectionDone);
|
Map(x =? x.Q2CorrectionDone);
|
||||||
|
|||||||
@ -73,6 +73,7 @@
|
|||||||
<Compile Include="Mappings\WaterMeterDataMap.cs" />
|
<Compile Include="Mappings\WaterMeterDataMap.cs" />
|
||||||
<Compile Include="Mappings\WaterMeterMap.cs" />
|
<Compile Include="Mappings\WaterMeterMap.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Utils.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Config\Config.csproj">
|
<ProjectReference Include="..\Config\Config.csproj">
|
||||||
|
|||||||
14
Results/Utils.cs
Normal file
14
Results/Utils.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Results
|
||||||
|
{
|
||||||
|
public static class Utils
|
||||||
|
{
|
||||||
|
public static string GetTestName(string name, int repeats, int repetitionNr)
|
||||||
|
{
|
||||||
|
if (repeats == 1) return name;
|
||||||
|
return string.Format("{0} ({1}/{2})", name, repetitionNr, repeats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -73,13 +73,13 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
radioButton2.Text = ProtocolName2;
|
radioButton2.Text = ProtocolName2;
|
||||||
radioButton3.Text = ProtocolName3;
|
radioButton3.Text = ProtocolName3;
|
||||||
|
|
||||||
qRise1TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qrise, 3);
|
qRise1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||||
qFall1TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qfall, 3);
|
qFall1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||||
|
|
||||||
if (Config.Data.CompoundWMsCount >= 2)
|
if (Config.Data.CompoundWMsCount >= 2)
|
||||||
{
|
{
|
||||||
qRise2TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qrise, 3);
|
qRise2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||||
qFall2TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qfall, 3);
|
qFall2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -89,8 +89,8 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
|
|
||||||
if (Config.Data.CompoundWMsCount >= 3)
|
if (Config.Data.CompoundWMsCount >= 3)
|
||||||
{
|
{
|
||||||
qRise3TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qrise, 3);
|
qRise3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||||
qFall3TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qfall, 3);
|
qFall3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,9 +43,9 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
|
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float errLimLo;
|
double errLimLo;
|
||||||
float errLimHi;
|
double errLimHi;
|
||||||
|
|
||||||
bool resultSaved;
|
bool resultSaved;
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>Reference to the operation</returns>
|
/// <returns>Reference to the operation</returns>
|
||||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
public IOperation ShowTestEndFormOp(double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||||
currentOp = CurrentOp.EnterTestEndStates;
|
currentOp = CurrentOp.EnterTestEndStates;
|
||||||
|
|||||||
@ -35,9 +35,9 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
public float[] AuxEndState;
|
public float[] AuxEndState;
|
||||||
|
|
||||||
bool endStates; /// false=start states, true=end states
|
bool endStates; /// false=start states, true=end states
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||||
|
|
||||||
int TextBoxesCount;
|
int TextBoxesCount;
|
||||||
///
|
///
|
||||||
@ -103,7 +103,7 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
public TestStartEndForm(int waterMetersCount, string[] mainStartStateStr, string[] auxStartStateStr,
|
public TestStartEndForm(int waterMetersCount, string[] mainStartStateStr, string[] auxStartStateStr,
|
||||||
bool[] disabled, float refVolume, float errLimLo, float errLimHi)
|
bool[] disabled, double refVolume, double errLimLo, double errLimHi)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
endStates = true;
|
endStates = true;
|
||||||
@ -290,12 +290,12 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void main1EndTextBox_TextChanged(object sender, EventArgs e)
|
private void main1EndTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//float err = 0;
|
//double err = 0;
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
// float endState = Utils.ParseUFloat(main1EndTextBox.Text);
|
// float endState = Utils.ParseUFloat(main1EndTextBox.Text);
|
||||||
// float startState = Utils.ParseUFloat(main1StartTextBox.Text);
|
// float startState = Utils.ParseUFloat(main1StartTextBox.Text);
|
||||||
// err = 100.0f * (endState - startState - refVolume) / refVolume;
|
// err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
//}
|
//}
|
||||||
//catch { };
|
//catch { };
|
||||||
|
|
||||||
@ -304,12 +304,12 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
|
|
||||||
private void aux1EndTextBox_TextChanged(object sender, EventArgs e)
|
private void aux1EndTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//float err = 0;
|
//double err = 0;
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
// float endState = Utils.ParseUFloat(aux1EndTextBox.Text);
|
// float endState = Utils.ParseUFloat(aux1EndTextBox.Text);
|
||||||
// float startState = Utils.ParseUFloat(aux1StartTextBox.Text);
|
// float startState = Utils.ParseUFloat(aux1StartTextBox.Text);
|
||||||
// err = 100.0f * (endState - startState - refVolume) / refVolume;
|
// err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
//}
|
//}
|
||||||
//catch { err = 1000.0f; };
|
//catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -318,12 +318,12 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
|
|
||||||
private void main2EndTextBox_TextChanged(object sender, EventArgs e)
|
private void main2EndTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//float err = 0;
|
//double err = 0;
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
// float endState = Utils.ParseUFloat(main2EndTextBox.Text);
|
// float endState = Utils.ParseUFloat(main2EndTextBox.Text);
|
||||||
// float startState = Utils.ParseUFloat(main2StartTextBox.Text);
|
// float startState = Utils.ParseUFloat(main2StartTextBox.Text);
|
||||||
// err = 100.0f * (endState - startState - refVolume) / refVolume;
|
// err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
//}
|
//}
|
||||||
//catch { err = 1000.0f; };
|
//catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -332,12 +332,12 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
|
|
||||||
private void aux2EndTextBox_TextChanged(object sender, EventArgs e)
|
private void aux2EndTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//float err = 0;
|
//double err = 0;
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
// float endState = Utils.ParseUFloat(aux2EndTextBox.Text);
|
// float endState = Utils.ParseUFloat(aux2EndTextBox.Text);
|
||||||
// float startState = Utils.ParseUFloat(aux2StartTextBox.Text);
|
// float startState = Utils.ParseUFloat(aux2StartTextBox.Text);
|
||||||
// err = 100.0f * (endState - startState - refVolume) / refVolume;
|
// err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
//}
|
//}
|
||||||
//catch { err = 1000.0f; };
|
//catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -346,12 +346,12 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
|
|
||||||
private void main3EndTextBox_TextChanged(object sender, EventArgs e)
|
private void main3EndTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//float err = 0;
|
//double err = 0;
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
// float endState = Utils.ParseUFloat(main3EndTextBox.Text);
|
// float endState = Utils.ParseUFloat(main3EndTextBox.Text);
|
||||||
// float startState = Utils.ParseUFloat(main3StartTextBox.Text);
|
// float startState = Utils.ParseUFloat(main3StartTextBox.Text);
|
||||||
// err = 100.0f * (endState - startState - refVolume) / refVolume;
|
// err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
//}
|
//}
|
||||||
//catch { err = 1000.0f; };
|
//catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -360,12 +360,12 @@ namespace TBF.BenchControl.DataEntry.Combined
|
|||||||
|
|
||||||
private void aux3EndTextBox_TextChanged(object sender, EventArgs e)
|
private void aux3EndTextBox_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//float err = 0;
|
//double err = 0;
|
||||||
//try
|
//try
|
||||||
//{
|
//{
|
||||||
// float endState = Utils.ParseUFloat(aux3EndTextBox.Text);
|
// float endState = Utils.ParseUFloat(aux3EndTextBox.Text);
|
||||||
// float startState = Utils.ParseUFloat(aux3StartTextBox.Text);
|
// float startState = Utils.ParseUFloat(aux3StartTextBox.Text);
|
||||||
// err = 100.0f * (endState - startState - refVolume) / refVolume;
|
// err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
//}
|
//}
|
||||||
//catch { err = 1000.0f; };
|
//catch { err = 1000.0f; };
|
||||||
|
|
||||||
|
|||||||
@ -73,13 +73,13 @@ namespace TBF.BenchControl.DataEntry.Munich
|
|||||||
radioButton2.Text = ProtocolName2;
|
radioButton2.Text = ProtocolName2;
|
||||||
radioButton3.Text = ProtocolName3;
|
radioButton3.Text = ProtocolName3;
|
||||||
|
|
||||||
qRise1TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qrise, 3);
|
qRise1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||||
qFall1TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qfall, 3);
|
qFall1TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||||
|
|
||||||
if (Config.Data.CompoundWMsCount >= 2)
|
if (Config.Data.CompoundWMsCount >= 2)
|
||||||
{
|
{
|
||||||
qRise2TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qrise, 3);
|
qRise2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||||
qFall2TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qfall, 3);
|
qFall2TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -89,8 +89,8 @@ namespace TBF.BenchControl.DataEntry.Munich
|
|||||||
|
|
||||||
if (Config.Data.CompoundWMsCount >= 3)
|
if (Config.Data.CompoundWMsCount >= 3)
|
||||||
{
|
{
|
||||||
qRise3TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qrise, 3);
|
qRise3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qrise, 3);
|
||||||
qFall3TextBox.Text = Utils.FloatToStr(Sequences.SequenceBase.Qfall, 3);
|
qFall3TextBox.Text = Utils.DoubleToStr(Sequences.SequenceBase.Qfall, 3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -43,9 +43,9 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
|
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float errLimLo;
|
double errLimLo;
|
||||||
float errLimHi;
|
double errLimHi;
|
||||||
|
|
||||||
bool resultSaved; /// Set in Run() when results are saved
|
bool resultSaved; /// Set in Run() when results are saved
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>Reference to the operation</returns>
|
/// <returns>Reference to the operation</returns>
|
||||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
public IOperation ShowTestEndFormOp(double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||||
currentOp = CurrentOp.EnterTestEndStates;
|
currentOp = CurrentOp.EnterTestEndStates;
|
||||||
|
|||||||
@ -31,9 +31,9 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
public float[] WMEndState;
|
public float[] WMEndState;
|
||||||
|
|
||||||
bool endStates; /// false=start states, true=end states
|
bool endStates; /// false=start states, true=end states
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor to fill in start states
|
/// Constructor to fill in start states
|
||||||
@ -58,7 +58,7 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||||
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
||||||
float refVolume, float errLimLo, float errLimHi)
|
double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
endStates = true;
|
endStates = true;
|
||||||
|
|
||||||
@ -219,12 +219,12 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
|
|
||||||
private void wmEndStateTextBox1_TextChanged(object sender, EventArgs e)
|
private void wmEndStateTextBox1_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(wmEndStateTextBox1.Text);
|
float endState = Utils.ParseUFloat(wmEndStateTextBox1.Text);
|
||||||
float startState = Utils.ParseUFloat(wmStartStateTextBox1.Text);
|
float startState = Utils.ParseUFloat(wmStartStateTextBox1.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { };
|
catch { };
|
||||||
|
|
||||||
@ -233,12 +233,12 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
|
|
||||||
private void wmEndStateTextBox2_TextChanged(object sender, EventArgs e)
|
private void wmEndStateTextBox2_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(wmEndStateTextBox2.Text);
|
float endState = Utils.ParseUFloat(wmEndStateTextBox2.Text);
|
||||||
float startState = Utils.ParseUFloat(wmStartStateTextBox2.Text);
|
float startState = Utils.ParseUFloat(wmStartStateTextBox2.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -247,12 +247,12 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
|
|
||||||
private void wmEndStateTextBox3_TextChanged(object sender, EventArgs e)
|
private void wmEndStateTextBox3_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(wmEndStateTextBox3.Text);
|
float endState = Utils.ParseUFloat(wmEndStateTextBox3.Text);
|
||||||
float startState = Utils.ParseUFloat(wmStartStateTextBox3.Text);
|
float startState = Utils.ParseUFloat(wmStartStateTextBox3.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -261,12 +261,12 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
|
|
||||||
private void wmEndStateTextBox4_TextChanged(object sender, EventArgs e)
|
private void wmEndStateTextBox4_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(wmEndStateTextBox4.Text);
|
float endState = Utils.ParseUFloat(wmEndStateTextBox4.Text);
|
||||||
float startState = Utils.ParseUFloat(wmStartStateTextBox4.Text);
|
float startState = Utils.ParseUFloat(wmStartStateTextBox4.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -275,12 +275,12 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
|
|
||||||
private void wmEndStateTextBox5_TextChanged(object sender, EventArgs e)
|
private void wmEndStateTextBox5_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(wmEndStateTextBox5.Text);
|
float endState = Utils.ParseUFloat(wmEndStateTextBox5.Text);
|
||||||
float startState = Utils.ParseUFloat(wmStartStateTextBox5.Text);
|
float startState = Utils.ParseUFloat(wmStartStateTextBox5.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
|
|
||||||
@ -289,12 +289,12 @@ namespace TBF.BenchControl.DataEntry.Standard
|
|||||||
|
|
||||||
private void wmEndStateTextBox6_TextChanged(object sender, EventArgs e)
|
private void wmEndStateTextBox6_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(wmEndStateTextBox6.Text);
|
float endState = Utils.ParseUFloat(wmEndStateTextBox6.Text);
|
||||||
float startState = Utils.ParseUFloat(wmStartStateTextBox6.Text);
|
float startState = Utils.ParseUFloat(wmStartStateTextBox6.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
|
|
||||||
|
|||||||
@ -43,9 +43,9 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
|
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float errLimLo;
|
double errLimLo;
|
||||||
float errLimHi;
|
double errLimHi;
|
||||||
|
|
||||||
bool resultSaved; /// Set in Run() when results are saved
|
bool resultSaved; /// Set in Run() when results are saved
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>Reference to the operation</returns>
|
/// <returns>Reference to the operation</returns>
|
||||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
public IOperation ShowTestEndFormOp(double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||||
currentOp = CurrentOp.EnterTestEndStates;
|
currentOp = CurrentOp.EnterTestEndStates;
|
||||||
|
|||||||
@ -32,9 +32,9 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
|||||||
public float[] WMEndState;
|
public float[] WMEndState;
|
||||||
|
|
||||||
bool endStates; /// false=start states, true=end states
|
bool endStates; /// false=start states, true=end states
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||||
|
|
||||||
int TextBoxesCount;
|
int TextBoxesCount;
|
||||||
///
|
///
|
||||||
@ -102,7 +102,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
|||||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
||||||
float refVolume, float errLimLo, float errLimHi)
|
double refVolume, double errLimLo, double errLimHi)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
endStates = true;
|
endStates = true;
|
||||||
@ -272,108 +272,108 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { };
|
catch { };
|
||||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -381,12 +381,12 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
|||||||
|
|
||||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -394,24 +394,24 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
|||||||
|
|
||||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
|
|||||||
@ -32,9 +32,9 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
public float[] WMEndState;
|
public float[] WMEndState;
|
||||||
|
|
||||||
bool endStates; /// false=start states, true=end states
|
bool endStates; /// false=start states, true=end states
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||||
|
|
||||||
int TextBoxesCount;
|
int TextBoxesCount;
|
||||||
///
|
///
|
||||||
@ -123,7 +123,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
public AdvancedFixedStartTestForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
public AdvancedFixedStartTestForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
||||||
float refVolume, float errLimLo, float errLimHi)
|
double refVolume, double errLimLo, double errLimHi)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
endStates = true;
|
endStates = true;
|
||||||
@ -295,108 +295,108 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { };
|
catch { };
|
||||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -404,12 +404,12 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
|
|
||||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -417,168 +417,168 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
|
|
||||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
|
|||||||
@ -43,9 +43,9 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
|
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float errLimLo;
|
double errLimLo;
|
||||||
float errLimHi;
|
double errLimHi;
|
||||||
|
|
||||||
bool resultSaved; /// Set in Run() when results are saved
|
bool resultSaved; /// Set in Run() when results are saved
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>Reference to the operation</returns>
|
/// <returns>Reference to the operation</returns>
|
||||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
public IOperation ShowTestEndFormOp(double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||||
currentOp = CurrentOp.EnterTestEndStates;
|
currentOp = CurrentOp.EnterTestEndStates;
|
||||||
|
|||||||
@ -32,9 +32,9 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
public float[] WMEndState;
|
public float[] WMEndState;
|
||||||
|
|
||||||
bool endStates; /// false=start states, true=end states
|
bool endStates; /// false=start states, true=end states
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||||
|
|
||||||
int TextBoxesCount;
|
int TextBoxesCount;
|
||||||
///
|
///
|
||||||
@ -107,7 +107,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
||||||
float refVolume, float errLimLo, float errLimHi)
|
double refVolume, double errLimLo, double errLimHi)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
endStates = true;
|
endStates = true;
|
||||||
@ -277,108 +277,108 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { };
|
catch { };
|
||||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -386,12 +386,12 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
|
|
||||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -399,168 +399,168 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
|||||||
|
|
||||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
|
|||||||
@ -43,9 +43,9 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
|
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float errLimLo;
|
double errLimLo;
|
||||||
float errLimHi;
|
double errLimHi;
|
||||||
|
|
||||||
bool resultSaved; /// Set in Run() when results are saved
|
bool resultSaved; /// Set in Run() when results are saved
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>Reference to the operation</returns>
|
/// <returns>Reference to the operation</returns>
|
||||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
public IOperation ShowTestEndFormOp(double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||||
currentOp = CurrentOp.EnterTestEndStates;
|
currentOp = CurrentOp.EnterTestEndStates;
|
||||||
|
|||||||
@ -32,9 +32,9 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
|||||||
public float[] WMEndState;
|
public float[] WMEndState;
|
||||||
|
|
||||||
bool endStates; /// false=start states, true=end states
|
bool endStates; /// false=start states, true=end states
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||||
|
|
||||||
int TextBoxesCount;
|
int TextBoxesCount;
|
||||||
///
|
///
|
||||||
@ -107,7 +107,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
|||||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
||||||
float refVolume, float errLimLo, float errLimHi)
|
double refVolume, double errLimLo, double errLimHi)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
endStates = true;
|
endStates = true;
|
||||||
@ -277,108 +277,108 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { };
|
catch { };
|
||||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -386,12 +386,12 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
|||||||
|
|
||||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -399,168 +399,168 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
|||||||
|
|
||||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
|
|||||||
@ -111,7 +111,7 @@ namespace TBF.BenchControl.DataEntry.WMStates
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>Reference to the operation</returns>
|
/// <returns>Reference to the operation</returns>
|
||||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
public IOperation ShowTestEndFormOp(double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||||
currentOp = CurrentOp.EnterTestEndStates;
|
currentOp = CurrentOp.EnterTestEndStates;
|
||||||
|
|||||||
@ -43,9 +43,9 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
|
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float errLimLo;
|
double errLimLo;
|
||||||
float errLimHi;
|
double errLimHi;
|
||||||
|
|
||||||
bool resultSaved; /// Set in Run() when results are saved
|
bool resultSaved; /// Set in Run() when results are saved
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <returns>Reference to the operation</returns>
|
/// <returns>Reference to the operation</returns>
|
||||||
public IOperation ShowTestEndFormOp(float refVolume, float errLimLo, float errLimHi)
|
public IOperation ShowTestEndFormOp(double refVolume, double errLimLo, double errLimHi)
|
||||||
{
|
{
|
||||||
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
if (currentOp != CurrentOp.None) throw new Exception("Sequence error");
|
||||||
currentOp = CurrentOp.EnterTestEndStates;
|
currentOp = CurrentOp.EnterTestEndStates;
|
||||||
|
|||||||
@ -32,9 +32,9 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
|||||||
public float[] WMEndState;
|
public float[] WMEndState;
|
||||||
|
|
||||||
bool endStates; /// false=start states, true=end states
|
bool endStates; /// false=start states, true=end states
|
||||||
float refVolume;
|
double refVolume;
|
||||||
float warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
double warningLimLo; /// limit to display exclamation mark, typically 2x errLimLo
|
||||||
float warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
double warningLimHi; /// limit to display exclamation mark, typically 2x errLimHi
|
||||||
|
|
||||||
int TextBoxesCount;
|
int TextBoxesCount;
|
||||||
///
|
///
|
||||||
@ -107,7 +107,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
|||||||
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimLo">Error limit low, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
/// <param name="errLimHi">Error limit high, it is used to verify the end state, show/hide exclamation if necessary</param>
|
||||||
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
public TestStartEndForm(int waterMetersCount, string[] wmStartStateStr, bool[] disabled,
|
||||||
float refVolume, float errLimLo, float errLimHi)
|
double refVolume, double errLimLo, double errLimHi)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
endStates = true;
|
endStates = true;
|
||||||
@ -277,108 +277,108 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
private void endTextBox1_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
float endState = Utils.ParseUFloat(endTextBox1.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
float startState = Utils.ParseUFloat(startTextBox1.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { };
|
catch { };
|
||||||
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation1.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
private void endTextBox2_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
float endState = Utils.ParseUFloat(endTextBox2.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
float startState = Utils.ParseUFloat(startTextBox2.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation2.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
private void endTextBox3_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
float endState = Utils.ParseUFloat(endTextBox3.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
float startState = Utils.ParseUFloat(startTextBox3.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation3.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
private void endTextBox4_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
float endState = Utils.ParseUFloat(endTextBox4.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
float startState = Utils.ParseUFloat(startTextBox4.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation4.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
private void endTextBox5_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
float endState = Utils.ParseUFloat(endTextBox5.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
float startState = Utils.ParseUFloat(startTextBox5.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation5.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
private void endTextBox6_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
float endState = Utils.ParseUFloat(endTextBox6.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
float startState = Utils.ParseUFloat(startTextBox6.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation6.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
private void endTextBox7_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
float endState = Utils.ParseUFloat(endTextBox7.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
float startState = Utils.ParseUFloat(startTextBox7.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation7.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
private void endTextBox8_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
float endState = Utils.ParseUFloat(endTextBox8.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
float startState = Utils.ParseUFloat(startTextBox8.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation8.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
private void endTextBox9_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
float endState = Utils.ParseUFloat(endTextBox9.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
float startState = Utils.ParseUFloat(startTextBox9.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation9.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -386,12 +386,12 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
|||||||
|
|
||||||
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
private void endTextBox10_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
float endState = Utils.ParseUFloat(endTextBox10.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
float startState = Utils.ParseUFloat(startTextBox10.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation10.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
@ -399,168 +399,168 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
|||||||
|
|
||||||
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
private void endTextBox11_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
float endState = Utils.ParseUFloat(endTextBox11.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
float startState = Utils.ParseUFloat(startTextBox11.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation11.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
private void endTextBox12_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
float endState = Utils.ParseUFloat(endTextBox12.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
float startState = Utils.ParseUFloat(startTextBox12.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation12.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
private void endTextBox13_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
float endState = Utils.ParseUFloat(endTextBox13.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
float startState = Utils.ParseUFloat(startTextBox13.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation13.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
private void endTextBox14_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
float endState = Utils.ParseUFloat(endTextBox14.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
float startState = Utils.ParseUFloat(startTextBox14.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation14.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
private void endTextBox15_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
float endState = Utils.ParseUFloat(endTextBox15.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
float startState = Utils.ParseUFloat(startTextBox15.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation15.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
private void endTextBox16_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
float endState = Utils.ParseUFloat(endTextBox16.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
float startState = Utils.ParseUFloat(startTextBox16.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation16.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
private void endTextBox17_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
float endState = Utils.ParseUFloat(endTextBox17.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
float startState = Utils.ParseUFloat(startTextBox17.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation17.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
private void endTextBox18_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
float endState = Utils.ParseUFloat(endTextBox18.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
float startState = Utils.ParseUFloat(startTextBox18.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation18.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
private void endTextBox19_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
float endState = Utils.ParseUFloat(endTextBox19.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
float startState = Utils.ParseUFloat(startTextBox19.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation19.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
private void endTextBox20_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
float endState = Utils.ParseUFloat(endTextBox20.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
float startState = Utils.ParseUFloat(startTextBox20.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation20.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
private void endTextBox21_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
float endState = Utils.ParseUFloat(endTextBox21.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
float startState = Utils.ParseUFloat(startTextBox21.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation21.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
private void endTextBox22_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
float endState = Utils.ParseUFloat(endTextBox22.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
float startState = Utils.ParseUFloat(startTextBox22.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation22.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
private void endTextBox23_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
float endState = Utils.ParseUFloat(endTextBox23.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
float startState = Utils.ParseUFloat(startTextBox23.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation23.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
}
|
}
|
||||||
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
private void endTextBox24_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
float err = 0;
|
double err = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
float endState = Utils.ParseUFloat(endTextBox24.Text);
|
||||||
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
float startState = Utils.ParseUFloat(startTextBox24.Text);
|
||||||
err = 100.0f * (endState - startState - refVolume) / refVolume;
|
err = 100.0 * (endState - startState - refVolume) / refVolume;
|
||||||
}
|
}
|
||||||
catch { err = 1000.0f; };
|
catch { err = 1000.0f; };
|
||||||
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
exclamation24.Visible = (err < warningLimLo) || (warningLimHi < err);
|
||||||
|
|||||||
@ -23,13 +23,13 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
|||||||
|
|
||||||
public float LtrPerPulse { get { return flowMeterCfg.NominalFlow / 7200.0f; } }
|
public float LtrPerPulse { get { return flowMeterCfg.NominalFlow / 7200.0f; } }
|
||||||
|
|
||||||
public float LtrPerPulseCorrected(float flow)
|
public float LtrPerPulseCorrected(double flow)
|
||||||
{
|
{
|
||||||
if (flow < 0.1f * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
if (flow < 0.1 * NominalFlow) return LtrPerPulse; /// No correction for small flow
|
||||||
|
|
||||||
/// Apply correction
|
/// Apply correction
|
||||||
float correctedFlow = BenchControl.Formulas.CorrectedValue(flow, Corrections);
|
double correctedFlow = BenchControl.Formulas.CorrectedValue(flow, Corrections);
|
||||||
return LtrPerPulse * correctedFlow / flow;
|
return (float)(LtrPerPulse * correctedFlow / flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,9 @@ namespace TBF.BenchControl.Elde.FlowMeterTwins
|
|||||||
public float LtrPerPulse { get { return flowMeterCfg.NominalFlow / 14400.0f; } }
|
public float LtrPerPulse { get { return flowMeterCfg.NominalFlow / 14400.0f; } }
|
||||||
|
|
||||||
/// Calculates the average of values of two flowmeters. Assumes the flow is divided evenly.
|
/// Calculates the average of values of two flowmeters. Assumes the flow is divided evenly.
|
||||||
public float LtrPerPulseCorrected(float flow)
|
public float LtrPerPulseCorrected(double flow)
|
||||||
{
|
{
|
||||||
float flow2 = flow / 2;
|
double flow2 = flow / 2.0;
|
||||||
return (FlowMeter1.LtrPerPulseCorrected(flow2) + FlowMeter2.LtrPerPulseCorrected(flow2)) / 2;
|
return (FlowMeter1.LtrPerPulseCorrected(flow2) + FlowMeter2.LtrPerPulseCorrected(flow2)) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ namespace TBF.BenchControl
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="t">Temperature in [degC]</param>
|
/// <param name="t">Temperature in [degC]</param>
|
||||||
/// <returns>Density in [kg/m3]</returns>
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
public static float DistilledWaterDensityFromTemp(float t)
|
public static double DistilledWaterDensityFromTemp(float t)
|
||||||
{
|
{
|
||||||
double tt = (double)t;
|
double tt = (double)t;
|
||||||
const double a0 = 999.842594;
|
const double a0 = 999.842594;
|
||||||
@ -23,7 +23,7 @@ namespace TBF.BenchControl
|
|||||||
const double a4 = -0.000001120083;
|
const double a4 = -0.000001120083;
|
||||||
const double a5 = 6.536332e-09;
|
const double a5 = 6.536332e-09;
|
||||||
|
|
||||||
return (float)(((((a5 * tt + a4) * tt + a3) * tt + a2) * tt + a1) * tt + a0);
|
return ((((a5 * tt + a4) * tt + a3) * tt + a2) * tt + a1) * tt + a0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -31,12 +31,12 @@ namespace TBF.BenchControl
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="t">Temperature in [degC]</param>
|
/// <param name="t">Temperature in [degC]</param>
|
||||||
/// <returns>Density in [kg/m3]</returns>
|
/// <returns>Density in [kg/m3]</returns>
|
||||||
public static float WaterDensityFromTemp(float t)
|
public static double WaterDensityFromTemp(float t)
|
||||||
{
|
{
|
||||||
float realDensity = Program.LocalSettings.RealDensity;
|
double realDensity = Program.LocalSettings.RealDensity;
|
||||||
float atTemperature = Program.LocalSettings.AtTemperature;
|
float atTemperature = Program.LocalSettings.AtTemperature;
|
||||||
|
|
||||||
float c_rho = realDensity / DistilledWaterDensityFromTemp(atTemperature);
|
double c_rho = realDensity / DistilledWaterDensityFromTemp(atTemperature);
|
||||||
|
|
||||||
return c_rho * DistilledWaterDensityFromTemp(t);
|
return c_rho * DistilledWaterDensityFromTemp(t);
|
||||||
}
|
}
|
||||||
@ -58,23 +58,23 @@ namespace TBF.BenchControl
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Convert 'pulses' to 'volume', prevent division by zero
|
/// Convert 'pulses' to 'volume', prevent division by zero
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static float VolumeFromPulses(int pulses, float pulsesPerLiter)
|
public static double VolumeFromPulses(int pulses, double pulsesPerLiter)
|
||||||
{
|
{
|
||||||
if (pulsesPerLiter <= float.Epsilon) return 0;
|
if (pulsesPerLiter <= double.Epsilon) return 0;
|
||||||
return Convert.ToSingle(pulses) / pulsesPerLiter;
|
return Convert.ToDouble(pulses) / pulsesPerLiter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculate the error in % from 'measured' and 'true' volume, prevent division by zero
|
/// Calculate the error in % from 'measured' and 'true' volume, prevent division by zero
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static float ErrorFromVolumes(float measuredVolume, float trueVolume)
|
public static double ErrorFromVolumes(double measuredVolume, double trueVolume)
|
||||||
{
|
{
|
||||||
if (trueVolume <= float.Epsilon)
|
if (trueVolume <= float.Epsilon)
|
||||||
{
|
{
|
||||||
if (measuredVolume <= float.Epsilon) return 0;
|
if (measuredVolume <= float.Epsilon) return 0;
|
||||||
return 100.0f;
|
return 99.0;
|
||||||
}
|
}
|
||||||
return 100.0f * (measuredVolume - trueVolume) / trueVolume;
|
return 100.0 * (measuredVolume - trueVolume) / trueVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -115,7 +115,7 @@ namespace TBF.BenchControl
|
|||||||
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
/// <param name="rawMeasurement">Raw uncorrected value</param>
|
||||||
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
/// <param name="corrections">Sorted (value, correction) pairs</param>
|
||||||
/// <returns>Corrected value</returns>
|
/// <returns>Corrected value</returns>
|
||||||
public static float CorrectedValue(float rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
|
public static double CorrectedValue(double rawValue, IList<Config.Entities.MeasurementCorrection> corrections)
|
||||||
{
|
{
|
||||||
if (corrections == null || corrections.Count == 0) return rawValue;
|
if (corrections == null || corrections.Count == 0) return rawValue;
|
||||||
|
|
||||||
@ -129,13 +129,13 @@ namespace TBF.BenchControl
|
|||||||
{
|
{
|
||||||
if (rawValue < corrections[i].Measurement)
|
if (rawValue < corrections[i].Measurement)
|
||||||
{
|
{
|
||||||
float d1 = rawValue - corrections[i-1].Measurement;
|
double d1 = rawValue - corrections[i-1].Measurement;
|
||||||
float d2 = corrections[i].Measurement - rawValue;
|
double d2 = corrections[i].Measurement - rawValue;
|
||||||
|
|
||||||
float corr;
|
double corr;
|
||||||
if (d1 + d2 <= float.Epsilon)
|
if (d1 + d2 <= float.Epsilon)
|
||||||
{
|
{
|
||||||
corr = (corrections[i - 1].Correction + corrections[i].Correction) / 2.0f;
|
corr = (corrections[i - 1].Correction + corrections[i].Correction) / 2.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@ namespace TBF.BenchControl.GenericDevices
|
|||||||
/// Corrected volume per flowmeter pulse in [l].
|
/// Corrected volume per flowmeter pulse in [l].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="flow">Water flow in [m3/h]</param>
|
/// <param name="flow">Water flow in [m3/h]</param>
|
||||||
float LtrPerPulseCorrected(float flow);
|
float LtrPerPulseCorrected(double flow);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 1 based index of the reference flowmeter
|
/// 1 based index of the reference flowmeter
|
||||||
|
|||||||
@ -25,6 +25,6 @@ namespace TBF.BenchControl.GenericDevices
|
|||||||
/// Displays form at the end of the test to enter water meter start start.
|
/// Displays form at the end of the test to enter water meter start start.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Operation to be used in the sequence</returns>
|
/// <returns>Operation to be used in the sequence</returns>
|
||||||
IOperation ShowTestEndFormOp(float volumeRef, float errLimLo, float errLimHi);
|
IOperation ShowTestEndFormOp(double volumeRef, double errLimLo, double errLimHi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
63
TestBenchFramework/BenchControl/Sequences/FloatStatistics.cs
Normal file
63
TestBenchFramework/BenchControl/Sequences/FloatStatistics.cs
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace TBF.BenchControl.Sequences
|
||||||
|
{
|
||||||
|
public class FloatStatistics
|
||||||
|
{
|
||||||
|
float first;
|
||||||
|
float last;
|
||||||
|
float min;
|
||||||
|
float max;
|
||||||
|
float sum;
|
||||||
|
UInt32 count;
|
||||||
|
|
||||||
|
public float First { get { return first; } }
|
||||||
|
public float Last { get { return last; } }
|
||||||
|
public float Min { get { return min; } }
|
||||||
|
public float Max { get { return max; } }
|
||||||
|
public float Average { get { if (Count > 0) return sum / (float)count; else return 0; } }
|
||||||
|
public UInt32 Count { get { return count; } }
|
||||||
|
|
||||||
|
|
||||||
|
public FloatStatistics()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets statistics
|
||||||
|
/// </summary>
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
sum = 0;
|
||||||
|
min = float.MaxValue;
|
||||||
|
max = float.MinValue;
|
||||||
|
first = 0;
|
||||||
|
last = 0;
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates statistics
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">New value</param>
|
||||||
|
public void Update(float value)
|
||||||
|
{
|
||||||
|
if (count == 0) first = value;
|
||||||
|
last = value;
|
||||||
|
sum += value;
|
||||||
|
if (value < min) min = value;
|
||||||
|
if (value > max) max = value;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates statistics
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">New boxed value</param>
|
||||||
|
public void Update(TBF.Boxes.FloatBox box)
|
||||||
|
{
|
||||||
|
Update(box.Val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -24,9 +24,9 @@ namespace TBF.BenchControl.Sequences
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
///
|
///
|
||||||
delegate void iPerlCommFormDlgt(MainSeq myRef, Generic.IComponentCfg cfg, IList<Generic.ITestParams> multiTestParams);
|
delegate void iPerlCommFormDlgt(MainSeq myRef, Generic.IComponentCfg cfg, IList<string> testNames, IList<Generic.ITestParams> multiTestParams);
|
||||||
///
|
///
|
||||||
void OpenIPerlCommForm(MainSeq myRef, Generic.IComponentCfg cfg, IList<Generic.ITestParams> multiTestParams)
|
void OpenIPerlCommForm(MainSeq myRef, Generic.IComponentCfg cfg, IList<string> testNames, IList<Generic.ITestParams> multiTestParams)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -40,11 +40,13 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// 2nd argument
|
/// 2nd argument
|
||||||
TestMethods.iPerlCommunication.TestMethodCfg iPerlCfg = cfg as TestMethods.iPerlCommunication.TestMethodCfg;
|
TestMethods.iPerlCommunication.TestMethodCfg iPerlCfg = cfg as TestMethods.iPerlCommunication.TestMethodCfg;
|
||||||
|
|
||||||
/// 3rd argument
|
/// 3rd argument: as is
|
||||||
|
|
||||||
|
/// 4th argument
|
||||||
IList<TestMethods.iPerlCommunication.iPerlCommunicationParams> iPerlCommParams = new List<TestMethods.iPerlCommunication.iPerlCommunicationParams>();
|
IList<TestMethods.iPerlCommunication.iPerlCommunicationParams> iPerlCommParams = new List<TestMethods.iPerlCommunication.iPerlCommunicationParams>();
|
||||||
foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as TestMethods.iPerlCommunication.iPerlCommunicationParams);
|
foreach (var tp in multiTestParams) iPerlCommParams.Add(tp as TestMethods.iPerlCommunication.iPerlCommunicationParams);
|
||||||
|
|
||||||
myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(wMtrs, iPerlCfg, iPerlCommParams);
|
myRef.modelessDlg = new TestMethods.iPerlCommunication.iPerlCommunicationForm(wMtrs, iPerlCfg, testNames, iPerlCommParams);
|
||||||
myRef.modelessDlg.Show();
|
myRef.modelessDlg.Show();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@ -259,7 +261,6 @@ namespace TBF.BenchControl.Sequences
|
|||||||
|
|
||||||
StateMachine.CycleStartTimeStamp = BatchRslts.Batch.StartTime;
|
StateMachine.CycleStartTimeStamp = BatchRslts.Batch.StartTime;
|
||||||
foreach (var wm in WaterMeters) wm.ClearData(); /// Clean water meter data
|
foreach (var wm in WaterMeters) wm.ClearData(); /// Clean water meter data
|
||||||
ResetResults();
|
|
||||||
|
|
||||||
StateMachine.LoadProcedureParams(StateMachine.Procedure);
|
StateMachine.LoadProcedureParams(StateMachine.Procedure);
|
||||||
Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure));
|
Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure));
|
||||||
@ -582,7 +583,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ResultsAreComplete(StateMachine.Tests))
|
if (BatchRslts.AllTestsDone())
|
||||||
{
|
{
|
||||||
Bridge.Bench2UI(ButtonsEtc.AcceptResultsBtnEn | ButtonsEtc.ResetResultsBtnEn);
|
Bridge.Bench2UI(ButtonsEtc.AcceptResultsBtnEn | ButtonsEtc.ResetResultsBtnEn);
|
||||||
}
|
}
|
||||||
@ -661,18 +662,19 @@ namespace TBF.BenchControl.Sequences
|
|||||||
}
|
}
|
||||||
while (e.Contains(Event.Busy));
|
while (e.Contains(Event.Busy));
|
||||||
|
|
||||||
///
|
/// TODO: Reimplement !!!!!!!!!!!
|
||||||
/// Save to database and to 'summary results' logger
|
/////
|
||||||
///
|
///// Save to database and to 'summary results' logger
|
||||||
IList<TestResult> sortedResults = Utils.GetSortedTestResults(StateMachine.Procedure, results, 0);
|
/////
|
||||||
foreach (var rslt in sortedResults)
|
//IList<TestResult> sortedResults = Utils.GetSortedTestResults(StateMachine.Procedure, results, 0);
|
||||||
{
|
//foreach (var rslt in sortedResults)
|
||||||
if (rslt != null)
|
//{
|
||||||
{
|
// if (rslt != null)
|
||||||
Config.FluentCommon.SaveToDb(StateMachine.WtSession, rslt);
|
// {
|
||||||
summaryResults.Info(TestResult2CsvLine(rslt));
|
// Config.FluentCommon.SaveToDb(StateMachine.WtSession, rslt);
|
||||||
}
|
// summaryResults.Info(TestResult2CsvLine(rslt));
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
Program.LocalSettings.BatchNr++;
|
Program.LocalSettings.BatchNr++;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using TBF.BenchControl.GenericDevices;
|
using System;
|
||||||
|
using TBF.BenchControl.GenericDevices;
|
||||||
using TBF.Boxes;
|
using TBF.Boxes;
|
||||||
|
|
||||||
namespace TBF.BenchControl.Sequences
|
namespace TBF.BenchControl.Sequences
|
||||||
@ -10,18 +11,61 @@ namespace TBF.BenchControl.Sequences
|
|||||||
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 AmbientPressure = new FloatBox() { Name = "Ambient Pressure", Format = "F1" };
|
||||||
public static FloatBox AmbientHumidity = new FloatBox() { Name = "Ambient Humidity", 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 TempIn = new FloatBox() { Name = "Temperature In", Format = "F2" }; /// [Celsius]
|
||||||
public static FloatBox TempOut = new FloatBox() { Name = "Temperature Out", 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 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 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 FloatBox PressureDown = new FloatBox() { Name = "Pressure Out", Format = "F3", Factor = 0.01f };
|
||||||
|
|
||||||
public static IntBox RefCount = new IntBox() { Name = "RefCount" };
|
public static IntBox RefCount = new IntBox() { Name = "RefCount" };
|
||||||
public static FloatBox RefFreq = new FloatBox() { Name = "RefFreq", Format = "F2" };
|
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 RefFlow = new FloatBox() { Name = "RefFlow", Format = "F2" }; /// [m3/h]
|
||||||
public static FloatBox Mass = new FloatBox() { Name = "Mass", Format = "F3" }; /// [kg]
|
public static FloatBox Mass = new FloatBox() { Name = "Mass", Format = "F3" }; /// [kg]
|
||||||
|
|
||||||
|
public static DateTime TestStartTime;
|
||||||
|
public static DateTime TestEndTime;
|
||||||
|
|
||||||
|
public static double StartMassRaw; /// [kg]
|
||||||
|
public static double CurrentMassRaw; /// [kg]
|
||||||
|
public static double EndMassRaw; /// [kg]
|
||||||
|
|
||||||
public static Results.BatchResults BatchRslts;
|
public static Results.BatchResults BatchRslts;
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Statistics
|
||||||
|
///
|
||||||
|
public static FloatStatistics AmbientTempStat = new FloatStatistics();
|
||||||
|
public static FloatStatistics AmbientPressureStat = new FloatStatistics();
|
||||||
|
public static FloatStatistics AmbientHumidityStat = new FloatStatistics();
|
||||||
|
public static FloatStatistics TempInStat = new FloatStatistics();
|
||||||
|
public static FloatStatistics TempOutStat = new FloatStatistics();
|
||||||
|
public static FloatStatistics TempDivStat = new FloatStatistics();
|
||||||
|
public static FloatStatistics PressureUpStat = new FloatStatistics();
|
||||||
|
public static FloatStatistics PressureDownStat = new FloatStatistics();
|
||||||
|
|
||||||
|
protected static void ClearAllStatistics()
|
||||||
|
{
|
||||||
|
AmbientTempStat.Clear();
|
||||||
|
AmbientPressureStat.Clear();
|
||||||
|
AmbientHumidityStat.Clear();
|
||||||
|
TempInStat.Clear();
|
||||||
|
TempOutStat.Clear();
|
||||||
|
TempDivStat.Clear();
|
||||||
|
PressureUpStat.Clear();
|
||||||
|
PressureDownStat.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static void UpdateAllStatistics()
|
||||||
|
{
|
||||||
|
AmbientTempStat.Update(AmbientTemp);
|
||||||
|
AmbientPressureStat.Update(AmbientPressure);
|
||||||
|
AmbientHumidityStat.Update(AmbientHumidity);
|
||||||
|
TempInStat.Update(TempIn);
|
||||||
|
TempOutStat.Update(TempOut);
|
||||||
|
TempDivStat.Update(TempDiv);
|
||||||
|
PressureUpStat.Update(PressureUp);
|
||||||
|
PressureDownStat.Update(PressureDown);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,68 +38,11 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// Procedure related (static) variables.
|
/// Procedure related (static) variables.
|
||||||
/// They are re-initialized when LoadProcedure() is called
|
/// They are re-initialized when LoadProcedure() is called
|
||||||
///------------------------------------------------------------
|
///------------------------------------------------------------
|
||||||
protected static IList<TestResult> results;
|
|
||||||
public static int ReferenceFlowmetersCount;
|
public static int ReferenceFlowmetersCount;
|
||||||
public static float[] LtrPerRefPulse; /// Reference flowmeter coefficients
|
public static float[] LtrPerRefPulse; /// Reference flowmeter coefficients
|
||||||
public static float Qrise;
|
public static double Qrise;
|
||||||
public static float Qfall;
|
public static double Qfall;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clear all test results.
|
|
||||||
/// </summary>
|
|
||||||
protected static void ResetResults()
|
|
||||||
{
|
|
||||||
results = new List<TestResult>();
|
|
||||||
Qrise = 0;
|
|
||||||
Qfall = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add result to the list of results.
|
|
||||||
/// Overwrite (=delete) any previous result with the same name.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="newTestResult">New test result</param>
|
|
||||||
public static void AddOrOverwriteResult(TestResult newTestResult)
|
|
||||||
{
|
|
||||||
if (newTestResult == null) return;
|
|
||||||
|
|
||||||
TestResult toDelete =
|
|
||||||
results.FirstOrDefault<TestResult>(x => x.Name.Equals(newTestResult.Name) &&
|
|
||||||
(x.Part == newTestResult.Part) &&
|
|
||||||
(x.TestId == newTestResult.TestId));
|
|
||||||
if (toDelete != null) results.Remove(toDelete);
|
|
||||||
|
|
||||||
results.Add(newTestResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check whether the results are complete, whether there is a result for each test.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tests">All tests</param>
|
|
||||||
/// <returns>true = The results are complete</returns>
|
|
||||||
protected static bool ResultsAreComplete(IList<Test> tests)
|
|
||||||
{
|
|
||||||
foreach (var test in tests)
|
|
||||||
{
|
|
||||||
if (!test.Method.Contains("RoiDetection")) /// TODO: Use 'DoNotEvaluate' etc.
|
|
||||||
{
|
|
||||||
for (int r = 1; r <= test.Repeats; r++)
|
|
||||||
{
|
|
||||||
bool resultExists = false;
|
|
||||||
foreach (var tr in results)
|
|
||||||
{
|
|
||||||
if ((tr.DoNotEvaluate == false) && (tr.RepetitionNr == r) && (tr.TestName == test.Name))
|
|
||||||
{
|
|
||||||
resultExists = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!resultExists) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static float TimeEstimateTotal; /// Time estimate of the selected cycle or test
|
protected static float TimeEstimateTotal; /// Time estimate of the selected cycle or test
|
||||||
protected static float TimeEstimateBeginRpts; /// Time estimate at the beginning of all repetitions of the current tests
|
protected static float TimeEstimateBeginRpts; /// Time estimate at the beginning of all repetitions of the current tests
|
||||||
@ -107,8 +50,6 @@ namespace TBF.BenchControl.Sequences
|
|||||||
|
|
||||||
static SequenceBase()
|
static SequenceBase()
|
||||||
{
|
{
|
||||||
results = new List<TestResult>();
|
|
||||||
|
|
||||||
WMVolumes = new FloatBox[Config.Data.WMsCount];
|
WMVolumes = new FloatBox[Config.Data.WMsCount];
|
||||||
WMErrors = new FloatBox[Config.Data.WMsCount];
|
WMErrors = new FloatBox[Config.Data.WMsCount];
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||||
@ -131,65 +72,6 @@ namespace TBF.BenchControl.Sequences
|
|||||||
protected static TransitionSequence transitionAfter;
|
protected static TransitionSequence transitionAfter;
|
||||||
|
|
||||||
|
|
||||||
#region Temperature_Pressure_Humidity
|
|
||||||
|
|
||||||
protected float tempInSum;
|
|
||||||
protected float tempOutSum;
|
|
||||||
protected float tempDivSum;
|
|
||||||
protected float pressInSum;
|
|
||||||
protected float pressOutSum;
|
|
||||||
protected float ambientTempSum;
|
|
||||||
protected float ambientPressSum;
|
|
||||||
protected float ambientHumiSum;
|
|
||||||
///
|
|
||||||
protected int averagedDataCount;
|
|
||||||
///
|
|
||||||
protected void ResetAveragedData()
|
|
||||||
{
|
|
||||||
tempInSum = 0;
|
|
||||||
tempOutSum = 0;
|
|
||||||
tempDivSum = 0;
|
|
||||||
pressInSum = 0;
|
|
||||||
pressOutSum = 0;
|
|
||||||
ambientTempSum = 0;
|
|
||||||
ambientPressSum = 0;
|
|
||||||
ambientHumiSum = 0;
|
|
||||||
///
|
|
||||||
averagedDataCount = 0;
|
|
||||||
}
|
|
||||||
///
|
|
||||||
protected void AccumulateAveragedData()
|
|
||||||
{
|
|
||||||
tempInSum += TempIn.Val;
|
|
||||||
tempOutSum += TempOut.Val;
|
|
||||||
tempDivSum += TempDiv.Val;
|
|
||||||
pressInSum += PressureUp.Val;
|
|
||||||
pressOutSum += PressureDown.Val;
|
|
||||||
ambientTempSum += AmbientTemp.Val;
|
|
||||||
ambientPressSum += AmbientPressure.Val;
|
|
||||||
ambientHumiSum += AmbientHumidity.Val;
|
|
||||||
///
|
|
||||||
averagedDataCount++;
|
|
||||||
}
|
|
||||||
///
|
|
||||||
protected void UpdateTestRsltWithAveragedData(TestResult tstRslt)
|
|
||||||
{
|
|
||||||
if (averagedDataCount != 0)
|
|
||||||
{
|
|
||||||
float denominator = (float)averagedDataCount;
|
|
||||||
tstRslt.AmbientTempAve = ambientTempSum / denominator;
|
|
||||||
tstRslt.AmbientPressAve = ambientPressSum / denominator;
|
|
||||||
tstRslt.AmbientHumiAve = ambientHumiSum / denominator;
|
|
||||||
tstRslt.PressInAvrg = pressInSum / denominator;
|
|
||||||
tstRslt.PressOutAvrg = pressOutSum / denominator;
|
|
||||||
tstRslt.TempInAvrg = tempInSum / denominator;
|
|
||||||
tstRslt.TempOutAvrg = tempOutSum / denominator;
|
|
||||||
tstRslt.TempDivAvrg = tempDivSum / denominator;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
protected float ltrPerRefPulse;
|
protected float ltrPerRefPulse;
|
||||||
|
|
||||||
protected IOperation readRegistersOp;
|
protected IOperation readRegistersOp;
|
||||||
@ -749,11 +631,11 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// <param name="time">Current test time in [s]</param>
|
/// <param name="time">Current test time in [s]</param>
|
||||||
/// <param name="progress">Current progress 0 .. 1.0f</param>
|
/// <param name="progress">Current progress 0 .. 1.0f</param>
|
||||||
/// <returns>Data for the UI</returns>
|
/// <returns>Data for the UI</returns>
|
||||||
protected TestProgressEventArgs GetTestProgressData(Test test, TestResult tstRslt, bool testRunning, Elde.ControlBoardDev cBrd, float time, float progress)
|
protected TestProgressEventArgs GetTestProgressData(Test test, int repetitionNr, bool testRunning, Elde.ControlBoardDev cBrd, float time, float progress)
|
||||||
{
|
{
|
||||||
TestProgressEventArgs data = new TestProgressEventArgs();
|
TestProgressEventArgs data = new TestProgressEventArgs();
|
||||||
|
|
||||||
data.TestResult = tstRslt;
|
data.RepetitionNr = repetitionNr;
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
data.FlowMtrFreq = RefFreq;
|
data.FlowMtrFreq = RefFreq;
|
||||||
@ -764,7 +646,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
data.Mass = Mass;
|
data.Mass = Mass;
|
||||||
|
|
||||||
data.Progress = progress;
|
data.Progress = progress;
|
||||||
float estCurrentTime = TimeEstimateBeginRpts + ((float)(tstRslt.RepetitionNr - 1) + progress) * TimeEstimateOneTest;
|
float estCurrentTime = TimeEstimateBeginRpts + ((float)(repetitionNr - 1) + progress) * TimeEstimateOneTest;
|
||||||
data.OveralProgress = estCurrentTime / TimeEstimateTotal;
|
data.OveralProgress = estCurrentTime / TimeEstimateTotal;
|
||||||
|
|
||||||
data.Tin = TempIn;
|
data.Tin = TempIn;
|
||||||
@ -782,20 +664,21 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// Only when test is running
|
/// Only when test is running
|
||||||
data.RefPulses = cBrd.EtPulses(0);
|
data.RefPulses = cBrd.EtPulses(0);
|
||||||
float refPulsesPerLtr = 1.0f / outPath.FlowMeter.LtrPerPulseCorrected(RefFlow.Val); /// [pulse/ltr]
|
float refPulsesPerLtr = 1.0f / outPath.FlowMeter.LtrPerPulseCorrected(RefFlow.Val); /// [pulse/ltr]
|
||||||
data.Volume = new FloatBox() { Name = "Volume", Format = "F1", Val = Formulas.VolumeFromPulses(data.RefPulses, refPulsesPerLtr) };
|
data.Volume = new FloatBox() { Name = "Volume", Format = "F1", Val = (float)Formulas.VolumeFromPulses(data.RefPulses, refPulsesPerLtr) };
|
||||||
|
|
||||||
int count = Math.Min(Config.Data.WMsCount, data.TestResult.Meters.Count);
|
/// TODO: Reimplement
|
||||||
for (int i = 0; i < count; i++)
|
//int count = Math.Min(Config.Data.WMsCount, data.TestResult.Meters.Count);
|
||||||
{
|
//for (int i = 0; i < count; i++)
|
||||||
if (sensPath.RegisterReaders[i] != null)
|
//{
|
||||||
{
|
// if (sensPath.RegisterReaders[i] != null)
|
||||||
data.TestResult.Meters[i].PulsesMeter = WMPulses[i];
|
// {
|
||||||
data.TestResult.Meters[i].PulsesMaster = WMRefPulses[i];
|
// data.TestResult.Meters[i].PulsesMeter = WMPulses[i];
|
||||||
data.TestResult.Meters[i].VolumeMeter = Formulas.VolumeFromPulses(WMPulses[i], sensPath.RegisterReaders[i].PulsesPerLtr);
|
// data.TestResult.Meters[i].PulsesMaster = WMRefPulses[i];
|
||||||
data.TestResult.Meters[i].VolumeRef = Formulas.VolumeFromPulses(WMRefPulses[i], refPulsesPerLtr);
|
// data.TestResult.Meters[i].VolumeMeter = Formulas.VolumeFromPulses(WMPulses[i], sensPath.RegisterReaders[i].PulsesPerLtr);
|
||||||
data.TestResult.Meters[i].VolumeErrorPct = Formulas.ErrorFromVolumes(data.TestResult.Meters[i].VolumeMeter, data.TestResult.Meters[i].VolumeRef);
|
// data.TestResult.Meters[i].VolumeRef = Formulas.VolumeFromPulses(WMRefPulses[i], refPulsesPerLtr);
|
||||||
}
|
// data.TestResult.Meters[i].VolumeErrorPct = Formulas.ErrorFromVolumes(data.TestResult.Meters[i].VolumeMeter, data.TestResult.Meters[i].VolumeRef);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -805,21 +688,23 @@ namespace TBF.BenchControl.Sequences
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string TestResult2CsvLine(TestResult tstRslt)
|
protected string TestResult2CsvLine(string testName, int part)
|
||||||
{
|
{
|
||||||
|
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(testName, part);
|
||||||
|
|
||||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||||
|
|
||||||
sb.Append(tstRslt.TimeStart);
|
sb.Append(tstRslt.StartTime);
|
||||||
sb.Append(";"); sb.Append(tstRslt.BatchNr);
|
sb.Append(";"); sb.Append(tstRslt.Batch.BatchNr);
|
||||||
sb.Append(";"); sb.Append(tstRslt.TestName);
|
sb.Append(";"); sb.Append(tstRslt.Name());
|
||||||
sb.Append(";"); sb.Append(tstRslt.RepetitionNr);
|
sb.Append(";"); sb.Append(tstRslt.RepetitionNr);
|
||||||
sb.Append(";"); sb.Append("1");
|
sb.Append(";"); sb.Append("1");
|
||||||
sb.Append(";"); sb.Append(tstRslt.Method);
|
sb.Append(";"); sb.Append(tstRslt.Method());
|
||||||
sb.Append(";"); sb.Append(tstRslt.Volume);
|
sb.Append(";"); sb.Append(tstRslt.TargetVolume());
|
||||||
sb.Append(";"); sb.Append(tstRslt.Qfrom);
|
sb.Append(";"); sb.Append(tstRslt.Qfrom());
|
||||||
sb.Append(";"); sb.Append(tstRslt.Qto);
|
sb.Append(";"); sb.Append(tstRslt.Qto());
|
||||||
sb.Append(";"); sb.Append(tstRslt.ErrLimLo + tstRslt.Uncertainty);
|
sb.Append(";"); sb.Append(tstRslt.ErrLimLo() + tstRslt.Uncertainty());
|
||||||
sb.Append(";"); sb.Append(tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
sb.Append(";"); sb.Append(tstRslt.ErrLimHi() - tstRslt.Uncertainty());
|
||||||
sb.Append(";"); sb.Append("0");
|
sb.Append(";"); sb.Append("0");
|
||||||
sb.Append(";"); sb.Append("60");
|
sb.Append(";"); sb.Append("60");
|
||||||
sb.Append(";"); sb.Append("0");
|
sb.Append(";"); sb.Append("0");
|
||||||
@ -830,12 +715,12 @@ namespace TBF.BenchControl.Sequences
|
|||||||
sb.Append(";"); sb.Append(tstRslt.AmbientTempAve);
|
sb.Append(";"); sb.Append(tstRslt.AmbientTempAve);
|
||||||
sb.Append(";"); sb.Append(tstRslt.AmbientPressAve);
|
sb.Append(";"); sb.Append(tstRslt.AmbientPressAve);
|
||||||
sb.Append(";"); sb.Append(tstRslt.AmbientHumiAve);
|
sb.Append(";"); sb.Append(tstRslt.AmbientHumiAve);
|
||||||
sb.Append(";"); sb.Append(tstRslt.PressInAvrg);
|
sb.Append(";"); sb.Append(tstRslt.PressUpAvrg);
|
||||||
sb.Append(";"); sb.Append(tstRslt.PressOutAvrg);
|
sb.Append(";"); sb.Append(tstRslt.PressDownAvrg);
|
||||||
sb.Append(";"); sb.Append(tstRslt.PressInStart);
|
sb.Append(";"); sb.Append(tstRslt.PressUpStart);
|
||||||
sb.Append(";"); sb.Append(tstRslt.PressOutStart);
|
sb.Append(";"); sb.Append(tstRslt.PressDownStart);
|
||||||
sb.Append(";"); sb.Append(tstRslt.PressInEnd);
|
sb.Append(";"); sb.Append(tstRslt.PressUpEnd);
|
||||||
sb.Append(";"); sb.Append(tstRslt.PressOutEnd);
|
sb.Append(";"); sb.Append(tstRslt.PressDownEnd);
|
||||||
sb.Append(";"); sb.Append(tstRslt.TempInAvrg);
|
sb.Append(";"); sb.Append(tstRslt.TempInAvrg);
|
||||||
sb.Append(";"); sb.Append(tstRslt.TempOutAvrg);
|
sb.Append(";"); sb.Append(tstRslt.TempOutAvrg);
|
||||||
sb.Append(";"); sb.Append(tstRslt.TempDivAvrg);
|
sb.Append(";"); sb.Append(tstRslt.TempDivAvrg);
|
||||||
@ -849,7 +734,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
sb.Append(";"); sb.Append(tstRslt.MassStart);
|
sb.Append(";"); sb.Append(tstRslt.MassStart);
|
||||||
sb.Append(";"); sb.Append(tstRslt.MassEndRaw);
|
sb.Append(";"); sb.Append(tstRslt.MassEndRaw);
|
||||||
sb.Append(";"); sb.Append(tstRslt.MassEnd);
|
sb.Append(";"); sb.Append(tstRslt.MassEnd);
|
||||||
sb.Append(";"); sb.Append(tstRslt.MassDiff);
|
sb.Append(";"); sb.Append(tstRslt.MassEnd - tstRslt.MassStart);
|
||||||
sb.Append(";"); sb.Append(tstRslt.DensityDiv);
|
sb.Append(";"); sb.Append(tstRslt.DensityDiv);
|
||||||
sb.Append(";"); sb.Append(tstRslt.DensityIn);
|
sb.Append(";"); sb.Append(tstRslt.DensityIn);
|
||||||
sb.Append(";"); sb.Append(tstRslt.DensityOut);
|
sb.Append(";"); sb.Append(tstRslt.DensityOut);
|
||||||
@ -863,7 +748,7 @@ namespace TBF.BenchControl.Sequences
|
|||||||
sb.Append(";"); sb.Append(tstRslt.VolumeCTV); /// Vet . . . komercne prava hodnota - podla vahy
|
sb.Append(";"); sb.Append(tstRslt.VolumeCTV); /// Vet . . . komercne prava hodnota - podla vahy
|
||||||
sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// Velm . . . . objem podla etalonu
|
sb.Append(";"); sb.Append(tstRslt.VolumeMaster); /// Velm . . . . objem podla etalonu
|
||||||
sb.Append(";"); sb.Append(" "); /// Vmass . . . objem podla druheho etalonu / prietokomeru pred tratou (teraz vynechavame)
|
sb.Append(";"); sb.Append(" "); /// Vmass . . . objem podla druheho etalonu / prietokomeru pred tratou (teraz vynechavame)
|
||||||
sb.Append(";"); sb.Append(tstRslt.Time); /// t
|
sb.Append(";"); sb.Append(tstRslt.TestTime); /// t
|
||||||
sb.Append(";"); sb.Append(tstRslt.ErrorMaster); /// Eelm . . . chyba etalonu voci komercne pravej hodnote
|
sb.Append(";"); sb.Append(tstRslt.ErrorMaster); /// Eelm . . . chyba etalonu voci komercne pravej hodnote
|
||||||
sb.Append(";"); sb.Append(" "); /// Emass . . . chyba druheho etalonu voci komercne pravej hodnote (teraz vynechavame)
|
sb.Append(";"); sb.Append(" "); /// Emass . . . chyba druheho etalonu voci komercne pravej hodnote (teraz vynechavame)
|
||||||
sb.Append(";"); if (outPath.FlowMeter != null && outPath.FlowMeter.LtrPerPulse != 0)
|
sb.Append(";"); if (outPath.FlowMeter != null && outPath.FlowMeter.LtrPerPulse != 0)
|
||||||
@ -871,65 +756,96 @@ namespace TBF.BenchControl.Sequences
|
|||||||
sb.Append(1.0f / outPath.FlowMeter.LtrPerPulse);/// Const.MID . konstanta eatlonu
|
sb.Append(1.0f / outPath.FlowMeter.LtrPerPulse);/// Const.MID . konstanta eatlonu
|
||||||
}
|
}
|
||||||
sb.Append(";"); sb.Append(" "); /// Const.MA . . konstanta druheho etalonu
|
sb.Append(";"); sb.Append(" "); /// Const.MA . . konstanta druheho etalonu
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivStart0); /// Time Div Start celkovy cas v [ms]
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivStart0); /// Time Div Start celkovy cas v [ms]
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivStart1); /// Time Div Start1
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivStart1); /// Time Div Start1
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivStart2); /// Time Div Start2
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivStart2); /// Time Div Start2
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivStart3); /// Time Div Start3
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivStart3); /// Time Div Start3
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivStart4); /// Time Div Start4
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivStart4); /// Time Div Start4
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivStart5); /// Time Div Start5
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivStart5); /// Time Div Start5
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivEnd0); /// Time Div End celkovy cas v [ms]
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivEnd0); /// Time Div End celkovy cas v [ms]
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivEnd1); /// Time Div End1
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivEnd1); /// Time Div End1
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivEnd2); /// Time Div End2
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivEnd2); /// Time Div End2
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivEnd3); /// Time Div End3
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivEnd3); /// Time Div End3
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivEnd4); /// Time Div End4
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivEnd4); /// Time Div End4
|
||||||
sb.Append(";"); sb.Append(tstRslt.TimeDivEnd5); /// Time Div End5
|
//sb.Append(";"); sb.Append(tstRslt.TimeDivEnd5); /// Time Div End5
|
||||||
sb.Append(";"); sb.Append(tstRslt.PulsesMaster); /// Celkovy pocet et. pulzov skusky
|
sb.Append(";"); sb.Append(tstRslt.PulsesMaster); /// Celkovy pocet et. pulzov skusky
|
||||||
sb.Append(";"); sb.Append(" "); /// - '' - pre druhy
|
sb.Append(";"); sb.Append(" "); /// - '' - pre druhy
|
||||||
for (int i = 0; i < tstRslt.Meters.Count; i++)
|
for (int i = 0; i < ProcessData.BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
|
||||||
MeterTestResult mtrRslt = tstRslt.Meters[i];
|
|
||||||
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.SerialNr); /// WM Ser.No.
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vref - objem namerany stanicou
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeErrorPct); /// WM Emt - chyba vodomerom nameraneho objemu
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.CalibFactor); /// iPerl calibration factor used during the test / ...
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.Time); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
|
|
||||||
bool ok = (mtrRslt.VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
&& (mtrRslt.VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
sb.Append(";"); sb.Append(ok ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.Q2Correction.ToString("F1")); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.TimeStart); /// WM Time_start - ' ' -
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Volume_end - ' ' -
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.TimeEnd); /// WM Time_end - ' ' -
|
|
||||||
}
|
|
||||||
for (int i = 0; i < tstRslt.CombinedMeters.Count; i++)
|
|
||||||
{
|
{
|
||||||
MeterTestResult mtrRslt = tstRslt.CombinedMeters[i];
|
if (ProcessData.BatchRslts.WaterMeters[i] != null)
|
||||||
|
{
|
||||||
|
if (!ProcessData.BatchRslts.WaterMeters[i].Compound())
|
||||||
|
{
|
||||||
|
Results.Entities.MeterTestRslt mtrRslt = ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
|
||||||
|
|
||||||
sb.Append(";"); sb.Append(mtrRslt.SerialNr); /// WM Ser.No.
|
if (mtrRslt != null)
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system
|
{
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system
|
sb.Append(";"); sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr); /// WM Ser.No.
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom
|
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vet - objem namerany stanicou
|
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeErrorPct); /// WM Emt - chyba vodomerom nameraneho objemu
|
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom
|
||||||
sb.Append(";"); sb.Append(" "); /// WM U - neistota (zatial nechat prazdne)
|
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vref - objem namerany stanicou
|
||||||
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
|
sb.Append(";"); sb.Append(mtrRslt.Error); /// WM Emt - chyba vodomerom nameraneho objemu
|
||||||
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
|
#if IPERLST
|
||||||
sb.Append(";"); sb.Append(mtrRslt.Time); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
|
sb.Append(";"); sb.Append(ProcessData.BatchRslts.WaterMeters[i].CalibFactor); /// iPerl calibration factor used during the test / ...
|
||||||
bool ok = (mtrRslt.VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
#else
|
||||||
&& (mtrRslt.VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
sb.Append(";"); sb.Append(" "); /// nechat prazdne
|
||||||
sb.Append(";"); sb.Append(ok ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
|
#endif
|
||||||
sb.Append(";"); sb.Append(" "); /// WM AN value - hodnota z analogoveho prevodnika (teraz nic)
|
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
|
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
|
||||||
sb.Append(";"); sb.Append(mtrRslt.TimeStart); /// WM Time_start - ' ' -
|
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
|
||||||
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Volume_end - ' ' -
|
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
|
||||||
sb.Append(";"); sb.Append(mtrRslt.TimeEnd); /// WM Time_end - ' ' -
|
#if IPERLST
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.Q2Correction.ToString("F1")); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
||||||
|
#else
|
||||||
|
sb.Append(";"); sb.Append(" "); /// nechat prazdne
|
||||||
|
#endif
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.TimestampStart); /// WM Time_start - ' ' -
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Volume_end - ' ' -
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.TimestampEnd); /// WM Time_end - ' ' -
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (byte b = (byte)CompoundMeterId.CompoundMain; b <= (byte)CompoundMeterId.Compound; b++)
|
||||||
|
{
|
||||||
|
Results.Entities.MeterTestRslt mtrRslt = ProcessData.BatchRslts.GetMeterTestRslt(testName, i, (CompoundMeterId)b);
|
||||||
|
|
||||||
|
if (mtrRslt != null)
|
||||||
|
{
|
||||||
|
sb.Append(";");
|
||||||
|
switch ((CompoundMeterId)b)
|
||||||
|
{
|
||||||
|
case CompoundMeterId.CompoundMain:
|
||||||
|
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr);
|
||||||
|
break;
|
||||||
|
case CompoundMeterId.CompoundAux:
|
||||||
|
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNrEx);
|
||||||
|
break;
|
||||||
|
case CompoundMeterId.Compound:
|
||||||
|
sb.Append(ProcessData.BatchRslts.WaterMeters[i].SerialNr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Vinit - pri pevnom starte pociatocny stav natukany alebo cez inteligentny system
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Vfin - pri pevnom starte konecny stav natukany alebo cez inteligentny system
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// WM Vmer - objem namerany vodomerom
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeRef); /// WM Vet - objem namerany stanicou
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.Error); /// WM Emt - chyba vodomerom nameraneho objemu
|
||||||
|
sb.Append(";"); sb.Append(" "); /// WM U - neistota (zatial nechat prazdne)
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.PulsesMeter); /// WM Np met - pocet impulzov zo skusaneho meradla
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.PulsesMaster); /// WM Np elm - pocet impulzov etalonu pocas merania pre prislusny vodomer
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
|
||||||
|
sb.Append(";"); sb.Append(" "); /// WM AN value - hodnota z analogoveho prevodnika (teraz nic)
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// WM Volume_start - pri datastreamovych hodnotach (alebo kamera)
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.TimestampStart); /// WM Time_start - ' ' -
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// WM Volume_end - ' ' -
|
||||||
|
sb.Append(";"); sb.Append(mtrRslt.TimestampEnd); /// WM Time_end - ' ' -
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sb.Append(";");
|
sb.Append(";");
|
||||||
|
|
||||||
@ -942,92 +858,92 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="test">Test to be simulated</param>
|
/// <param name="test">Test to be simulated</param>
|
||||||
/// <returns>Test result</returns>
|
/// <returns>Test result</returns>
|
||||||
protected TestResult MakeSimulated(Test test, int repetitionNr, float errorPctBase)
|
protected void MakeSimulated(string testName, int repeats, int repetitionNr, int part, float errorPctBase)
|
||||||
{
|
{
|
||||||
TestResult tstRslt = new TestResult(test, repetitionNr, MetersKind.Single);
|
string fullTestName = Results.Utils.GetTestName(testName, repeats, repetitionNr);
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
|
||||||
|
tstRslt.StartTime = DateTime.Now;
|
||||||
|
tstRslt.EndTime = DateTime.Now;
|
||||||
|
tstRslt.FlowSetTime = 10;
|
||||||
|
tstRslt.TestTime = tstRslt.TargetTime();
|
||||||
|
/// TODO: Verify whether 'ltrPerRefPulse' is up to date
|
||||||
|
tstRslt.PulsesMaster = (ltrPerRefPulse > 1E-6) ? (tstRslt.TargetVolume() / ltrPerRefPulse) : 1;
|
||||||
|
tstRslt.ConstMaster = ltrPerRefPulse;
|
||||||
|
tstRslt.MassStartRaw = 0;
|
||||||
|
tstRslt.MassStart = 0;
|
||||||
|
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Program.LocalSettings.RealDensity / 1000.0f;
|
||||||
|
tstRslt.MassEnd = tstRslt.MassEndRaw;
|
||||||
|
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
|
||||||
|
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
|
||||||
|
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
|
||||||
|
tstRslt.Buoyancy = 0; /// TODO
|
||||||
|
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
|
||||||
|
tstRslt.FlowVolume = tstRslt.TargetVolume() / tstRslt.TargetTime();
|
||||||
|
tstRslt.VolumeCTV = tstRslt.TargetVolume();
|
||||||
|
tstRslt.VolumeMaster = tstRslt.TargetVolume();
|
||||||
|
tstRslt.ErrorMaster = 0;
|
||||||
|
|
||||||
tstRslt.AmbientTempAve = 20.0f;
|
tstRslt.AmbientTempAve = 20.0f;
|
||||||
tstRslt.AmbientPressAve = 1000.0f;
|
tstRslt.AmbientPressAve = 1000.0f;
|
||||||
tstRslt.AmbientHumiAve = 50.0f;
|
tstRslt.AmbientHumiAve = 50.0f;
|
||||||
|
|
||||||
tstRslt.PressInStart = 1000.0f;
|
tstRslt.PressUpStart = 1000.0f;
|
||||||
tstRslt.PressOutStart = 1000.0f;
|
tstRslt.PressDownStart = 1000.0f;
|
||||||
tstRslt.TempInStart = 20.0f;
|
tstRslt.TempInStart = 20.0f;
|
||||||
tstRslt.TempOutStart = 20.0f;
|
tstRslt.TempOutStart = 20.0f;
|
||||||
tstRslt.TempDivStart = 20.0f;
|
tstRslt.TempDivStart = 20.0f;
|
||||||
|
tstRslt.PressUpEnd = 1000.0f;
|
||||||
tstRslt.PressInEnd = 1000.0f;
|
tstRslt.PressDownEnd = 1000.0f;
|
||||||
tstRslt.PressOutEnd = 1000.0f;
|
|
||||||
tstRslt.TempInEnd = 20.0f;
|
tstRslt.TempInEnd = 20.0f;
|
||||||
tstRslt.TempOutEnd = 20.0f;
|
tstRslt.TempOutEnd = 20.0f;
|
||||||
tstRslt.TempDivEnd = 20.0f;
|
tstRslt.TempDivEnd = 20.0f;
|
||||||
|
tstRslt.PressUpAvrg = 1000.0f;
|
||||||
tstRslt.PressInAvrg = 1000.0f;
|
tstRslt.PressDownAvrg = 1000.0f;
|
||||||
tstRslt.PressOutAvrg = 1000.0f;
|
|
||||||
tstRslt.TempInAvrg = 20.0f;
|
tstRslt.TempInAvrg = 20.0f;
|
||||||
tstRslt.TempOutAvrg = 20.0f;
|
tstRslt.TempOutAvrg = 20.0f;
|
||||||
tstRslt.TempDivAvrg = 20.0f;
|
tstRslt.TempDivAvrg = 20.0f;
|
||||||
|
tstRslt.PressUpMin = 1000.0f;
|
||||||
|
tstRslt.PressDownMin = 1000.0f;
|
||||||
|
tstRslt.TempInMin = 20.0f;
|
||||||
|
tstRslt.TempOutMin = 20.0f;
|
||||||
|
tstRslt.TempDivMin = 20.0f;
|
||||||
|
tstRslt.PressUpMax = 1000.0f;
|
||||||
|
tstRslt.PressDownMax = 1000.0f;
|
||||||
|
tstRslt.TempInMax = 20.0f;
|
||||||
|
tstRslt.TempOutMax = 20.0f;
|
||||||
|
tstRslt.TempDivMax = 20.0f;
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
tstRslt.FlowMin = 0; /// TODO
|
||||||
tstRslt.MassStartRaw = 0;
|
tstRslt.FlowMax = 0; /// TODO
|
||||||
tstRslt.MassStart = 0;
|
|
||||||
tstRslt.MassEndRaw = test.Volume * Program.LocalSettings.RealDensity / 1000.0f;
|
|
||||||
tstRslt.MassEnd = tstRslt.MassEndRaw;
|
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd;
|
|
||||||
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.Time = test.TstTime;
|
|
||||||
tstRslt.FlowMass = tstRslt.MassDiff / test.TstTime;
|
|
||||||
tstRslt.FlowVolume = test.Volume / test.TstTime;
|
|
||||||
tstRslt.VolumeCTV = test.Volume;
|
|
||||||
tstRslt.VolumeMaster = test.Volume;
|
|
||||||
tstRslt.PulsesMaster = (ltrPerRefPulse > 1E-6) ? (test.Volume / ltrPerRefPulse) : 1;
|
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse;
|
|
||||||
tstRslt.ErrorMaster = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
float errorPct = errorPctBase + 0.05f * i;
|
float errorPct = errorPctBase + 0.05f * i;
|
||||||
|
|
||||||
/// Reference to iPerl water meter or null:
|
Results.Entities.MeterTestRslt meterRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.Single);
|
||||||
WaterMeters.iPerl.WaterMeter iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
IRegisterReader regReader = sensPath.RegisterReaders[i];
|
||||||
? (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
if ((sensPath.RegisterReaders[i] != null) && (WaterMeters.Count > i) && !WaterMeters[i].Disabled)
|
if (meterRslt != null && regReader != null)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
meterRslt.VolumeMeter = tstRslt.TargetVolume() * (1.0 + 0.01 * errorPct);
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
tstRslt.Meters[i].VolumeRef = test.Volume;
|
|
||||||
tstRslt.Meters[i].Time = test.TstTime;
|
|
||||||
tstRslt.Meters[i].TimeStart = 0;
|
|
||||||
tstRslt.Meters[i].TimeEnd = test.TstTime;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = tstRslt.PulsesMaster;
|
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = errorPct;
|
|
||||||
tstRslt.Meters[i].Passed = (errorPct >= test.ErrLimLo + test.Uncertainty)
|
|
||||||
&& (errorPct <= test.ErrLimHi - test.Uncertainty);
|
|
||||||
tstRslt.Meters[i].VolumeMeter = test.Volume * (1.0f + 0.01f * errorPct);
|
|
||||||
tstRslt.Meters[i].PulsesMeter = sensPath.RegisterReaders[i].PulsesPerLtr * tstRslt.Meters[i].VolumeMeter;
|
|
||||||
tstRslt.Meters[i].Disabled = false;
|
|
||||||
|
|
||||||
if (iPerl == null)
|
meterRslt.PulsesMeter = regReader.PulsesPerLtr * meterRslt.VolumeMeter;
|
||||||
{
|
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
tstRslt.Meters[i].VolumeEnd = 0; /// Normal meter
|
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||||
}
|
meterRslt.VolumeStart = 0;
|
||||||
else
|
meterRslt.VolumeEnd = meterRslt.VolumeMeter;
|
||||||
{
|
meterRslt.VolumeRef = tstRslt.TargetVolume();
|
||||||
/// iPerl
|
meterRslt.TimestampStart = 0;
|
||||||
tstRslt.Meters[i].VolumeEnd = tstRslt.Meters[i].VolumeStart + tstRslt.Meters[i].VolumeMeter;
|
meterRslt.TimestampEnd = tstRslt.TargetTime();
|
||||||
}
|
meterRslt.TestTime = tstRslt.TargetTime();
|
||||||
|
meterRslt.Error = errorPct;
|
||||||
|
meterRslt.Passed = (errorPct >= tstRslt.ErrLimLo() + tstRslt.Uncertainty())
|
||||||
|
&& (errorPct <= tstRslt.ErrLimHi() - tstRslt.Uncertainty());
|
||||||
|
meterRslt.TestDone = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tstRslt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1036,122 +952,112 @@ namespace TBF.BenchControl.Sequences
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="test">Test to be simulated</param>
|
/// <param name="test">Test to be simulated</param>
|
||||||
/// <returns>Test result</returns>
|
/// <returns>Test result</returns>
|
||||||
protected TestResult MakeSimulatedCompound(Test test, CompoundTestType testType, int repetitionNr, float errorPct)
|
protected void MakeSimulatedCompound(string testName, int repeats, int repetitionNr, int part, float errorPct, float mainPart)
|
||||||
{
|
{
|
||||||
TestResult tstRslt = new TestResult(test, repetitionNr, MetersKind.Combined);
|
string fullTestName = Results.Utils.GetTestName(testName, repeats, repetitionNr);
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(fullTestName, part);
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
|
||||||
|
tstRslt.StartTime = DateTime.Now;
|
||||||
|
tstRslt.EndTime = DateTime.Now;
|
||||||
|
tstRslt.FlowSetTime = 10;
|
||||||
|
tstRslt.TestTime = tstRslt.TargetTime();
|
||||||
|
/// TODO: Verify whether 'ltrPerRefPulse' is up to date
|
||||||
|
tstRslt.PulsesMaster = (ltrPerRefPulse > 1E-6) ? (tstRslt.TargetVolume() / ltrPerRefPulse) : 1;
|
||||||
|
tstRslt.ConstMaster = ltrPerRefPulse;
|
||||||
|
tstRslt.MassStartRaw = 0;
|
||||||
|
tstRslt.MassStart = 0;
|
||||||
|
tstRslt.MassEndRaw = tstRslt.TargetVolume() * Program.LocalSettings.RealDensity / 1000.0f;
|
||||||
|
tstRslt.MassEnd = tstRslt.MassEndRaw;
|
||||||
|
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
|
||||||
|
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
|
||||||
|
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
|
||||||
|
tstRslt.Buoyancy = 0; /// TODO
|
||||||
|
tstRslt.FlowMass = tstRslt.MassEnd / tstRslt.TargetTime();
|
||||||
|
tstRslt.FlowVolume = tstRslt.TargetVolume() / tstRslt.TargetTime();
|
||||||
|
tstRslt.VolumeCTV = tstRslt.TargetVolume();
|
||||||
|
tstRslt.VolumeMaster = tstRslt.TargetVolume();
|
||||||
|
tstRslt.ErrorMaster = 0;
|
||||||
|
|
||||||
tstRslt.AmbientTempAve = 20.0f;
|
tstRslt.AmbientTempAve = 20.0f;
|
||||||
tstRslt.AmbientPressAve = 1000.0f;
|
tstRslt.AmbientPressAve = 1000.0f;
|
||||||
tstRslt.AmbientHumiAve = 50.0f;
|
tstRslt.AmbientHumiAve = 50.0f;
|
||||||
|
|
||||||
tstRslt.PressInStart = 1000.0f;
|
tstRslt.PressUpStart = 1000.0f;
|
||||||
tstRslt.PressOutStart = 1000.0f;
|
tstRslt.PressDownStart = 1000.0f;
|
||||||
tstRslt.TempInStart = 20.0f;
|
tstRslt.TempInStart = 20.0f;
|
||||||
tstRslt.TempOutStart = 20.0f;
|
tstRslt.TempOutStart = 20.0f;
|
||||||
tstRslt.TempDivStart = 20.0f;
|
tstRslt.TempDivStart = 20.0f;
|
||||||
|
tstRslt.PressUpEnd = 1000.0f;
|
||||||
tstRslt.PressInEnd = 1000.0f;
|
tstRslt.PressDownEnd = 1000.0f;
|
||||||
tstRslt.PressOutEnd = 1000.0f;
|
|
||||||
tstRslt.TempInEnd = 20.0f;
|
tstRslt.TempInEnd = 20.0f;
|
||||||
tstRslt.TempOutEnd = 20.0f;
|
tstRslt.TempOutEnd = 20.0f;
|
||||||
tstRslt.TempDivEnd = 20.0f;
|
tstRslt.TempDivEnd = 20.0f;
|
||||||
|
tstRslt.PressUpAvrg = 1000.0f;
|
||||||
tstRslt.PressInAvrg = 1000.0f;
|
tstRslt.PressDownAvrg = 1000.0f;
|
||||||
tstRslt.PressOutAvrg = 1000.0f;
|
|
||||||
tstRslt.TempInAvrg = 20.0f;
|
tstRslt.TempInAvrg = 20.0f;
|
||||||
tstRslt.TempOutAvrg = 20.0f;
|
tstRslt.TempOutAvrg = 20.0f;
|
||||||
tstRslt.TempDivAvrg = 20.0f;
|
tstRslt.TempDivAvrg = 20.0f;
|
||||||
|
tstRslt.PressUpMin = 1000.0f;
|
||||||
|
tstRslt.PressDownMin = 1000.0f;
|
||||||
|
tstRslt.TempInMin = 20.0f;
|
||||||
|
tstRslt.TempOutMin = 20.0f;
|
||||||
|
tstRslt.TempDivMin = 20.0f;
|
||||||
|
tstRslt.PressUpMax = 1000.0f;
|
||||||
|
tstRslt.PressDownMax = 1000.0f;
|
||||||
|
tstRslt.TempInMax = 20.0f;
|
||||||
|
tstRslt.TempOutMax = 20.0f;
|
||||||
|
tstRslt.TempDivMax = 20.0f;
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
tstRslt.FlowMin = 0; /// TODO
|
||||||
tstRslt.MassStartRaw = 0;
|
tstRslt.FlowMax = 0; /// TODO
|
||||||
tstRslt.MassStart = 0;
|
|
||||||
tstRslt.MassEndRaw = test.Volume * Program.LocalSettings.RealDensity / 1000.0f;
|
|
||||||
tstRslt.MassEnd = tstRslt.MassEndRaw;
|
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd;
|
|
||||||
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.Time = test.TstTime;
|
|
||||||
tstRslt.FlowMass = tstRslt.MassDiff / test.TstTime;
|
|
||||||
tstRslt.FlowVolume = test.Volume / test.TstTime;
|
|
||||||
tstRslt.VolumeCTV = test.Volume;
|
|
||||||
tstRslt.VolumeMaster = test.Volume;
|
|
||||||
tstRslt.PulsesMaster = (ltrPerRefPulse > 1E-6) ? (test.Volume / ltrPerRefPulse) : 1;
|
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse;
|
|
||||||
tstRslt.ErrorMaster = 0;
|
|
||||||
|
|
||||||
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
|
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeRef = tstRslt.VolumeCTV; /// [l] must be calculated before main & aux. meter error
|
Results.Entities.MeterTestRslt compoundRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.Compound);
|
||||||
|
Results.Entities.MeterTestRslt mainRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.CompoundMain);
|
||||||
|
Results.Entities.MeterTestRslt auxRslt = ProcessData.BatchRslts.GetMeterTestRslt(fullTestName, i, CompoundMeterId.CompoundAux);
|
||||||
|
|
||||||
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
|
double compoundVolume = tstRslt.TargetVolume() * (1.0 + 0.01 * errorPct);
|
||||||
|
double mainVolume = compoundVolume * mainPart;
|
||||||
|
double auxVolume = compoundVolume * (1.0 - mainPart);
|
||||||
|
|
||||||
|
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||||
{
|
{
|
||||||
if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon)
|
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[2 * i + isAux];
|
||||||
{
|
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainRslt : auxRslt;
|
||||||
tstRslt.Meters[i].PulsesPerLiter = 1.0f;
|
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
if (meterRslt != null && regReader != null)
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
{
|
||||||
tstRslt.Meters[i].VolumeEnd = 0; /// Normal meter
|
meterRslt.VolumeMeter = (isAux == 0) ? mainVolume : auxVolume;
|
||||||
|
|
||||||
tstRslt.Meters[i].VolumeRef = test.Volume;
|
meterRslt.PulsesMeter = regReader.PulsesPerLtr * meterRslt.VolumeMeter;
|
||||||
if (testType == CompoundTestType.Regular && IsMainMtr(i))
|
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
{
|
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||||
tstRslt.Meters[i].VolumeMeter = test.Volume * (1.0f + 0.01f * errorPct);
|
meterRslt.VolumeStart = 0;
|
||||||
|
meterRslt.VolumeEnd = meterRslt.VolumeMeter;
|
||||||
|
meterRslt.VolumeRef = tstRslt.TargetVolume();
|
||||||
|
meterRslt.TimestampStart = 0;
|
||||||
|
meterRslt.TimestampEnd = tstRslt.TargetTime();
|
||||||
|
meterRslt.TestTime = tstRslt.TargetTime();
|
||||||
|
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV);
|
||||||
|
meterRslt.Passed = (errorPct >= tstRslt.ErrLimLo() + tstRslt.Uncertainty())
|
||||||
|
&& (errorPct <= tstRslt.ErrLimHi() - tstRslt.Uncertainty());
|
||||||
|
meterRslt.TestDone = true;
|
||||||
}
|
}
|
||||||
else if (testType == CompoundTestType.DetectionRise && !IsMainMtr(i))
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeMeter = test.Volume * (1.0f + 0.01f * errorPct);
|
|
||||||
}
|
|
||||||
else if (testType == CompoundTestType.DetectionFall && IsMainMtr(i))
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeMeter = test.Volume * (1.0f + 0.01f * errorPct);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].Time = test.TstTime;
|
|
||||||
tstRslt.Meters[i].TimeStart = 0;
|
|
||||||
tstRslt.Meters[i].TimeEnd = test.TstTime;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = tstRslt.PulsesMaster;
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = errorPct;
|
|
||||||
tstRslt.Meters[i].Passed = (errorPct >= test.ErrLimLo + test.Uncertainty)
|
|
||||||
&& (errorPct <= test.ErrLimHi - test.Uncertainty);
|
|
||||||
tstRslt.Meters[i].PulsesMeter = sensPath.RegisterReaders[i].PulsesPerLtr * tstRslt.Meters[i].VolumeMeter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = tstRslt.Meters[2 * iCmbnd].VolumeMeter + tstRslt.Meters[2 * iCmbnd + 1].VolumeMeter;
|
compoundRslt.VolumeRef = tstRslt.VolumeCTV; /// [l] must be calculated before main & aux. meter error
|
||||||
|
compoundRslt.VolumeMeter = mainRslt.VolumeMeter + auxRslt.VolumeMeter;
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = tstRslt.PulsesMaster;
|
compoundRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
tstRslt.CombinedMeters[iCmbnd].Time = test.TstTime;
|
compoundRslt.TestTime = tstRslt.TargetTime();
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef);
|
compoundRslt.Error = Formulas.ErrorFromVolumes(compoundRslt.VolumeMeter, tstRslt.VolumeCTV);
|
||||||
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
compoundRslt.Passed = (compoundRslt.Error >= tstRslt.ErrLimLo() + tstRslt.Uncertainty())
|
||||||
&& (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
&& (compoundRslt.Error <= tstRslt.ErrLimHi() - tstRslt.Uncertainty());
|
||||||
|
compoundRslt.TestDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tstRslt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns information whether a meter is a main meter or an aux. meter (compound meters).
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="i">Index to TestResult.Meters[] array</param>
|
|
||||||
/// <returns>true = main meter, false = aux. meter</returns>
|
|
||||||
bool IsMainMtr(int i)
|
|
||||||
{
|
|
||||||
return (i % 2) == 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ namespace TBF.BenchControl
|
|||||||
Factories.Add(new Elde.FlowMeter.FlowMeterFactory());
|
Factories.Add(new Elde.FlowMeter.FlowMeterFactory());
|
||||||
Factories.Add(new Elde.FlowMeterTwins.FlowMeterFactory());
|
Factories.Add(new Elde.FlowMeterTwins.FlowMeterFactory());
|
||||||
Factories.Add(new TestMethods.FlyingStart.TestMethodFactory());
|
Factories.Add(new TestMethods.FlyingStart.TestMethodFactory());
|
||||||
Factories.Add(new TestMethods.FlyingStartCollectionMethod.TestMethodFactory());
|
Factories.Add(new TestMethods.FlyingStartMassCollection.TestMethodFactory());
|
||||||
Factories.Add(new DataEntry.WMStates.EntryFormFactory());
|
Factories.Add(new DataEntry.WMStates.EntryFormFactory());
|
||||||
Factories.Add(new Ambient.Comet.Factory());
|
Factories.Add(new Ambient.Comet.Factory());
|
||||||
Factories.Add(new Ambient.Greco.Factory());
|
Factories.Add(new Ambient.Greco.Factory());
|
||||||
|
|||||||
@ -86,9 +86,11 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
|
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
TestResult tstRslt;
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -104,9 +106,9 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
//Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
//Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -121,9 +123,9 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
//Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
//Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -138,9 +140,9 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
//Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
//Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -175,7 +177,8 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
if (mode == Config.Entities.DebugMode.Simulate)
|
if (mode == Config.Entities.DebugMode.Simulate)
|
||||||
{
|
{
|
||||||
tstRslt = MakeSimulated(test, 1, simulatedError);
|
/// TODO: Reimplement
|
||||||
|
//tstRslt = MakeSimulated(test, 1, simulatedError);
|
||||||
simulatedError *= 0.6f;
|
simulatedError *= 0.6f;
|
||||||
|
|
||||||
State.Create("Adjustment : Simulating the test")
|
State.Create("Adjustment : Simulating the test")
|
||||||
@ -192,12 +195,6 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tstRslt = new TestResult(test, repetitionNr, MetersKind.Single);
|
|
||||||
tstRslt.DoNotEvaluate = true;
|
|
||||||
tstRslt.DoNotPublish = true;
|
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
|
||||||
|
|
||||||
State.Create("Adjustment : Starting the test")
|
State.Create("Adjustment : Starting the test")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(measureOperations)
|
.AddOperations(measureOperations)
|
||||||
@ -217,8 +214,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
while (true)
|
while (true)
|
||||||
@ -231,30 +227,10 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
case Event.MeasurementCompleted: goto one_test_completed;
|
case Event.MeasurementCompleted: goto one_test_completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -266,7 +242,7 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress));
|
||||||
}
|
}
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
|
|
||||||
@ -276,81 +252,92 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
Bridge.OnActivity(this, Strings.Adjustment_in_progress);
|
Bridge.OnActivity(this, Strings.Adjustment_in_progress);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
|
||||||
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
if (tstRslt != null)
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
|
||||||
tstRslt.MassStart = 0;
|
|
||||||
tstRslt.MassEnd = 0;
|
|
||||||
tstRslt.MassDiff = 0;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 0; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
|
||||||
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume / 1000.0f); /// Convert the flow to [m3/h]
|
|
||||||
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
/// Corrected master pulses per liter
|
|
||||||
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
|
|
||||||
tstRslt.TimeDivStart0 = 0;
|
|
||||||
tstRslt.TimeDivStart1 = 0;
|
|
||||||
tstRslt.TimeDivStart2 = 0;
|
|
||||||
tstRslt.TimeDivStart3 = 0;
|
|
||||||
tstRslt.TimeDivStart4 = 0;
|
|
||||||
tstRslt.TimeDivStart5 = 0;
|
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
||||||
{
|
{
|
||||||
if ((sensPath.RegisterReaders[i] != null) && (WaterMeters.Count > i) && !WaterMeters[i].Disabled)
|
/// Auxiliary results
|
||||||
{
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
tstRslt.Meters[i].VolumeStart = 0; /// liter
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
tstRslt.Meters[i].PulsesPerLiter = (sensPath.RegisterReaders[i] == null ? 1.0f : sensPath.RegisterReaders[i].PulsesPerLtr);
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0)
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
{
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
tstRslt.Meters[i].VolumeErrorPct =
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
/// %
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
}
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
else
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
{
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
tstRslt.Meters[i].VolumeErrorPct = -100;
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
}
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
tstRslt.Meters[i].Disabled = false;
|
/// Main results
|
||||||
}
|
tstRslt.StartTime = TestStartTime;
|
||||||
else
|
tstRslt.EndTime = TestEndTime;
|
||||||
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStart = 0;
|
||||||
|
tstRslt.MassEnd = 0;
|
||||||
|
tstRslt.FlowMass = 0; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
|
||||||
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume); /// Calculate master flowmeter coefficient
|
||||||
|
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
|
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
|
||||||
|
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].Disabled = true;
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
|
||||||
|
GenericDevices.IRegisterReader regReader = (sensPath.RegisterReaders == null) ? null : sensPath.RegisterReaders[i];
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Update modeless dialog error information
|
/// Update modeless dialog error information
|
||||||
Bridge.OnAdjustmentInProgress(this, new AdjustmentInProgressEventArgs(tstRslt));
|
Bridge.OnAdjustmentInProgress(this, new AdjustmentInProgressEventArgs(tstRslt));
|
||||||
|
|
||||||
@ -365,11 +352,10 @@ namespace TBF.BenchControl.TestMethods.Adjustment
|
|||||||
///
|
///
|
||||||
/// Add to results (after user quits the adjustment loop)
|
/// Add to results (after user quits the adjustment loop)
|
||||||
///
|
///
|
||||||
AddOrOverwriteResult(tstRslt);
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
stopTest:
|
stopTest:
|
||||||
|
|
||||||
|
|||||||
@ -134,7 +134,7 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
|||||||
/// Quit this sequence ///
|
/// Quit this sequence ///
|
||||||
///----------------------///
|
///----------------------///
|
||||||
|
|
||||||
State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.")
|
State.Create("RoiDetection : Stopping diverter, gate, etc.")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.StopPreviousOp())
|
.AddOperation(cBrd.StopPreviousOp())
|
||||||
.EnterState();
|
.EnterState();
|
||||||
|
|||||||
@ -61,10 +61,12 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Combined);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -80,9 +82,9 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -97,9 +99,9 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -152,9 +154,9 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -221,8 +223,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
StartMassRaw = startMass.Val;
|
||||||
tstRslt.MassStartRaw = startMass.Val;
|
|
||||||
Mass.Val = startMass.Val;
|
Mass.Val = startMass.Val;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -247,8 +248,7 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
|
||||||
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
@ -272,30 +272,10 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -306,17 +286,18 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
log.Debug(logstr);
|
log.Debug(logstr);
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
TestProgressEventArgs data = GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress);
|
TestProgressEventArgs data = GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress);
|
||||||
for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
/// TODO: Reimplement
|
||||||
{
|
//for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
||||||
data.TestResult.CombinedMeters[i].VolumeMeter = data.TestResult.Meters[2 * i].VolumeMeter
|
//{
|
||||||
+ data.TestResult.Meters[2 * i + 1].VolumeMeter;
|
// data.TestResult.CombinedMeters[i].VolumeMeter = data.TestResult.Meters[2 * i].VolumeMeter
|
||||||
if (data.Volume.Valid)
|
// + data.TestResult.Meters[2 * i + 1].VolumeMeter;
|
||||||
{
|
// if (data.Volume.Valid)
|
||||||
data.TestResult.CombinedMeters[i].VolumeErrorPct =
|
// {
|
||||||
Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
|
// data.TestResult.CombinedMeters[i].VolumeErrorPct =
|
||||||
}
|
// Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
Bridge.OnTestProgress(this, data);
|
Bridge.OnTestProgress(this, data);
|
||||||
}
|
}
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
@ -361,8 +342,8 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
///
|
///
|
||||||
tstRslt.MassEndRaw = endMass.Val;
|
EndMassRaw = endMass.Val;
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
@ -371,107 +352,121 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
|||||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||||
|
|
||||||
/// Optionally supress pulses from the large water meter
|
|
||||||
if (testParams.SupressTrills)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < tstRslt.Meters.Count; i += 2)
|
|
||||||
{
|
|
||||||
WMPulses[i] = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (tstRslt != null)
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
|
||||||
|
|
||||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
|
||||||
{
|
|
||||||
tstRslt.ErrorMaster = 0.1f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
|
||||||
}
|
|
||||||
tstRslt.TimeDivStart0 = 0;
|
|
||||||
tstRslt.TimeDivStart1 = 0;
|
|
||||||
tstRslt.TimeDivStart2 = 0;
|
|
||||||
tstRslt.TimeDivStart3 = 0;
|
|
||||||
tstRslt.TimeDivStart4 = 0;
|
|
||||||
tstRslt.TimeDivStart5 = 0;
|
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
|
|
||||||
{
|
{
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeRef = tstRslt.VolumeCTV; /// [l] must be calculated before main & aux. meter error
|
/// Auxiliary results
|
||||||
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
|
/// Main results
|
||||||
|
tstRslt.StartTime = TestStartTime;
|
||||||
|
tstRslt.EndTime = TestEndTime;
|
||||||
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = startMass.Val;
|
||||||
|
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||||
|
tstRslt.MassEndRaw = endMass.Val;
|
||||||
|
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||||
|
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
|
||||||
|
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1001.03f is because density is in [kg/m3]
|
||||||
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||||
|
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||||
|
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon)
|
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
|
||||||
{
|
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
|
||||||
tstRslt.Meters[i].PulsesPerLiter = 1.0f;
|
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||||
tstRslt.Meters[i].VolumeStart = 0; /// [l]
|
|
||||||
tstRslt.Meters[i].VolumeEnd = 0; /// [l]
|
|
||||||
|
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV; /// [l]
|
|
||||||
if (WMRefPulses[i] != 0)
|
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeMeter *= ((float)cBrd.EtPulses(0) / (float)WMRefPulses[i]);
|
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[2 * i + isAux];
|
||||||
|
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||||
|
|
||||||
|
if (meterRslt != null && regReader != null)
|
||||||
|
{
|
||||||
|
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||||
|
|
||||||
|
/// 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 = tstRslt.TestTime;
|
||||||
|
meterRslt.VolumeStart = 0;
|
||||||
|
meterRslt.VolumeEnd = 0;
|
||||||
|
meterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||||
|
|
||||||
|
meterRslt.VolumeMeter = (regReader.PulsesPerLtr <= float.Epsilon)
|
||||||
|
? 0 : meterRslt.PulsesMeter / meterRslt.PulsesPerLiter;
|
||||||
|
|
||||||
|
if (meterRslt.PulsesMaster != 0)
|
||||||
|
{
|
||||||
|
meterRslt.VolumeMeter *= (tstRslt.PulsesMaster / meterRslt.PulsesMaster);
|
||||||
|
}
|
||||||
|
|
||||||
|
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV); /// Main/Aux meter error is not usedfor evaluation
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
Results.Entities.MeterTestRslt compoundMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Compound);
|
||||||
tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.Meters[i].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef); /// Not used
|
if (compoundMeterRslt != null && mainMeterRslt != null && auxMeterRslt != null)
|
||||||
|
{
|
||||||
|
compoundMeterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||||
|
compoundMeterRslt.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
|
||||||
|
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
|
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||||
|
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||||
|
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||||
|
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||||
|
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = tstRslt.Meters[2 * iCmbnd].VolumeMeter + tstRslt.Meters[2 * iCmbnd + 1].VolumeMeter;
|
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = cBrd.EtPulses(0);
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef);
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
&& (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
|
|||||||
@ -78,8 +78,11 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, (int)totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, (int)totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Combined);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
|
Qrise = 0;
|
||||||
|
Qfall = 0;
|
||||||
|
|
||||||
if (!test.Emptying) /// Do not skip emptying if test.Emptying==true
|
if (!test.Emptying) /// Do not skip emptying if test.Emptying==true
|
||||||
{
|
{
|
||||||
@ -112,7 +115,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
|
|
||||||
switching_flow_detection:
|
switching_flow_detection:
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowDetectTime0 = StateMachine.Time;
|
||||||
|
int flowDetectTime = 0;
|
||||||
float estFlowSetTime = 100.0f;
|
float estFlowSetTime = 100.0f;
|
||||||
|
|
||||||
/// Extract cameras from the current sensors path, add operations to the detection state
|
/// Extract cameras from the current sensors path, add operations to the detection state
|
||||||
@ -136,9 +140,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowDetectTime = StateMachine.Time - flowDetectTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowDetectTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowDetectTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
||||||
}
|
}
|
||||||
@ -154,9 +158,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowDetectTime = StateMachine.Time - flowDetectTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowDetectTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowDetectTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
||||||
if (e.Contains(Event.RegulValveTimeOut))
|
if (e.Contains(Event.RegulValveTimeOut))
|
||||||
@ -210,9 +214,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowDetectTime = StateMachine.Time - flowDetectTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowDetectTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowDetectTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
||||||
}
|
}
|
||||||
@ -310,30 +314,29 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
if (rvPulse > 0)
|
if (rvPulse > 0)
|
||||||
{
|
{
|
||||||
Qrise = detectedFlow;
|
Qrise = detectedFlow;
|
||||||
tstRslt.QRise = detectedFlow;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Qfall = detectedFlow;
|
Qfall = detectedFlow;
|
||||||
tstRslt.QFall = detectedFlow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UiBridge.Bridge.OnLog(this, string.Format("detected flow={0}\r\n", detectedFlow.ToString("F2")));
|
UiBridge.Bridge.OnLog(this, string.Format("detected flow={0}\r\n", detectedFlow.ToString("F2")));
|
||||||
|
|
||||||
float qfrom_test = detectedFlow + testParams.RelativeQfrom;
|
float qfrom_detected = detectedFlow + testParams.RelativeQfrom;
|
||||||
float qto_test = detectedFlow + testParams.RelativeQto;
|
float qto_detected = detectedFlow + testParams.RelativeQto;
|
||||||
|
|
||||||
/// Update test results with the test flow determined from the detected switching flow
|
/// Update test results with the test flow determined from the detected switching flow
|
||||||
tstRslt.Qfrom = qfrom_test;
|
float Qave_lps = (qfrom_detected + qto_detected) / 7.2f;
|
||||||
tstRslt.Qto = qto_test;
|
float testTimeFromDetectedFlow = test.Volume / Qave_lps; /// Test volume wont be changed
|
||||||
float Qave_lps = (qfrom_test + qto_test) / 7.2f;
|
|
||||||
tstRslt.TstTime = tstRslt.Volume / Qave_lps;
|
|
||||||
|
|
||||||
float relativeQave = (testParams.RelativeQfrom + testParams.RelativeQto) / 2.0f;
|
float relativeQave = (testParams.RelativeQfrom + testParams.RelativeQto) / 2.0f;
|
||||||
bool goBackToInitFlow = ((rvPulse > 0) && (relativeQave < 0)) ||
|
bool goBackToInitFlow = ((rvPulse > 0) && (relativeQave < 0)) ||
|
||||||
((rvPulse < 0) && (relativeQave > 0));
|
((rvPulse < 0) && (relativeQave > 0));
|
||||||
|
|
||||||
if (goBackToInitFlow)
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
|
|
||||||
|
if (goBackToInitFlow)
|
||||||
{
|
{
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
State.Create("CombinedWithDetection : Switching flow detected, going back")
|
State.Create("CombinedWithDetection : Switching flow detected, going back")
|
||||||
@ -345,9 +348,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
||||||
if (e.Contains(Event.RegulValveTimeOut))
|
if (e.Contains(Event.RegulValveTimeOut))
|
||||||
@ -364,16 +367,16 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
//State.Create("set_RV_position",
|
//State.Create("set_RV_position",
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(measureOperations)
|
.AddOperations(measureOperations)
|
||||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_test, qto_test, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 sec.
|
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, qfrom_detected, qto_detected, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 sec.
|
||||||
//.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue))
|
//.AddOp(pOut.RegulValve.SetPositionOp(35.0f, 38.0f, uint.MaxValue))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, testTimeFromDetectedFlow);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
if (e.Contains(Event.UiCmdStop)) goto stopTest;
|
||||||
//if (e.Contains(Event.FlowTimeOut)) goto do_detection;
|
//if (e.Contains(Event.FlowTimeOut)) goto do_detection;
|
||||||
@ -399,8 +402,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
StartMassRaw = startMass.Val;
|
||||||
tstRslt.MassStartRaw = startMass.Val;
|
|
||||||
Mass.Val = startMass.Val;
|
Mass.Val = startMass.Val;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -410,7 +412,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(measureOperations)
|
.AddOperations(measureOperations)
|
||||||
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||||
test.Qfrom, test.Qto, totalPulses, (float)test.TolerRed))
|
qfrom_detected, qto_detected, totalPulses, (float)test.TolerRed))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -426,9 +428,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// Used to reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
int estimtdEndTime = StateMachine.Time + (int)tstRslt.TstTime;
|
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
while (true)
|
while (true)
|
||||||
@ -451,25 +452,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -481,17 +465,18 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
TestProgressEventArgs data = GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress);
|
TestProgressEventArgs data = GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress);
|
||||||
for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
/// TODO: Reimplement
|
||||||
{
|
//for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
||||||
data.TestResult.CombinedMeters[i].VolumeMeter = data.TestResult.Meters[2 * i].VolumeMeter
|
//{
|
||||||
+ data.TestResult.Meters[2 * i + 1].VolumeMeter;
|
// data.TestResult.CombinedMeters[i].VolumeMeter = data.TestResult.Meters[2 * i].VolumeMeter
|
||||||
if (data.Volume.Valid)
|
// + data.TestResult.Meters[2 * i + 1].VolumeMeter;
|
||||||
{
|
// if (data.Volume.Valid)
|
||||||
data.TestResult.CombinedMeters[i].VolumeErrorPct =
|
// {
|
||||||
Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
|
// data.TestResult.CombinedMeters[i].VolumeErrorPct =
|
||||||
}
|
// Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
Bridge.OnTestProgress(this, data);
|
Bridge.OnTestProgress(this, data);
|
||||||
}
|
}
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
@ -514,8 +499,8 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
///
|
///
|
||||||
tstRslt.MassEndRaw = endMass.Val;
|
EndMassRaw = endMass.Val;
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
@ -546,110 +531,127 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.PreviousStopped));
|
while (!e.Contains(Event.PreviousStopped));
|
||||||
|
|
||||||
|
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||||
|
|
||||||
/// Optionally supress pulses from the large water meter
|
|
||||||
if (testParams.SupressTrills)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < tstRslt.Meters.Count; i += 2)
|
|
||||||
{
|
|
||||||
WMPulses[i] = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (tstRslt != null)
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
|
||||||
|
|
||||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
|
||||||
{
|
|
||||||
tstRslt.ErrorMaster = 0.1f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TimeDivStart0 = 0;
|
|
||||||
tstRslt.TimeDivStart1 = 0;
|
|
||||||
tstRslt.TimeDivStart2 = 0;
|
|
||||||
tstRslt.TimeDivStart3 = 0;
|
|
||||||
tstRslt.TimeDivStart4 = 0;
|
|
||||||
tstRslt.TimeDivStart5 = 0;
|
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
|
|
||||||
{
|
{
|
||||||
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
|
/// Auxiliary results
|
||||||
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
|
/// Main results
|
||||||
|
tstRslt.StartTime = TestStartTime;
|
||||||
|
tstRslt.EndTime = TestEndTime;
|
||||||
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = startMass.Val;
|
||||||
|
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||||
|
tstRslt.MassEndRaw = endMass.Val;
|
||||||
|
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||||
|
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
|
||||||
|
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||||
|
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||||
|
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon)
|
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
|
||||||
{
|
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = (sensPath.RegisterReaders[i] == null ? 1.0f : sensPath.RegisterReaders[i].PulsesPerLtr);
|
|
||||||
tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||||
tstRslt.Meters[i].VolumeStart = 0; /// liter
|
|
||||||
tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
|
||||||
|
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV; /// liter
|
|
||||||
if (WMRefPulses[i] != 0)
|
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeMeter *= ((float)cBrd.EtPulses(0) / (float)WMRefPulses[i]);
|
GenericDevices.IRegisterReader regReader = sensPath.RegisterReaders[2 * i + isAux];
|
||||||
|
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||||
|
|
||||||
|
if (meterRslt != null && regReader != null)
|
||||||
|
{
|
||||||
|
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||||
|
|
||||||
|
/// 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;
|
||||||
|
|
||||||
|
if (meterRslt.PulsesMaster != 0)
|
||||||
|
{
|
||||||
|
meterRslt.VolumeMeter *= (tstRslt.PulsesMaster / meterRslt.PulsesMaster);
|
||||||
|
}
|
||||||
|
|
||||||
|
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, tstRslt.VolumeCTV); /// Main/Aux meter error is not usedfor evaluation
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
Results.Entities.MeterTestRslt compoundMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Compound);
|
||||||
tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = 0; /// Not used
|
if (compoundMeterRslt != null && mainMeterRslt != null && auxMeterRslt != null)
|
||||||
|
{
|
||||||
|
compoundMeterRslt.VolumeRef = tstRslt.VolumeCTV;
|
||||||
|
compoundMeterRslt.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
|
||||||
|
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
|
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||||
|
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||||
|
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||||
|
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||||
|
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||||
|
|
||||||
|
if (Qrise != 0) BatchRslts.WaterMeters[i].QRise = Qrise;
|
||||||
|
if (Qfall != 0) BatchRslts.WaterMeters[i].QFall = Qfall;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeRef = tstRslt.VolumeCTV; /// liter
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = tstRslt.Meters[2 * iCmbnd].VolumeMeter + tstRslt.Meters[2 * iCmbnd + 1].VolumeMeter;
|
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = cBrd.EtPulses(0);
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef);
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
&& (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -62,10 +62,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Single);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -81,9 +83,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -98,9 +100,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -154,9 +156,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -171,9 +173,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -239,9 +241,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeStart = dataEntryCmpnt.WMStartState(i); /// Units: 1 liter
|
|
||||||
|
|
||||||
///-----
|
|
||||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
|
|
||||||
@ -275,8 +274,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
TestStartTime = DateTime.Now;
|
||||||
tstRslt.MassStartRaw = startMass.Val;
|
StartMassRaw = startMass.Val;
|
||||||
Mass.Val = startMass.Val;
|
Mass.Val = startMass.Val;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -315,8 +314,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
|
||||||
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
@ -340,30 +338,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -375,7 +353,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress));
|
||||||
}
|
}
|
||||||
while (cBrd.EtPulses(0) < totalPulses);
|
while (cBrd.EtPulses(0) < totalPulses);
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
@ -442,8 +420,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
///
|
///
|
||||||
tstRslt.MassEndRaw = endMass.Val;
|
EndMassRaw = endMass.Val;
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
|
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
|
||||||
@ -458,11 +436,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
while (!e.Contains(Event.PreviousStopped));
|
while (!e.Contains(Event.PreviousStopped));
|
||||||
|
|
||||||
|
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
double massStart = Formulas.CorrectedValue(startMass.Val, outPath.Balance.Corrections);
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
double massEnd = Formulas.CorrectedValue(endMass.Val, outPath.Balance.Corrections);
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
double densityOut = Formulas.WaterDensityFromTemp(TempOutStat.Average);
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
double volumeCTV = 1.00103f * 1000.0f * (massEnd - massStart) / densityOut;
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Enter watermeter end states here
|
/// Enter watermeter end states here
|
||||||
@ -471,8 +448,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
{
|
{
|
||||||
Bridge.OnActivity(this, "Enter the water meter data");
|
Bridge.OnActivity(this, "Enter the water meter data");
|
||||||
State.Create("FixedStartAdvanced : Enter end-state")
|
State.Create("FixedStartAdvanced : Enter end-state")
|
||||||
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo + tstRslt.Uncertainty,
|
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(volumeCTV, test.ErrLimLo + test.Uncertainty,
|
||||||
tstRslt.ErrLimHi - tstRslt.Uncertainty))
|
test.ErrLimHi - test.Uncertainty))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
@ -485,9 +462,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeEnd = dataEntryCmpnt.WMEndState(i);
|
|
||||||
|
|
||||||
///-----
|
|
||||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
|
|
||||||
@ -506,82 +480,90 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
|
|||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (tstRslt != null)
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
{
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
/// Auxiliary results
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
/// Main results
|
||||||
{
|
tstRslt.StartTime = TestStartTime;
|
||||||
tstRslt.ErrorMaster = 0.1f;
|
tstRslt.EndTime = TestEndTime;
|
||||||
}
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
else
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
{
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
tstRslt.MassStartRaw = startMass.Val;
|
||||||
}
|
tstRslt.MassStart = massStart; /// [kg] calculated before displaying 'End state' dialog
|
||||||
tstRslt.TimeDivStart0 = 0;
|
tstRslt.MassEndRaw = endMass.Val;
|
||||||
tstRslt.TimeDivStart1 = 0;
|
tstRslt.MassEnd = massEnd; /// [kg] calculated before displaying 'End state' dialog
|
||||||
tstRslt.TimeDivStart2 = 0;
|
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||||
tstRslt.TimeDivStart3 = 0;
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime;
|
||||||
tstRslt.TimeDivStart4 = 0;
|
tstRslt.VolumeCTV = volumeCTV; /// [kg] calculated before displaying 'End state' dialog
|
||||||
tstRslt.TimeDivStart5 = 0;
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
|
||||||
if ((i < WaterMeters.Count) && !WaterMeters[i].Disabled)
|
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].SerialNr = (i < WaterMeters.Count) ? WaterMeters[i].SerialNr : string.Empty;
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||||
tstRslt.Meters[i].VolumeMeter = tstRslt.Meters[i].VolumeEnd - tstRslt.Meters[i].VolumeStart;
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader regReader =
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV; /// liter
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = tstRslt.PulsesMaster;
|
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
if (tstRslt.Meters[i].VolumeRef > 0)
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct =
|
|
||||||
100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
|
||||||
/// %
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = -100;
|
|
||||||
}
|
|
||||||
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
|
|
||||||
tstRslt.Meters[i].Disabled = false;
|
if (meterRslt != null && regReader != null)
|
||||||
}
|
{
|
||||||
else
|
meterRslt.PulsesPerLiter = 1.0f;
|
||||||
{
|
meterRslt.VolumeStart = regReader.BeginWMState;
|
||||||
tstRslt.Meters[i].Disabled = true;
|
meterRslt.VolumeEnd = regReader.EndWMState;
|
||||||
|
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart;
|
||||||
|
meterRslt.VolumeRef = tstRslt.VolumeCTV; /// liter
|
||||||
|
meterRslt.PulsesMeter = meterRslt.VolumeMeter;
|
||||||
|
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
|
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 = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
|
|||||||
@ -62,10 +62,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Combined);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -81,9 +83,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -98,9 +100,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -154,9 +156,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -171,9 +173,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -239,9 +241,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeStart = dataEntryCmpnt.WMStartState(i); /// Units: 1 liter
|
|
||||||
///
|
|
||||||
///-----
|
|
||||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
|
|
||||||
@ -275,8 +274,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
StartMassRaw = startMass.Val;
|
||||||
tstRslt.MassStartRaw = startMass.Val;
|
|
||||||
Mass.Val = startMass.Val;
|
Mass.Val = startMass.Val;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -315,8 +313,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
|
||||||
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
@ -340,30 +337,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -375,17 +352,18 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
TestProgressEventArgs data = GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress);
|
TestProgressEventArgs data = GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress);
|
||||||
for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
/// TODO: Reimplement
|
||||||
{
|
//for (int i = 0; i < Config.Data.CompoundWMsCount; i++)
|
||||||
data.TestResult.CombinedMeters[i].VolumeMeter = data.TestResult.Meters[2 * i].VolumeMeter
|
//{
|
||||||
+ data.TestResult.Meters[2 * i + 1].VolumeMeter;
|
// data.TestResult.CombinedMeters[i].VolumeMeter = data.TestResult.Meters[2 * i].VolumeMeter
|
||||||
if (data.Volume.Valid)
|
// + data.TestResult.Meters[2 * i + 1].VolumeMeter;
|
||||||
{
|
// if (data.Volume.Valid)
|
||||||
data.TestResult.CombinedMeters[i].VolumeErrorPct =
|
// {
|
||||||
Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
|
// data.TestResult.CombinedMeters[i].VolumeErrorPct =
|
||||||
}
|
// Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val);
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
Bridge.OnTestProgress(this, data);
|
Bridge.OnTestProgress(this, data);
|
||||||
}
|
}
|
||||||
while (cBrd.EtPulses(0) < totalPulses);
|
while (cBrd.EtPulses(0) < totalPulses);
|
||||||
@ -453,8 +431,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
///
|
///
|
||||||
tstRslt.MassEndRaw = endMass.Val;
|
EndMassRaw = endMass.Val;
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
State.Create("FixedStartCombinedMeters : Stopping diverter, gate, etc.")
|
State.Create("FixedStartCombinedMeters : Stopping diverter, gate, etc.")
|
||||||
@ -469,11 +447,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
while (!e.Contains(Event.PreviousStopped));
|
while (!e.Contains(Event.PreviousStopped));
|
||||||
|
|
||||||
|
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
double massStart = Formulas.CorrectedValue(startMass.Val, outPath.Balance.Corrections);
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
double massEnd = Formulas.CorrectedValue(endMass.Val, outPath.Balance.Corrections);
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
double densityOut = Formulas.WaterDensityFromTemp(TempOutStat.Average); /// [kg/m3]
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
double volumeCTV = 1.00103f * 1000.0f * (massEnd - massStart) / densityOut;
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Enter watermeter end states here
|
/// Enter watermeter end states here
|
||||||
@ -482,8 +459,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
{
|
{
|
||||||
Bridge.OnActivity(this, "Enter the water meter data");
|
Bridge.OnActivity(this, "Enter the water meter data");
|
||||||
State.Create("FixedStartCombinedMeters : Enter end-state")
|
State.Create("FixedStartCombinedMeters : Enter end-state")
|
||||||
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo + tstRslt.Uncertainty,
|
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(volumeCTV, test.ErrLimLo + test.Uncertainty,
|
||||||
tstRslt.ErrLimHi - tstRslt.Uncertainty))
|
test.ErrLimHi - test.Uncertainty))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
@ -496,9 +473,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
|
|
||||||
for (int i = 0; i < Config.Data.CompoundWMsCount * 2; i++)
|
for (int i = 0; i < Config.Data.CompoundWMsCount * 2; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeEnd = dataEntryCmpnt.WMEndState(i);
|
|
||||||
|
|
||||||
///-----
|
|
||||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
|
|
||||||
@ -517,82 +491,108 @@ namespace TBF.BenchControl.TestMethods.FixedStartCombinedMeters
|
|||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (tstRslt != null)
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
|
||||||
|
|
||||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
|
||||||
{
|
{
|
||||||
tstRslt.ErrorMaster = 0.1f;
|
/// Auxiliary results
|
||||||
}
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
else
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
{
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
}
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
tstRslt.TimeDivStart0 = 0;
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
tstRslt.TimeDivStart1 = 0;
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
tstRslt.TimeDivStart2 = 0;
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
tstRslt.TimeDivStart3 = 0;
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
tstRslt.TimeDivStart4 = 0;
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
tstRslt.TimeDivStart5 = 0;
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
|
/// Main results
|
||||||
{
|
tstRslt.StartTime = TestStartTime;
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeRef = tstRslt.VolumeCTV; /// [l] must be calculated before main & aux. meter error
|
tstRslt.EndTime = TestEndTime;
|
||||||
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = tstRslt.PulsesMaster;
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = startMass.Val;
|
||||||
|
tstRslt.MassStart = massStart;
|
||||||
|
tstRslt.MassEndRaw = endMass.Val;
|
||||||
|
tstRslt.MassEnd = massEnd;
|
||||||
|
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [l/h]
|
||||||
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
|
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||||
|
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||||
|
|
||||||
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].PulsesPerLiter = 1.0f;
|
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
|
||||||
if (sensPath.RegisterReaders[i] != null && sensPath.RegisterReaders[i].PulsesPerLtr > float.Epsilon)
|
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
|
||||||
|
|
||||||
|
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||||
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader regReader =
|
||||||
|
sensPath.RegisterReaders[2 * i + isAux] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
|
|
||||||
|
if (meterRslt != null && regReader != null)
|
||||||
|
{
|
||||||
|
meterRslt.PulsesPerLiter = 1.0f;
|
||||||
|
meterRslt.VolumeStart = regReader.BeginWMState; /// [l]
|
||||||
|
meterRslt.VolumeEnd = regReader.EndWMState; /// [l]
|
||||||
|
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart; /// [l]
|
||||||
|
meterRslt.VolumeRef = tstRslt.VolumeCTV; /// [l]
|
||||||
|
meterRslt.PulsesMeter = meterRslt.VolumeMeter;
|
||||||
|
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
|
meterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef); /// Not used for evaluation
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = (i < WaterMeters.Count) ? WaterMeters[i].SerialNr : string.Empty;
|
Results.Entities.MeterTestRslt compoundMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Compound);
|
||||||
tstRslt.Meters[i].VolumeMeter = tstRslt.Meters[i].VolumeEnd - tstRslt.Meters[i].VolumeStart; /// [l]
|
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV; /// [l]
|
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = tstRslt.PulsesMaster;
|
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.Meters[i].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef); /// Not used
|
if (compoundMeterRslt != null && mainMeterRslt != null && auxMeterRslt != null)
|
||||||
|
{
|
||||||
|
compoundMeterRslt.VolumeRef = tstRslt.VolumeCTV; /// [l] must be calculated before main & aux. meter error
|
||||||
|
compoundMeterRslt.VolumeMeter = mainMeterRslt.VolumeMeter + auxMeterRslt.VolumeMeter;
|
||||||
|
compoundMeterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
|
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
compoundMeterRslt.Error = Formulas.ErrorFromVolumes(compoundMeterRslt.VolumeMeter, compoundMeterRslt.VolumeRef);
|
||||||
|
compoundMeterRslt.Passed = (compoundMeterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||||
|
&& (compoundMeterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||||
|
mainMeterRslt.Passed = auxMeterRslt.Passed = compoundMeterRslt.Passed;
|
||||||
|
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = tstRslt.Meters[2 * iCmbnd].VolumeMeter + tstRslt.Meters[2 * iCmbnd + 1].VolumeMeter;
|
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Time = cBrd.TTime;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = Formulas.ErrorFromVolumes(tstRslt.CombinedMeters[iCmbnd].VolumeMeter, tstRslt.CombinedMeters[iCmbnd].VolumeRef);
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Passed = (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
&& (tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
|
|||||||
@ -62,10 +62,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Single);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -81,9 +83,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -98,9 +100,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -154,9 +156,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -171,9 +173,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -239,9 +241,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeStart = dataEntryCmpnt.WMStartState(i); /// Units: 1 liter
|
|
||||||
|
|
||||||
///-----
|
|
||||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
|
|
||||||
@ -275,8 +274,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
StartMassRaw = startMass.Val;
|
||||||
tstRslt.MassStartRaw = startMass.Val;
|
|
||||||
Mass.Val = startMass.Val;
|
Mass.Val = startMass.Val;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -315,8 +313,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
|
||||||
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
@ -340,30 +337,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -375,7 +352,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress));
|
||||||
}
|
}
|
||||||
while (cBrd.EtPulses(0) < totalPulses);
|
while (cBrd.EtPulses(0) < totalPulses);
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
@ -442,8 +419,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
///
|
///
|
||||||
tstRslt.MassEndRaw = endMass.Val;
|
EndMassRaw = endMass.Val;
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
State.Create("FixedStartMassCollection : Stopping diverter, gate, etc.")
|
State.Create("FixedStartMassCollection : Stopping diverter, gate, etc.")
|
||||||
@ -458,11 +435,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
while (!e.Contains(Event.PreviousStopped));
|
while (!e.Contains(Event.PreviousStopped));
|
||||||
|
|
||||||
|
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
double massStart = Formulas.CorrectedValue(startMass.Val, outPath.Balance.Corrections);
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
double massEnd = Formulas.CorrectedValue(endMass.Val, outPath.Balance.Corrections);
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
double densityOut = Formulas.WaterDensityFromTemp(TempOutStat.Average); /// [kg/m3]
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
double volumeCTV = 1001.03 * (massEnd - massStart) / densityOut;
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Enter watermeter end states here
|
/// Enter watermeter end states here
|
||||||
@ -471,8 +447,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
{
|
{
|
||||||
Bridge.OnActivity(this, "Enter the water meter data");
|
Bridge.OnActivity(this, "Enter the water meter data");
|
||||||
State.Create("FixedStartMassCollection : Enter end-state")
|
State.Create("FixedStartMassCollection : Enter end-state")
|
||||||
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(tstRslt.VolumeCTV, tstRslt.ErrLimLo + tstRslt.Uncertainty,
|
.AddOperation(dataEntryCmpnt.ShowTestEndFormOp(volumeCTV, test.ErrLimLo + test.Uncertainty,
|
||||||
tstRslt.ErrLimHi - tstRslt.Uncertainty))
|
test.ErrLimHi - test.Uncertainty))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
@ -485,9 +461,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeEnd = dataEntryCmpnt.WMEndState(i);
|
|
||||||
|
|
||||||
///-----
|
|
||||||
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader registerReader =
|
||||||
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
|
|
||||||
@ -506,82 +479,90 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
|
|||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (tstRslt != null)
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
{
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
/// Auxiliary results
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
/// Main results
|
||||||
{
|
tstRslt.StartTime = TestStartTime;
|
||||||
tstRslt.ErrorMaster = 0.1f;
|
tstRslt.EndTime = TestEndTime;
|
||||||
}
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
else
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
{
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
tstRslt.MassStartRaw = startMass.Val;
|
||||||
}
|
tstRslt.MassStart = massStart;
|
||||||
tstRslt.TimeDivStart0 = 0;
|
tstRslt.MassEndRaw = endMass.Val;
|
||||||
tstRslt.TimeDivStart1 = 0;
|
tstRslt.MassEnd = massEnd;
|
||||||
tstRslt.TimeDivStart2 = 0;
|
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||||
tstRslt.TimeDivStart3 = 0;
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [l/h]
|
||||||
tstRslt.TimeDivStart4 = 0;
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
tstRslt.TimeDivStart5 = 0;
|
tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
|
||||||
if ((i < WaterMeters.Count) && !WaterMeters[i].Disabled)
|
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].SerialNr = (i < WaterMeters.Count) ? WaterMeters[i].SerialNr : string.Empty;
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||||
tstRslt.Meters[i].VolumeMeter = tstRslt.Meters[i].VolumeEnd - tstRslt.Meters[i].VolumeStart;
|
BenchControl.Elde.FixedStartRegisterReader.RegisterReader regReader =
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV; /// liter
|
sensPath.RegisterReaders[i] as BenchControl.Elde.FixedStartRegisterReader.RegisterReader;
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = tstRslt.PulsesMaster;
|
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
if (tstRslt.Meters[i].VolumeRef > 0)
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct =
|
|
||||||
100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
|
||||||
/// %
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = -100;
|
|
||||||
}
|
|
||||||
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
|
|
||||||
tstRslt.Meters[i].Disabled = false;
|
if (meterRslt != null && regReader != null)
|
||||||
}
|
{
|
||||||
else
|
meterRslt.PulsesPerLiter = 1.0f;
|
||||||
{
|
meterRslt.VolumeStart = regReader.BeginWMState;
|
||||||
tstRslt.Meters[i].Disabled = true;
|
meterRslt.VolumeEnd = regReader.EndWMState;
|
||||||
|
meterRslt.VolumeMeter = meterRslt.VolumeEnd - meterRslt.VolumeStart;
|
||||||
|
meterRslt.VolumeRef = tstRslt.VolumeCTV; /// liter
|
||||||
|
meterRslt.PulsesMeter = meterRslt.VolumeMeter;
|
||||||
|
meterRslt.PulsesMaster = tstRslt.PulsesMaster;
|
||||||
|
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 = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
|
|||||||
@ -59,12 +59,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Single);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||||
@ -76,9 +78,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -93,9 +95,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -121,8 +123,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp());
|
if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp());
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -152,8 +152,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
|
||||||
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
@ -177,30 +176,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -212,7 +191,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress));
|
||||||
}
|
}
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
|
|
||||||
@ -222,117 +201,120 @@ namespace TBF.BenchControl.TestMethods.FlyingStart
|
|||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
|
||||||
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
if (tstRslt != null)
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
|
||||||
tstRslt.MassStart = 0;
|
|
||||||
tstRslt.MassEnd = 0;
|
|
||||||
tstRslt.MassDiff = 0;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 0; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
|
||||||
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume / 1000.0f); /// Convert the flow to [m3/h]
|
|
||||||
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
/// Corrected master pulses per liter
|
|
||||||
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
|
|
||||||
tstRslt.TimeDivStart0 = 0;
|
|
||||||
tstRslt.TimeDivStart1 = 0;
|
|
||||||
tstRslt.TimeDivStart2 = 0;
|
|
||||||
tstRslt.TimeDivStart3 = 0;
|
|
||||||
tstRslt.TimeDivStart4 = 0;
|
|
||||||
tstRslt.TimeDivStart5 = 0;
|
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
||||||
{
|
{
|
||||||
/// Reference to iPerl water meter or null:
|
/// Auxiliary results
|
||||||
WaterMeters.iPerl.WaterMeter iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
? (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter)
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
: null;
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
if ((sensPath.RegisterReaders[i] != null) && (WaterMeters.Count > i) && !WaterMeters[i].Disabled)
|
/// Main results
|
||||||
|
tstRslt.StartTime = TestStartTime;
|
||||||
|
tstRslt.EndTime = TestEndTime;
|
||||||
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = 0;
|
||||||
|
tstRslt.MassStart = 0;
|
||||||
|
tstRslt.MassEndRaw = 0;
|
||||||
|
tstRslt.MassEnd = 0;
|
||||||
|
tstRslt.FlowMass = 0; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
|
||||||
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume); /// Corrected master pulses per liter
|
||||||
|
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
|
tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement
|
||||||
|
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
GenericDevices.IRegisterReader regReader = (sensPath.RegisterReaders == null) ? null : sensPath.RegisterReaders[i];
|
||||||
|
WaterMeters.iPerl.WaterMeter iPerl = regReader as WaterMeters.iPerl.WaterMeter;
|
||||||
|
|
||||||
if (iPerl != null)
|
if (meterRslt != null && regReader != null)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeStart = (float)iPerl.VolumeLtrStart; /// liter
|
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||||
tstRslt.Meters[i].VolumeEnd = (float)iPerl.VolumeLtrEnd; /// liter
|
meterRslt.PulsesMeter = Convert.ToDouble(WMPulses[i]);
|
||||||
tstRslt.Meters[i].VolumeMeter = (float)Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
|
meterRslt.PulsesMaster = Convert.ToDouble(WMRefPulses[i]);
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV * (float)(iPerl.TimestampSecEnd - iPerl.TimestampSecStart) / tstRslt.Time;
|
|
||||||
iPerl.VolumeLtrRef = (double)tstRslt.Meters[i].VolumeRef;
|
|
||||||
tstRslt.Meters[i].Time = (float)(iPerl.TimestampSecEnd - iPerl.TimestampSecStart);
|
|
||||||
tstRslt.Meters[i].TimeStart = (float)iPerl.TimestampSecStart;
|
|
||||||
tstRslt.Meters[i].TimeEnd = (float)iPerl.TimestampSecEnd;
|
|
||||||
tstRslt.Meters[i].CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
|
|
||||||
tstRslt.Meters[i].Q2Correction = iPerl.CurrentQ2Correction;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeStart = 0; /// liter
|
|
||||||
tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
|
||||||
if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter
|
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
tstRslt.Meters[i].TimeStart = 0;
|
|
||||||
tstRslt.Meters[i].TimeEnd = 0;
|
|
||||||
tstRslt.Meters[i].CalibFactor = 0;
|
|
||||||
tstRslt.Meters[i].Q2Correction = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
if (iPerl != null)
|
||||||
tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
{
|
||||||
if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0)
|
meterRslt.TimestampStart = iPerl.TimestampSecStart;
|
||||||
{
|
meterRslt.TimestampEnd = iPerl.TimestampSecEnd;
|
||||||
tstRslt.Meters[i].VolumeErrorPct =
|
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||||
100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
meterRslt.VolumeStart = iPerl.VolumeLtrStart; /// liter
|
||||||
/// %
|
meterRslt.VolumeEnd = iPerl.VolumeLtrEnd; /// liter
|
||||||
}
|
meterRslt.VolumeMeter = Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
|
||||||
else
|
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||||
{
|
iPerl.VolumeLtrRef = meterRslt.VolumeRef;
|
||||||
tstRslt.Meters[i].VolumeErrorPct = -100;
|
#if IPERLST
|
||||||
}
|
meterRslt.CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
|
||||||
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
meterRslt.Q2Correction = iPerl.CurrentQ2Correction;
|
||||||
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
#endif
|
||||||
}
|
iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||||
else
|
iPerl.NominalTestFlow = 500.0 * (test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||||
{
|
}
|
||||||
tstRslt.Meters[i].Disabled = true;
|
else
|
||||||
}
|
{
|
||||||
|
meterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
meterRslt.VolumeStart = 0;
|
||||||
|
meterRslt.VolumeEnd = 0;
|
||||||
|
meterRslt.VolumeMeter = (meterRslt.PulsesPerLiter <= float.Epsilon) ? 0 : meterRslt.PulsesMeter / meterRslt.PulsesPerLiter;
|
||||||
|
meterRslt.VolumeRef = tstRslt.ConstMaster * meterRslt.PulsesMaster; /// liter
|
||||||
|
}
|
||||||
|
|
||||||
if (iPerl != null)
|
meterRslt.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||||
{
|
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||||
iPerl.LastTestResult = tstRslt.Meters[i]; /// Save this water meter test result to iPerl WM
|
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||||
iPerl.NominalTestFlow = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
meterRslt.TestDone = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ using TBF.Boxes;
|
|||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
using TBF.UiBridge;
|
using TBF.UiBridge;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||||
{
|
{
|
||||||
public class FlyingStartCollectionMethodSeq : Sequences.SequenceBase
|
public class FlyingStartCollectionMethodSeq : Sequences.SequenceBase
|
||||||
{
|
{
|
||||||
@ -59,12 +59,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Single);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
tstRslt.DoNotEvaluate = !testParams.Evaluate;
|
TestStartTime = DateTime.Now;
|
||||||
tstRslt.DoNotPublish = !testParams.Publish;
|
|
||||||
|
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -72,7 +71,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
||||||
|
|
||||||
State.Create("FlyingStartCollectionMethod : Starting the pump")
|
State.Create("FlyingStartMassCollection : Starting the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(new Operations.TimerOp(5))
|
.AddOperation(new Operations.TimerOp(5))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
@ -80,16 +79,16 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.TimerExpired));
|
while (!e.Contains(Event.TimerExpired));
|
||||||
|
|
||||||
|
|
||||||
State.Create("FlyingStartCollectionMethod : Starting the pump")
|
State.Create("FlyingStartMassCollection : Starting the pump")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
@ -97,9 +96,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -111,7 +110,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
///
|
///
|
||||||
/// Measure the weight and skip emptying if there is enough room in the tank
|
/// Measure the weight and skip emptying if there is enough room in the tank
|
||||||
///
|
///
|
||||||
State.Create("FlyingStartCollectionMethod : Measuring the mass of water in the tank")
|
State.Create("FlyingStartMassCollection : Measuring the mass of water in the tank")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
@ -144,7 +143,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
State.Create("FlyingStartCollectionMethod : Setting the flow")
|
State.Create("FlyingStartMassCollection : Setting the flow")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||||
.EnterState();
|
.EnterState();
|
||||||
@ -152,9 +151,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -180,7 +179,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp());
|
if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp());
|
||||||
}
|
}
|
||||||
|
|
||||||
State.Create("FlyingStartCollectionMethod : Waiting before 1st mass measurement")
|
State.Create("FlyingStartMassCollection : Waiting before 1st mass measurement")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
@ -208,7 +207,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
State.Create("FlyingStartCollectionMethod : Measuring the start mass")
|
State.Create("FlyingStartMassCollection : Measuring the start mass")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
@ -232,15 +231,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
|
|
||||||
LogProcessHeader(processDataLogger, "Measurement");
|
LogProcessHeader(processDataLogger, "Measurement");
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
StartMassRaw = startMass.Val;
|
||||||
tstRslt.MassStartRaw = startMass.Val;
|
|
||||||
log.WarnFormat("Start mass = {0}kg", startMass);
|
log.WarnFormat("Start mass = {0}kg", startMass);
|
||||||
Mass.Val = startMass.Val;
|
Mass.Val = startMass.Val;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
State.Create("FlyingStartCollectionMethod : Starting the test")
|
State.Create("FlyingStartMassCollection : Starting the test")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
@ -274,9 +272,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMTimes, ref WMRefPulses);
|
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMTimes, ref WMRefPulses);
|
||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
int estimtdEndTime = StateMachine.Time + (int)test.TstTime;
|
||||||
ResetAveragedData();
|
ClearAllStatistics();
|
||||||
int estimtdEndTime = StateMachine.Time + (int)tstRslt.TstTime;
|
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
State.Create("Read water meters")
|
State.Create("Read water meters")
|
||||||
@ -315,30 +312,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
}
|
}
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -350,13 +327,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress));
|
||||||
}
|
}
|
||||||
while (true);
|
while (true);
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
|
|
||||||
test_completed:
|
test_completed:
|
||||||
State.Create("FlyingStartCollectionMethod : Waiting before 2nd mass measurement")
|
State.Create("FlyingStartMassCollection : Waiting before 2nd mass measurement")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
@ -384,7 +361,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
State.Create("FlyingStartCollectionMethod : Measuring the end mass")
|
State.Create("FlyingStartMassCollection : Measuring the end mass")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
@ -407,8 +384,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
///
|
///
|
||||||
log.WarnFormat("End mass = {0}kg", endMass);
|
log.WarnFormat("End mass = {0}kg", endMass);
|
||||||
tstRslt.MassEndRaw = endMass.Val;
|
EndMassRaw = endMass.Val;
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
@ -420,116 +397,112 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (tstRslt != null)
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
{
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
/// Auxiliary results
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
/// Main results
|
||||||
{
|
tstRslt.StartTime = TestStartTime;
|
||||||
tstRslt.ErrorMaster = 0.0f;
|
tstRslt.EndTime = TestEndTime;
|
||||||
}
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
else
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
{
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
tstRslt.MassStartRaw = startMass.Val;
|
||||||
}
|
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||||
tstRslt.TimeDivStart0 = 0;
|
tstRslt.MassEndRaw = endMass.Val;
|
||||||
tstRslt.TimeDivStart1 = 0;
|
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||||
tstRslt.TimeDivStart2 = 0;
|
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||||
tstRslt.TimeDivStart3 = 0;
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
|
||||||
tstRslt.TimeDivStart4 = 0;
|
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
tstRslt.TimeDivStart5 = 0;
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
||||||
{
|
|
||||||
/// Reference to iPerl water meter or null:
|
|
||||||
WaterMeters.iPerl.WaterMeter iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
|
||||||
? (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
if ((sensPath.RegisterReaders[i] != null) && (WaterMeters.Count > i) && !WaterMeters[i].Disabled)
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
GenericDevices.IRegisterReader regReader = (sensPath.RegisterReaders == null) ? null : sensPath.RegisterReaders[i];
|
||||||
|
WaterMeters.iPerl.WaterMeter iPerl = regReader as WaterMeters.iPerl.WaterMeter;
|
||||||
|
|
||||||
if (iPerl != null)
|
if (meterRslt != null && regReader != null)
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeStart = (float)iPerl.VolumeLtrStart; /// liter
|
|
||||||
tstRslt.Meters[i].VolumeEnd = (float)iPerl.VolumeLtrEnd; /// liter
|
|
||||||
tstRslt.Meters[i].VolumeMeter = (float)Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
|
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV * (float)(iPerl.TimestampSecEnd - iPerl.TimestampSecStart) / tstRslt.Time;
|
|
||||||
iPerl.VolumeLtrRef = (double)tstRslt.Meters[i].VolumeRef;
|
|
||||||
tstRslt.Meters[i].Time = (float)(iPerl.TimestampSecEnd - iPerl.TimestampSecStart);
|
|
||||||
tstRslt.Meters[i].TimeStart = (float)iPerl.TimestampSecStart;
|
|
||||||
tstRslt.Meters[i].TimeEnd = (float)iPerl.TimestampSecEnd;
|
|
||||||
tstRslt.Meters[i].CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
|
|
||||||
tstRslt.Meters[i].Q2Correction = iPerl.CurrentQ2Correction;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeStart = 0; /// liter
|
|
||||||
tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
|
||||||
if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter
|
|
||||||
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
tstRslt.Meters[i].TimeStart = 0;
|
|
||||||
tstRslt.Meters[i].TimeEnd = 0;
|
|
||||||
tstRslt.Meters[i].CalibFactor = 0;
|
|
||||||
tstRslt.Meters[i].Q2Correction = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
|
||||||
tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
|
||||||
if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0)
|
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].VolumeErrorPct =
|
meterRslt.PulsesPerLiter = regReader.PulsesPerLtr;
|
||||||
100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
meterRslt.PulsesMeter = Convert.ToDouble(WMPulses[i]);
|
||||||
/// %
|
meterRslt.PulsesMaster = Convert.ToDouble(WMRefPulses[i]);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = -100;
|
|
||||||
}
|
|
||||||
tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
&& (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].Disabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iPerl != null)
|
if (iPerl != null)
|
||||||
{
|
{
|
||||||
iPerl.LastTestResult = tstRslt.Meters[i]; /// Save this water meter test result to iPerl WM
|
meterRslt.TimestampStart = iPerl.TimestampSecStart;
|
||||||
iPerl.NominalTestFlow = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
meterRslt.TimestampEnd = iPerl.TimestampSecEnd;
|
||||||
|
meterRslt.TestTime = meterRslt.TimestampEnd - meterRslt.TimestampStart;
|
||||||
|
meterRslt.VolumeStart = iPerl.VolumeLtrStart; /// liter
|
||||||
|
meterRslt.VolumeEnd = iPerl.VolumeLtrEnd; /// liter
|
||||||
|
meterRslt.VolumeMeter = Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
|
||||||
|
meterRslt.VolumeRef = tstRslt.VolumeCTV * meterRslt.TestTime / tstRslt.TestTime;
|
||||||
|
iPerl.VolumeLtrRef = meterRslt.VolumeRef;
|
||||||
|
#if IPERLST
|
||||||
|
meterRslt.CalibFactor = (iPerl.CalibrationStruct != null) ? iPerl.CalibrationStruct.Calibration : 0;
|
||||||
|
meterRslt.Q2Correction = iPerl.CurrentQ2Correction;
|
||||||
|
#endif
|
||||||
|
iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||||
|
iPerl.NominalTestFlow = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
meterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
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.Error = Formulas.ErrorFromVolumes(meterRslt.VolumeMeter, meterRslt.VolumeRef);
|
||||||
|
meterRslt.Passed = (meterRslt.Error >= test.ErrLimLo + test.Uncertainty)
|
||||||
|
&& (meterRslt.Error <= test.ErrLimHi - test.Uncertainty);
|
||||||
|
meterRslt.TestDone = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
@ -543,7 +516,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
|||||||
/// Quit this sequence ///
|
/// Quit this sequence ///
|
||||||
///----------------------///
|
///----------------------///
|
||||||
|
|
||||||
State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.")
|
State.Create("FlyingStartMassCollection : Stopping diverter, gate, etc.")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.StopPreviousOp())
|
.AddOperation(cBrd.StopPreviousOp())
|
||||||
.EnterState();
|
.EnterState();
|
||||||
@ -8,12 +8,12 @@ using log4net;
|
|||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.BenchControl;
|
using TBF.BenchControl;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||||
{
|
{
|
||||||
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
|
public class TestMethod : ComponentBase, GenericDevices.ITestMethod
|
||||||
{
|
{
|
||||||
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
|
private static readonly ILog log = LogManager.GetLogger(typeof(TestMethod));
|
||||||
public override string ToString() { return string.Format("TestMethods.FlyingStartCollectionMethod({0})", Cfg.ToString(1)); }
|
public override string ToString() { return string.Format("TestMethods.FlyingStartMassCollection({0})", Cfg.ToString(1)); }
|
||||||
|
|
||||||
readonly TestMethodCfg testMethodCfg;
|
readonly TestMethodCfg testMethodCfg;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ using System.Xml.Serialization;
|
|||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||||
{
|
{
|
||||||
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||||
{
|
{
|
||||||
@ -6,7 +6,7 @@ using System.Windows.Forms;
|
|||||||
using log4net;
|
using log4net;
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||||
{
|
{
|
||||||
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
||||||
{
|
{
|
||||||
@ -1,7 +1,7 @@
|
|||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||||
///
|
///
|
||||||
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||||
{
|
{
|
||||||
partial class TestMethodCfgCtrl
|
partial class TestMethodCfgCtrl
|
||||||
{
|
{
|
||||||
@ -3,7 +3,7 @@
|
|||||||
///
|
///
|
||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||||
{
|
{
|
||||||
public class TestMethodFactory : IComponentFactory
|
public class TestMethodFactory : IComponentFactory
|
||||||
{
|
{
|
||||||
@ -9,7 +9,7 @@ using Config.Entities;
|
|||||||
using TBF.BenchControl.Generic;
|
using TBF.BenchControl.Generic;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
|
||||||
{
|
{
|
||||||
public class TestParams : TestParamsBase, IParamsProvider, ITestParams
|
public class TestParams : TestParamsBase, IParamsProvider, ITestParams
|
||||||
{
|
{
|
||||||
@ -47,7 +47,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
|
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0));
|
||||||
TestResult tstRslt = new TestResult(test, 1, StateMachine.Procedure.MetersKind);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, 1);
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
@ -123,6 +123,9 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
|
|
||||||
pressure_set:
|
pressure_set:
|
||||||
|
|
||||||
|
ClearAllStatistics();
|
||||||
|
UpdateAllStatistics();
|
||||||
|
|
||||||
startTime = StateMachine.Time;
|
startTime = StateMachine.Time;
|
||||||
int estimtdEndTime = startTime + testParams.DurationPMax;
|
int estimtdEndTime = startTime + testParams.DurationPMax;
|
||||||
|
|
||||||
@ -141,14 +144,11 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
|
||||||
|
UpdateAllStatistics();
|
||||||
|
|
||||||
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
|
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
|
||||||
if (remainingTime > 60)
|
if (remainingTime > 60)
|
||||||
{
|
{
|
||||||
@ -178,13 +178,10 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
|
||||||
|
UpdateAllStatistics();
|
||||||
}
|
}
|
||||||
while (e.Contains(Event.ValvesBusy));
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
|
||||||
@ -204,23 +201,20 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
|
||||||
|
UpdateAllStatistics();
|
||||||
}
|
}
|
||||||
while (e.Contains(Event.ValvesBusy));
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
|
||||||
|
|
||||||
pump_is_off:
|
pump_is_off:
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
TestStartTime = DateTime.Now;
|
||||||
startTime = StateMachine.Time;
|
startTime = StateMachine.Time;
|
||||||
estimtdEndTime = startTime + testParams.DurationLeak;
|
estimtdEndTime = startTime + testParams.DurationLeak;
|
||||||
ResetAveragedData();
|
ClearAllStatistics();
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||||
@ -236,9 +230,12 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
|
||||||
|
UpdateAllStatistics();
|
||||||
|
|
||||||
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
|
int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0);
|
||||||
if (remainingTime > 60)
|
if (remainingTime > 60)
|
||||||
{
|
{
|
||||||
@ -248,14 +245,6 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
{
|
{
|
||||||
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
}
|
}
|
||||||
while (e.Contains(Event.TimerBusy));
|
while (e.Contains(Event.TimerBusy));
|
||||||
|
|
||||||
@ -267,108 +256,118 @@ namespace TBF.BenchControl.TestMethods.LeakTest
|
|||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
|
||||||
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
if (tstRslt != null)
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
|
||||||
tstRslt.MassStart = 0;
|
|
||||||
tstRslt.MassEnd = 0;
|
|
||||||
tstRslt.MassDiff = 0;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg);/// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = 0; /// [kg/m3]
|
|
||||||
tstRslt.Time = testParams.DurationPMax; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 0; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 0; /// [l/h]
|
|
||||||
tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter
|
|
||||||
tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h]
|
|
||||||
tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
tstRslt.ErrorMaster = 0;
|
|
||||||
tstRslt.TimeDivStart0 = 0;
|
|
||||||
tstRslt.TimeDivStart1 = 0;
|
|
||||||
tstRslt.TimeDivStart2 = 0;
|
|
||||||
tstRslt.TimeDivStart3 = 0;
|
|
||||||
tstRslt.TimeDivStart4 = 0;
|
|
||||||
tstRslt.TimeDivStart5 = 0;
|
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
if (StateMachine.Procedure.MetersKind == MetersKind.Single)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
||||||
{
|
{
|
||||||
if (sensPath.RegisterReaders[i] != null)
|
/// Auxiliary results
|
||||||
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = 0;
|
||||||
|
|
||||||
|
/// Main results
|
||||||
|
tstRslt.StartTime = TestStartTime;
|
||||||
|
tstRslt.EndTime = TestEndTime;
|
||||||
|
tstRslt.FlowSetTime = 0;
|
||||||
|
tstRslt.TestTime = Convert.ToDouble(testParams.DurationPMax); /// [s] measurement time
|
||||||
|
tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = 0;
|
||||||
|
tstRslt.MassStart = 0;
|
||||||
|
tstRslt.MassEndRaw = 0;
|
||||||
|
tstRslt.MassEnd = 0;
|
||||||
|
tstRslt.FlowMass = 0; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 0; /// [m3/h]
|
||||||
|
tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
|
tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h]
|
||||||
|
tstRslt.ErrorMaster = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
if (StateMachine.Procedure.MetersKind == MetersKind.Single)
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
{
|
||||||
tstRslt.Meters[i].VolumeEnd = 0;
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
tstRslt.Meters[i].VolumeRef = 0;
|
if (meterRslt != null)
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
{
|
||||||
tstRslt.Meters[i].PulsesMaster = 0;
|
meterRslt.TestTime = tstRslt.TestTime;
|
||||||
tstRslt.Meters[i].Time = testParams.DurationPMax;
|
meterRslt.Error = 0;
|
||||||
tstRslt.Meters[i].VolumeErrorPct = 0;
|
meterRslt.Passed = true;
|
||||||
tstRslt.Meters[i].Passed = true;
|
meterRslt.TestDone = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
|
||||||
|
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
|
||||||
|
|
||||||
|
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||||
|
{
|
||||||
|
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||||
|
|
||||||
|
if (meterRslt != null)
|
||||||
|
{
|
||||||
|
meterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
meterRslt.Error = 0;
|
||||||
|
meterRslt.Passed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Results.Entities.MeterTestRslt compoundMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Compound);
|
||||||
|
|
||||||
|
if (compoundMeterRslt != null)
|
||||||
|
{
|
||||||
|
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
compoundMeterRslt.Error = 0;
|
||||||
|
compoundMeterRslt.Passed = true;
|
||||||
|
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
|
|
||||||
{
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeRef = 0;
|
|
||||||
|
|
||||||
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
|
|
||||||
{
|
|
||||||
if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon)
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = 1.0f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
|
||||||
tstRslt.Meters[i].VolumeEnd = 0;
|
|
||||||
tstRslt.Meters[i].VolumeRef = 0;
|
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
tstRslt.Meters[i].Time = test.TstTime;
|
|
||||||
tstRslt.Meters[i].TimeStart = 0;
|
|
||||||
tstRslt.Meters[i].TimeEnd = testParams.DurationPMax;
|
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = 0;
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = 0;
|
|
||||||
tstRslt.Meters[i].Passed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = 0;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = 0;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Time = testParams.DurationPMax;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = 0;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Passed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
stopTest:
|
stopTest:
|
||||||
|
|||||||
@ -47,7 +47,8 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
|||||||
|
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, 1, inPath, benchPath, outPath, sensPath, 0));
|
||||||
TestResult tstRslt = new TestResult(test, 1, StateMachine.Procedure.MetersKind);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, 1);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
@ -103,11 +104,6 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
|||||||
PressureUp.Val.ToString("F1"),
|
PressureUp.Val.ToString("F1"),
|
||||||
PressureUp.Val.ToString("F1")));
|
PressureUp.Val.ToString("F1")));
|
||||||
|
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
|
|
||||||
float step = (pumpPower < 40.0f) ? 5.0f : ((pumpPower < 60.0f) ? 3.0f : ((pumpPower < 80.0f) ? 2.0f : 1.0f));
|
float step = (pumpPower < 40.0f) ? 5.0f : ((pumpPower < 60.0f) ? 3.0f : ((pumpPower < 80.0f) ? 2.0f : 1.0f));
|
||||||
|
|
||||||
if (PressureDown.Val < testParams.PressureLo)
|
if (PressureDown.Val < testParams.PressureLo)
|
||||||
@ -128,10 +124,11 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
|||||||
|
|
||||||
pressure_set:
|
pressure_set:
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
ClearAllStatistics();
|
||||||
|
UpdateAllStatistics();
|
||||||
|
|
||||||
startTime = StateMachine.Time;
|
startTime = StateMachine.Time;
|
||||||
int endTime = startTime + testParams.DurationPMax;
|
int endTime = startTime + testParams.DurationPMax;
|
||||||
ResetAveragedData();
|
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||||
@ -148,17 +145,13 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
CurrentMassRaw = Mass.Val;
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
|
||||||
|
UpdateAllStatistics();
|
||||||
|
|
||||||
int remainingTime = Math.Max(endTime - StateMachine.Time, 0);
|
int remainingTime = Math.Max(endTime - StateMachine.Time, 0);
|
||||||
if (remainingTime > 60)
|
if (remainingTime > 60)
|
||||||
{
|
{
|
||||||
@ -173,7 +166,9 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
|||||||
|
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
|
|
||||||
test_completed:
|
test_completed:
|
||||||
|
|
||||||
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
@ -185,102 +180,110 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
|
|||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
if (tstRslt != null)
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
|
||||||
tstRslt.MassStart = 0;
|
|
||||||
tstRslt.MassEnd = 0;
|
|
||||||
tstRslt.MassDiff = 0;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = 0; /// [kg/m3]
|
|
||||||
tstRslt.Time = testParams.DurationPMax; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 0; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 0; /// [l/h]
|
|
||||||
tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter
|
|
||||||
tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h]
|
|
||||||
tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
tstRslt.ErrorMaster = 0;
|
|
||||||
tstRslt.TimeDivStart0 = 0;
|
|
||||||
tstRslt.TimeDivStart1 = 0;
|
|
||||||
tstRslt.TimeDivStart2 = 0;
|
|
||||||
tstRslt.TimeDivStart3 = 0;
|
|
||||||
tstRslt.TimeDivStart4 = 0;
|
|
||||||
tstRslt.TimeDivStart5 = 0;
|
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
|
|
||||||
if (StateMachine.Procedure.MetersKind == Config.Entities.MetersKind.Single)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
||||||
{
|
|
||||||
if (sensPath.RegisterReaders[i] != null)
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
|
||||||
tstRslt.Meters[i].VolumeEnd = 0;
|
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
tstRslt.Meters[i].VolumeRef = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = 0;
|
|
||||||
tstRslt.Meters[i].Time = testParams.DurationPMax;
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = 0;
|
|
||||||
tstRslt.Meters[i].Passed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
for (int iCmbnd = 0; iCmbnd < Config.Data.CompoundWMsCount; iCmbnd++)
|
/// Auxiliary results
|
||||||
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = 0;
|
||||||
|
|
||||||
|
/// Main results
|
||||||
|
tstRslt.StartTime = TestStartTime;
|
||||||
|
tstRslt.EndTime = TestEndTime;
|
||||||
|
tstRslt.FlowSetTime = 0;
|
||||||
|
tstRslt.TestTime = Convert.ToDouble(testParams.DurationPMax); /// [s] measurement time
|
||||||
|
tstRslt.PulsesMaster = 0; /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = 0;
|
||||||
|
tstRslt.MassStart = 0;
|
||||||
|
tstRslt.MassEndRaw = 0;
|
||||||
|
tstRslt.MassEnd = 0;
|
||||||
|
tstRslt.FlowMass = 0; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 0; /// [m3/h]
|
||||||
|
tstRslt.VolumeMaster = 0; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.VolumeCTV = 0; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
|
tstRslt.ConstMaster = 0; /// Convert the flow to [m3/h]
|
||||||
|
tstRslt.ErrorMaster = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeRef = 0;
|
if (StateMachine.Procedure.MetersKind == MetersKind.Single)
|
||||||
|
|
||||||
for (int i = 2 * iCmbnd; i < 2 * iCmbnd + 2; i++)
|
|
||||||
{
|
{
|
||||||
if (sensPath.RegisterReaders[i] == null || sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon)
|
Results.Entities.MeterTestRslt meterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||||
{
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = 1.0f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
if (meterRslt != null)
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
{
|
||||||
tstRslt.Meters[i].VolumeEnd = 0;
|
meterRslt.TestTime = tstRslt.TestTime;
|
||||||
tstRslt.Meters[i].VolumeRef = 0;
|
meterRslt.Error = 0;
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
meterRslt.Passed = true;
|
||||||
tstRslt.Meters[i].Time = test.TstTime;
|
meterRslt.TestDone = true;
|
||||||
tstRslt.Meters[i].TimeStart = 0;
|
}
|
||||||
tstRslt.Meters[i].TimeEnd = testParams.DurationPMax;
|
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = 0;
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = 0;
|
|
||||||
tstRslt.Meters[i].Passed = true;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Results.Entities.MeterTestRslt mainMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundMain);
|
||||||
|
Results.Entities.MeterTestRslt auxMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.CompoundAux);
|
||||||
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeMeter = 0;
|
for (int isAux = 0; isAux <= 1; isAux++) /// 0=main, 1=aux
|
||||||
tstRslt.CombinedMeters[iCmbnd].PulsesMaster = 0;
|
{
|
||||||
tstRslt.CombinedMeters[iCmbnd].Time = testParams.DurationPMax;
|
Results.Entities.MeterTestRslt meterRslt = (isAux == 0) ? mainMeterRslt : auxMeterRslt;
|
||||||
tstRslt.CombinedMeters[iCmbnd].VolumeErrorPct = 0;
|
|
||||||
tstRslt.CombinedMeters[iCmbnd].Passed = true;
|
if (meterRslt != null)
|
||||||
|
{
|
||||||
|
meterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
meterRslt.Error = 0;
|
||||||
|
meterRslt.Passed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Results.Entities.MeterTestRslt compoundMeterRslt = BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Compound);
|
||||||
|
|
||||||
|
if (compoundMeterRslt != null)
|
||||||
|
{
|
||||||
|
compoundMeterRslt.TestTime = tstRslt.TestTime;
|
||||||
|
compoundMeterRslt.Error = 0;
|
||||||
|
compoundMeterRslt.Passed = true;
|
||||||
|
mainMeterRslt.TestDone = auxMeterRslt.TestDone = compoundMeterRslt.TestDone = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
stopTest:
|
stopTest:
|
||||||
|
|||||||
@ -30,39 +30,41 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
|||||||
{
|
{
|
||||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||||
|
|
||||||
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
||||||
Event retVal = Event.Done;
|
Event retVal = Event.Done;
|
||||||
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
||||||
|
|
||||||
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
||||||
|
|
||||||
/// Notes:
|
/// Notes:
|
||||||
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
||||||
/// float timeSec = 3600.0f * timeHr;
|
/// float timeSec = 3600.0f * timeHr;
|
||||||
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
|
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
|
||||||
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
|
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
|
||||||
|
|
||||||
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
|
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
|
||||||
|
|
||||||
int repetitionNr = 1; /// First test: repetitionNr=1
|
int repetitionNr = 1; /// First test: repetitionNr=1
|
||||||
|
|
||||||
//====================================
|
//====================================
|
||||||
// Transition or SetRoute - Start
|
// Transition or SetRoute - Start
|
||||||
//====================================
|
//====================================
|
||||||
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
switch (Transition(transitionBefore, TransitionContext.BeforeTest))
|
||||||
{
|
{
|
||||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
|
|
||||||
//====================================
|
//====================================
|
||||||
loop:
|
loop:
|
||||||
/// Start the test, initialize test results
|
/// Start the test, initialize test results
|
||||||
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
||||||
Config.Entities.TestResult tstRslt = new Config.Entities.TestResult(test, repetitionNr, Config.Entities.MetersKind.Single);
|
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
|
||||||
|
TestStartTime = DateTime.Now;
|
||||||
|
|
||||||
|
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
int flowSetTime = 0;
|
||||||
float estFlowSetTime = 10.0f;
|
float estFlowSetTime = 10.0f;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
@ -78,9 +80,9 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
@ -95,51 +97,51 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
|
|
||||||
|
|
||||||
if (!test.Emptying) /// If condition met => skip measuring and force emptying
|
if (!test.Emptying) /// If condition met => skip measuring and force emptying
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
/// Measure the weight and skip emptying if there is enough room in the tank
|
/// Measure the weight and skip emptying if there is enough room in the tank
|
||||||
///
|
///
|
||||||
State.Create("ReferenceFlowmeterCalibration : Measuring the mass of water in the tank")
|
State.Create("ReferenceFlowmeterCalibration : Measuring the mass of water in the tank")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
|
|
||||||
float estimatedEndMass = Mass.Val + test.Volume;
|
float estimatedEndMass = Mass.Val + test.Volume;
|
||||||
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
if (estimatedEndMass < outPath.Balance.Capacity * Constants.TankFullFactor)
|
||||||
{
|
{
|
||||||
goto set_flow; /// Enough room in the tank -> skip emptying
|
goto set_flow; /// Enough room in the tank -> skip emptying
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Empty the water tank
|
/// Empty the water tank
|
||||||
///
|
///
|
||||||
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance))
|
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance))
|
||||||
{
|
{
|
||||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
|
|
||||||
set_flow:
|
set_flow:
|
||||||
|
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
State.Create("ReferenceFlowmeterCalibration : Setting the flow")
|
State.Create("ReferenceFlowmeterCalibration : Setting the flow")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, RefFlow, 600)) /// timeout = 10 min.
|
||||||
@ -148,12 +150,12 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
|||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
|
||||||
int flowSetTime = StateMachine.Time - flowSetTime0;
|
flowSetTime = StateMachine.Time - flowSetTime0;
|
||||||
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, false, cBrd, flowSetTime, progress));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
if (e.Contains(Event.RegulValveTimeOut))
|
if (e.Contains(Event.RegulValveTimeOut))
|
||||||
{
|
{
|
||||||
Bridge.OnError(this, Strings.Timeout);
|
Bridge.OnError(this, Strings.Timeout);
|
||||||
@ -164,97 +166,75 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.FlowReached));
|
while (!e.Contains(Event.FlowReached));
|
||||||
|
|
||||||
flow_set:
|
flow_set:
|
||||||
int time = StateMachine.Time;
|
int time = StateMachine.Time;
|
||||||
float currentFlow = RefFlow.Val;
|
float currentFlow = RefFlow.Val;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
State.Create("ReferenceFlowmeterCalibration : Measuring the start mass")
|
State.Create("ReferenceFlowmeterCalibration : Measuring the start mass")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||||
.AddOperation((StateMachine.Ambient != null)
|
.AddOperation((StateMachine.Ambient != null)
|
||||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
.AddOperation(outPath.Balance.ReadStableMassOp(ref startMass, 5))
|
||||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(processDataLoggingOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
StartMassRaw = startMass.Val;
|
||||||
tstRslt.MassStartRaw = startMass.Val;
|
Mass.Val = startMass.Val;
|
||||||
Mass.Val = startMass.Val;
|
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_in_progress);
|
Bridge.OnActivity(this, Strings.Test_in_progress);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
State.Create("ReferenceFlowmeterCalibration : Starting the test")
|
State.Create("ReferenceFlowmeterCalibration : Starting the test")
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Diverter | Elde.TestMethods.Synchro,
|
||||||
test.Qfrom, test.Qto, totalPulses, (float)test.TolerRed))
|
test.Qfrom, test.Qto, totalPulses, (float)test.TolerRed))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.MeasurementStarted));
|
while (!e.Contains(Event.MeasurementStarted));
|
||||||
|
|
||||||
/// Measurement loop - preparation
|
/// Measurement loop - preparation
|
||||||
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
readRegistersOp = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
||||||
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
||||||
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
||||||
|
|
||||||
bool firstTime = true; /// To reset sums for averaging
|
ClearAllStatistics();
|
||||||
ResetAveragedData();
|
|
||||||
|
|
||||||
/// Measurement loop - begin
|
/// Measurement loop - begin
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
switch (ReadRegistersTempPressAmbient(null, true))
|
switch (ReadRegistersTempPressAmbient(null, true))
|
||||||
{
|
{
|
||||||
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
||||||
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
case Event.MeasurementCompleted: goto test_completed;
|
case Event.MeasurementCompleted: goto test_completed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstTime)
|
UpdateAllStatistics();
|
||||||
{
|
CurrentMassRaw = Mass.Val;
|
||||||
firstTime = false; /// Do the following only once
|
RefFreq.Val = cBrd.ReferenceFreq;
|
||||||
tstRslt.TempInStart = TempIn.Val;
|
RefFlow.Val = cBrd.ReferenceFlow;
|
||||||
tstRslt.TempOutStart = TempOut.Val;
|
|
||||||
tstRslt.TempDivStart = TempDiv.Val;
|
|
||||||
tstRslt.PressInStart = PressureUp.Val;
|
|
||||||
tstRslt.PressOutStart = PressureDown.Val;
|
|
||||||
}
|
|
||||||
|
|
||||||
tstRslt.TempInEnd = TempIn.Val;
|
|
||||||
tstRslt.TempOutEnd = TempOut.Val;
|
|
||||||
tstRslt.TempDivEnd = TempDiv.Val;
|
|
||||||
tstRslt.PressInEnd = PressureUp.Val;
|
|
||||||
tstRslt.PressOutEnd = PressureDown.Val;
|
|
||||||
tstRslt.MassEndRaw = Mass.Val;
|
|
||||||
|
|
||||||
AccumulateAveragedData();
|
|
||||||
|
|
||||||
RefFreq.Val = cBrd.ReferenceFreq;
|
|
||||||
RefFlow.Val = cBrd.ReferenceFlow;
|
|
||||||
tstRslt.AmbientTempAve = AmbientTemp.Val;
|
|
||||||
tstRslt.AmbientPressAve = AmbientPressure.Val;
|
|
||||||
tstRslt.AmbientHumiAve = AmbientHumidity.Val;
|
|
||||||
|
|
||||||
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
||||||
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
||||||
@ -265,151 +245,140 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
|||||||
log.Debug(logstr);
|
log.Debug(logstr);
|
||||||
|
|
||||||
|
|
||||||
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
||||||
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress));
|
Bridge.OnTestProgress(this, GetTestProgressData(test, repetitionNr, true, cBrd, cBrd.TTime, progress));
|
||||||
}
|
}
|
||||||
/// Measurement loop - end
|
/// Measurement loop - end
|
||||||
|
|
||||||
test_completed:
|
test_completed:
|
||||||
State.Create("FlyingStartCollectionMethod : Waiting before mass measurement")
|
State.Create("ReferenceFlowmeterCalibration : Waiting before mass measurement")
|
||||||
.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 PressureUp))
|
|
||||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
|
||||||
.AddOperation(readRegistersOp)
|
|
||||||
.AddOperation((StateMachine.Ambient != null)
|
|
||||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
|
||||||
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
|
||||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
|
||||||
.AddOperation(processDataLoggingOp)
|
|
||||||
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
|
||||||
.EnterState();
|
|
||||||
do
|
|
||||||
{
|
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
||||||
}
|
|
||||||
while (!e.Contains(Event.TimerExpired));
|
|
||||||
|
|
||||||
//------------------------------------------------
|
|
||||||
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
|
||||||
//------------------------------------------------
|
|
||||||
State.Create("ReferenceFlowmeterCalibration : Measuring the end mass")
|
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
.AddOperation(benchPath.TempIn.ReadTempOp(ref TempIn))
|
||||||
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
.AddOperation(benchPath.TempOut.ReadTempOp(ref TempOut))
|
||||||
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
.AddOperation(outPath.TempDiv.ReadTempOp(ref TempDiv))
|
||||||
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
.AddOperation(benchPath.PressIn.ReadPressureOp(ref PressureUp))
|
||||||
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||||
.AddOperation((StateMachine.Ambient != null)
|
.AddOperation(readRegistersOp)
|
||||||
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
.AddOperation((StateMachine.Ambient != null)
|
||||||
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
.AddOperation(outPath.Balance.ReadMassOp(ref Mass))
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||||
.EnterState();
|
.AddOperation(processDataLoggingOp)
|
||||||
|
.AddOperation(new Operations.TimerOp(test.TimeStop2Mass))
|
||||||
|
.EnterState();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
}
|
||||||
|
while (!e.Contains(Event.TimerExpired));
|
||||||
|
|
||||||
|
//------------------------------------------------
|
||||||
|
Bridge.OnActivity(this, Strings.Measuring_the_weight);
|
||||||
|
//------------------------------------------------
|
||||||
|
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 PressureUp))
|
||||||
|
.AddOperation(benchPath.PressOut.ReadPressureOp(ref PressureDown))
|
||||||
|
.AddOperation((StateMachine.Ambient != null)
|
||||||
|
? StateMachine.Ambient.ReadAmbientOp(AmbientTemp, AmbientPressure, AmbientHumidity) : null)
|
||||||
|
.AddOperation(outPath.Balance.ReadStableMassOp(ref endMass, 5))
|
||||||
|
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||||
|
.AddOperation(processDataLoggingOp)
|
||||||
|
.EnterState();
|
||||||
|
do
|
||||||
|
{
|
||||||
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.BalanceDone));
|
while (!e.Contains(Event.BalanceDone));
|
||||||
///
|
///
|
||||||
tstRslt.MassEndRaw = endMass.Val;
|
EndMassRaw = endMass.Val;
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Test_completed);
|
Bridge.OnActivity(this, Strings.Test_completed);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
|
||||||
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Populate TestResult data entity with data
|
/// Populate TestResult data entity with data
|
||||||
///
|
///
|
||||||
UpdateTestRsltWithAveragedData(tstRslt);
|
Results.Entities.TestRslt tstRslt = BatchRslts.GetTestRslt(testName, test.Part);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (tstRslt != null)
|
||||||
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
|
||||||
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
|
|
||||||
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
||||||
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
|
||||||
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
|
||||||
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
|
|
||||||
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
|
||||||
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
|
||||||
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
|
|
||||||
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
|
||||||
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
|
||||||
|
|
||||||
if (tstRslt.VolumeCTV <= float.Epsilon)
|
|
||||||
{
|
{
|
||||||
tstRslt.ErrorMaster = 0.1f;
|
/// Auxiliary results
|
||||||
}
|
tstRslt.AmbientTempAve = AmbientTempStat.Average;
|
||||||
else
|
tstRslt.AmbientPressAve = AmbientPressureStat.Average;
|
||||||
{
|
tstRslt.AmbientHumiAve = AmbientHumidityStat.Average;
|
||||||
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
|
tstRslt.PressUpAvrg = PressureUpStat.Average;
|
||||||
|
tstRslt.PressUpStart = PressureUpStat.First;
|
||||||
|
tstRslt.PressUpEnd = PressureUpStat.Last;
|
||||||
|
tstRslt.PressUpMin = PressureUpStat.Min;
|
||||||
|
tstRslt.PressUpMax = PressureUpStat.Max;
|
||||||
|
tstRslt.PressDownAvrg = PressureDownStat.Average;
|
||||||
|
tstRslt.PressDownStart = PressureDownStat.First;
|
||||||
|
tstRslt.PressDownEnd = PressureDownStat.Last;
|
||||||
|
tstRslt.PressDownMin = PressureDownStat.Min;
|
||||||
|
tstRslt.PressDownMax = PressureDownStat.Max;
|
||||||
|
tstRslt.TempInAvrg = TempInStat.Average;
|
||||||
|
tstRslt.TempInStart = TempInStat.First;
|
||||||
|
tstRslt.TempInEnd = TempInStat.Last;
|
||||||
|
tstRslt.TempInMin = TempInStat.Min;
|
||||||
|
tstRslt.TempInMax = TempInStat.Max;
|
||||||
|
tstRslt.TempOutAvrg = TempOutStat.Average;
|
||||||
|
tstRslt.TempOutStart = TempOutStat.First;
|
||||||
|
tstRslt.TempOutEnd = TempOutStat.Last;
|
||||||
|
tstRslt.TempOutMin = TempOutStat.Min;
|
||||||
|
tstRslt.TempOutMax = TempOutStat.Max;
|
||||||
|
tstRslt.TempDivAvrg = TempDivStat.Average;
|
||||||
|
tstRslt.TempDivStart = TempDivStat.First;
|
||||||
|
tstRslt.TempDivEnd = TempDivStat.Last;
|
||||||
|
tstRslt.TempDivMin = TempDivStat.Min;
|
||||||
|
tstRslt.TempDivMax = TempDivStat.Max;
|
||||||
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
||||||
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
||||||
|
|
||||||
/// Update flowmeter constant with the measured one
|
/// Main results
|
||||||
if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount)
|
tstRslt.StartTime = TestStartTime;
|
||||||
{
|
tstRslt.EndTime = TestEndTime;
|
||||||
LtrPerRefPulse[outPath.FlowMeter.Idx1 - 1] = tstRslt.ConstMaster;
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
log.InfoFormat("Updating LtrPerRefPulse[{0}] = {1}", outPath.FlowMeter.Idx1 - 1, tstRslt.ConstMaster);
|
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
|
||||||
}
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
|
||||||
|
tstRslt.MassStartRaw = startMass.Val;
|
||||||
|
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
|
||||||
|
tstRslt.MassEndRaw = endMass.Val;
|
||||||
|
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
|
||||||
|
tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.TestTime; /// [kg/h]
|
||||||
|
tstRslt.FlowVolume = 3.6 * ltrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
|
||||||
|
tstRslt.VolumeCTV = 1001.03 * (tstRslt.MassEnd - tstRslt.MassStart) / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
|
||||||
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
||||||
|
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster; /// Corrected master pulses per liter
|
||||||
|
tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV);
|
||||||
|
|
||||||
|
/// Update flowmeter constant with the measured one
|
||||||
|
if (outPath.FlowMeter.Idx1 > 0 && outPath.FlowMeter.Idx1 <= ReferenceFlowmetersCount)
|
||||||
|
{
|
||||||
|
LtrPerRefPulse[outPath.FlowMeter.Idx1 - 1] = Convert.ToSingle(tstRslt.ConstMaster);
|
||||||
|
log.InfoFormat("Updating LtrPerRefPulse[{0}] = {1}", outPath.FlowMeter.Idx1 - 1, tstRslt.ConstMaster);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tstRslt.TimeDivStart0 = 0;
|
|
||||||
tstRslt.TimeDivStart1 = 0;
|
|
||||||
tstRslt.TimeDivStart2 = 0;
|
|
||||||
tstRslt.TimeDivStart3 = 0;
|
|
||||||
tstRslt.TimeDivStart4 = 0;
|
|
||||||
tstRslt.TimeDivStart5 = 0;
|
|
||||||
tstRslt.TimeDivEnd0 = 0;
|
|
||||||
tstRslt.TimeDivEnd1 = 0;
|
|
||||||
tstRslt.TimeDivEnd2 = 0;
|
|
||||||
tstRslt.TimeDivEnd3 = 0;
|
|
||||||
tstRslt.TimeDivEnd4 = 0;
|
|
||||||
tstRslt.TimeDivEnd5 = 0;
|
|
||||||
//for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
||||||
//{
|
|
||||||
// if (sensPath.RegisterReaders[i] != null)
|
|
||||||
// {
|
|
||||||
// tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString();
|
|
||||||
// tstRslt.Meters[i].VolumeStart = 0; /// liter
|
|
||||||
// tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
|
||||||
// if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
// else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
||||||
// tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter
|
|
||||||
// tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
|
||||||
// tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
|
||||||
// tstRslt.Meters[i].Time = cBrd.TTime;
|
|
||||||
// if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0)
|
|
||||||
// {
|
|
||||||
// tstRslt.Meters[i].VolumeErrorPct =
|
|
||||||
// 100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
|
||||||
// /// %
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// tstRslt.Meters[i].VolumeErrorPct = -100;
|
|
||||||
// }
|
|
||||||
// tstRslt.Meters[i].Passed = (tstRslt.Meters[i].VolumeErrorPct >= tstRslt.ErrLimLo + tstRslt.Uncertainty)
|
|
||||||
// && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi - tstRslt.Uncertainty);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
/// Add data - end
|
/// Add data - end
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(testName));
|
||||||
|
|
||||||
/// Append the results to the CSV-file
|
/// Append the results to the CSV-file
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt));
|
allResults.Info(TestResult2CsvLine(testName, test.Part));
|
||||||
|
|
||||||
|
|
||||||
if (++repetitionNr <= test.Repeats)
|
if (++repetitionNr <= test.Repeats)
|
||||||
@ -439,7 +408,7 @@ namespace TBF.BenchControl.TestMethods.ReferenceFlowmeterCalibration
|
|||||||
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
||||||
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
switch (Transition(transitionAfter, TransitionContext.AfterTest))
|
||||||
{
|
{
|
||||||
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
||||||
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ using System.Windows.Forms;
|
|||||||
using log4net;
|
using log4net;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
|
using TBF.BenchControl.Sequences;
|
||||||
using TBF.BenchControl.WaterMeters.iPerl;
|
using TBF.BenchControl.WaterMeters.iPerl;
|
||||||
|
|
||||||
namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||||
@ -262,6 +263,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
/// RFID multiplexer PCB / RFID serial port and worker thread related variables
|
/// RFID multiplexer PCB / RFID serial port and worker thread related variables
|
||||||
///
|
///
|
||||||
static TestMethodCfg cfg;
|
static TestMethodCfg cfg;
|
||||||
|
static IList<string> testNames;
|
||||||
static IList<iPerlCommunicationParams> multiTestParams;
|
static IList<iPerlCommunicationParams> multiTestParams;
|
||||||
|
|
||||||
|
|
||||||
@ -413,10 +415,12 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
/// Constructor for one iPerlCommunication 'test'
|
/// Constructor for one iPerlCommunication 'test'
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||||
public iPerlCommunicationForm(IList<GenericDevices.IWaterMeter> waterMeters,
|
public iPerlCommunicationForm(IList<GenericDevices.IWaterMeter> waterMeters, TestMethodCfg cfg,
|
||||||
TestMethodCfg cfg, iPerlCommunicationParams testParams)
|
string testName, iPerlCommunicationParams testParams)
|
||||||
: this(waterMeters, cfg)
|
: this(waterMeters, cfg)
|
||||||
{
|
{
|
||||||
|
iPerlCommunicationForm.testNames = new List<string>();
|
||||||
|
iPerlCommunicationForm.testNames.Add(testName);
|
||||||
iPerlCommunicationForm.multiTestParams = new List<iPerlCommunicationParams>();
|
iPerlCommunicationForm.multiTestParams = new List<iPerlCommunicationParams>();
|
||||||
iPerlCommunicationForm.multiTestParams.Add(testParams);
|
iPerlCommunicationForm.multiTestParams.Add(testParams);
|
||||||
|
|
||||||
@ -429,9 +433,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
/// <param name="waterMetersCount">Number of text boxes for serial numbers</param>
|
||||||
public iPerlCommunicationForm(IList<GenericDevices.IWaterMeter> waterMeters, TestMethodCfg cfg,
|
public iPerlCommunicationForm(IList<GenericDevices.IWaterMeter> waterMeters, TestMethodCfg cfg,
|
||||||
IList<iPerlCommunicationParams> multiTestParams)
|
IList<string> testNames, IList<iPerlCommunicationParams> multiTestParams)
|
||||||
: this(waterMeters, cfg)
|
: this(waterMeters, cfg)
|
||||||
{
|
{
|
||||||
|
iPerlCommunicationForm.testNames = testNames;
|
||||||
iPerlCommunicationForm.multiTestParams = multiTestParams;
|
iPerlCommunicationForm.multiTestParams = multiTestParams;
|
||||||
|
|
||||||
if (multiTestParams.Count > 0) activityLabel.Text = multiTestParams[0].Activity;
|
if (multiTestParams.Count > 0) activityLabel.Text = multiTestParams[0].Activity;
|
||||||
@ -534,9 +539,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
CommCompletedHandler = null;
|
CommCompletedHandler = null;
|
||||||
AllCompletedHandler = null;
|
AllCompletedHandler = null;
|
||||||
|
|
||||||
TestResult result = CommResult(StateMachine.Tests[0]); /// TODO: Pass the test info in a correct way
|
UpdateRfidCommResult(StateMachine.Tests[0].Name); /// TODO: Pass the test info in a correct way
|
||||||
BenchControl.Sequences.SequenceBase.AddOrOverwriteResult(result); /// TODO: Pass the result in a correct way
|
|
||||||
TBF.UiBridge.Bridge.OnTestCompleted(this, new TBF.UiBridge.TestCompletedEventArgs(result));
|
TBF.UiBridge.Bridge.OnTestCompleted(this, new TBF.UiBridge.TestCompletedEventArgs(StateMachine.Tests[0].Name));
|
||||||
|
|
||||||
formCompleted = true;
|
formCompleted = true;
|
||||||
Program.LocalSettings.iPerlCommunicationsFormLeft = Location.X;
|
Program.LocalSettings.iPerlCommunicationsFormLeft = Location.X;
|
||||||
@ -1158,82 +1163,25 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create virtual test result with representing communication success/failure
|
/// Update test result representing RFID communication success/failure
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="test"></param>
|
/// <param name="test"></param>
|
||||||
/// <returns></returns>
|
void UpdateRfidCommResult(string testName)
|
||||||
TestResult CommResult(Test test)
|
|
||||||
{
|
{
|
||||||
TestResult tstRslt = new TestResult(test, 1, MetersKind.Single);
|
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(testName, 0);
|
||||||
|
|
||||||
tstRslt.DoNotEvaluate = false;
|
for (int i = 0; i < Math.Min(ProcessData.BatchRslts.WMPositionsCount, waterMeters.Count); i++)
|
||||||
tstRslt.DoNotPublish = false;
|
{
|
||||||
|
Results.Entities.MeterTestRslt meterRslt =
|
||||||
|
ProcessData.BatchRslts.GetMeterTestRslt(testName, i, Config.Entities.CompoundMeterId.Single);
|
||||||
|
WaterMeters.iPerl.WaterMeter iPerl = waterMeters[i] as WaterMeters.iPerl.WaterMeter;
|
||||||
|
|
||||||
tstRslt.TimeStart = DateTime.Now;
|
if (meterRslt != null && iPerl != null)
|
||||||
tstRslt.TimeEnd = DateTime.Now;
|
{
|
||||||
|
meterRslt.Passed = (!iPerl.CommFailed && !iPerl.Disabled);
|
||||||
tstRslt.AmbientTempAve = 20.0f;
|
meterRslt.TestDone = true;
|
||||||
tstRslt.AmbientPressAve = 1000.0f;
|
}
|
||||||
tstRslt.AmbientHumiAve = 50.0f;
|
}
|
||||||
|
|
||||||
tstRslt.PressInStart = 1000.0f;
|
|
||||||
tstRslt.PressOutStart = 1000.0f;
|
|
||||||
tstRslt.TempInStart = 20.0f;
|
|
||||||
tstRslt.TempOutStart = 20.0f;
|
|
||||||
tstRslt.TempDivStart = 20.0f;
|
|
||||||
|
|
||||||
tstRslt.PressInEnd = 1000.0f;
|
|
||||||
tstRslt.PressOutEnd = 1000.0f;
|
|
||||||
tstRslt.TempInEnd = 20.0f;
|
|
||||||
tstRslt.TempOutEnd = 20.0f;
|
|
||||||
tstRslt.TempDivEnd = 20.0f;
|
|
||||||
|
|
||||||
tstRslt.PressInAvrg = 1000.0f;
|
|
||||||
tstRslt.PressOutAvrg = 1000.0f;
|
|
||||||
tstRslt.TempInAvrg = 20.0f;
|
|
||||||
tstRslt.TempOutAvrg = 20.0f;
|
|
||||||
tstRslt.TempDivAvrg = 20.0f;
|
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
|
||||||
tstRslt.MassStartRaw = 0;
|
|
||||||
tstRslt.MassStart = 0;
|
|
||||||
tstRslt.MassEndRaw = 0;
|
|
||||||
tstRslt.MassEnd = 0;
|
|
||||||
tstRslt.MassDiff = 0;
|
|
||||||
tstRslt.DensityIn = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.DensityOut = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.DensityDiv = Program.LocalSettings.RealDensity;
|
|
||||||
tstRslt.Time = 0;
|
|
||||||
tstRslt.FlowMass = 0;
|
|
||||||
tstRslt.FlowVolume = 0;
|
|
||||||
tstRslt.VolumeCTV = 0;
|
|
||||||
tstRslt.VolumeMaster = 0;
|
|
||||||
tstRslt.PulsesMaster = 0;
|
|
||||||
tstRslt.ConstMaster = 0;
|
|
||||||
tstRslt.ErrorMaster = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
|
||||||
{
|
|
||||||
/// Reference to iPerl water meter or null:
|
|
||||||
WaterMeters.iPerl.WaterMeter iPerl = (i < iPerlCommunicationForm.waterMeters.Count) ? iPerlCommunicationForm.waterMeters[i] : null;
|
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = iPerl.SerialNr;
|
|
||||||
tstRslt.Meters[i].PulsesPerLiter = 0;
|
|
||||||
tstRslt.Meters[i].VolumeRef = 0;
|
|
||||||
tstRslt.Meters[i].Time = 0;
|
|
||||||
tstRslt.Meters[i].TimeStart = 0;
|
|
||||||
tstRslt.Meters[i].TimeEnd = 0;
|
|
||||||
tstRslt.Meters[i].PulsesMaster = 0;
|
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
|
||||||
tstRslt.Meters[i].VolumeEnd = 0;
|
|
||||||
tstRslt.Meters[i].VolumeMeter = 0;
|
|
||||||
tstRslt.Meters[i].VolumeErrorPct = 0;
|
|
||||||
tstRslt.Meters[i].Passed = (!iPerl.CommFailed && !iPerl.Disabled);
|
|
||||||
tstRslt.Meters[i].PulsesMeter = 0;
|
|
||||||
tstRslt.Meters[i].Disabled = iPerl.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
return tstRslt;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using System.Text;
|
|||||||
using log4net;
|
using log4net;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using TBF.BenchControl;
|
using TBF.BenchControl;
|
||||||
|
using TBF.BenchControl.Sequences;
|
||||||
using TBF.Boxes;
|
using TBF.Boxes;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
using TBF.UiBridge;
|
using TBF.UiBridge;
|
||||||
@ -20,9 +21,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
|
|
||||||
System.Windows.Forms.Form modelessDlg;
|
System.Windows.Forms.Form modelessDlg;
|
||||||
///
|
///
|
||||||
delegate void iPerlCommFormDlgt(iPerlCommunicationSeq myRef, TestMethodCfg cfg, iPerlCommunicationParams testParams);
|
delegate void iPerlCommFormDlgt(iPerlCommunicationSeq myRef, TestMethodCfg cfg, string testName, iPerlCommunicationParams testParams);
|
||||||
///
|
///
|
||||||
void OpenIPerlCommForm(iPerlCommunicationSeq myRef, TestMethodCfg cfg, iPerlCommunicationParams testParams)
|
void OpenIPerlCommForm(iPerlCommunicationSeq myRef, TestMethodCfg cfg, string testName, iPerlCommunicationParams testParams)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
IList<GenericDevices.IWaterMeter> wMtrs = new List<GenericDevices.IWaterMeter>();
|
IList<GenericDevices.IWaterMeter> wMtrs = new List<GenericDevices.IWaterMeter>();
|
||||||
@ -36,7 +37,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.ErrorFormat("OpenIPerlCommForm(wms:{0})", sb);
|
log.ErrorFormat("OpenIPerlCommForm(wms:{0})", sb);
|
||||||
myRef.modelessDlg = new iPerlCommunicationForm(WaterMeters, cfg, testParams);
|
myRef.modelessDlg = new iPerlCommunicationForm(WaterMeters, cfg, testName, testParams);
|
||||||
myRef.modelessDlg.Show();
|
myRef.modelessDlg.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,17 +74,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
{
|
{
|
||||||
string fromTestName = testParams.Activity.Substring(Q2correctedFromCmd.Length);
|
string fromTestName = testParams.Activity.Substring(Q2correctedFromCmd.Length);
|
||||||
|
|
||||||
TestResult oriTestResult = null;
|
MakeCorrectedFrom(test.Name, fromTestName);
|
||||||
foreach (var tr in results)
|
|
||||||
{
|
|
||||||
if ((tr.TestName == fromTestName)) { oriTestResult = tr; break; }
|
|
||||||
}
|
|
||||||
|
|
||||||
TestResult tstRslt = MakeCorrectedFrom(test, oriTestResult);
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name));
|
||||||
|
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt)); /// Append the results to the CSV-file
|
|
||||||
|
|
||||||
IList<Event> rList = new List<Event>(1);
|
IList<Event> rList = new List<Event>(1);
|
||||||
rList.Add(Event.Done);
|
rList.Add(Event.Done);
|
||||||
@ -91,20 +85,16 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
}
|
}
|
||||||
else if (testParams.Activity.ToLower().Contains("simulate "))
|
else if (testParams.Activity.ToLower().Contains("simulate "))
|
||||||
{
|
{
|
||||||
TestResult tstRslt;
|
if (testParams.Activity.ToLower().Contains("q3")) MakeSimulated(test.Name, 1, 1, 0, -0.5f);
|
||||||
|
else if (testParams.Activity.ToLower().Contains("q2")) MakeSimulated(test.Name, 1, 1, 0, 0.5f);
|
||||||
|
else if (testParams.Activity.ToLower().Contains("q1")) MakeSimulated(test.Name, 1, 1, 0, -5.1f);
|
||||||
|
else if (testParams.Activity.ToLower().Contains("compound ok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 1.0f);
|
||||||
|
else if (testParams.Activity.ToLower().Contains("compound nok")) MakeSimulatedCompound(test.Name, 1, 1, 0, 4.7f, 0.9f);
|
||||||
|
else if (testParams.Activity.ToLower().Contains("compound rise")) MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 0.0f);
|
||||||
|
else if (testParams.Activity.ToLower().Contains("compound fall")) MakeSimulatedCompound(test.Name, 1, 1, 0, 0.7f, 0.9f);
|
||||||
|
|
||||||
if (testParams.Activity.ToLower().Contains("q3")) tstRslt = MakeSimulated(test, 1, -0.5f);
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(test.Name));
|
||||||
else if (testParams.Activity.ToLower().Contains("q2")) tstRslt = MakeSimulated(test, 1, 0.5f);
|
allResults.Info(TestResult2CsvLine(test.Name, 0)); /// Append the results to the CSV-file
|
||||||
else if (testParams.Activity.ToLower().Contains("q1")) tstRslt = MakeSimulated(test, 1, -5.1f);
|
|
||||||
else if (testParams.Activity.ToLower().Contains("compound ok")) tstRslt = MakeSimulatedCompound(test, CompoundTestType.Regular, 1, 0.7f);
|
|
||||||
else if (testParams.Activity.ToLower().Contains("compound nok")) tstRslt = MakeSimulatedCompound(test, CompoundTestType.Regular, 1, 4.7f);
|
|
||||||
else if (testParams.Activity.ToLower().Contains("compound rise")) tstRslt = MakeSimulatedCompound(test, CompoundTestType.DetectionRise, 1, 0.7f);
|
|
||||||
else if (testParams.Activity.ToLower().Contains("compound fall")) tstRslt = MakeSimulatedCompound(test, CompoundTestType.DetectionFall, 1, 0.7f);
|
|
||||||
else tstRslt = null;
|
|
||||||
|
|
||||||
AddOrOverwriteResult(tstRslt);
|
|
||||||
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
|
||||||
allResults.Info(TestResult2CsvLine(tstRslt)); /// Append the results to the CSV-file
|
|
||||||
|
|
||||||
for (int i = 0; i < Config.Data.WMsCount; i++)
|
for (int i = 0; i < Config.Data.WMsCount; i++)
|
||||||
{
|
{
|
||||||
@ -113,7 +103,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
: null;
|
: null;
|
||||||
if (iPerl != null)
|
if (iPerl != null)
|
||||||
{
|
{
|
||||||
iPerl.LastTestResult = tstRslt.Meters[i]; /// Save this water meter test result to iPerl WM
|
/// TODO: Reimplement
|
||||||
|
//iPerl.LastTestResult = meterRslt; /// Save this water meter test result to iPerl WM
|
||||||
iPerl.NominalTestFlow = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
iPerl.NominalTestFlow = 500.0 * (double)(test.Qfrom + test.Qto); /// Ave. + convert to liter/hour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,36 +168,26 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="oriTestRslt">Q2Adj test result</param>
|
/// <param name="oriTestRslt">Q2Adj test result</param>
|
||||||
/// <returns>Virtual Q2 test result</returns>
|
/// <returns>Virtual Q2 test result</returns>
|
||||||
TestResult MakeCorrectedFrom(Test test, TestResult oriTestRslt)
|
/// <remarks>Assuming this test does not have multiple parts (part = 0)</remarks>
|
||||||
|
void MakeCorrectedFrom(string testName, string oriTestName)
|
||||||
{
|
{
|
||||||
TestResult tstRslt = new TestResult(test, 1, MetersKind.Single);
|
Results.Entities.TestRslt oriTestRslt = ProcessData.BatchRslts.GetTestRslt(oriTestName, 0);
|
||||||
|
Results.Entities.TestRslt tstRslt = ProcessData.BatchRslts.GetTestRslt(testName, 0);
|
||||||
|
|
||||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
if (oriTestRslt == null || tstRslt == null) return;
|
||||||
tstRslt.TimeStart = oriTestRslt.TimeStart;
|
|
||||||
tstRslt.TimeEnd = oriTestRslt.TimeEnd;
|
tstRslt.Components = oriTestRslt.Components;
|
||||||
tstRslt.AmbientTempAve = oriTestRslt.AmbientTempAve;
|
|
||||||
tstRslt.AmbientPressAve = oriTestRslt.AmbientPressAve;
|
tstRslt.StartTime = oriTestRslt.StartTime;
|
||||||
tstRslt.AmbientHumiAve = oriTestRslt.AmbientHumiAve;
|
tstRslt.EndTime = oriTestRslt.EndTime;
|
||||||
tstRslt.PressInAvrg = oriTestRslt.PressInAvrg;
|
tstRslt.FlowSetTime = oriTestRslt.FlowSetTime;
|
||||||
tstRslt.PressInStart = oriTestRslt.PressInStart;
|
tstRslt.TestTime = oriTestRslt.TestTime;
|
||||||
tstRslt.PressInEnd = oriTestRslt.PressInEnd;
|
tstRslt.PulsesMaster = oriTestRslt.PulsesMaster;
|
||||||
tstRslt.PressOutAvrg = oriTestRslt.PressOutAvrg;
|
tstRslt.ConstMaster = oriTestRslt.ConstMaster;
|
||||||
tstRslt.PressOutStart = oriTestRslt.PressOutStart;
|
tstRslt.MassStartRaw = oriTestRslt.MassStartRaw;
|
||||||
tstRslt.PressOutEnd = oriTestRslt.PressOutEnd;
|
|
||||||
tstRslt.TempInAvrg = oriTestRslt.TempInAvrg;
|
|
||||||
tstRslt.TempInStart = oriTestRslt.TempInStart;
|
|
||||||
tstRslt.TempInEnd = oriTestRslt.TempInEnd;
|
|
||||||
tstRslt.TempOutAvrg = oriTestRslt.TempOutAvrg;
|
|
||||||
tstRslt.TempOutStart = oriTestRslt.TempOutStart;
|
|
||||||
tstRslt.TempOutEnd = oriTestRslt.TempOutEnd;
|
|
||||||
tstRslt.TempDivAvrg = oriTestRslt.TempDivAvrg;
|
|
||||||
tstRslt.TempDivStart = oriTestRslt.TempDivStart;
|
|
||||||
tstRslt.TempDivEnd = oriTestRslt.TempDivEnd;
|
|
||||||
tstRslt.MassStartRaw = oriTestRslt.MassStartRaw;
|
|
||||||
tstRslt.MassStart = oriTestRslt.MassStart;
|
tstRslt.MassStart = oriTestRslt.MassStart;
|
||||||
tstRslt.MassEndRaw = oriTestRslt.MassEndRaw;
|
tstRslt.MassEndRaw = oriTestRslt.MassEndRaw;
|
||||||
tstRslt.MassEnd = oriTestRslt.MassEnd;
|
tstRslt.MassEnd = oriTestRslt.MassEnd;
|
||||||
tstRslt.MassDiff = oriTestRslt.MassEnd;
|
|
||||||
tstRslt.DensityIn = oriTestRslt.DensityIn;
|
tstRslt.DensityIn = oriTestRslt.DensityIn;
|
||||||
tstRslt.DensityOut = oriTestRslt.DensityOut;
|
tstRslt.DensityOut = oriTestRslt.DensityOut;
|
||||||
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
|
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
|
||||||
@ -215,64 +196,91 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
|||||||
tstRslt.FlowVolume = oriTestRslt.FlowVolume;
|
tstRslt.FlowVolume = oriTestRslt.FlowVolume;
|
||||||
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
|
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
|
||||||
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
|
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
|
||||||
tstRslt.Time = oriTestRslt.Time;
|
|
||||||
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
|
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
|
||||||
tstRslt.PulsesMaster = oriTestRslt.PulsesMaster;
|
|
||||||
tstRslt.ConstMaster = oriTestRslt.ConstMaster;
|
|
||||||
tstRslt.TimeDivStart0 = oriTestRslt.TimeDivStart0;
|
|
||||||
tstRslt.TimeDivStart1 = oriTestRslt.TimeDivStart1;
|
|
||||||
tstRslt.TimeDivStart2 = oriTestRslt.TimeDivStart2;
|
|
||||||
tstRslt.TimeDivStart3 = oriTestRslt.TimeDivStart3;
|
|
||||||
tstRslt.TimeDivStart4 = oriTestRslt.TimeDivStart4;
|
|
||||||
tstRslt.TimeDivStart5 = oriTestRslt.TimeDivStart5;
|
|
||||||
tstRslt.TimeDivEnd0 = oriTestRslt.TimeDivEnd0;
|
|
||||||
tstRslt.TimeDivEnd1 = oriTestRslt.TimeDivEnd1;
|
|
||||||
tstRslt.TimeDivEnd2 = oriTestRslt.TimeDivEnd2;
|
|
||||||
tstRslt.TimeDivEnd3 = oriTestRslt.TimeDivEnd3;
|
|
||||||
tstRslt.TimeDivEnd4 = oriTestRslt.TimeDivEnd4;
|
|
||||||
tstRslt.TimeDivEnd5 = oriTestRslt.TimeDivEnd5;
|
|
||||||
|
|
||||||
for (int i = 0; i < Math.Min(tstRslt.Meters.Count, oriTestRslt.Meters.Count); i++)
|
tstRslt.AmbientTempAve = oriTestRslt.AmbientTempAve;
|
||||||
|
tstRslt.AmbientPressAve = oriTestRslt.AmbientPressAve;
|
||||||
|
tstRslt.AmbientHumiAve = oriTestRslt.AmbientHumiAve;
|
||||||
|
tstRslt.PressUpAvrg = oriTestRslt.PressUpAvrg;
|
||||||
|
tstRslt.PressUpStart = oriTestRslt.PressUpStart;
|
||||||
|
tstRslt.PressUpEnd = oriTestRslt.PressUpEnd;
|
||||||
|
tstRslt.PressUpMin = oriTestRslt.PressUpMin;
|
||||||
|
tstRslt.PressUpMax = oriTestRslt.PressUpMax;
|
||||||
|
tstRslt.PressDownAvrg = oriTestRslt.PressDownAvrg;
|
||||||
|
tstRslt.PressDownStart = oriTestRslt.PressDownStart;
|
||||||
|
tstRslt.PressDownEnd = oriTestRslt.PressDownEnd;
|
||||||
|
tstRslt.PressDownMin = oriTestRslt.PressDownMin;
|
||||||
|
tstRslt.PressDownMax = oriTestRslt.PressDownMax;
|
||||||
|
tstRslt.TempInAvrg = oriTestRslt.TempInAvrg;
|
||||||
|
tstRslt.TempInStart = oriTestRslt.TempInStart;
|
||||||
|
tstRslt.TempInEnd = oriTestRslt.TempInEnd;
|
||||||
|
tstRslt.TempInMin = oriTestRslt.TempInMin;
|
||||||
|
tstRslt.TempInMax = oriTestRslt.TempInMax;
|
||||||
|
tstRslt.TempOutAvrg = oriTestRslt.TempOutAvrg;
|
||||||
|
tstRslt.TempOutStart = oriTestRslt.TempOutStart;
|
||||||
|
tstRslt.TempOutEnd = oriTestRslt.TempOutEnd;
|
||||||
|
tstRslt.TempOutMin = oriTestRslt.TempOutMin;
|
||||||
|
tstRslt.TempOutMax = oriTestRslt.TempOutMax;
|
||||||
|
tstRslt.TempDivAvrg = oriTestRslt.TempDivAvrg;
|
||||||
|
tstRslt.TempDivStart = oriTestRslt.TempDivStart;
|
||||||
|
tstRslt.TempDivEnd = oriTestRslt.TempDivEnd;
|
||||||
|
tstRslt.TempDivMin = oriTestRslt.TempDivMin;
|
||||||
|
tstRslt.TempDivMax = oriTestRslt.TempDivMax;
|
||||||
|
tstRslt.FlowMin = oriTestRslt.FlowMin;
|
||||||
|
tstRslt.FlowMax = oriTestRslt.FlowMax;
|
||||||
|
|
||||||
|
tstRslt.Custom1 = oriTestRslt.Custom1;
|
||||||
|
tstRslt.Custom2 = oriTestRslt.Custom2;
|
||||||
|
tstRslt.Custom3 = oriTestRslt.Custom3;
|
||||||
|
tstRslt.Custom4 = oriTestRslt.Custom4;
|
||||||
|
tstRslt.Custom5 = oriTestRslt.Custom5;
|
||||||
|
tstRslt.Custom6 = oriTestRslt.Custom6;
|
||||||
|
tstRslt.Custom7 = oriTestRslt.Custom7;
|
||||||
|
tstRslt.Custom8 = oriTestRslt.Custom8;
|
||||||
|
|
||||||
|
for (int i = 0; i < ProcessData.BatchRslts.WMPositionsCount; i++)
|
||||||
{
|
{
|
||||||
|
Results.Entities.MeterTestRslt oriMeterRslt = ProcessData.BatchRslts.GetMeterTestRslt(oriTestName, i, CompoundMeterId.Single);
|
||||||
|
Results.Entities.MeterTestRslt meterRslt = ProcessData.BatchRslts.GetMeterTestRslt(testName, i, CompoundMeterId.Single);
|
||||||
|
|
||||||
/// Reference to iPerl water meter or null:
|
/// Reference to iPerl water meter or null:
|
||||||
WaterMeters.iPerl.WaterMeter iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
WaterMeters.iPerl.WaterMeter iPerl = ((sensPath.RegisterReaders != null) && (i < sensPath.RegisterReaders.Length))
|
||||||
? (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter)
|
? (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
tstRslt.Meters[i].SerialNr = oriTestRslt.Meters[i].SerialNr;
|
if (meterRslt != null && oriMeterRslt != null)
|
||||||
tstRslt.Meters[i].PulsesPerLiter = oriTestRslt.Meters[i].PulsesPerLiter;
|
{
|
||||||
tstRslt.Meters[i].VolumeRef = oriTestRslt.Meters[i].VolumeRef;
|
meterRslt.PulsesMeter = oriMeterRslt.PulsesMeter;
|
||||||
tstRslt.Meters[i].Time = oriTestRslt.Meters[i].Time;
|
meterRslt.PulsesMaster = oriMeterRslt.PulsesMaster;
|
||||||
tstRslt.Meters[i].TimeStart = oriTestRslt.Meters[i].TimeStart;
|
meterRslt.PulsesPerLiter = oriMeterRslt.PulsesPerLiter;
|
||||||
tstRslt.Meters[i].TimeEnd = oriTestRslt.Meters[i].TimeEnd;
|
meterRslt.VolumeRef = oriMeterRslt.VolumeRef;
|
||||||
tstRslt.Meters[i].PulsesMeter = oriTestRslt.Meters[i].PulsesMeter;
|
meterRslt.TestTime = oriMeterRslt.TestTime;
|
||||||
tstRslt.Meters[i].PulsesMaster = oriTestRslt.Meters[i].PulsesMaster;
|
|
||||||
tstRslt.Meters[i].Disabled = oriTestRslt.Meters[i].Disabled;
|
|
||||||
|
|
||||||
if (iPerl == null ||
|
if (iPerl == null ||
|
||||||
Math.Abs(oriTestRslt.Meters[i].VolumeErrorPct) <= 0.5f ||
|
Math.Abs(oriMeterRslt.Error) <= 0.5f ||
|
||||||
oriTestRslt.Meters[i].VolumeErrorPct < oriTestRslt.ErrLimLo + oriTestRslt.Uncertainty ||
|
oriMeterRslt.Error < oriTestRslt.ErrLimLo() + oriTestRslt.Uncertainty() ||
|
||||||
oriTestRslt.Meters[i].VolumeErrorPct > oriTestRslt.ErrLimHi - oriTestRslt.Uncertainty)
|
oriMeterRslt.Error > oriTestRslt.ErrLimHi() - oriTestRslt.Uncertainty())
|
||||||
{
|
{
|
||||||
/// Normal meter or iPerl without correction
|
/// Normal meter or iPerl without correction
|
||||||
tstRslt.Meters[i].VolumeStart = oriTestRslt.Meters[i].VolumeStart;
|
meterRslt.VolumeStart = oriMeterRslt.VolumeStart;
|
||||||
tstRslt.Meters[i].VolumeEnd = oriTestRslt.Meters[i].VolumeEnd;
|
meterRslt.VolumeEnd = oriMeterRslt.VolumeEnd;
|
||||||
tstRslt.Meters[i].VolumeMeter = oriTestRslt.Meters[i].VolumeMeter;
|
meterRslt.VolumeMeter = oriMeterRslt.VolumeMeter;
|
||||||
tstRslt.Meters[i].VolumeErrorPct = oriTestRslt.Meters[i].VolumeErrorPct;
|
meterRslt.Error = oriMeterRslt.Error;
|
||||||
tstRslt.Meters[i].Passed = oriTestRslt.Meters[i].Passed;
|
meterRslt.Passed = oriMeterRslt.Passed;
|
||||||
}
|
meterRslt.TestDone = true;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
/// corrected iPerl
|
{
|
||||||
tstRslt.Meters[i].VolumeStart = 0;
|
/// corrected iPerl
|
||||||
tstRslt.Meters[i].VolumeEnd = 0;
|
meterRslt.VolumeStart = 0;
|
||||||
tstRslt.Meters[i].VolumeMeter = oriTestRslt.Meters[i].VolumeRef;
|
meterRslt.VolumeEnd = 0;
|
||||||
tstRslt.Meters[i].VolumeErrorPct = 0;
|
meterRslt.VolumeMeter = oriMeterRslt.VolumeRef;
|
||||||
tstRslt.Meters[i].Passed = true;
|
meterRslt.Error = 0;
|
||||||
|
meterRslt.Passed = true;
|
||||||
|
meterRslt.TestDone = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tstRslt;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
|||||||
|
|
||||||
|
|
||||||
/// <summary> Result of the last test used to calculate Q2 correction factors, etc </summary>
|
/// <summary> Result of the last test used to calculate Q2 correction factors, etc </summary>
|
||||||
public MeterTestResult LastTestResult;
|
public Results.Entities.MeterTestRslt LastTestResult;
|
||||||
public double NominalTestFlow; /// liter per hour
|
public double NominalTestFlow; /// liter per hour
|
||||||
|
|
||||||
|
|
||||||
@ -161,9 +161,9 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
|||||||
/// <returns>Q2 correction factor</returns>
|
/// <returns>Q2 correction factor</returns>
|
||||||
public double Q2CorrectionFactor()
|
public double Q2CorrectionFactor()
|
||||||
{
|
{
|
||||||
Q2ErrorWOCorrection = LastTestResult.VolumeErrorPct;
|
Q2ErrorWOCorrection = LastTestResult.Error;
|
||||||
|
|
||||||
if (Math.Abs(LastTestResult.VolumeErrorPct) <= 0.5f)
|
if (Math.Abs(LastTestResult.Error) <= 0.5)
|
||||||
{
|
{
|
||||||
Q2CorrectionDone = false;
|
Q2CorrectionDone = false;
|
||||||
return 0; /// No Q2 correction if error < +/-0.5 %
|
return 0; /// No Q2 correction if error < +/-0.5 %
|
||||||
@ -176,26 +176,26 @@ namespace TBF.BenchControl.WaterMeters.iPerl
|
|||||||
double F = D / (NominalTestFlow * 10.0); /// Error corrected with 8 Raw Units per minute [%]
|
double F = D / (NominalTestFlow * 10.0); /// Error corrected with 8 Raw Units per minute [%]
|
||||||
double G = F / B; /// Error corrected with 1 Raw Unit per minute [%]
|
double G = F / B; /// Error corrected with 1 Raw Unit per minute [%]
|
||||||
|
|
||||||
float errLimitLo = LastTestResult.TestResult.ErrLimLo + LastTestResult.TestResult.Uncertainty;
|
double errLimitLo = LastTestResult.ErrLimLo() + LastTestResult.Uncertainty();
|
||||||
float errLimitHi = LastTestResult.TestResult.ErrLimHi - LastTestResult.TestResult.Uncertainty;
|
double errLimitHi = LastTestResult.ErrLimHi() - LastTestResult.Uncertainty();
|
||||||
|
|
||||||
if (LastTestResult.VolumeErrorPct < errLimitLo) return 0; /// No Q2 correction if error too large -> WM failed
|
if (LastTestResult.Error < errLimitLo) return 0; /// No Q2 correction if error too large -> WM failed
|
||||||
if (LastTestResult.VolumeErrorPct > errLimitHi) return 0; /// No Q2 correction if error too large -> WM failed
|
if (LastTestResult.Error > errLimitHi) return 0; /// No Q2 correction if error too large -> WM failed
|
||||||
|
|
||||||
float volumeMeterErrLimLo = LastTestResult.VolumeRef * (100.0f + errLimitLo) / 100.0f;
|
double volumeMeterErrLimLo = LastTestResult.VolumeRef * (100.0 + errLimitLo) / 100.0;
|
||||||
float volumeMeterErrLimHi = LastTestResult.VolumeRef * (100.0f + errLimitHi) / 100.0f;
|
double volumeMeterErrLimHi = LastTestResult.VolumeRef * (100.0 + errLimitHi) / 100.0;
|
||||||
|
|
||||||
double corrFactorHi = (-1) * (errLimitLo / G) * (LastTestResult.VolumeRef / volumeMeterErrLimLo); /// > 0
|
double corrFactorHi = (-1) * (errLimitLo / G) * (LastTestResult.VolumeRef / volumeMeterErrLimLo); /// > 0
|
||||||
double corrFactorLo = (-1) * (errLimitHi / G) * (LastTestResult.VolumeRef / volumeMeterErrLimHi); /// < 0
|
double corrFactorLo = (-1) * (errLimitHi / G) * (LastTestResult.VolumeRef / volumeMeterErrLimHi); /// < 0
|
||||||
|
|
||||||
double corrFactor = (-1) * (LastTestResult.VolumeErrorPct / G) * (LastTestResult.VolumeRef / LastTestResult.VolumeMeter);
|
double corrFactor = (-1) * (LastTestResult.Error / G) * (LastTestResult.VolumeRef / LastTestResult.VolumeMeter);
|
||||||
double origCalulatedCorrFactor = corrFactor;
|
double origCalulatedCorrFactor = corrFactor;
|
||||||
|
|
||||||
log.WarnFormat("Q2 correction: {0}, corrFactor={4}, error={3}% [Lo={1}%, Hi={2}%]",
|
log.WarnFormat("Q2 correction: {0}, corrFactor={4}, error={3}% [Lo={1}%, Hi={2}%]",
|
||||||
Name,
|
Name,
|
||||||
errLimitLo.ToString("F1"),
|
errLimitLo.ToString("F1"),
|
||||||
errLimitHi.ToString("F1"),
|
errLimitHi.ToString("F1"),
|
||||||
LastTestResult.VolumeErrorPct.ToString("F2"),
|
LastTestResult.Error.ToString("F2"),
|
||||||
corrFactor.ToString("F1"));
|
corrFactor.ToString("F1"));
|
||||||
|
|
||||||
Q2CorrectionDone = true;
|
Q2CorrectionDone = true;
|
||||||
|
|||||||
@ -149,15 +149,16 @@ namespace TBF.Screens
|
|||||||
|
|
||||||
public void OnTestProgress(object sender, TestProgressEventArgs data)
|
public void OnTestProgress(object sender, TestProgressEventArgs data)
|
||||||
{
|
{
|
||||||
if (data.TestResult != null)
|
/// TODO: Reimplement
|
||||||
{
|
//if (data.TestResult != null)
|
||||||
int count = Math.Min(Config.Data.WMsCount, data.TestResult.Meters.Count);
|
//{
|
||||||
for (int i = 0; i < count; i++)
|
// int count = Math.Min(Config.Data.WMsCount, data.TestResult.Meters.Count);
|
||||||
{
|
// for (int i = 0; i < count; i++)
|
||||||
measurementTbl1Col2.SetData(i, data.TestResult.Meters[i].VolumeMeter.ToString("F1"));
|
// {
|
||||||
measurementTbl1Col3.SetData(i, data.TestResult.Meters[i].VolumeErrorPct.ToString("F1"));
|
// measurementTbl1Col2.SetData(i, data.TestResult.Meters[i].VolumeMeter.ToString("F1"));
|
||||||
}
|
// measurementTbl1Col3.SetData(i, data.TestResult.Meters[i].VolumeErrorPct.ToString("F1"));
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
measurementTbl2Col2.SetData(0, data.RefPulses);
|
measurementTbl2Col2.SetData(0, data.RefPulses);
|
||||||
measurementTbl2Col2.SetData(1, data.Time.ToString("F1"));
|
measurementTbl2Col2.SetData(1, data.Time.ToString("F1"));
|
||||||
|
|
||||||
|
|||||||
@ -401,23 +401,26 @@ namespace TBF.Screens
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < textBoxesCount; i++)
|
for (int i = 0; i < textBoxesCount; i++)
|
||||||
{
|
{
|
||||||
pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||||
volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||||
error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||||
|
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (currentMetersKind == MetersKind.Combined)
|
else if (currentMetersKind == MetersKind.Combined)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||||
volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||||
error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||||
|
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
/// TODO: Reimplement
|
||||||
error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
//volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
||||||
|
//error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
|
|
||||||
tInLabel.Text = args.Tin.ToString();
|
tInLabel.Text = args.Tin.ToString();
|
||||||
@ -447,57 +450,58 @@ namespace TBF.Screens
|
|||||||
|
|
||||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||||
{
|
{
|
||||||
TestResult tRes = args.TestResult;
|
/// TODO: Reimplement
|
||||||
|
//TestResult tRes = args.TestResult;
|
||||||
|
|
||||||
tInLabel.Text = tRes.TempInAvrg.ToString("F2");
|
//tInLabel.Text = tRes.TempInAvrg.ToString("F2");
|
||||||
tOutLabel.Text = tRes.TempOutAvrg.ToString("F2");
|
//tOutLabel.Text = tRes.TempOutAvrg.ToString("F2");
|
||||||
tDivLabel.Text = tRes.TempDivAvrg.ToString("F2");
|
//tDivLabel.Text = tRes.TempDivAvrg.ToString("F2");
|
||||||
prInLabel.Text = tRes.PressInAvrg.ToString("F1");
|
//prInLabel.Text = tRes.PressInAvrg.ToString("F1");
|
||||||
prOutLabel.Text = tRes.PressOutAvrg.ToString("F1");
|
//prOutLabel.Text = tRes.PressOutAvrg.ToString("F1");
|
||||||
airTempLabel.Text = tRes.AmbientTempAve.ToString("F1");
|
//airTempLabel.Text = tRes.AmbientTempAve.ToString("F1");
|
||||||
airPressLabel.Text = tRes.AmbientPressAve.ToString("F1");
|
//airPressLabel.Text = tRes.AmbientPressAve.ToString("F1");
|
||||||
airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1");
|
//airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1");
|
||||||
|
|
||||||
refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
|
//refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
|
||||||
//refFreqLabel.Text = tstRslt.
|
////refFreqLabel.Text = tstRslt.
|
||||||
refFlowLabel.Text = Utils.FloatToStr(tRes.FlowMass / 1000.0f, 4);
|
//refFlowLabel.Text = Utils.FloatToStr(tRes.FlowMass / 1000.0f, 4);
|
||||||
|
|
||||||
refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
|
//refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
|
||||||
//regValvePosLabel.Text = tstRslt.
|
////regValvePosLabel.Text = tstRslt.
|
||||||
//massLabel.Text = tstRslt.
|
////massLabel.Text = tstRslt.
|
||||||
|
|
||||||
volumeCtvLabel.Text = args.TestResult.VolumeCTV.ToString("F1");
|
//volumeCtvLabel.Text = args.TestResult.VolumeCTV.ToString("F1");
|
||||||
refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
|
//refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
|
||||||
|
|
||||||
if (tRes.MetersKind == MetersKind.Single)
|
//if (tRes.MetersKind == MetersKind.Single)
|
||||||
{
|
//{
|
||||||
for (int i = 0; i < textBoxesCount; i++)
|
// for (int i = 0; i < textBoxesCount; i++)
|
||||||
{
|
// {
|
||||||
pulses[i].Text = tRes.Meters[i].PulsesMeter.ToString("F0");
|
// pulses[i].Text = tRes.Meters[i].PulsesMeter.ToString("F0");
|
||||||
refPulses[i].Text = tRes.Meters[i].PulsesMaster.ToString("F0");
|
// refPulses[i].Text = tRes.Meters[i].PulsesMaster.ToString("F0");
|
||||||
volume[i].Text = tRes.Meters[i].VolumeMeter.ToString("F2");
|
// volume[i].Text = tRes.Meters[i].VolumeMeter.ToString("F2");
|
||||||
error[i].Text = tRes.Meters[i].VolumeErrorPct.ToString("F2");
|
// error[i].Text = tRes.Meters[i].VolumeErrorPct.ToString("F2");
|
||||||
passed[i].Text = tRes.Meters[i].Passed ? Strings.Passed : Strings.Failed;
|
// passed[i].Text = tRes.Meters[i].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
else if (tRes.MetersKind == MetersKind.Combined)
|
//else if (tRes.MetersKind == MetersKind.Combined)
|
||||||
{
|
//{
|
||||||
pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
// pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
||||||
pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
// pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
||||||
//pulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMeter.ToString("F0");
|
// //pulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMeter.ToString("F0");
|
||||||
refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
// refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
||||||
refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
// refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
||||||
//refPulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMaster.ToString("F0");
|
// //refPulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMaster.ToString("F0");
|
||||||
volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
// volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
||||||
volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
// volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
||||||
volume1zLabel.Text = tRes.CombinedMeters[0].VolumeMeter.ToString("F2");
|
// volume1zLabel.Text = tRes.CombinedMeters[0].VolumeMeter.ToString("F2");
|
||||||
error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
// error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
||||||
error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
// error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
||||||
error1zLabel.Text = tRes.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
// error1zLabel.Text = tRes.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||||
passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
// passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
// passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed1zLabel.Text = tRes.CombinedMeters[0].Passed ? Strings.Passed : Strings.Failed;
|
// passed1zLabel.Text = tRes.CombinedMeters[0].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
|
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
|
||||||
|
|||||||
@ -430,23 +430,26 @@ namespace TBF.Screens
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < textBoxesCount; i++)
|
for (int i = 0; i < textBoxesCount; i++)
|
||||||
{
|
{
|
||||||
pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||||
volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||||
error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||||
|
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (currentMetersKind == MetersKind.Combined)
|
else if (currentMetersKind == MetersKind.Combined)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||||
volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||||
error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||||
|
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
/// TODO: Reimplement
|
||||||
error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
//volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
||||||
|
//error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
|
|
||||||
tInLabel.Text = args.Tin.ToString();
|
tInLabel.Text = args.Tin.ToString();
|
||||||
@ -476,57 +479,58 @@ namespace TBF.Screens
|
|||||||
|
|
||||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||||
{
|
{
|
||||||
TestResult tRes = args.TestResult;
|
/// TODO: Reimplement
|
||||||
|
//TestResult tRes = args.TestResult;
|
||||||
|
|
||||||
tInLabel.Text = tRes.TempInAvrg.ToString("F2");
|
//tInLabel.Text = tRes.TempInAvrg.ToString("F2");
|
||||||
tOutLabel.Text = tRes.TempOutAvrg.ToString("F2");
|
//tOutLabel.Text = tRes.TempOutAvrg.ToString("F2");
|
||||||
tDivLabel.Text = tRes.TempDivAvrg.ToString("F2");
|
//tDivLabel.Text = tRes.TempDivAvrg.ToString("F2");
|
||||||
prInLabel.Text = tRes.PressInAvrg.ToString("F1");
|
//prInLabel.Text = tRes.PressInAvrg.ToString("F1");
|
||||||
prOutLabel.Text = tRes.PressOutAvrg.ToString("F1");
|
//prOutLabel.Text = tRes.PressOutAvrg.ToString("F1");
|
||||||
airTempLabel.Text = tRes.AmbientTempAve.ToString("F1");
|
//airTempLabel.Text = tRes.AmbientTempAve.ToString("F1");
|
||||||
airPressLabel.Text = tRes.AmbientPressAve.ToString("F1");
|
//airPressLabel.Text = tRes.AmbientPressAve.ToString("F1");
|
||||||
airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1");
|
//airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1");
|
||||||
|
|
||||||
refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
|
//refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
|
||||||
//refFreqLabel.Text = tstRslt.
|
////refFreqLabel.Text = tstRslt.
|
||||||
refFlowLabel.Text = Utils.FloatToStr(tRes.FlowMass / 1000.0f, 4);
|
//refFlowLabel.Text = Utils.FloatToStr(tRes.FlowMass / 1000.0f, 4);
|
||||||
|
|
||||||
refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
|
//refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
|
||||||
//regValvePosLabel.Text = tstRslt.
|
////regValvePosLabel.Text = tstRslt.
|
||||||
//massLabel.Text = tstRslt.
|
////massLabel.Text = tstRslt.
|
||||||
|
|
||||||
volumeCtvLabel.Text = args.TestResult.VolumeCTV.ToString("F1");
|
//volumeCtvLabel.Text = args.TestResult.VolumeCTV.ToString("F1");
|
||||||
refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
|
//refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
|
||||||
|
|
||||||
if (tRes.MetersKind == MetersKind.Single)
|
//if (tRes.MetersKind == MetersKind.Single)
|
||||||
{
|
//{
|
||||||
for (int i = 0; i < textBoxesCount; i++)
|
// for (int i = 0; i < textBoxesCount; i++)
|
||||||
{
|
// {
|
||||||
pulses[i].Text = tRes.Meters[i].PulsesMeter.ToString("F0");
|
// pulses[i].Text = tRes.Meters[i].PulsesMeter.ToString("F0");
|
||||||
refPulses[i].Text = tRes.Meters[i].PulsesMaster.ToString("F0");
|
// refPulses[i].Text = tRes.Meters[i].PulsesMaster.ToString("F0");
|
||||||
volume[i].Text = tRes.Meters[i].VolumeMeter.ToString("F2");
|
// volume[i].Text = tRes.Meters[i].VolumeMeter.ToString("F2");
|
||||||
error[i].Text = tRes.Meters[i].VolumeErrorPct.ToString("F2");
|
// error[i].Text = tRes.Meters[i].VolumeErrorPct.ToString("F2");
|
||||||
passed[i].Text = tRes.Meters[i].Passed ? Strings.Passed : Strings.Failed;
|
// passed[i].Text = tRes.Meters[i].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
else if (tRes.MetersKind == MetersKind.Combined)
|
//else if (tRes.MetersKind == MetersKind.Combined)
|
||||||
{
|
//{
|
||||||
pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
// pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
||||||
pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
// pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
||||||
//pulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMeter.ToString("F0");
|
// //pulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMeter.ToString("F0");
|
||||||
refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
// refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
||||||
refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
// refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
||||||
//refPulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMaster.ToString("F0");
|
// //refPulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMaster.ToString("F0");
|
||||||
volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
// volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
||||||
volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
// volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
||||||
volume1zLabel.Text = tRes.CombinedMeters[0].VolumeMeter.ToString("F2");
|
// volume1zLabel.Text = tRes.CombinedMeters[0].VolumeMeter.ToString("F2");
|
||||||
error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
// error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
||||||
error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
// error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
||||||
error1zLabel.Text = tRes.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
// error1zLabel.Text = tRes.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||||
passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
// passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
// passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed1zLabel.Text = tRes.CombinedMeters[0].Passed ? Strings.Passed : Strings.Failed;
|
// passed1zLabel.Text = tRes.CombinedMeters[0].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
|
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
|
||||||
|
|||||||
@ -368,64 +368,73 @@ namespace TBF.Screens
|
|||||||
tDivLabel.Text = args.Tdiv.ToString();
|
tDivLabel.Text = args.Tdiv.ToString();
|
||||||
|
|
||||||
/// Bottom part
|
/// Bottom part
|
||||||
pulses1Label.Text = args.TestResult.Meters[0].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses1Label.Text = args.TestResult.Meters[0].PulsesMaster.ToString();
|
//pulses1Label.Text = args.TestResult.Meters[0].PulsesMeter.ToString();
|
||||||
volume1Label.Text = args.TestResult.Meters[0].VolumeMeter.ToString();
|
//refPulses1Label.Text = args.TestResult.Meters[0].PulsesMaster.ToString();
|
||||||
error1Label.Text = args.TestResult.Meters[0].VolumeErrorPct.ToString("F2");
|
//volume1Label.Text = args.TestResult.Meters[0].VolumeMeter.ToString();
|
||||||
|
//error1Label.Text = args.TestResult.Meters[0].VolumeErrorPct.ToString("F2");
|
||||||
|
|
||||||
if (Config.Data.WMsCount >= 2)
|
if (Config.Data.WMsCount >= 2)
|
||||||
{
|
{
|
||||||
pulses2Label.Text = args.TestResult.Meters[1].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses2Label.Text = args.TestResult.Meters[1].PulsesMaster.ToString();
|
//pulses2Label.Text = args.TestResult.Meters[1].PulsesMeter.ToString();
|
||||||
volume2Label.Text = args.TestResult.Meters[1].VolumeMeter.ToString();
|
//refPulses2Label.Text = args.TestResult.Meters[1].PulsesMaster.ToString();
|
||||||
error2Label.Text = args.TestResult.Meters[1].VolumeErrorPct.ToString("F2");
|
//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)
|
if (currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 2)
|
||||||
{
|
{
|
||||||
volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
/// TODO: Reimplement
|
||||||
error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
//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) ||
|
if ((currentMetersKind == MetersKind.Single && Config.Data.WMsCount >= 3) ||
|
||||||
(currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 4))
|
(currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 4))
|
||||||
{
|
{
|
||||||
pulses3Label.Text = args.TestResult.Meters[2].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses3Label.Text = args.TestResult.Meters[2].PulsesMaster.ToString();
|
//pulses3Label.Text = args.TestResult.Meters[2].PulsesMeter.ToString();
|
||||||
volume3Label.Text = args.TestResult.Meters[2].VolumeMeter.ToString();
|
//refPulses3Label.Text = args.TestResult.Meters[2].PulsesMaster.ToString();
|
||||||
error3Label.Text = args.TestResult.Meters[2].VolumeErrorPct.ToString("F2");
|
//volume3Label.Text = args.TestResult.Meters[2].VolumeMeter.ToString();
|
||||||
|
//error3Label.Text = args.TestResult.Meters[2].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
if (Config.Data.WMsCount >= 4)
|
if (Config.Data.WMsCount >= 4)
|
||||||
{
|
{
|
||||||
pulses4Label.Text = args.TestResult.Meters[3].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses4Label.Text = args.TestResult.Meters[3].PulsesMaster.ToString();
|
//pulses4Label.Text = args.TestResult.Meters[3].PulsesMeter.ToString();
|
||||||
volume4Label.Text = args.TestResult.Meters[3].VolumeMeter.ToString();
|
//refPulses4Label.Text = args.TestResult.Meters[3].PulsesMaster.ToString();
|
||||||
error4Label.Text = args.TestResult.Meters[3].VolumeErrorPct.ToString("F2");
|
//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)
|
if (currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 4)
|
||||||
{
|
{
|
||||||
volume2zLabel.Text = args.TestResult.CombinedMeters[1].VolumeMeter.ToString();
|
/// TODO: Reimplement
|
||||||
error2zLabel.Text = args.TestResult.CombinedMeters[1].VolumeErrorPct.ToString("F2");
|
//volume2zLabel.Text = args.TestResult.CombinedMeters[1].VolumeMeter.ToString();
|
||||||
|
//error2zLabel.Text = args.TestResult.CombinedMeters[1].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((currentMetersKind == MetersKind.Single && Config.Data.WMsCount >= 5) ||
|
if ((currentMetersKind == MetersKind.Single && Config.Data.WMsCount >= 5) ||
|
||||||
(currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 6))
|
(currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 6))
|
||||||
{
|
{
|
||||||
pulses5Label.Text = args.TestResult.Meters[4].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses5Label.Text = args.TestResult.Meters[4].PulsesMaster.ToString();
|
//pulses5Label.Text = args.TestResult.Meters[4].PulsesMeter.ToString();
|
||||||
volume5Label.Text = args.TestResult.Meters[4].VolumeMeter.ToString();
|
//refPulses5Label.Text = args.TestResult.Meters[4].PulsesMaster.ToString();
|
||||||
error5Label.Text = args.TestResult.Meters[4].VolumeErrorPct.ToString("F2");
|
//volume5Label.Text = args.TestResult.Meters[4].VolumeMeter.ToString();
|
||||||
|
//error5Label.Text = args.TestResult.Meters[4].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
if (Config.Data.WMsCount >= 6)
|
if (Config.Data.WMsCount >= 6)
|
||||||
{
|
{
|
||||||
pulses6Label.Text = args.TestResult.Meters[5].PulsesMeter.ToString();
|
/// TODO: Reimplement
|
||||||
refPulses6Label.Text = args.TestResult.Meters[5].PulsesMaster.ToString();
|
//pulses6Label.Text = args.TestResult.Meters[5].PulsesMeter.ToString();
|
||||||
volume6Label.Text = args.TestResult.Meters[5].VolumeMeter.ToString();
|
//refPulses6Label.Text = args.TestResult.Meters[5].PulsesMaster.ToString();
|
||||||
error6Label.Text = args.TestResult.Meters[5].VolumeErrorPct.ToString("F2");
|
//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)
|
if (currentMetersKind == MetersKind.Combined && Config.Data.WMsCount >= 6)
|
||||||
{
|
{
|
||||||
volume3zLabel.Text = args.TestResult.CombinedMeters[2].VolumeMeter.ToString();
|
/// TODO: Reimplement
|
||||||
error3zLabel.Text = args.TestResult.CombinedMeters[2].VolumeErrorPct.ToString("F2");
|
//volume3zLabel.Text = args.TestResult.CombinedMeters[2].VolumeMeter.ToString();
|
||||||
|
//error3zLabel.Text = args.TestResult.CombinedMeters[2].VolumeErrorPct.ToString("F2");
|
||||||
}
|
}
|
||||||
|
|
||||||
tInLabel.Text = args.Tin.ToString();
|
tInLabel.Text = args.Tin.ToString();
|
||||||
@ -455,138 +464,139 @@ namespace TBF.Screens
|
|||||||
|
|
||||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||||
{
|
{
|
||||||
TestResult tRes = args.TestResult;
|
/// TODO: Reimplement
|
||||||
|
//TestResult tRes = args.TestResult;
|
||||||
|
|
||||||
tInLabel.Text = tRes.TempInAvrg.ToString("F2");
|
//tInLabel.Text = tRes.TempInAvrg.ToString("F2");
|
||||||
tOutLabel.Text = tRes.TempOutAvrg.ToString("F2");
|
//tOutLabel.Text = tRes.TempOutAvrg.ToString("F2");
|
||||||
tDivLabel.Text = tRes.TempDivAvrg.ToString("F2");
|
//tDivLabel.Text = tRes.TempDivAvrg.ToString("F2");
|
||||||
prInLabel.Text = tRes.PressInAvrg.ToString("F1");
|
//prInLabel.Text = tRes.PressInAvrg.ToString("F1");
|
||||||
prOutLabel.Text = tRes.PressOutAvrg.ToString("F1");
|
//prOutLabel.Text = tRes.PressOutAvrg.ToString("F1");
|
||||||
airTempLabel.Text = tRes.AmbientTempAve.ToString("F1");
|
//airTempLabel.Text = tRes.AmbientTempAve.ToString("F1");
|
||||||
airPressLabel.Text = tRes.AmbientPressAve.ToString("F1");
|
//airPressLabel.Text = tRes.AmbientPressAve.ToString("F1");
|
||||||
airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1");
|
//airHumiLabel.Text = tRes.AmbientHumiAve.ToString("F1");
|
||||||
|
|
||||||
refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
|
//refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");
|
||||||
//refFreqLabel.Text = tstRslt.
|
////refFreqLabel.Text = tstRslt.
|
||||||
refFlowLabel.Text = Utils.FloatToStr(tRes.FlowMass / 1000.0f, 4);
|
//refFlowLabel.Text = Utils.FloatToStr(tRes.FlowMass / 1000.0f, 4);
|
||||||
|
|
||||||
refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
|
//refVolumeLabel.Text = tRes.VolumeCTV.ToString("F2");
|
||||||
//regValvePosLabel.Text = tstRslt.
|
////regValvePosLabel.Text = tstRslt.
|
||||||
//massLabel.Text = tstRslt.
|
////massLabel.Text = tstRslt.
|
||||||
|
|
||||||
volumeCtvLabel.Text = args.TestResult.VolumeCTV.ToString("F1");
|
//volumeCtvLabel.Text = args.TestResult.VolumeCTV.ToString("F1");
|
||||||
refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
|
//refErrorLabel.Text = (tRes.ErrorMaster == 0) ? "---" : tRes.ErrorMaster.ToString("F3");
|
||||||
|
|
||||||
if (tRes.MetersKind == MetersKind.Single)
|
//if (tRes.MetersKind == MetersKind.Single)
|
||||||
{
|
//{
|
||||||
pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
// pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
||||||
refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
// refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
||||||
volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
// volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
||||||
error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
// error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
||||||
passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
// passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
||||||
|
|
||||||
if (Config.Data.WMsCount >= 2)
|
// if (Config.Data.WMsCount >= 2)
|
||||||
{
|
// {
|
||||||
pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
// pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
||||||
refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
// refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
||||||
volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
// volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
||||||
error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
// error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
||||||
passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
// passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (Config.Data.WMsCount >= 3)
|
// if (Config.Data.WMsCount >= 3)
|
||||||
{
|
// {
|
||||||
pulses3Label.Text = tRes.Meters[2].PulsesMeter.ToString("F0");
|
// pulses3Label.Text = tRes.Meters[2].PulsesMeter.ToString("F0");
|
||||||
refPulses3Label.Text = tRes.Meters[2].PulsesMaster.ToString("F0");
|
// refPulses3Label.Text = tRes.Meters[2].PulsesMaster.ToString("F0");
|
||||||
volume3Label.Text = tRes.Meters[2].VolumeMeter.ToString("F2");
|
// volume3Label.Text = tRes.Meters[2].VolumeMeter.ToString("F2");
|
||||||
error3Label.Text = tRes.Meters[2].VolumeErrorPct.ToString("F2");
|
// error3Label.Text = tRes.Meters[2].VolumeErrorPct.ToString("F2");
|
||||||
passed3Label.Text = tRes.Meters[2].Passed ? Strings.Passed : Strings.Failed;
|
// passed3Label.Text = tRes.Meters[2].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (Config.Data.WMsCount >= 4)
|
// if (Config.Data.WMsCount >= 4)
|
||||||
{
|
// {
|
||||||
pulses4Label.Text = tRes.Meters[3].PulsesMeter.ToString("F0");
|
// pulses4Label.Text = tRes.Meters[3].PulsesMeter.ToString("F0");
|
||||||
refPulses4Label.Text = tRes.Meters[3].PulsesMaster.ToString("F0");
|
// refPulses4Label.Text = tRes.Meters[3].PulsesMaster.ToString("F0");
|
||||||
volume4Label.Text = tRes.Meters[3].VolumeMeter.ToString("F2");
|
// volume4Label.Text = tRes.Meters[3].VolumeMeter.ToString("F2");
|
||||||
error4Label.Text = tRes.Meters[3].VolumeErrorPct.ToString("F2");
|
// error4Label.Text = tRes.Meters[3].VolumeErrorPct.ToString("F2");
|
||||||
passed4Label.Text = tRes.Meters[3].Passed ? Strings.Passed : Strings.Failed;
|
// passed4Label.Text = tRes.Meters[3].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (Config.Data.WMsCount >= 5)
|
// if (Config.Data.WMsCount >= 5)
|
||||||
{
|
// {
|
||||||
pulses5Label.Text = tRes.Meters[4].PulsesMeter.ToString("F0");
|
// pulses5Label.Text = tRes.Meters[4].PulsesMeter.ToString("F0");
|
||||||
refPulses5Label.Text = tRes.Meters[4].PulsesMaster.ToString("F0");
|
// refPulses5Label.Text = tRes.Meters[4].PulsesMaster.ToString("F0");
|
||||||
volume5Label.Text = tRes.Meters[4].VolumeMeter.ToString("F2");
|
// volume5Label.Text = tRes.Meters[4].VolumeMeter.ToString("F2");
|
||||||
error5Label.Text = tRes.Meters[4].VolumeErrorPct.ToString("F2");
|
// error5Label.Text = tRes.Meters[4].VolumeErrorPct.ToString("F2");
|
||||||
passed5Label.Text = tRes.Meters[4].Passed ? Strings.Passed : Strings.Failed;
|
// passed5Label.Text = tRes.Meters[4].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (Config.Data.WMsCount >= 6)
|
// if (Config.Data.WMsCount >= 6)
|
||||||
{
|
// {
|
||||||
pulses6Label.Text = tRes.Meters[5].PulsesMeter.ToString("F0");
|
// pulses6Label.Text = tRes.Meters[5].PulsesMeter.ToString("F0");
|
||||||
refPulses6Label.Text = tRes.Meters[5].PulsesMaster.ToString("F0");
|
// refPulses6Label.Text = tRes.Meters[5].PulsesMaster.ToString("F0");
|
||||||
volume6Label.Text = tRes.Meters[5].VolumeMeter.ToString("F2");
|
// volume6Label.Text = tRes.Meters[5].VolumeMeter.ToString("F2");
|
||||||
error6Label.Text = tRes.Meters[5].VolumeErrorPct.ToString("F2");
|
// error6Label.Text = tRes.Meters[5].VolumeErrorPct.ToString("F2");
|
||||||
passed6Label.Text = tRes.Meters[5].Passed ? Strings.Passed : Strings.Failed;
|
// passed6Label.Text = tRes.Meters[5].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
else if (tRes.MetersKind == MetersKind.Combined)
|
//else if (tRes.MetersKind == MetersKind.Combined)
|
||||||
{
|
//{
|
||||||
if (Config.Data.WMsCount >= 2)
|
// if (Config.Data.WMsCount >= 2)
|
||||||
{
|
// {
|
||||||
pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
// pulses1Label.Text = tRes.Meters[0].PulsesMeter.ToString("F0");
|
||||||
pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
// pulses2Label.Text = tRes.Meters[1].PulsesMeter.ToString("F0");
|
||||||
//pulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMeter.ToString("F0");
|
// //pulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMeter.ToString("F0");
|
||||||
refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
// refPulses1Label.Text = tRes.Meters[0].PulsesMaster.ToString("F0");
|
||||||
refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
// refPulses2Label.Text = tRes.Meters[1].PulsesMaster.ToString("F0");
|
||||||
//refPulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMaster.ToString("F0");
|
// //refPulses1zLabel.Text = tRes.CombinedMeters[0].PulsesMaster.ToString("F0");
|
||||||
volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
// volume1Label.Text = tRes.Meters[0].VolumeMeter.ToString("F2");
|
||||||
volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
// volume2Label.Text = tRes.Meters[1].VolumeMeter.ToString("F2");
|
||||||
volume1zLabel.Text = tRes.CombinedMeters[0].VolumeMeter.ToString("F2");
|
// volume1zLabel.Text = tRes.CombinedMeters[0].VolumeMeter.ToString("F2");
|
||||||
error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
// error1Label.Text = tRes.Meters[0].VolumeErrorPct.ToString("F2");
|
||||||
error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
// error2Label.Text = tRes.Meters[1].VolumeErrorPct.ToString("F2");
|
||||||
error1zLabel.Text = tRes.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
// error1zLabel.Text = tRes.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||||
passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
// passed1Label.Text = tRes.Meters[0].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
// passed2Label.Text = tRes.Meters[1].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed1zLabel.Text = tRes.CombinedMeters[0].Passed ? Strings.Passed : Strings.Failed;
|
// passed1zLabel.Text = tRes.CombinedMeters[0].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
if (Config.Data.WMsCount >= 4)
|
// if (Config.Data.WMsCount >= 4)
|
||||||
{
|
// {
|
||||||
pulses3Label.Text = tRes.Meters[2].PulsesMeter.ToString("F0");
|
// pulses3Label.Text = tRes.Meters[2].PulsesMeter.ToString("F0");
|
||||||
pulses4Label.Text = tRes.Meters[3].PulsesMeter.ToString("F0");
|
// pulses4Label.Text = tRes.Meters[3].PulsesMeter.ToString("F0");
|
||||||
//pulses2zLabel.Text = tRes.CombinedMeters[1].PulsesMeter.ToString("F0");
|
// //pulses2zLabel.Text = tRes.CombinedMeters[1].PulsesMeter.ToString("F0");
|
||||||
refPulses3Label.Text = tRes.Meters[2].PulsesMaster.ToString("F0");
|
// refPulses3Label.Text = tRes.Meters[2].PulsesMaster.ToString("F0");
|
||||||
refPulses4Label.Text = tRes.Meters[3].PulsesMaster.ToString("F0");
|
// refPulses4Label.Text = tRes.Meters[3].PulsesMaster.ToString("F0");
|
||||||
//refPulses2zLabel.Text = tRes.CombinedMeters[1].PulsesMaster.ToString("F0");
|
// //refPulses2zLabel.Text = tRes.CombinedMeters[1].PulsesMaster.ToString("F0");
|
||||||
volume3Label.Text = tRes.Meters[2].VolumeMeter.ToString("F2");
|
// volume3Label.Text = tRes.Meters[2].VolumeMeter.ToString("F2");
|
||||||
volume4Label.Text = tRes.Meters[3].VolumeMeter.ToString("F2");
|
// volume4Label.Text = tRes.Meters[3].VolumeMeter.ToString("F2");
|
||||||
volume2zLabel.Text = tRes.CombinedMeters[1].VolumeMeter.ToString("F2");
|
// volume2zLabel.Text = tRes.CombinedMeters[1].VolumeMeter.ToString("F2");
|
||||||
error3Label.Text = tRes.Meters[2].VolumeErrorPct.ToString("F2");
|
// error3Label.Text = tRes.Meters[2].VolumeErrorPct.ToString("F2");
|
||||||
error4Label.Text = tRes.Meters[3].VolumeErrorPct.ToString("F2");
|
// error4Label.Text = tRes.Meters[3].VolumeErrorPct.ToString("F2");
|
||||||
error2zLabel.Text = tRes.CombinedMeters[1].VolumeErrorPct.ToString("F2");
|
// error2zLabel.Text = tRes.CombinedMeters[1].VolumeErrorPct.ToString("F2");
|
||||||
passed3Label.Text = tRes.Meters[2].Passed ? Strings.Passed : Strings.Failed;
|
// passed3Label.Text = tRes.Meters[2].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed4Label.Text = tRes.Meters[3].Passed ? Strings.Passed : Strings.Failed;
|
// passed4Label.Text = tRes.Meters[3].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed2zLabel.Text = tRes.CombinedMeters[1].Passed ? Strings.Passed : Strings.Failed;
|
// passed2zLabel.Text = tRes.CombinedMeters[1].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
if (Config.Data.WMsCount >= 6)
|
// if (Config.Data.WMsCount >= 6)
|
||||||
{
|
// {
|
||||||
pulses5Label.Text = tRes.Meters[4].PulsesMeter.ToString("F0");
|
// pulses5Label.Text = tRes.Meters[4].PulsesMeter.ToString("F0");
|
||||||
pulses6Label.Text = tRes.Meters[5].PulsesMeter.ToString("F0");
|
// pulses6Label.Text = tRes.Meters[5].PulsesMeter.ToString("F0");
|
||||||
//pulses3zLabel.Text = tRes.CombinedMeters[2].PulsesMeter.ToString("F0");
|
// //pulses3zLabel.Text = tRes.CombinedMeters[2].PulsesMeter.ToString("F0");
|
||||||
refPulses5Label.Text = tRes.Meters[4].PulsesMaster.ToString("F0");
|
// refPulses5Label.Text = tRes.Meters[4].PulsesMaster.ToString("F0");
|
||||||
refPulses6Label.Text = tRes.Meters[5].PulsesMaster.ToString("F0");
|
// refPulses6Label.Text = tRes.Meters[5].PulsesMaster.ToString("F0");
|
||||||
//refPulses3zLabel.Text = tRes.CombinedMeters[2].PulsesMaster.ToString("F0");
|
// //refPulses3zLabel.Text = tRes.CombinedMeters[2].PulsesMaster.ToString("F0");
|
||||||
volume5Label.Text = tRes.Meters[4].VolumeMeter.ToString("F2");
|
// volume5Label.Text = tRes.Meters[4].VolumeMeter.ToString("F2");
|
||||||
volume6Label.Text = tRes.Meters[5].VolumeMeter.ToString("F2");
|
// volume6Label.Text = tRes.Meters[5].VolumeMeter.ToString("F2");
|
||||||
volume3zLabel.Text = tRes.CombinedMeters[2].VolumeMeter.ToString("F2");
|
// volume3zLabel.Text = tRes.CombinedMeters[2].VolumeMeter.ToString("F2");
|
||||||
error5Label.Text = tRes.Meters[4].VolumeErrorPct.ToString("F2");
|
// error5Label.Text = tRes.Meters[4].VolumeErrorPct.ToString("F2");
|
||||||
error6Label.Text = tRes.Meters[5].VolumeErrorPct.ToString("F2");
|
// error6Label.Text = tRes.Meters[5].VolumeErrorPct.ToString("F2");
|
||||||
error3zLabel.Text = tRes.CombinedMeters[2].VolumeErrorPct.ToString("F2");
|
// error3zLabel.Text = tRes.CombinedMeters[2].VolumeErrorPct.ToString("F2");
|
||||||
passed5Label.Text = tRes.Meters[4].Passed ? Strings.Passed : Strings.Failed;
|
// passed5Label.Text = tRes.Meters[4].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed6Label.Text = tRes.Meters[5].Passed ? Strings.Passed : Strings.Failed;
|
// passed6Label.Text = tRes.Meters[5].Passed ? Strings.Passed : Strings.Failed;
|
||||||
passed3zLabel.Text = tRes.CombinedMeters[2].Passed ? Strings.Passed : Strings.Failed;
|
// passed3zLabel.Text = tRes.CombinedMeters[2].Passed ? Strings.Passed : Strings.Failed;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
|
void OnProcedureCompleted(object sender, ProcedureCompletedEventArgs args)
|
||||||
|
|||||||
@ -473,21 +473,7 @@ namespace TBF.Screens
|
|||||||
|
|
||||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.TestResult != null)
|
RedrawAll();
|
||||||
{
|
|
||||||
/// Delete an existing testResults with the same test name and repetition number
|
|
||||||
try
|
|
||||||
{
|
|
||||||
TestResult tr = testResults
|
|
||||||
.First<TestResult>(x => (x.TestId == args.TestResult.TestId) && (x.RepetitionNr == args.TestResult.RepetitionNr));
|
|
||||||
testResults.Remove(tr);
|
|
||||||
}
|
|
||||||
catch { };
|
|
||||||
|
|
||||||
/// Add the new test results
|
|
||||||
testResults.Add(args.TestResult);
|
|
||||||
RedrawAll();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void columnWidthsButton_Click(object sender, EventArgs e)
|
private void columnWidthsButton_Click(object sender, EventArgs e)
|
||||||
|
|||||||
@ -413,6 +413,7 @@
|
|||||||
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
|
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BenchControl\ResultsPrinters\Zapiska\PrinterFactory.cs" />
|
<Compile Include="BenchControl\ResultsPrinters\Zapiska\PrinterFactory.cs" />
|
||||||
|
<Compile Include="BenchControl\Sequences\FloatStatistics.cs" />
|
||||||
<Compile Include="BenchControl\Sequences\ProcessData.cs" />
|
<Compile Include="BenchControl\Sequences\ProcessData.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\Adjustment\WMErrorsForm12.cs">
|
<Compile Include="BenchControl\TestMethods\Adjustment\WMErrorsForm12.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
@ -446,7 +447,7 @@
|
|||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BenchControl\TestMethods\FixedStartCombinedMeters\TestMethodFactory.cs" />
|
<Compile Include="BenchControl\TestMethods\FixedStartCombinedMeters\TestMethodFactory.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestParams.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStartMassCollection\TestParams.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlCommunication\AllCompletedEventArgs.cs" />
|
<Compile Include="BenchControl\TestMethods\iPerlCommunication\AllCompletedEventArgs.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlCommunication\CommCompletedEventArgs.cs" />
|
<Compile Include="BenchControl\TestMethods\iPerlCommunication\CommCompletedEventArgs.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\iPerlCommunication\iPerlCommunicationParams.cs" />
|
<Compile Include="BenchControl\TestMethods\iPerlCommunication\iPerlCommunicationParams.cs" />
|
||||||
@ -911,16 +912,16 @@
|
|||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BenchControl\TestMethods\FixedStartMassCollection\TestMethodFactory.cs" />
|
<Compile Include="BenchControl\TestMethods\FixedStartMassCollection\TestMethodFactory.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\FlyingStartCollectionMethodSeq.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStartMassCollection\FlyingStartMassCollectionSeq.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethod.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStartMassCollection\TestMethod.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethodCfg.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStartMassCollection\TestMethodCfg.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethodCfgCtrl.cs">
|
<Compile Include="BenchControl\TestMethods\FlyingStartMassCollection\TestMethodCfgCtrl.cs">
|
||||||
<SubType>UserControl</SubType>
|
<SubType>UserControl</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethodCfgCtrl.designer.cs">
|
<Compile Include="BenchControl\TestMethods\FlyingStartMassCollection\TestMethodCfgCtrl.designer.cs">
|
||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethodFactory.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStartMassCollection\TestMethodFactory.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\CameraRoiDetection\RoiDetectionCfgCtrl.designer.cs" />
|
<Compile Include="BenchControl\TestMethods\CameraRoiDetection\RoiDetectionCfgCtrl.designer.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStart\FlyingStartSeq.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStart\FlyingStartSeq.cs" />
|
||||||
<Compile Include="BenchControl\TestMethods\FlyingStart\TestMethod.cs" />
|
<Compile Include="BenchControl\TestMethods\FlyingStart\TestMethod.cs" />
|
||||||
@ -1616,7 +1617,7 @@
|
|||||||
<EmbeddedResource Include="BenchControl\TestMethods\FixedStartMassCollection\TestMethodCfgCtrl.resx">
|
<EmbeddedResource Include="BenchControl\TestMethods\FixedStartMassCollection\TestMethodCfgCtrl.resx">
|
||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStartCollectionMethod\TestMethodCfgCtrl.resx">
|
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStartMassCollection\TestMethodCfgCtrl.resx">
|
||||||
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
<DependentUpon>TestMethodCfgCtrl.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStart\TestMethodCfgCtrl.resx">
|
<EmbeddedResource Include="BenchControl\TestMethods\FlyingStart\TestMethodCfgCtrl.resx">
|
||||||
|
|||||||
@ -112,14 +112,16 @@ namespace TBF
|
|||||||
if (currentProgress != null)
|
if (currentProgress != null)
|
||||||
{
|
{
|
||||||
// Test is 'failed' if any meter failed
|
// Test is 'failed' if any meter failed
|
||||||
foreach (var meterTestResult in args.TestResult.Meters)
|
|
||||||
{
|
/// TODO: Reimplement
|
||||||
if (!meterTestResult.Passed)
|
//foreach (var meterTestResult in args.TestResult.Meters)
|
||||||
{
|
//{
|
||||||
currentProgress.TestResult = UiControls.TestProgressCtrl.Result.Failed;
|
// if (!meterTestResult.Passed)
|
||||||
return;
|
// {
|
||||||
}
|
// currentProgress.TestResult = UiControls.TestProgressCtrl.Result.Failed;
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
currentProgress.TestResult = UiControls.TestProgressCtrl.Result.Failed;
|
currentProgress.TestResult = UiControls.TestProgressCtrl.Result.Failed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,11 +8,11 @@ namespace TBF.UiBridge
|
|||||||
{
|
{
|
||||||
public class TestCompletedEventArgs : EventArgs
|
public class TestCompletedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
public TestResult TestResult;
|
public string TestName;
|
||||||
|
|
||||||
public TestCompletedEventArgs(TestResult testResult)
|
public TestCompletedEventArgs(string testName)
|
||||||
{
|
{
|
||||||
this.TestResult = testResult;
|
this.TestName = testName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ namespace TBF.UiBridge
|
|||||||
{
|
{
|
||||||
public class TestProgressEventArgs : EventArgs
|
public class TestProgressEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
|
public int RepetitionNr;
|
||||||
public float Progress;
|
public float Progress;
|
||||||
public float OveralProgress;
|
public float OveralProgress;
|
||||||
|
|
||||||
@ -31,7 +32,5 @@ namespace TBF.UiBridge
|
|||||||
public FloatBox AmbientTemp;
|
public FloatBox AmbientTemp;
|
||||||
public FloatBox AmbientPressure;
|
public FloatBox AmbientPressure;
|
||||||
public FloatBox AmbientHumidity;
|
public FloatBox AmbientHumidity;
|
||||||
|
|
||||||
public TestResult TestResult;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -230,7 +230,7 @@ namespace TBF.UiControls
|
|||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
out measured))
|
out measured))
|
||||||
{
|
{
|
||||||
float corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections);
|
double corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections);
|
||||||
correctedTextBox.Text = corrected.ToString();
|
correctedTextBox.Text = corrected.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,7 +229,7 @@ namespace TBF.UiControls
|
|||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
out measured))
|
out measured))
|
||||||
{
|
{
|
||||||
float corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections);
|
double corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections);
|
||||||
correctedTextBox.Text = corrected.ToString();
|
correctedTextBox.Text = corrected.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,7 +229,7 @@ namespace TBF.UiControls
|
|||||||
CultureInfo.InvariantCulture,
|
CultureInfo.InvariantCulture,
|
||||||
out measured))
|
out measured))
|
||||||
{
|
{
|
||||||
float corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections);
|
double corrected = BenchControl.Formulas.CorrectedValue(measured, meterEntity.Corrections);
|
||||||
correctedTextBox.Text = corrected.ToString();
|
correctedTextBox.Text = corrected.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -298,11 +298,11 @@ namespace TBF
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts float number to a string with the specified number of valid digits
|
/// Converts a float number to a string with the specified number of valid digits
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">Float value to be converted to a string</param>
|
/// <param name="value">Float value to be converted to a string</param>
|
||||||
/// <param name="validDigits">Number of valid digits: 4, 3, or 2 (otherwise a full precision number is printed)</param>
|
/// <param name="validDigits">Number of valid digits: 4, 3, or 2 (otherwise a full precision number is printed)</param>
|
||||||
/// <returns>String representation of the float number</returns>
|
/// <returns>String representation of a float number</returns>
|
||||||
public static string FloatToStr(float value, int validDigits)
|
public static string FloatToStr(float value, int validDigits)
|
||||||
{
|
{
|
||||||
if (validDigits == 4)
|
if (validDigits == 4)
|
||||||
@ -337,6 +337,46 @@ namespace TBF
|
|||||||
else return value.ToString();
|
else return value.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a double number to a string with the specified number of valid digits
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">Double value to be converted to a string</param>
|
||||||
|
/// <param name="validDigits">Number of valid digits: 4, 3, or 2 (otherwise a full precision number is printed)</param>
|
||||||
|
/// <returns>String representation of a double number</returns>
|
||||||
|
public static string DoubleToStr(double value, int validDigits)
|
||||||
|
{
|
||||||
|
if (validDigits == 4)
|
||||||
|
{
|
||||||
|
if (value >= 999.5 || value < -999.5) return value.ToString("F0");
|
||||||
|
else if (value >= 99.95 || value < -99.95) return value.ToString("F1");
|
||||||
|
else if (value >= 9.995 || value < -9.995) return value.ToString("F2");
|
||||||
|
else if (value >= 0.9995 || value < -0.9995) return value.ToString("F3");
|
||||||
|
else if (value >= 0.09995 || value < -0.09995) return value.ToString("F4");
|
||||||
|
else if (value >= 0.009995 || value < -0.009995) return value.ToString("F5");
|
||||||
|
else return value.ToString("F6");
|
||||||
|
}
|
||||||
|
else if (validDigits == 3)
|
||||||
|
{
|
||||||
|
if (value >= 99.5 || value < -99.5) return value.ToString("F0");
|
||||||
|
else if (value >= 9.95 || value < -9.95) return value.ToString("F1");
|
||||||
|
else if (value >= 0.995 || value < -0.995) return value.ToString("F2");
|
||||||
|
else if (value >= 0.0995 || value < -0.0995) return value.ToString("F3");
|
||||||
|
else if (value >= 0.00995 || value < -0.00995) return value.ToString("F4");
|
||||||
|
else if (value >= 0.000995 || value < -0.000995) return value.ToString("F5");
|
||||||
|
else return value.ToString("F6");
|
||||||
|
}
|
||||||
|
else if (validDigits == 2)
|
||||||
|
{
|
||||||
|
if (value >= 9.5 || value < -9.5) return value.ToString("F0");
|
||||||
|
else if (value >= 0.95 || value < -0.95) return value.ToString("F1");
|
||||||
|
else if (value >= 0.095 || value < -0.095) return value.ToString("F2");
|
||||||
|
else if (value >= 0.0095 || value < -0.0095) return value.ToString("F3");
|
||||||
|
else if (value >= 0.00095 || value < -0.00095) return value.ToString("F4");
|
||||||
|
else return value.ToString("F5");
|
||||||
|
}
|
||||||
|
else return value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
public static string ShowRoute(ulong route)
|
public static string ShowRoute(ulong route)
|
||||||
{
|
{
|
||||||
string str = string.Empty;
|
string str = string.Empty;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user