Version 1.5.100: - serious bug in SensusOracle database configuration control fixed, etc.
- bug in ResultsWriter.Basic configuration control fixed - FlyingStartMassCollection minor fixes - iPerlCommunication activity "Q2 corrected from ..." implemented - iPerl communication timeout increased to 1800 ms - more comments in EntitiesTestResults
This commit is contained in:
parent
fcf4f6bdcf
commit
1d8156e4d7
@ -104,21 +104,27 @@ namespace TBF.BenchControl.DB.SensusOracle
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None; /// <------------------- !!!
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
if (config.Name != nameTextBox.Text) { config.Name = nameTextBox.Text; flags = CfgUpdateFlags.RestartRqrd; }
|
||||
|
||||
int benchId;
|
||||
if (int.TryParse(benchIdTextBox.Text, out benchId) && benchId > 0)
|
||||
if (int.TryParse(benchIdTextBox.Text, out benchId) && (benchId > 0) && (config.TestBenchId != benchId))
|
||||
{
|
||||
config.TestBenchId = benchId;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)DBUsed.Count; i++)
|
||||
{
|
||||
if (((DBUsed)i).ToString().Equals(dbUsedComboBox.Text)) config.DBUsed = (DBUsed)i;
|
||||
if (((DBUsed)i).ToString().Equals(dbUsedComboBox.Text) && (config.DBUsed != (DBUsed)i))
|
||||
{
|
||||
config.DBUsed = (DBUsed)i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (config.DestinationPath != destinationTextBox.Text)
|
||||
@ -146,7 +152,12 @@ namespace TBF.BenchControl.DB.SensusOracle
|
||||
|
||||
for (int i = 0; i < (int)Separator.Count; i++)
|
||||
{
|
||||
if (((Separator)i).ToString().Equals(separatorComboBox.Text)) config.Separator = (Separator)i;
|
||||
if (((Separator)i).ToString().Equals(separatorComboBox.Text) && (config.Separator != (Separator)i))
|
||||
{
|
||||
config.Separator = (Separator)i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (eliminateSpacesCheckBox.Checked != config.EliminateSpaces)
|
||||
@ -157,10 +168,5 @@ namespace TBF.BenchControl.DB.SensusOracle
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
private void destinationButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,7 +113,6 @@ namespace TBF.BenchControl.DB.SensusOracle
|
||||
this.destinationButton.TabIndex = 9;
|
||||
this.destinationButton.Text = "...";
|
||||
this.destinationButton.UseVisualStyleBackColor = true;
|
||||
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
|
||||
//
|
||||
// yearFoldersCheckBox
|
||||
//
|
||||
|
||||
@ -113,9 +113,11 @@ namespace TBF.BenchControl.ResultsWriters.Basic
|
||||
|
||||
for (int i = 0; i < (int)Separator.Count; i++)
|
||||
{
|
||||
if (((Separator)i).ToString().Equals(separatorComboBox.Text))
|
||||
if (((Separator)i).ToString().Equals(separatorComboBox.Text) && (config.Separator != (Separator)i))
|
||||
{
|
||||
config.Separator = (Separator)i;
|
||||
flags = CfgUpdateFlags.RestartRqrd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -61,6 +61,8 @@ namespace TBF.BenchControl.Sequences
|
||||
/// <param name="newTestResult">New test result</param>
|
||||
protected static void AddOrOverwriteResult(Entities.TestResult newTestResult)
|
||||
{
|
||||
if (newTestResult == null) return;
|
||||
|
||||
Entities.TestResult toDelete =
|
||||
results.FirstOrDefault<Entities.TestResult>(x => x.Name.Equals(newTestResult.Name) &&
|
||||
(x.Part == newTestResult.Part) &&
|
||||
|
||||
@ -44,7 +44,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
|
||||
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
|
||||
@ -443,18 +443,21 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
tstRslt.TimeDivEnd5 = 0;
|
||||
for (int i = 0; i < Program.WMsCount; i++)
|
||||
{
|
||||
WaterMeters.iPerl.WaterMeter iPerl = (sensPath.RegisterReaders[i] as WaterMeters.iPerl.WaterMeter); /// != null for iPerl
|
||||
/// 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)
|
||||
{
|
||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
||||
tstRslt.Meters[i].VolumeStart = 0; /// liter
|
||||
tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
||||
tstRslt.Meters[i].PulsesPerLiter = (sensPath.RegisterReaders[i] == null ? 1.0f : sensPath.RegisterReaders[i].PulsesPerLtr);
|
||||
tstRslt.Meters[i].PulsesPerLiter = sensPath.RegisterReaders[i].PulsesPerLtr;
|
||||
|
||||
if (iPerl != null)
|
||||
{
|
||||
tstRslt.Meters[i].VolumeMeter = (float)Math.Abs(iPerl.VolumeLtrEnd - iPerl.VolumeLtrStart);
|
||||
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);
|
||||
@ -464,10 +467,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
||||
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].PulsesMeter = WMPulses[i];
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
@ -90,15 +89,23 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None; /// <------------------- !!!
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
config.Name = nameTextBox.Text;
|
||||
config.RfidPortNrBoard1 = int.Parse(rfidPortBoard1TextBox.Text);
|
||||
config.RfidPortNrBoard2 = int.Parse(rfidPortBoard2TextBox.Text);
|
||||
config.RfidPortNrBoard3 = int.Parse(rfidPortBoard3TextBox.Text);
|
||||
config.RfidPortNrBoard4 = int.Parse(rfidPortBoard4TextBox.Text);
|
||||
if (config.Name != nameTextBox.Text) { config.Name = nameTextBox.Text; flags = CfgUpdateFlags.RestartRqrd; }
|
||||
|
||||
int comPortNr = int.Parse(rfidPortBoard1TextBox.Text);
|
||||
if (config.RfidPortNrBoard1 != comPortNr) { config.RfidPortNrBoard1 = comPortNr; flags = CfgUpdateFlags.RestartRqrd; }
|
||||
|
||||
comPortNr = int.Parse(rfidPortBoard2TextBox.Text);
|
||||
if (config.RfidPortNrBoard2 != comPortNr) { config.RfidPortNrBoard2 = comPortNr; flags = CfgUpdateFlags.RestartRqrd; }
|
||||
|
||||
comPortNr = int.Parse(rfidPortBoard3TextBox.Text);
|
||||
if (config.RfidPortNrBoard3 != comPortNr) { config.RfidPortNrBoard3 = comPortNr; flags = CfgUpdateFlags.RestartRqrd; }
|
||||
|
||||
comPortNr = int.Parse(rfidPortBoard4TextBox.Text);
|
||||
if (config.RfidPortNrBoard4 != comPortNr) { config.RfidPortNrBoard4 = comPortNr; flags = CfgUpdateFlags.RestartRqrd; }
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
|
||||
public partial class iPerlCommunicationForm : Form, GenericDevices.IHasCompleted
|
||||
{
|
||||
const int CommTimeout = 1500;
|
||||
const int CommTimeout = 1800;
|
||||
const int MaxCommRetries = 4;
|
||||
const int NrThreads = 2; /// 1, 2 or 4 threads
|
||||
|
||||
|
||||
@ -67,53 +67,33 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
Entities.TestResult oriTestResult = null;
|
||||
foreach (var tr in results)
|
||||
{
|
||||
if ((tr.TestName == fromTestName))
|
||||
{
|
||||
oriTestResult = tr;
|
||||
break;
|
||||
}
|
||||
if ((tr.TestName == fromTestName)) { oriTestResult = tr; break; }
|
||||
}
|
||||
|
||||
Entities.TestResult correctedTestResult = new Entities.TestResult(Entities.MetersKind.Single);
|
||||
AddOrOverwriteResult(MakeCorrectedFrom(test, oriTestResult));
|
||||
|
||||
}
|
||||
else if (testParams.Activity.Contains("Simulate"))
|
||||
{
|
||||
IList<Event> rList = new List<Event>(1);
|
||||
|
||||
rList.Add(Event.Done);
|
||||
return rList;
|
||||
}
|
||||
else if (testParams.Activity.Contains("Simulate "))
|
||||
{
|
||||
Entities.TestResult tstRslt = new Entities.TestResult(test, 1, Entities.MetersKind.Single);
|
||||
|
||||
if (testParams.Activity.Contains("Q1"))
|
||||
if (testParams.Activity.Contains("Q3"))
|
||||
{
|
||||
tstRslt.VolumeMaster = tstRslt.VolumeCTV = 5;
|
||||
for (int i = 0; i < WaterMeters.Count; i++)
|
||||
{
|
||||
tstRslt.Meters[i].VolumeMeter = 5;
|
||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV;
|
||||
}
|
||||
AddOrOverwriteResult(tstRslt);
|
||||
AddOrOverwriteResult(MakeSimulated(test, 1, 0.5f));
|
||||
}
|
||||
else if (testParams.Activity.Contains("Q2"))
|
||||
{
|
||||
tstRslt.VolumeMaster = tstRslt.VolumeCTV = 5;
|
||||
for (int i = 0; i < WaterMeters.Count; i++)
|
||||
{
|
||||
tstRslt.Meters[i].VolumeMeter = 5;
|
||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV;
|
||||
}
|
||||
AddOrOverwriteResult(tstRslt);
|
||||
AddOrOverwriteResult(MakeSimulated(test, 1, 1.7f));
|
||||
}
|
||||
else if (testParams.Activity.Contains("Q3"))
|
||||
else if (testParams.Activity.Contains("Q1"))
|
||||
{
|
||||
tstRslt.VolumeMaster = tstRslt.VolumeCTV = 5;
|
||||
for (int i = 0; i < WaterMeters.Count; i++)
|
||||
{
|
||||
tstRslt.Meters[i].VolumeMeter = 5;
|
||||
tstRslt.Meters[i].VolumeRef = tstRslt.VolumeCTV;
|
||||
}
|
||||
AddOrOverwriteResult(tstRslt);
|
||||
AddOrOverwriteResult(MakeSimulated(test, 1, 2.2f));
|
||||
}
|
||||
|
||||
IList<Event> rList = new List<Event>(1);
|
||||
rList.Add(Event.Done);
|
||||
return rList;
|
||||
}
|
||||
@ -155,5 +135,174 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
retList.Add(retVal);
|
||||
return retList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Virtually apply Q2 correction to a test used for the correction calculation.
|
||||
/// </summary>
|
||||
/// <param name="oriTestRslt">Q2Adj test result</param>
|
||||
/// <returns>Virtual Q2 test result</returns>
|
||||
Entities.TestResult MakeCorrectedFrom(Entities.Test test, Entities.TestResult oriTestRslt)
|
||||
{
|
||||
Entities.TestResult tstRslt = new Entities.TestResult(test, 1, Entities.MetersKind.Single);
|
||||
|
||||
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
||||
tstRslt.MassStart = oriTestRslt.MassStart;
|
||||
tstRslt.MassEnd = oriTestRslt.MassEnd;
|
||||
tstRslt.MassDiff = oriTestRslt.MassEnd;
|
||||
tstRslt.DensityIn = oriTestRslt.DensityIn;
|
||||
tstRslt.DensityOut = oriTestRslt.DensityOut;
|
||||
tstRslt.DensityDiv = oriTestRslt.DensityDiv;
|
||||
tstRslt.Time = oriTestRslt.Time;
|
||||
tstRslt.FlowMass = oriTestRslt.FlowMass;
|
||||
tstRslt.FlowVolume = oriTestRslt.FlowVolume;
|
||||
tstRslt.VolumeCTV = oriTestRslt.VolumeCTV;
|
||||
tstRslt.VolumeMaster = oriTestRslt.VolumeMaster;
|
||||
tstRslt.PulsesMaster = oriTestRslt.PulsesMaster;
|
||||
tstRslt.ConstMaster = oriTestRslt.ConstMaster;
|
||||
tstRslt.ErrorMaster = oriTestRslt.ErrorMaster;
|
||||
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++)
|
||||
{
|
||||
/// 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;
|
||||
|
||||
tstRslt.Meters[i].SerialNr = oriTestRslt.Meters[i].SerialNr;
|
||||
tstRslt.Meters[i].PulsesPerLiter = oriTestRslt.Meters[i].PulsesPerLiter;
|
||||
tstRslt.Meters[i].VolumeRef = oriTestRslt.Meters[i].VolumeRef;
|
||||
tstRslt.Meters[i].Time = oriTestRslt.Meters[i].Time;
|
||||
tstRslt.Meters[i].TimeStart = oriTestRslt.Meters[i].TimeStart;
|
||||
tstRslt.Meters[i].TimeEnd = oriTestRslt.Meters[i].TimeEnd;
|
||||
tstRslt.Meters[i].PulsesMeter = oriTestRslt.Meters[i].PulsesMeter;
|
||||
tstRslt.Meters[i].PulsesMaster = oriTestRslt.Meters[i].PulsesMaster;
|
||||
tstRslt.Meters[i].Disabled = oriTestRslt.Meters[i].Disabled;
|
||||
|
||||
if (iPerl == null)
|
||||
{
|
||||
/// Normal meter
|
||||
tstRslt.Meters[i].VolumeStart = oriTestRslt.Meters[i].VolumeStart;
|
||||
tstRslt.Meters[i].VolumeEnd = oriTestRslt.Meters[i].VolumeEnd;
|
||||
tstRslt.Meters[i].VolumeMeter = oriTestRslt.Meters[i].VolumeMeter;
|
||||
tstRslt.Meters[i].VolumeErrorPct = oriTestRslt.Meters[i].VolumeErrorPct;
|
||||
tstRslt.Meters[i].Passed = oriTestRslt.Meters[i].Passed;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// iPerl
|
||||
tstRslt.Meters[i].VolumeStart = 0;
|
||||
tstRslt.Meters[i].VolumeEnd = 0;
|
||||
tstRslt.Meters[i].VolumeMeter = oriTestRslt.Meters[i].VolumeRef;
|
||||
tstRslt.Meters[i].VolumeErrorPct = 0;
|
||||
tstRslt.Meters[i].Passed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return tstRslt;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Virtually apply Q2 correction to a test used for the correction calculation.
|
||||
/// </summary>
|
||||
/// <param name="oriTestRslt">Q2Adj test result</param>
|
||||
/// <returns>Virtual Q2 test result</returns>
|
||||
Entities.TestResult MakeSimulated(Entities.Test test, int repetitionNr, float errorPct)
|
||||
{
|
||||
Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single);
|
||||
|
||||
tstRslt.TimeStart = DateTime.Now;
|
||||
tstRslt.TimeEnd = DateTime.Now;
|
||||
|
||||
tstRslt.AmbientTempAve = 20.0f;
|
||||
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 = 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 < Program.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)
|
||||
{
|
||||
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
||||
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 = (test.ErrLimLo <= errorPct) && (errorPct <= test.ErrLimLo);
|
||||
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)
|
||||
{
|
||||
tstRslt.Meters[i].VolumeEnd = 0; /// Normal meter
|
||||
}
|
||||
else
|
||||
{
|
||||
/// iPerl
|
||||
tstRslt.Meters[i].VolumeEnd = tstRslt.Meters[i].VolumeStart + tstRslt.Meters[i].VolumeMeter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tstRslt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,23 +21,23 @@ namespace TBF.Entities
|
||||
public virtual string ProtocolTitle { get; set; }
|
||||
|
||||
/// Values copied from the test (Entities.Test)
|
||||
public virtual int TestId { get; set; } /// Test entity ID to distinguish between tests with the same name
|
||||
public virtual int TestId { get; set; } /// Test entity ID to distinguish between tests with the same name
|
||||
public virtual string TestName { get; set; }
|
||||
public virtual int Part { get; set; }
|
||||
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
|
||||
public virtual bool DoNotPublish { get; set; } /// Not mapped to the database
|
||||
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
|
||||
public virtual float Volume { get; set; } /// Test volume (target) in [l]
|
||||
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
|
||||
public virtual bool DoNotPublish { get; set; } /// Not mapped to the database
|
||||
public virtual float Qfrom { get; set; } /// [m3/h] Water flow low limit
|
||||
public virtual float Qto { get; set; } /// [m3/h] Water flow high limit
|
||||
public virtual float Volume { get; set; } /// [l] Target test volume
|
||||
public virtual float TstTime { get; set; } /// [s] Test time estimate
|
||||
public virtual int Repeats { get; set; }
|
||||
public virtual bool Emptying { get; set; }
|
||||
public virtual bool Zeroing { get; set; }
|
||||
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
|
||||
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
|
||||
public virtual int Time2MassMsrmt { get; set; }
|
||||
public virtual string Method { get; set; }
|
||||
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
|
||||
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
|
||||
public virtual float ErrLimLo { get; set; } /// [%] Lower error limit (usually < 0)
|
||||
public virtual float ErrLimHi { get; set; } /// [%] Upper error limit (usually > 0)
|
||||
|
||||
/// To be replaced by the virtual bench component parameters
|
||||
public virtual string FeedingPath { get; set; }
|
||||
@ -46,46 +46,46 @@ namespace TBF.Entities
|
||||
public virtual string MetersPath { get; set; }
|
||||
|
||||
/// Results
|
||||
public virtual DateTime TimeStart { get; set; } /// Date and time of the test start
|
||||
public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end
|
||||
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
|
||||
public virtual float AmbientTempAve { get; set; } /// Average ambient air temperature [degC]
|
||||
public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure
|
||||
public virtual float AmbientHumiAve { get; set; } /// Average ambient air relative humidity [%]
|
||||
public virtual float PressInAvrg { get; set; } /// Input water pressure (average) [Bar]
|
||||
public virtual float PressInStart { get; set; }
|
||||
public virtual float PressInEnd { get; set; }
|
||||
public virtual float PressOutAvrg { get; set; }
|
||||
public virtual float PressOutStart { get; set; }
|
||||
public virtual float PressOutEnd { get; set; }
|
||||
public virtual float TempInAvrg { get; set; }
|
||||
public virtual float TempInStart { get; set; }
|
||||
public virtual float TempInEnd { get; set; }
|
||||
public virtual float TempOutAvrg { get; set; }
|
||||
public virtual float TempOutStart { get; set; }
|
||||
public virtual float TempOutEnd { get; set; }
|
||||
public virtual float TempDivAvrg { get; set; }
|
||||
public virtual float TempDivStart { get; set; }
|
||||
public virtual float TempDivEnd { get; set; }
|
||||
public virtual float MassStartRaw { get; set; }
|
||||
public virtual float MassStart { get; set; }
|
||||
public virtual float MassEndRaw { get; set; }
|
||||
public virtual float MassEnd { get; set; }
|
||||
public virtual float MassDiff { get; set; }
|
||||
public virtual float DensityIn { get; set; }
|
||||
public virtual float DensityOut { get; set; }
|
||||
public virtual float DensityDiv { get; set; }
|
||||
public virtual float Buoyancy { get; set; } ///TODO -> map
|
||||
public virtual float FlowMass { get; set; } /// from conventional true value
|
||||
public virtual float FlowVolume { get; set; } /// from conventional true value
|
||||
public virtual float VolumeCTV { get; set; } /// volume conventional true value
|
||||
public virtual float VolumeMaster { get; set; } /// volume from the master flow meter
|
||||
public virtual float Time { get; set; } /// measurement time in seconds
|
||||
public virtual float ErrorMaster { get; set; }
|
||||
public virtual DateTime TimeStart { get; set; } /// Date and time of the test start
|
||||
public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end
|
||||
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
|
||||
public virtual float AmbientTempAve { get; set; } /// [deg.C] Average ambient air temperature
|
||||
public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure
|
||||
public virtual float AmbientHumiAve { get; set; } /// [%] Average ambient air relative humidity
|
||||
public virtual float PressInAvrg { get; set; } /// [Bar] Input water pressure (average)
|
||||
public virtual float PressInStart { get; set; } /// [Bar]
|
||||
public virtual float PressInEnd { get; set; } /// [Bar]
|
||||
public virtual float PressOutAvrg { get; set; } /// [Bar]
|
||||
public virtual float PressOutStart { get; set; } /// [Bar]
|
||||
public virtual float PressOutEnd { get; set; } /// [Bar]
|
||||
public virtual float TempInAvrg { get; set; } /// [deg.C]
|
||||
public virtual float TempInStart { get; set; } /// [deg.C]
|
||||
public virtual float TempInEnd { get; set; } /// [deg.C]
|
||||
public virtual float TempOutAvrg { get; set; } /// [deg.C]
|
||||
public virtual float TempOutStart { get; set; } /// [deg.C]
|
||||
public virtual float TempOutEnd { get; set; } /// [deg.C]
|
||||
public virtual float TempDivAvrg { get; set; } /// [deg.C]
|
||||
public virtual float TempDivStart { get; set; } /// [deg.C]
|
||||
public virtual float TempDivEnd { get; set; } /// [deg.C]
|
||||
public virtual float MassStartRaw { get; set; } /// [kg]
|
||||
public virtual float MassStart { get; set; } /// [kg]
|
||||
public virtual float MassEndRaw { get; set; } /// [kg]
|
||||
public virtual float MassEnd { get; set; } /// [kg]
|
||||
public virtual float MassDiff { get; set; } /// [kg]
|
||||
public virtual float DensityIn { get; set; } /// [kg/m3]
|
||||
public virtual float DensityOut { get; set; } /// [kg/m3]
|
||||
public virtual float DensityDiv { get; set; } /// [kg/m3]
|
||||
public virtual float Buoyancy { get; set; } ///TODO -> map
|
||||
public virtual float FlowMass { get; set; } /// [kg/h] calculated from conventional true value
|
||||
public virtual float FlowVolume { get; set; } /// [l/h] calculated from conventional true value
|
||||
public virtual float VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||
public virtual float VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||
public virtual float Time { get; set; } /// [s] Measurement time in seconds
|
||||
public virtual float ErrorMaster { get; set; } /// [%]
|
||||
public virtual float PulsesMaster { get; set; }
|
||||
public virtual float ConstMaster { get; set; } /// Pulses per liter master flow meter
|
||||
public virtual float QRise { get; set; } /// Detected Q_rise of a composed meter
|
||||
public virtual float QFall { get; set; } /// Detected Q_fall of a composed meter
|
||||
public virtual float ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
|
||||
public virtual float QRise { get; set; } /// Detected Q_rise of a composed meter
|
||||
public virtual float QFall { get; set; } /// Detected Q_fall of a composed meter
|
||||
public virtual float TimeDivStart0 { get; set; }
|
||||
public virtual float TimeDivStart1 { get; set; }
|
||||
public virtual float TimeDivStart2 { get; set; }
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.5.99.1")]
|
||||
[assembly: AssemblyFileVersion("1.5.99.1")]
|
||||
[assembly: AssemblyVersion("1.5.100.1")]
|
||||
[assembly: AssemblyFileVersion("1.5.100.1")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user