Results.Entities.TestRslt.TimeBtwnMassMsrmnts added, evaluated in test methods, ver. 2.18.1226

This commit is contained in:
Milan Hanajik 2019-05-14 16:59:20 +02:00
parent 39f44ad2e3
commit 55ed11ae58
13 changed files with 83 additions and 42 deletions

View File

@ -23,8 +23,9 @@ namespace Results.Entities
public virtual string Remark { get; set; }
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 int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual int FlowSetTime { get; set; } /// [s] Flow set time in seconds
public virtual int TimeBtwnMassMsrmnts { get; set; }/// [s] Time between two mass measurements in seconds (if applicable)
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual double PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
@ -233,6 +234,7 @@ namespace Results.Entities
StartTime = src.StartTime;
EndTime = src.EndTime;
FlowSetTime = src.FlowSetTime;
TimeBtwnMassMsrmnts = src.TimeBtwnMassMsrmnts;
TestTime = src.TestTime;
PulsesMaster = src.PulsesMaster;
TotalPulsesMstr = src.TotalPulsesMstr;

View File

@ -315,6 +315,7 @@ namespace Results
Counter10, /// 268 counterIdx0 = 9
ConstMasterCorr, /// 269
TimeBtwnMassMsrmnts, /// 270
Count,
}

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.18.1224.0")]
[assembly: AssemblyFileVersion("2.18.1224.0")]
[assembly: AssemblyVersion("2.18.1226.0")]
[assembly: AssemblyFileVersion("2.18.1226.0")]

View File

@ -196,8 +196,9 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_start, "Timestamp start ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_end, "Timestamp end ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time_ni, Strings.T_s + "_ni()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetMeterTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.PMax_test_time, "Pressure test time ()", "Pressure test time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "F1", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.TimeBtwnMassMsrmnts, "Time between mass measurements ()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).TimeBtwnMassMsrmnts)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.PMax_test_time, "Pressure test time ()", "Pressure test time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "F0", w.GetTestRslt(t).TestTime)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_start_time, "Diverter start time ()", "Diverter start time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_end_time, "Diverter end time ()", "Diverter end time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_open_time, "Start valve open time ()", "Start valve open time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));

View File

@ -65,7 +65,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
IList<Event> e; /// Events from currently running operations
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
@ -506,8 +508,9 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
}
while (!e.Contains(Event.BalanceDone));
///
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@ -601,6 +604,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
}
while (!e.Contains(Event.BalanceDone));
///
tMass2 = StateMachine.Time;
TestEndTime = DateTime.Now;
/// Read the diverter switch time
@ -652,6 +656,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
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;

View File

@ -29,8 +29,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
/// </returns>
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition)
{
IList<Event> e = new List<Event>(); /// Events from currently running operations
IScale scale = outPath.Scale as IScale;
if (scale == null)
{
@ -60,8 +58,11 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
}
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
IList<Event> e; /// Events from currently running operations
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
@ -352,9 +353,10 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
}
}
while (!e.Contains(Event.BalanceDone));
///
TestStartTime = DateTime.Now;
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_in_progress);
@ -485,7 +487,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
}
while (!e.Contains(Event.BalanceDone));
///
TestEndTime = DateTime.Now;
tMass2 = StateMachine.Time;
TestEndTime = DateTime.Now;
State.Create("FixedStartAdvanced : Stopping diverter, gate, etc.")
@ -558,7 +561,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartAdvanced
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
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; /// [kg] calculated before displaying 'End state' dialog

View File

@ -87,7 +87,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
IList<Event> e; /// Events from currently running operations
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@ -506,8 +508,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
}
}
while (!e.Contains(Event.BalanceDone));
///
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
///
@ -792,6 +795,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
}
while (!e.Contains(Event.BalanceDone));
///
tMass2 = StateMachine.Time;
TestEndTime = DateTime.Now;
@ -919,8 +923,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;

View File

@ -68,7 +68,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
IList<Event> e; /// Events from currently running operations
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@ -488,8 +490,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
}
}
while (!e.Contains(Event.BalanceDone));
///
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
///
@ -782,6 +785,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
///
tMass2 = StateMachine.Time;
TestEndTime = DateTime.Now;
@ -952,8 +956,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.TestTime = Math.Max(1.0, EndTime - StartTime); /// [s] measurement time, at least 1 to prevent division by zero
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.MassStartRaw = StartMass.Val;

View File

@ -77,7 +77,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true);
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true);
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@ -508,9 +510,10 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
}
}
while (!e.Contains(Event.BalanceDone));
log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val;
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
log.WarnFormat("Start mass = {0}kg", StartMass);
}
@ -687,7 +690,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
}
while (!e.Contains(Event.BalanceDone));
///
log.WarnFormat("End mass = {0}kg", EndMass);
tMass2 = StateMachine.Time;
log.WarnFormat("End mass = {0}kg", EndMass);
}
//------------------------------------------------
@ -716,7 +720,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h]
///

View File

@ -90,7 +90,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@ -600,8 +602,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
}
while (!e.Contains(Event.BalanceDone));
log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
log.WarnFormat("Start mass = {0}kg", StartMass);
if (Math.Abs(StartMass.Val + refMass - measuredRefMass.Val) > 0.03 * refMass)
@ -783,7 +786,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
}
while (!e.Contains(Event.BalanceDone));
///
log.WarnFormat("End mass = {0}kg", EndMass);
tMass2 = StateMachine.Time;
log.WarnFormat("End mass = {0}kg", EndMass);
TestEndTime = DateTime.Now;
//------------------------------------------------
@ -810,7 +814,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
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 = StartMass.Val;

View File

@ -84,7 +84,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
IList<Event> e = new List<Event>(); /// Events from currently running operations
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@ -512,8 +514,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
}
while (!e.Contains(Event.BalanceDone));
log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
log.WarnFormat("Start mass = {0}kg", StartMass);
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
@ -698,7 +701,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
}
while (!e.Contains(Event.BalanceDone));
///
log.WarnFormat("End mass = {0}kg", EndMass);
tMass2 = StateMachine.Time;
log.WarnFormat("End mass = {0}kg", EndMass);
TestEndTime = DateTime.Now;
//------------------------------------------------
@ -728,6 +732,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time (TODO: or cBrd.ImpulseTime(0) ???)
tstRslt.PulsesMaster = massPulses; /// Pulses of the master flow meter (test total)
tstRslt.TotalPulsesMstr = totalPulses;

View File

@ -79,7 +79,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
int tMass1 = 0;
int tMass2 = 0;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, heatMetersTestParams != null);
@ -504,8 +506,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
log.WarnFormat("Start mass = {0}kg", StartMass);
Mass.Val = StartMass.Val;
tMass1 = StateMachine.Time;
log.WarnFormat("Start mass = {0}kg", StartMass);
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement");
@ -690,7 +693,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
}
while (!e.Contains(Event.BalanceDone));
///
log.WarnFormat("End mass = {0}kg", EndMass);
tMass2 = StateMachine.Time;
log.WarnFormat("End mass = {0}kg", EndMass);
TestEndTime = DateTime.Now;
//------------------------------------------------
@ -717,7 +721,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
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 = Config.Formulas.CorrectedValue(tstRslt.MassStartRaw, scale.Corrections);

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.18.1225.0")]
[assembly: AssemblyFileVersion("2.18.1225.0")]
[assembly: AssemblyVersion("2.18.1226.0")]
[assembly: AssemblyFileVersion("2.18.1226.0")]