Bugfix: Preserve final RefPulses value in StandingStartMassCollection
Description:
During StandingStartMassCollection test evaluation, `tstRslt.PulsesMaster` was assigned directly from `cBrd.RefPulses`. By the time the evaluation was executed, the control board had already reset `RefPulses` to zero, resulting in an incorrect master pulse count being stored.
Solution:
Added `finalPulsesCount` to preserve the last valid `cBrd.RefPulses` value immediately after the measurement completed and before the control board reset the pulse counter.
The test evaluation now uses:
tstRslt.PulsesMaster = Convert.ToDouble(finalPulsesCount);
instead of the live `cBrd.RefPulses` value, ensuring the recorded master pulse count reflects the actual measured value.
This commit is contained in:
parent
a210a0d1f2
commit
a2cee155e4
@ -247,6 +247,7 @@
|
|||||||
<EmbeddedResource Include="Resources\Strings.resx">
|
<EmbeddedResource Include="Resources\Strings.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\Strings.ru.resx" />
|
<EmbeddedResource Include="Resources\Strings.ru.resx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("3.9.3134.107")]
|
[assembly: AssemblyVersion("3.9.3134.108")]
|
||||||
[assembly: AssemblyFileVersion("3.9.3134.107")]
|
[assembly: AssemblyFileVersion("3.9.3134.108")]
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
///
|
using log4net;
|
||||||
|
using SharedComponents;
|
||||||
|
///
|
||||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using log4net;
|
using System.Text;
|
||||||
|
|
||||||
namespace TBF.Rig.ControlBoard.Uni
|
namespace TBF.Rig.ControlBoard.Uni
|
||||||
{
|
{
|
||||||
@ -206,6 +208,8 @@ namespace TBF.Rig.ControlBoard.Uni
|
|||||||
|
|
||||||
log.InfoFormat("Et={0} State={1:X14} Route={2} Freq={3} EtPulses={4} TTime={5} WMPulses[3]={6} WMRefPulses[3]={7}, Time[3]={8}",
|
log.InfoFormat("Et={0} State={1:X14} Route={2} Freq={3} EtPulses={4} TTime={5} WMPulses[3]={6} WMRefPulses[3]={7}, Time[3]={8}",
|
||||||
State & 7, State, Utils.ToBin40(Vystupy >> 8), ReferenceFreq[0], EtPulses[0], Ttime, WMeterPuls[3], EtPulses[3], ImpulseTime[3]);
|
State & 7, State, Utils.ToBin40(Vystupy >> 8), ReferenceFreq[0], EtPulses[0], Ttime, WMeterPuls[3], EtPulses[3], ImpulseTime[3]);
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("Et={0} State={1:X14} Route={2} Freq={3} EtPulses={4} TTime={5} WMPulses[3]={6} WMRefPulses[3]={7}, Time[3]={8}",
|
||||||
|
State & 7, State, Utils.ToBin40(Vystupy >> 8), ReferenceFreq[0], EtPulses[0], Ttime, WMeterPuls[3], EtPulses[3], ImpulseTime[3]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
///
|
using Common;
|
||||||
|
using log4net;
|
||||||
|
using SharedComponents;
|
||||||
|
///
|
||||||
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
/// Copyright (c) 2021 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Common;
|
|
||||||
using log4net;
|
|
||||||
using TBF.Rig.GenericDevices;
|
using TBF.Rig.GenericDevices;
|
||||||
|
|
||||||
namespace TBF.Rig.ControlBoard.Uni
|
namespace TBF.Rig.ControlBoard.Uni
|
||||||
@ -24,6 +25,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
|||||||
readonly TBF.Rig.Uni.FlowMetersInParallel.FlowMeter flowMeterInParallel;
|
readonly TBF.Rig.Uni.FlowMetersInParallel.FlowMeter flowMeterInParallel;
|
||||||
readonly TBF.Rig.Uni.Diverter.Diverter diverter;
|
readonly TBF.Rig.Uni.Diverter.Diverter diverter;
|
||||||
readonly int pulsesCount; /// Number of reference pulses for a complete test
|
readonly int pulsesCount; /// Number of reference pulses for a complete test
|
||||||
|
readonly int massPulsesCount; /// Number of reference pulses for mass collection
|
||||||
readonly bool withDiverter; /// Test with diverter (and scale)
|
readonly bool withDiverter; /// Test with diverter (and scale)
|
||||||
|
|
||||||
private DateTime startTimeForSimulation;
|
private DateTime startTimeForSimulation;
|
||||||
@ -69,16 +71,16 @@ namespace TBF.Rig.ControlBoard.Uni
|
|||||||
{
|
{
|
||||||
string deviceInfo = GetAllDevicesInfo(devices);
|
string deviceInfo = GetAllDevicesInfo(devices);
|
||||||
string flowMeterStatus = devices.FlowMeter == null
|
string flowMeterStatus = devices.FlowMeter == null
|
||||||
? "devices.FlowMeter je NULL"
|
? "devices.FlowMeter is NULL"
|
||||||
: $"devices.FlowMeter je typu: {devices.FlowMeter.GetType().FullName}";
|
: $"devices.FlowMeter is type of: {devices.FlowMeter.GetType().FullName}";
|
||||||
|
|
||||||
MessageBox.Show(
|
MessageBox.Show(
|
||||||
$"Chyba počas zastavenia regulácie prietoku, v ramci StandingStartStopTestOp() pre flowMeter:\n" +
|
$"Error during flow control stop, within StandingStartStopTestOp() for flowMeter:\n" +
|
||||||
$"{ex.Message}\n\n" +
|
$"{ex.Message}\n\n" +
|
||||||
$"Diagnostika:\n{flowMeterStatus}\n\n" +
|
$"Diagnostic:\n{flowMeterStatus}\n\n" +
|
||||||
$"{deviceInfo}\n\n" +
|
$"{deviceInfo}\n\n" +
|
||||||
$"Stack trace:\n{ex.StackTrace}",
|
$"Stack trace:\n{ex.StackTrace}",
|
||||||
"Chyba",
|
"Error",
|
||||||
MessageBoxButtons.OK,
|
MessageBoxButtons.OK,
|
||||||
MessageBoxIcon.Error
|
MessageBoxIcon.Error
|
||||||
);
|
);
|
||||||
@ -101,9 +103,9 @@ namespace TBF.Rig.ControlBoard.Uni
|
|||||||
string deviceInfo = GetAllDevicesInfo(devices);
|
string deviceInfo = GetAllDevicesInfo(devices);
|
||||||
|
|
||||||
MessageBox.Show(
|
MessageBox.Show(
|
||||||
$"Chyba počas zastavenia regulácie prietoku, v ramci StandingStartStopTestOp() pre diverter:\n" +
|
$"Error while stopping the flow control, within StandingStartStopTestOp() for the diverter:\n" +
|
||||||
$"{ex.Message}\n\n{deviceInfo}\n\nStack trace:\n{ex.StackTrace}",
|
$"{ex.Message}\n\n{deviceInfo}\n\nStack trace:\n{ex.StackTrace}",
|
||||||
"Chyba",
|
"Error",
|
||||||
MessageBoxButtons.OK,
|
MessageBoxButtons.OK,
|
||||||
MessageBoxIcon.Error
|
MessageBoxIcon.Error
|
||||||
);
|
);
|
||||||
@ -117,10 +119,10 @@ namespace TBF.Rig.ControlBoard.Uni
|
|||||||
|
|
||||||
string GetAllDevicesInfo(object obj)
|
string GetAllDevicesInfo(object obj)
|
||||||
{
|
{
|
||||||
if (obj == null) return "devices objekt je null.";
|
if (obj == null) return "devices object is null.";
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.AppendLine("Zoznam zariadení v devices:");
|
sb.AppendLine("List of devices:");
|
||||||
|
|
||||||
var props = obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
var props = obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||||
foreach (var prop in props)
|
foreach (var prop in props)
|
||||||
@ -133,7 +135,7 @@ namespace TBF.Rig.ControlBoard.Uni
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
sb.AppendLine($"{prop.Name}: [Chyba pri načítaní - {ex.Message}]");
|
sb.AppendLine($"{prop.Name}: [Loading error - {ex.Message}]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,9 +222,11 @@ namespace TBF.Rig.ControlBoard.Uni
|
|||||||
|
|
||||||
if (uniCB.RefPulses < pulsesCount)
|
if (uniCB.RefPulses < pulsesCount)
|
||||||
{
|
{
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSSOp: uniCB.RefPulses = {0}/{1}", uniCB.RefPulses, pulsesCount));
|
||||||
return Event.TestInProgress; /// Test was not completed yet
|
return Event.TestInProgress; /// Test was not completed yet
|
||||||
}
|
}
|
||||||
opState = OpState.TestCompleted;
|
opState = OpState.TestCompleted;
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSSOp: TestComplet"));
|
||||||
return Event.TestCompleted;
|
return Event.TestCompleted;
|
||||||
|
|
||||||
case OpState.TestCompleted:
|
case OpState.TestCompleted:
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
using Common;
|
using Common;
|
||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
using Results.Entities;
|
||||||
|
using SharedComponents;
|
||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
@ -10,7 +12,6 @@ using System.IO;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Results.Entities;
|
|
||||||
using TBF.Boxes;
|
using TBF.Boxes;
|
||||||
using TBF.Resources;
|
using TBF.Resources;
|
||||||
using TBF.Rig;
|
using TBF.Rig;
|
||||||
@ -761,7 +762,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
|
|||||||
tstRslt.FlowSetTime = flowSetTime;
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
|
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
|
||||||
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
|
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
|
||||||
tstRslt.MassStartRaw = StartMass.Val;
|
tstRslt.MassStartRaw = StartMass.Val;
|
||||||
tstRslt.MassEndRaw = EndMass.Val;
|
tstRslt.MassEndRaw = EndMass.Val;
|
||||||
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
|
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
|
||||||
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse;
|
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse;
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
using Config.Entities;
|
using Config.Entities;
|
||||||
using log4net;
|
using log4net;
|
||||||
using NHibernate.Action;
|
using NHibernate.Action;
|
||||||
|
using SharedComponents;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
||||||
///
|
///
|
||||||
@ -78,21 +80,21 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fixed start mass collection method sequence
|
/// Fixed start mass collection method sequence
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="test">Test entity</param>
|
/// <param name="test">Test entity</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Event.Done . . . . . . . OK
|
/// Event.Done . . . . . . . OK
|
||||||
/// Event.MakeSecondPass . . OK, 2nd pass (=evaluation) required
|
/// Event.MakeSecondPass . . OK, 2nd pass (=evaluation) required
|
||||||
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
||||||
/// Event.OpArgumentError . Target flow is out of range
|
/// Event.OpArgumentError . Target flow is out of range
|
||||||
/// Event.Error . . . . . . Unspecified error
|
/// Event.Error . . . . . . Unspecified error
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
public IList<Event> Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition,
|
||||||
bool compound,
|
bool compound,
|
||||||
HeatMeters.TestParams heatMetersTestParams,
|
HeatMeters.TestParams heatMetersTestParams,
|
||||||
Common.DebugMode debugLevel)
|
Common.DebugMode debugLevel)
|
||||||
{
|
{
|
||||||
ControlBoard.IControlBoard cBrd = StateMachine.ControlBoardMain;
|
ControlBoard.IControlBoard cBrd = StateMachine.ControlBoardMain;
|
||||||
IScale scale = cBrd.Devices.Scale as IScale;
|
IScale scale = cBrd.Devices.Scale as IScale;
|
||||||
@ -105,7 +107,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
}
|
}
|
||||||
|
|
||||||
IList<Event> e; /// Events from currently running operations
|
IList<Event> e; /// Events from currently running operations
|
||||||
int waterMetersCount = Math.Min(BenchInfo.WaterMetersCount, sensPath.RegisterReaders.Length);
|
int waterMetersCount = Math.Min(BenchInfo.WaterMetersCount, sensPath.RegisterReaders.Length);
|
||||||
DateTimeBox timeStampStart = new DateTimeBox();
|
DateTimeBox timeStampStart = new DateTimeBox();
|
||||||
DateTimeBox timeStampEnd = new DateTimeBox();
|
DateTimeBox timeStampEnd = new DateTimeBox();
|
||||||
FloatBox startSwitchTime = new FloatBox();
|
FloatBox startSwitchTime = new FloatBox();
|
||||||
@ -186,53 +188,53 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
IOperation heatMetersPromptOp = null;
|
IOperation heatMetersPromptOp = null;
|
||||||
if (heatMetersTestParams != null && !string.IsNullOrEmpty(heatMetersTestParams.Prompt))
|
if (heatMetersTestParams != null && !string.IsNullOrEmpty(heatMetersTestParams.Prompt))
|
||||||
{
|
{
|
||||||
/// Make sure the CycleBeginForm is closed
|
/// Make sure the CycleBeginForm is closed
|
||||||
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
if (UIFlowControl.Stop == WaitBeginFormClosed()) goto stopTest;
|
||||||
|
|
||||||
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
heatMetersPromptOp = new Operations.MessageBoxOp(heatMetersTestParams.Prompt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (test.DoDraining || (scale.Mass + test.Volume >= scale.Capacity * Constants.TankFullFactor))
|
if (test.DoDraining || (scale.Mass + test.Volume >= scale.Capacity * Constants.TankFullFactor))
|
||||||
{
|
{
|
||||||
///
|
///
|
||||||
/// There is not enough room in the tank OR unconditional draining ... drain the water tank
|
/// There is not enough room in the tank OR unconditional draining ... drain the water tank
|
||||||
///
|
///
|
||||||
IList<IOperation> ops = new List<IOperation>(readTempPressOps);
|
IList<IOperation> ops = new List<IOperation>(readTempPressOps);
|
||||||
ops.Add(heatMetersPromptOp);
|
ops.Add(heatMetersPromptOp);
|
||||||
switch (DrainTheTank(scale, ops))
|
switch (DrainTheTank(scale, ops))
|
||||||
{
|
{
|
||||||
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
///
|
///
|
||||||
/// Make sure the drain valve is closed
|
/// Make sure the drain valve is closed
|
||||||
///
|
///
|
||||||
State.Create(string.Format("{0}({1}) : Make sure the drain valve is closed", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Make sure the drain valve is closed", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.AddOperation(heatMetersPromptOp)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.AddOperation(cBrd.SetValvesOp(null, scale.DrainValve))
|
.AddOperation(cBrd.SetValvesOp(null, scale.DrainValve))
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.JustStarted));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.JustStarted));
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
Bridge.OnActivity(this, Strings.Starting_the_pump);
|
||||||
//------------------------------------------------
|
//------------------------------------------------
|
||||||
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
||||||
int flowSetTime0 = StateMachine.Time;
|
int flowSetTime0 = StateMachine.Time;
|
||||||
|
|
||||||
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(string.Format("{0}({1}) : Starting the pump", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Starting the pump", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
@ -246,9 +248,9 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
||||||
|
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (e.Contains(Event.ValvesBusy) /* || !e.Contains(Event.AllPositionsReached)*/);
|
while (e.Contains(Event.ValvesBusy) /* || !e.Contains(Event.AllPositionsReached)*/);
|
||||||
|
|
||||||
|
|
||||||
if (test.TimePump2StartV > 0)
|
if (test.TimePump2StartV > 0)
|
||||||
@ -280,7 +282,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
}
|
}
|
||||||
@ -316,7 +318,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
||||||
.AddOperation(heatMetersPromptOp)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
||||||
@ -344,13 +346,13 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.AddOperation(cBrd.SetFlowOp(test.QfromM3ph(), test.QtoM3ph(), RefFlow, FlowSettingTimeoutSec))//...develop: step 1
|
.AddOperation(cBrd.SetFlowOp(test.QfromM3ph(), test.QtoM3ph(), RefFlow, FlowSettingTimeoutSec))//...develop: step 1
|
||||||
.AddOperation(heatMetersPromptOp)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.FlowSetting));
|
||||||
|
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
if (e.Contains(Event.RegulValveTimeOut))
|
if (e.Contains(Event.RegulValveTimeOut))
|
||||||
{
|
{
|
||||||
Bridge.OnError(this, Strings.Flow_adjustment_failed);
|
Bridge.OnError(this, Strings.Flow_adjustment_failed);
|
||||||
@ -376,14 +378,14 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
|
|
||||||
int lastTimeSec = StateMachine.Time;
|
int lastTimeSec = StateMachine.Time;
|
||||||
double Tw_last = 0;
|
double Tw_last = 0;
|
||||||
double Tc_last = 0;
|
double Tc_last = 0;
|
||||||
|
|
||||||
State.Create(string.Format("{0}({1}) : Checking if the temperature is stable", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Checking if the temperature is stable", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.AddOperation(heatMetersPromptOp)
|
.AddOperation(heatMetersPromptOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
@ -392,56 +394,56 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
break; /// Simulate temperature is within range
|
break; /// Simulate temperature is within range
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TempRefHi1.Val != 0 && TempRefHi2.Val != 0 && TempRefLo1.Val != 0 && TempRefLo2.Val != 0)
|
if (TempRefHi1.Val != 0 && TempRefHi2.Val != 0 && TempRefLo1.Val != 0 && TempRefLo2.Val != 0)
|
||||||
{
|
{
|
||||||
if (StateMachine.Time - lastTimeSec > 10 || StateMachine.Time - lastTimeSec < 0)
|
if (StateMachine.Time - lastTimeSec > 10 || StateMachine.Time - lastTimeSec < 0)
|
||||||
{
|
{
|
||||||
double Tw = (TempRefHi1.Val + TempRefHi2.Val) / 2;
|
double Tw = (TempRefHi1.Val + TempRefHi2.Val) / 2;
|
||||||
double Tc = (TempRefLo1.Val + TempRefLo2.Val) / 2;
|
double Tc = (TempRefLo1.Val + TempRefLo2.Val) / 2;
|
||||||
if ((heatMetersTestParams.TempWarmLo <= Tw) && (Tw <= heatMetersTestParams.TempWarmHi) &&
|
if ((heatMetersTestParams.TempWarmLo <= Tw) && (Tw <= heatMetersTestParams.TempWarmHi) &&
|
||||||
(heatMetersTestParams.TempColdLo <= Tc) && (Tc <= heatMetersTestParams.TempColdHi) &&
|
(heatMetersTestParams.TempColdLo <= Tc) && (Tc <= heatMetersTestParams.TempColdHi) &&
|
||||||
(Math.Abs(Tw - Tw_last) <= heatMetersTestParams.ChangeInTimeWarm) &&
|
(Math.Abs(Tw - Tw_last) <= heatMetersTestParams.ChangeInTimeWarm) &&
|
||||||
(Math.Abs(Tc - Tc_last) <= heatMetersTestParams.ChangeInTimeCold) &&
|
(Math.Abs(Tc - Tc_last) <= heatMetersTestParams.ChangeInTimeCold) &&
|
||||||
(Math.Abs(TempRefHi1.Val - TempRefHi2.Val) <= heatMetersTestParams.DeltaTempWarm) &&
|
(Math.Abs(TempRefHi1.Val - TempRefHi2.Val) <= heatMetersTestParams.DeltaTempWarm) &&
|
||||||
(Math.Abs(TempRefLo1.Val - TempRefLo2.Val) <= heatMetersTestParams.DeltaTempCold))
|
(Math.Abs(TempRefLo1.Val - TempRefLo2.Val) <= heatMetersTestParams.DeltaTempCold))
|
||||||
{
|
{
|
||||||
break; /// Temperature is withing required range
|
break; /// Temperature is withing required range
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTimeSec = StateMachine.Time;
|
lastTimeSec = StateMachine.Time;
|
||||||
Tw_last = Tw;
|
Tw_last = Tw;
|
||||||
Tc_last = Tc;
|
Tc_last = Tc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (true);
|
while (true);
|
||||||
}
|
}
|
||||||
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
|
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
|
||||||
{
|
{
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Setting_temperature);
|
Bridge.OnActivity(this, Strings.Setting_temperature);
|
||||||
//---------------------------------------------------
|
//---------------------------------------------------
|
||||||
|
|
||||||
State.Create(string.Format("{0}({1}) : Wait until the water temperature is within limits", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Wait until the water temperature is within limits", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
if (e.Contains(Event.Next))
|
if (e.Contains(Event.Next))
|
||||||
{
|
{
|
||||||
break; /// Simulate temperature is within range
|
break; /// Simulate temperature is within range
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TempUp.Val >= test.TempLimLo && TempUp.Val <= test.TempLimHi &&
|
if (TempUp.Val >= test.TempLimLo && TempUp.Val <= test.TempLimHi &&
|
||||||
TempDown.Val >= test.TempLimLo && TempDown.Val <= test.TempLimHi)
|
TempDown.Val >= test.TempLimLo && TempDown.Val <= test.TempLimHi)
|
||||||
{
|
{
|
||||||
break; /// Temperature set withing required range
|
break; /// Temperature set withing required range
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (true);
|
while (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Temperature is withing required range at this point
|
/// Temperature is withing required range at this point
|
||||||
@ -462,7 +464,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
|
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start);
|
Bridge.OnActivity(this, Strings.Stopping_flow_for_the_fixed_start);
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
State.Create(string.Format("{0}({1}) : Stop flow regulation", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Stop flow regulation", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
@ -471,7 +473,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
|
||||||
IOperation testInProgress = cBrd.StandingStartStopTestOp(test, 2 * totalPulses, Devices.Diverter is TBF.Rig.Uni.Diverter.Diverter);
|
IOperation testInProgress = cBrd.StandingStartStopTestOp(test, /*2 * */totalPulses, Devices.Diverter is TBF.Rig.Uni.Diverter.Diverter);
|
||||||
IOperation controlFlowOp = cBrd.SetFlowOp(test.QfromM3ph(), test.QtoM3ph(), RefFlow, int.MaxValue, test.TimeBeforeFlow);
|
IOperation controlFlowOp = cBrd.SetFlowOp(test.QfromM3ph(), test.QtoM3ph(), RefFlow, int.MaxValue, test.TimeBeforeFlow);
|
||||||
|
|
||||||
State.Create(string.Format("{0}({1}) : Close the start/stop valve before measuring the start mass", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Close the start/stop valve before measuring the start mass", test.Method, test.Name))
|
||||||
@ -481,7 +483,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
.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 (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
}
|
}
|
||||||
while (!e.Contains(Event.ValvesSet));
|
while (!e.Contains(Event.ValvesSet));
|
||||||
@ -490,7 +492,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
///-----------------
|
///-----------------
|
||||||
delay = test.TimeFlow2Mass;
|
delay = test.TimeFlow2Mass;
|
||||||
|
|
||||||
if (delay > 0)
|
if (delay > 0)
|
||||||
{
|
{
|
||||||
State.Create(string.Format("{0}({1}) : Delay for meters stabilization <T flow stab. - start = {2}s> ", test.Method, test.Name, delay))
|
State.Create(string.Format("{0}({1}) : Delay for meters stabilization <T flow stab. - start = {2}s> ", test.Method, test.Name, delay))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
@ -512,7 +514,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
State.Create(string.Format("{0}({1}) : Start the standing start/stop test", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Start the standing start/stop test", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.AddOperation(testInProgress) //...develop: step 4 --> diverter switch to the mass
|
.AddOperation(cBrd.StandingStartStopTestOp(test, 2 * totalPulses, Devices.Diverter is TBF.Rig.Uni.Diverter.Diverter)) //...develop: step 4 --> diverter switch to the mass
|
||||||
.EnterState();
|
.EnterState();
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
@ -534,10 +536,10 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Start mass");
|
if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Start mass");
|
||||||
else LogProcessDataHeaderHeatMeters(processDataLogger, "Start mass");
|
else LogProcessDataHeaderHeatMeters(processDataLogger, "Start mass");
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Enter water meter begin states and read the start mass at the same time
|
/// Enter water meter begin states and read the start mass at the same time
|
||||||
///
|
///
|
||||||
GenericDevices.IHasWMStatesForm dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IHasWMStatesForm;
|
GenericDevices.IHasWMStatesForm dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IHasWMStatesForm;
|
||||||
IOperation readStartMassOp = scale.ReadStableMassOp(ref StartMass, test.TimeFlow2Mass, test.MassMethod, test.MassRepeats, test.MassSpread);
|
IOperation readStartMassOp = scale.ReadStableMassOp(ref StartMass, test.TimeFlow2Mass, test.MassMethod, test.MassRepeats, test.MassSpread);
|
||||||
IOperation readStopMassOp = scale.ReadStableMassOp(ref StartMass, test.TimeStop2Mass, test.MassMethod, test.MassRepeats, test.MassSpread);
|
IOperation readStopMassOp = scale.ReadStableMassOp(ref StartMass, test.TimeStop2Mass, test.MassMethod, test.MassRepeats, test.MassSpread);
|
||||||
IOperation readEndMassOp = scale.ReadStableMassOp(ref EndMass, test.TimeStop2Mass, test.MassMethod, test.MassRepeats, test.MassSpread);
|
IOperation readEndMassOp = scale.ReadStableMassOp(ref EndMass, test.TimeStop2Mass, test.MassMethod, test.MassRepeats, test.MassSpread);
|
||||||
@ -568,7 +570,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
triggerValve = roi.GetValve();
|
triggerValve = roi.GetValve();
|
||||||
if (triggerValve != null && !triggerSend)
|
if (triggerValve != null && !triggerSend)
|
||||||
{
|
{
|
||||||
OpenValveGrabImage(cBrd,testInProgress, triggerValve, e,
|
OpenValveGrabImage(cBrd, testInProgress, triggerValve, e,
|
||||||
string.Format("{0}({1}) : Grabbing images - valve open", test.Method, test.Name));
|
string.Format("{0}({1}) : Grabbing images - valve open", test.Method, test.Name));
|
||||||
triggerSend = true;
|
triggerSend = true;
|
||||||
}
|
}
|
||||||
@ -591,18 +593,18 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
|
||||||
|
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; break; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; break; }
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; break; }
|
||||||
}
|
}
|
||||||
while (e.Contains(Event.CameraBusy));
|
while (e.Contains(Event.CameraBusy));
|
||||||
|
|
||||||
(dataEntryCmpnt as GenericDevices.IDataEntryForCamera).StartImages = startImages;
|
(dataEntryCmpnt as GenericDevices.IDataEntryForCamera).StartImages = startImages;
|
||||||
}
|
}
|
||||||
|
|
||||||
///valve trigger camera close
|
///valve trigger camera close
|
||||||
if (triggerValve != null)
|
if (triggerValve != null)
|
||||||
{
|
{
|
||||||
CloseValveGrabImage(cBrd,testInProgress,triggerValve, e,
|
CloseValveGrabImage(cBrd, testInProgress, triggerValve, e,
|
||||||
string.Format("{0}({1}) : Grabbing images - valve close", test.Method, test.Name));
|
string.Format("{0}({1}) : Grabbing images - valve close", test.Method, test.Name));
|
||||||
}
|
}
|
||||||
///////
|
///////
|
||||||
@ -628,7 +630,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
}
|
}
|
||||||
while (!e.Contains(Event.ModelessFormClosed) || !e.Contains(Event.ScaleDone));
|
while (!e.Contains(Event.ModelessFormClosed) || !e.Contains(Event.ScaleDone));
|
||||||
long readEndTime = StateMachine.Time;
|
long readEndTime = StateMachine.Time;
|
||||||
|
|
||||||
log.Debug("Read poseidon - took:" + (readEndTime - readStartTime));
|
log.Debug("Read poseidon - took:" + (readEndTime - readStartTime));
|
||||||
|
|
||||||
if (heatMetersTestParams != null)
|
if (heatMetersTestParams != null)
|
||||||
@ -670,7 +672,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
{
|
{
|
||||||
(rr as Rig.Network.Camera.RoiForFixedStartKeyence.Roi).BeginWMState =
|
(rr as Rig.Network.Camera.RoiForFixedStartKeyence.Roi).BeginWMState =
|
||||||
dataEntryCmpnt.WMStartState(i);
|
dataEntryCmpnt.WMStartState(i);
|
||||||
log.DebugFormat(" StandingStartMassCollectionSeq.cs - BeginWMState [{0}] -> RoiForFixedStartKeyence.Roi",dataEntryCmpnt.WMStartState(i));
|
log.DebugFormat(" StandingStartMassCollectionSeq.cs - BeginWMState [{0}] -> RoiForFixedStartKeyence.Roi", dataEntryCmpnt.WMStartState(i));
|
||||||
}
|
}
|
||||||
if (rr is Rig.Network.Camera.RoiForFixedStartCJMS11.Roi)
|
if (rr is Rig.Network.Camera.RoiForFixedStartCJMS11.Roi)
|
||||||
(rr as Rig.Network.Camera.RoiForFixedStartCJMS11.Roi).BeginWMState = dataEntryCmpnt.WMStartState(i);
|
(rr as Rig.Network.Camera.RoiForFixedStartCJMS11.Roi).BeginWMState = dataEntryCmpnt.WMStartState(i);
|
||||||
@ -696,7 +698,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
string destFName = string.IsNullOrEmpty((dataEntryCmpnt as IDataEntryForCamera).TestStartImgName(i, testName))
|
string destFName = string.IsNullOrEmpty((dataEntryCmpnt as IDataEntryForCamera).TestStartImgName(i, testName))
|
||||||
? fileName : (dataEntryCmpnt as IDataEntryForCamera).TestStartImgName(i, testName);
|
? fileName : (dataEntryCmpnt as IDataEntryForCamera).TestStartImgName(i, testName);
|
||||||
File.Copy(Path.Combine(srcDir, fileName), Path.Combine(destDir, destFName), true);
|
File.Copy(Path.Combine(srcDir, fileName), Path.Combine(destDir, destFName), true);
|
||||||
log.DebugFormat("Save images sourceFile: {0}, destFile: {1} ",Path.Combine(srcDir, fileName), Path.Combine(destDir, destFName));
|
log.DebugFormat("Save images sourceFile: {0}, destFile: {1} ", Path.Combine(srcDir, fileName), Path.Combine(destDir, destFName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
@ -734,7 +736,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
.AddOperation(testInProgress)//...nevhodne prepina diverter
|
.AddOperation(testInProgress)//...nevhodne prepina diverter
|
||||||
//.AddOperation(readStartMassOp)
|
//.AddOperation(readStartMassOp)
|
||||||
.AddOperation(scale.ReadStableMassOp(ref StartMass, test.TimeFlow2Mass, test.MassMethod, test.MassRepeats, test.MassSpread))
|
.AddOperation(scale.ReadStableMassOp(ref StartMass, test.TimeFlow2Mass, test.MassMethod, test.MassRepeats, test.MassSpread))
|
||||||
.AddOperation(processDataLoggingOp)
|
.AddOperation(processDataLoggingOp)
|
||||||
.EnterState();
|
.EnterState();
|
||||||
@ -775,7 +777,9 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
|
StartNewStatistics(outPath.FlowMeter, BatchRslts.Batch.BatchNr, test, repetitionNr, Math.Max((int)(test.TestTime / 10), 5));
|
||||||
|
|
||||||
int initialPulsesCount = RefPulses;
|
int initialPulsesCount = RefPulses;
|
||||||
|
int finalPulsesCount = 0;
|
||||||
|
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSMC: Start the test, open the start/stop valve"));
|
||||||
State.Create(string.Format("{0}({1}) : Start the test, open the start/stop valve", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Start the test, open the start/stop valve", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
@ -787,14 +791,17 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
do {
|
do {
|
||||||
e = StateMachine.WaitRunDevsRunOps();
|
e = StateMachine.WaitRunDevsRunOps();
|
||||||
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
||||||
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
||||||
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; }
|
||||||
|
|
||||||
/// Update statistics
|
/// Update statistics
|
||||||
RefFrequency.Val = cBrd.RefFrequency;
|
RefFrequency.Val = cBrd.RefFrequency;
|
||||||
RefFlow.Val = outPath.FlowMeter.ReadFlow();
|
RefFlow.Val = outPath.FlowMeter.ReadFlow();
|
||||||
UpdateAllStatistics();
|
UpdateAllStatistics();
|
||||||
|
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSMC: finalPulsesCount = {0}", finalPulsesCount));
|
||||||
|
|
||||||
|
|
||||||
#region Heat meters
|
#region Heat meters
|
||||||
|
|
||||||
if (heatMetersTestParams != null)
|
if (heatMetersTestParams != null)
|
||||||
@ -820,9 +827,13 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
|
Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Progress.Test));
|
||||||
|
|
||||||
|
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSMC: e.Contains(Event.TestCompleted) = {0}", e.Contains(Event.TestCompleted)));
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSMC: e.Contains(Event.Next) = {0}", e.Contains(Event.Next)));
|
||||||
}
|
}
|
||||||
while ((cBrd.DebugLevel==DebugMode.Simulate && !e.Contains(Event.FlowReached)) ||
|
while ((cBrd.DebugLevel == DebugMode.Simulate && !e.Contains(Event.FlowReached)) ||
|
||||||
(cBrd.DebugLevel!=DebugMode.Simulate && cBrd.RefPulses < initialPulsesCount + totalPulses && !e.Contains(Event.TestCompleted) && !e.Contains(Event.Next)));
|
(cBrd.DebugLevel != DebugMode.Simulate && (/*&& cBrd.RefPulses < initialPulsesCount + totalPulses*/ !e.Contains(Event.TestCompleted)) && !e.Contains(Event.Next)));
|
||||||
|
|
||||||
/// Measurement loop end
|
/// Measurement loop end
|
||||||
log.WarnFormat("Start valve switch time on test start = {0} ms", cBrd.ValveOpenCloseTime);
|
log.WarnFormat("Start valve switch time on test start = {0} ms", cBrd.ValveOpenCloseTime);
|
||||||
@ -830,6 +841,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
EndTime = (double)StateMachine.Time;
|
EndTime = (double)StateMachine.Time;
|
||||||
TestEndTime = DateTime.Now;
|
TestEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSMC: Closing the start/stop valve at the end of the standing start/stop test"));
|
||||||
State.Create(string.Format("{0}({1}) : Closing the start/stop valve at the end of the standing start/stop test", test.Method, test.Name))
|
State.Create(string.Format("{0}({1}) : Closing the start/stop valve at the end of the standing start/stop test", test.Method, test.Name))
|
||||||
.AddOperation(checkUiOp)
|
.AddOperation(checkUiOp)
|
||||||
.AddOperations(readTempPressOps)
|
.AddOperations(readTempPressOps)
|
||||||
@ -840,6 +852,7 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
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; }
|
||||||
|
finalPulsesCount = cBrd.RefPulses;
|
||||||
}
|
}
|
||||||
while (e.Contains(Event.ValvesBusy));
|
while (e.Contains(Event.ValvesBusy));
|
||||||
|
|
||||||
@ -1126,12 +1139,14 @@ namespace TBF.Rig.TestMethods.StandingStartMassCollection
|
|||||||
|
|
||||||
/// Raw data
|
/// Raw data
|
||||||
UpdateTempPressDensAmb(tstRslt);
|
UpdateTempPressDensAmb(tstRslt);
|
||||||
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
|
tstRslt.MethodClass = TbfComponents.FindComponent(test.Method).ClassName;
|
||||||
tstRslt.StartTime = TestStartTime;
|
tstRslt.StartTime = TestStartTime;
|
||||||
tstRslt.EndTime = TestEndTime;
|
tstRslt.EndTime = TestEndTime;
|
||||||
tstRslt.FlowSetTime = flowSetTime;
|
tstRslt.FlowSetTime = flowSetTime;
|
||||||
tstRslt.TestTime = Math.Max(1.0, DateTimeBox.DurationSec(timeStampStart, timeStampEnd)); /// Min. 1s to prevent division by zero
|
tstRslt.TestTime = Math.Max(1.0, DateTimeBox.DurationSec(timeStampStart, timeStampEnd)); /// Min. 1s to prevent division by zero
|
||||||
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
|
tstRslt.PulsesMaster = Convert.ToDouble(finalPulsesCount);// Convert.ToDouble(cBrd.RefPulses);
|
||||||
|
LiveLogCache.Instance.AddLog(String.Format("SSMC: tstRslt.PulsesMaster = {0}", tstRslt.PulsesMaster));
|
||||||
|
/// Pulses of the master flow meter (test total)
|
||||||
tstRslt.MassStartRaw = StartMass.Val;
|
tstRslt.MassStartRaw = StartMass.Val;
|
||||||
tstRslt.MassEndRaw = EndMass.Val;
|
tstRslt.MassEndRaw = EndMass.Val;
|
||||||
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
|
tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1;
|
||||||
|
|||||||
@ -739,7 +739,7 @@
|
|||||||
<value>processTabPageCtrl</value>
|
<value>processTabPageCtrl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>processTabPageCtrl.Type" xml:space="preserve">
|
<data name=">>processTabPageCtrl.Type" xml:space="preserve">
|
||||||
<value>TBF.UI.Process.ProcessTabPageCtrl, TBF, Version=3.9.3001.1, Culture=neutral, PublicKeyToken=null</value>
|
<value>TBF.UI.Process.ProcessTabPageCtrl, TBF, Version=3.9.3134.107, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>processTabPageCtrl.Parent" xml:space="preserve">
|
<data name=">>processTabPageCtrl.Parent" xml:space="preserve">
|
||||||
<value>processTabPage</value>
|
<value>processTabPage</value>
|
||||||
@ -817,7 +817,7 @@
|
|||||||
<value>resultsTabPageCtrl</value>
|
<value>resultsTabPageCtrl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>resultsTabPageCtrl.Type" xml:space="preserve">
|
<data name=">>resultsTabPageCtrl.Type" xml:space="preserve">
|
||||||
<value>TBF.UI.ResultsMI.ResultsTabPageCtrl, TBF, Version=3.9.3001.1, Culture=neutral, PublicKeyToken=null</value>
|
<value>TBF.UI.ResultsMI.ResultsTabPageCtrl, TBF, Version=3.9.3134.107, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>resultsTabPageCtrl.Parent" xml:space="preserve">
|
<data name=">>resultsTabPageCtrl.Parent" xml:space="preserve">
|
||||||
<value>resultsTabPage</value>
|
<value>resultsTabPage</value>
|
||||||
@ -871,7 +871,7 @@
|
|||||||
<value>graphsTabPageCtrl</value>
|
<value>graphsTabPageCtrl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>graphsTabPageCtrl.Type" xml:space="preserve">
|
<data name=">>graphsTabPageCtrl.Type" xml:space="preserve">
|
||||||
<value>TBF.UI.Graphs.GraphsTabPageCtrl, TBF, Version=3.9.3001.1, Culture=neutral, PublicKeyToken=null</value>
|
<value>TBF.UI.Graphs.GraphsTabPageCtrl, TBF, Version=3.9.3134.107, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>graphsTabPageCtrl.Parent" xml:space="preserve">
|
<data name=">>graphsTabPageCtrl.Parent" xml:space="preserve">
|
||||||
<value>graphsTabPage</value>
|
<value>graphsTabPage</value>
|
||||||
@ -925,7 +925,7 @@
|
|||||||
<value>eventLogsTabPageCtrl</value>
|
<value>eventLogsTabPageCtrl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>eventLogsTabPageCtrl.Type" xml:space="preserve">
|
<data name=">>eventLogsTabPageCtrl.Type" xml:space="preserve">
|
||||||
<value>TBF.UI.EventLogs.EventLogsTabPageCtrl, TBF, Version=3.9.3001.1, Culture=neutral, PublicKeyToken=null</value>
|
<value>TBF.UI.EventLogs.EventLogsTabPageCtrl, TBF, Version=3.9.3134.107, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>eventLogsTabPageCtrl.Parent" xml:space="preserve">
|
<data name=">>eventLogsTabPageCtrl.Parent" xml:space="preserve">
|
||||||
<value>eventLogsTabPage</value>
|
<value>eventLogsTabPage</value>
|
||||||
@ -979,7 +979,7 @@
|
|||||||
<value>calendarTabPageCtrl</value>
|
<value>calendarTabPageCtrl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>calendarTabPageCtrl.Type" xml:space="preserve">
|
<data name=">>calendarTabPageCtrl.Type" xml:space="preserve">
|
||||||
<value>TBF.UI.Calendar.CalendarTabPageCtrl, TBF, Version=3.9.3001.1, Culture=neutral, PublicKeyToken=null</value>
|
<value>TBF.UI.Calendar.CalendarTabPageCtrl, TBF, Version=3.9.3134.107, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>calendarTabPageCtrl.Parent" xml:space="preserve">
|
<data name=">>calendarTabPageCtrl.Parent" xml:space="preserve">
|
||||||
<value>calendarTabPage</value>
|
<value>calendarTabPage</value>
|
||||||
@ -1033,7 +1033,7 @@
|
|||||||
<value>picturesTabPageCtrl</value>
|
<value>picturesTabPageCtrl</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>picturesTabPageCtrl.Type" xml:space="preserve">
|
<data name=">>picturesTabPageCtrl.Type" xml:space="preserve">
|
||||||
<value>TBF.UI.Camera.PicturesTabPageCtrl, TBF, Version=3.9.3001.1, Culture=neutral, PublicKeyToken=null</value>
|
<value>TBF.UI.Camera.PicturesTabPageCtrl, TBF, Version=3.9.3134.107, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>picturesTabPageCtrl.Parent" xml:space="preserve">
|
<data name=">>picturesTabPageCtrl.Parent" xml:space="preserve">
|
||||||
<value>picturesTabPage</value>
|
<value>picturesTabPage</value>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user