2015-01-28 17:17:50 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using log4net;
|
|
|
|
|
|
using TBF.BenchControl;
|
|
|
|
|
|
using TBF.Boxes;
|
|
|
|
|
|
using TBF.Resources;
|
|
|
|
|
|
using TBF.UiBridge;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TBF.BenchControl.TestMethods.Adjustment
|
|
|
|
|
|
{
|
2015-01-28 18:33:02 +00:00
|
|
|
|
public class AdjustmentSeq : Sequences.SequenceBase
|
2015-01-28 17:17:50 +00:00
|
|
|
|
{
|
2015-01-28 18:33:02 +00:00
|
|
|
|
private static readonly ILog log = LogManager.GetLogger(typeof(AdjustmentSeq));
|
|
|
|
|
|
|
|
|
|
|
|
System.Windows.Forms.Form modelessDlg;
|
|
|
|
|
|
///
|
|
|
|
|
|
delegate void ErrorsFormDlgt(AdjustmentSeq myRef);
|
|
|
|
|
|
///
|
|
|
|
|
|
void OpenWMErrorsForm(AdjustmentSeq myRef)
|
|
|
|
|
|
{
|
|
|
|
|
|
myRef.modelessDlg = new WMErrorsForm(Program.WMsCount);
|
|
|
|
|
|
modelessDlg.Show();
|
|
|
|
|
|
}
|
2015-01-28 17:17:50 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Flying start mass collection method sequence
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="test">Test entity</param>
|
|
|
|
|
|
/// <returns>
|
|
|
|
|
|
/// Event.Done . . . . . . . OK
|
|
|
|
|
|
/// Event.UiCmdStop . . . . Stopped by the user using the on-screen button STOP
|
|
|
|
|
|
/// Event.OpArgumentError . Target flow is out of range
|
|
|
|
|
|
/// Event.Error . . . . . . Unspecified error
|
|
|
|
|
|
/// </returns>
|
|
|
|
|
|
public IList<Event> Execute(Entities.Test test)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
|
|
|
|
|
|
|
|
|
|
|
IList<Event> e = new List<Event>(); /// Events from currently running operations
|
|
|
|
|
|
Event retVal = Event.Done;
|
|
|
|
|
|
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
|
|
|
|
|
|
|
|
|
|
|
|
ltrPerRefPulse = outPath.FlowMeter.LtrPerPulse; /// [ltr/pulse], nominal flow in [m3/h]
|
|
|
|
|
|
|
|
|
|
|
|
/// Notes:
|
|
|
|
|
|
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
|
|
|
|
|
/// float timeSec = 3600.0f * timeHr;
|
|
|
|
|
|
/// int refPulses = (int)(timeSec * (2000.0f * targetFlow / pOut.FlowMeter.NominalFlow));
|
|
|
|
|
|
int totalPulses = (int)(test.Volume / ltrPerRefPulse + 0.5f);
|
|
|
|
|
|
|
|
|
|
|
|
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this);
|
|
|
|
|
|
|
|
|
|
|
|
int repetitionNr = 1; /// First test: repetitionNr=1
|
|
|
|
|
|
|
|
|
|
|
|
//====================================
|
|
|
|
|
|
// Transition or SetRoute - Start
|
|
|
|
|
|
//====================================
|
|
|
|
|
|
switch (Transition(transitionStart, TransitionContext.TestStart))
|
|
|
|
|
|
{
|
|
|
|
|
|
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
|
|
|
|
|
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Start the test, initialize test results
|
|
|
|
|
|
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, totalPulses));
|
|
|
|
|
|
Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single);
|
2015-02-01 15:20:27 +00:00
|
|
|
|
tstRslt.DoNotEvaluate = true;
|
|
|
|
|
|
tstRslt.DoNotPublish = true;
|
2015-01-28 17:17:50 +00:00
|
|
|
|
|
|
|
|
|
|
int flowSetTime0 = StateMachine.Time;
|
|
|
|
|
|
float estFlowSetTime = 10.0f;
|
|
|
|
|
|
|
2015-02-01 18:30:00 +00:00
|
|
|
|
//------------------------------------------------
|
|
|
|
|
|
Bridge.OnActivity(this, Strings.Setting_the_flow);
|
|
|
|
|
|
//------------------------------------------------
|
2015-01-28 17:17:50 +00:00
|
|
|
|
if (inPath.Pump is GenericDevices.IPumpFM) (inPath.Pump as GenericDevices.IPumpFM).TurnOn(test.PumpPower);
|
2015-02-01 18:30:00 +00:00
|
|
|
|
|
2015-01-28 17:17:50 +00:00
|
|
|
|
State.Create("Adjustment : Starting the pump")
|
2015-02-01 18:30:00 +00:00
|
|
|
|
.AddOperation(checkUiOp)
|
|
|
|
|
|
.AddOperation(new Operations.TimerOp(5))
|
|
|
|
|
|
.EnterState();
|
|
|
|
|
|
do
|
|
|
|
|
|
{
|
|
|
|
|
|
e = StateMachine.WaitRunDevsRunOps();
|
|
|
|
|
|
|
|
|
|
|
|
int flowSetTime = StateMachine.Time - flowSetTime0;
|
|
|
|
|
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
|
|
|
|
|
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
|
|
|
|
|
|
|
|
|
|
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
|
|
|
|
}
|
|
|
|
|
|
while (!e.Contains(Event.TimerExpired));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
State.Create("Adjustment : Starting the pump")
|
|
|
|
|
|
.AddOperation(checkUiOp)
|
2015-01-28 17:17:50 +00:00
|
|
|
|
.AddOperation(cBrd.SetValvesOp(inPath.Pump, null))
|
2015-02-01 18:30:00 +00:00
|
|
|
|
.EnterState();
|
|
|
|
|
|
do
|
|
|
|
|
|
{
|
|
|
|
|
|
e = StateMachine.WaitRunDevsRunOps();
|
2015-01-28 17:17:50 +00:00
|
|
|
|
|
2015-02-01 18:30:00 +00:00
|
|
|
|
int flowSetTime = StateMachine.Time - flowSetTime0;
|
2015-01-28 17:17:50 +00:00
|
|
|
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
2015-02-01 18:30:00 +00:00
|
|
|
|
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
2015-01-28 17:17:50 +00:00
|
|
|
|
|
|
|
|
|
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
2015-02-01 18:30:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
while (!e.Contains(Event.ValvesSet));
|
2015-01-28 17:17:50 +00:00
|
|
|
|
|
|
|
|
|
|
//--------------------------------
|
|
|
|
|
|
State.Create("Adjustment : Setting the flow")
|
|
|
|
|
|
.AddOperation(checkUiOp)
|
|
|
|
|
|
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, outPath.PidCoef, refFlow, 600)) /// timeout = 10 min.
|
|
|
|
|
|
.EnterState();
|
|
|
|
|
|
do
|
|
|
|
|
|
{
|
|
|
|
|
|
e = StateMachine.WaitRunDevsRunOps();
|
|
|
|
|
|
|
|
|
|
|
|
int flowSetTime = StateMachine.Time - flowSetTime0;
|
|
|
|
|
|
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
|
|
|
|
|
|
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, false, cBrd, flowSetTime, progress));
|
|
|
|
|
|
|
|
|
|
|
|
if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; }
|
|
|
|
|
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
|
|
|
|
if (e.Contains(Event.RegulValveTimeOut))
|
|
|
|
|
|
{
|
|
|
|
|
|
Bridge.OnError(this, Strings.Timeout);
|
|
|
|
|
|
retVal = Event.Done;
|
|
|
|
|
|
goto stopTest;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (e.Contains(Event.Next)) goto flow_set;
|
|
|
|
|
|
}
|
|
|
|
|
|
while (!e.Contains(Event.FlowReached));
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Show the modeless dialog with error indication
|
|
|
|
|
|
///
|
2015-01-28 18:33:02 +00:00
|
|
|
|
Program.MainWnd.Invoke(new ErrorsFormDlgt(OpenWMErrorsForm), this);
|
2015-01-28 17:17:50 +00:00
|
|
|
|
|
|
|
|
|
|
flow_set:
|
|
|
|
|
|
loop:
|
|
|
|
|
|
int time = StateMachine.Time;
|
|
|
|
|
|
float currentFlow = refFlow.Val;
|
|
|
|
|
|
|
|
|
|
|
|
/// Extract cameras from the current sensors path, add operations to the detection state
|
|
|
|
|
|
IList<IOperation> measureOperations = new List<IOperation>();
|
|
|
|
|
|
for (int i = 0; i < sensPath.RegisterReaders.Length; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
GenericDevices.ICameraRoi cameraRoi = sensPath.RegisterReaders[i] as GenericDevices.ICameraRoi;
|
|
|
|
|
|
if (cameraRoi != null) measureOperations.Add(cameraRoi.MeasureOp());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tstRslt.TimeStart = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------
|
|
|
|
|
|
Bridge.OnActivity(this, Strings.Test_in_progress);
|
|
|
|
|
|
//------------------------------------------------
|
|
|
|
|
|
State.Create("Adjustment : Starting the test")
|
|
|
|
|
|
.AddOperation(checkUiOp)
|
|
|
|
|
|
.AddOperations(measureOperations)
|
|
|
|
|
|
.AddOperation(cBrd.StartMeasurementOp(outPath.FlowMeter, totalPulses, Elde.TestMethods.Synchro, (float)test.TolerRed))
|
|
|
|
|
|
.EnterState();
|
|
|
|
|
|
do
|
|
|
|
|
|
{
|
|
|
|
|
|
e = StateMachine.WaitRunDevsRunOps();
|
|
|
|
|
|
if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; }
|
|
|
|
|
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
|
|
|
|
}
|
|
|
|
|
|
while (!e.Contains(Event.MeasurementStarted));
|
|
|
|
|
|
|
|
|
|
|
|
/// Measurement loop - preparation
|
|
|
|
|
|
readRegisters1 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
|
|
|
|
|
readRegisters2 = new Operations.ReadMoreRegistersOp(sensPath.RegisterReaders, ref WMPulses, ref WMRefPulses);
|
|
|
|
|
|
queryEnd1 = cBrd.QueryMeasurementEndOp();
|
|
|
|
|
|
queryEnd2 = cBrd.QueryMeasurementEndOp();
|
|
|
|
|
|
|
|
|
|
|
|
bool firstTime = true; /// To reset sums for averaging
|
|
|
|
|
|
ResetAveragedData();
|
|
|
|
|
|
|
|
|
|
|
|
/// Measurement loop - begin
|
|
|
|
|
|
while (true)
|
|
|
|
|
|
{
|
|
|
|
|
|
//--------------------------------
|
|
|
|
|
|
switch (ReadRegistersTempPressAmbient(measureOperations, true))
|
|
|
|
|
|
{
|
|
|
|
|
|
case Event.Error: { retVal = Event.Error; goto stopTest; }
|
|
|
|
|
|
case Event.UiCmdStop: { retVal = Event.UiCmdStop; goto stopTest; }
|
|
|
|
|
|
case Event.MeasurementCompleted: goto one_test_completed;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (firstTime)
|
|
|
|
|
|
{
|
|
|
|
|
|
firstTime = false; /// Do the following only once
|
|
|
|
|
|
tstRslt.TempInStart = tempIn.Val;
|
|
|
|
|
|
tstRslt.TempOutStart = tempOut.Val;
|
|
|
|
|
|
tstRslt.TempDivStart = tempDiv.Val;
|
|
|
|
|
|
tstRslt.PressInStart = pressIn.Val;
|
|
|
|
|
|
tstRslt.PressOutStart = pressOut.Val;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tstRslt.TempInEnd = tempIn.Val;
|
|
|
|
|
|
tstRslt.TempOutEnd = tempOut.Val;
|
|
|
|
|
|
tstRslt.TempDivEnd = tempDiv.Val;
|
|
|
|
|
|
tstRslt.PressInEnd = pressIn.Val;
|
|
|
|
|
|
tstRslt.PressOutEnd = pressOut.Val;
|
|
|
|
|
|
tstRslt.MassEndRaw = mass.Val;
|
|
|
|
|
|
|
|
|
|
|
|
AccumulateAveragedData();
|
|
|
|
|
|
|
|
|
|
|
|
refFreq.Val = cBrd.ReferenceFreq;
|
|
|
|
|
|
refFlow.Val = cBrd.ReferenceFlow;
|
|
|
|
|
|
tstRslt.AmbientTempAve = airTemperature.Val;
|
|
|
|
|
|
tstRslt.AmbientPressAve = airPressure.Val;
|
|
|
|
|
|
tstRslt.AmbientHumiAve = airHumidity.Val;
|
|
|
|
|
|
|
|
|
|
|
|
string logstr = string.Format("E={0} f={1} q={2}", cBrd.EtPulses(0), cBrd.ReferenceFreq,
|
|
|
|
|
|
cBrd.ReferenceFlow * outPath.FlowMeter.NominalFlow);
|
|
|
|
|
|
for (int i = 0; i < Program.WMsCount; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
logstr += string.Format(" M{0}=({1},{2})", i + 1, WMRefPulses[i], WMPulses[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
log.Debug(logstr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float progress = Formulas.TestProgress(cBrd.EtPulses(0), totalPulses, estFlowSetTime, test.TstTime);
|
|
|
|
|
|
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, true, cBrd, cBrd.TTime, progress));
|
|
|
|
|
|
}
|
|
|
|
|
|
/// Measurement loop - end
|
|
|
|
|
|
|
|
|
|
|
|
one_test_completed:
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------
|
|
|
|
|
|
Bridge.OnActivity(this, Strings.Adjustment_in_progress);
|
|
|
|
|
|
//------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
/// Make sure the CycleBeginForm is closed so that water meter data (s/n) can be copied into results
|
|
|
|
|
|
if (cycleBeginFormOpened)
|
|
|
|
|
|
{
|
|
|
|
|
|
cycleBeginFormOpened = false;
|
|
|
|
|
|
if (CloseCycleBeginForm()) goto stopTest;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Populate TestResult data entity with data
|
|
|
|
|
|
///
|
|
|
|
|
|
UpdateTestRsltWithAveragedData(tstRslt);
|
2015-02-02 17:09:05 +00:00
|
|
|
|
|
|
|
|
|
|
tstRslt.TimeEnd = DateTime.Now;
|
|
|
|
|
|
tstRslt.BatchNr = Program.LocalSettings.BatchNr;
|
2015-01-28 17:17:50 +00:00
|
|
|
|
tstRslt.MassStart = 0;
|
|
|
|
|
|
tstRslt.MassEnd = 0;
|
|
|
|
|
|
tstRslt.MassDiff = 0;
|
|
|
|
|
|
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
|
|
|
|
|
|
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
|
|
|
|
|
|
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
|
|
|
|
|
|
tstRslt.Time = cBrd.TTime; /// [s] measurement time
|
|
|
|
|
|
tstRslt.FlowMass = 0; /// [kg/h]
|
|
|
|
|
|
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
|
|
|
|
|
|
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
|
|
|
|
|
|
tstRslt.VolumeMaster = ltrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
|
|
|
|
|
|
tstRslt.ConstMaster = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume / 1000.0f); /// Convert the flow to [m3/h]
|
|
|
|
|
|
tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3]
|
|
|
|
|
|
/// Corrected master pulses per liter
|
|
|
|
|
|
tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement
|
|
|
|
|
|
tstRslt.TimeDivStart0 = 0;
|
|
|
|
|
|
tstRslt.TimeDivStart1 = 0;
|
|
|
|
|
|
tstRslt.TimeDivStart2 = 0;
|
|
|
|
|
|
tstRslt.TimeDivStart3 = 0;
|
|
|
|
|
|
tstRslt.TimeDivStart4 = 0;
|
|
|
|
|
|
tstRslt.TimeDivStart5 = 0;
|
|
|
|
|
|
tstRslt.TimeDivEnd0 = 0;
|
|
|
|
|
|
tstRslt.TimeDivEnd1 = 0;
|
|
|
|
|
|
tstRslt.TimeDivEnd2 = 0;
|
|
|
|
|
|
tstRslt.TimeDivEnd3 = 0;
|
|
|
|
|
|
tstRslt.TimeDivEnd4 = 0;
|
|
|
|
|
|
tstRslt.TimeDivEnd5 = 0;
|
2015-02-02 17:09:05 +00:00
|
|
|
|
|
2015-01-28 17:17:50 +00:00
|
|
|
|
for (int i = 0; i < Program.WMsCount; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sensPath.RegisterReaders[i] != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
tstRslt.Meters[i].SerialNr = (WaterMeters.Count > i) ? WaterMeters[i].SerialNr : string.Empty;
|
|
|
|
|
|
tstRslt.Meters[i].VolumeStart = 0; /// liter
|
|
|
|
|
|
tstRslt.Meters[i].VolumeEnd = 0; /// liter
|
|
|
|
|
|
if (sensPath.RegisterReaders[i].PulsesPerLtr <= float.Epsilon) tstRslt.Meters[i].VolumeMeter = 0;
|
|
|
|
|
|
else tstRslt.Meters[i].VolumeMeter = Convert.ToSingle(WMPulses[i]) / sensPath.RegisterReaders[i].PulsesPerLtr;
|
|
|
|
|
|
tstRslt.Meters[i].VolumeRef = tstRslt.ConstMaster * WMRefPulses[i]; /// liter
|
|
|
|
|
|
tstRslt.Meters[i].PulsesMeter = WMPulses[i];
|
|
|
|
|
|
tstRslt.Meters[i].PulsesMaster = WMRefPulses[i];
|
|
|
|
|
|
tstRslt.Meters[i].Time = cBrd.TTime;
|
|
|
|
|
|
if (WMPulses[i] > 0 && tstRslt.Meters[i].VolumeRef > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
tstRslt.Meters[i].VolumeErrorPct =
|
|
|
|
|
|
100 * (tstRslt.Meters[i].VolumeMeter - tstRslt.Meters[i].VolumeRef) / tstRslt.Meters[i].VolumeRef;
|
|
|
|
|
|
/// %
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
tstRslt.Meters[i].VolumeErrorPct = -100;
|
|
|
|
|
|
}
|
|
|
|
|
|
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// Add data - end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Update modeless dialog error information
|
|
|
|
|
|
Bridge.OnAdjustmentInProgress(this, new AdjustmentInProgressEventArgs(tstRslt));
|
|
|
|
|
|
|
|
|
|
|
|
/// Test 'Quit'
|
|
|
|
|
|
if ((modelessDlg is GenericDevices.IHasCompleted) && !(modelessDlg as GenericDevices.IHasCompleted).Completed)
|
|
|
|
|
|
{
|
|
|
|
|
|
goto loop; /// Modeless dilaog not closed, keep looping
|
|
|
|
|
|
}
|
|
|
|
|
|
modelessDlg = null; /// Modeless dialog is closed now
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
/// Add to results (after user quits the adjustment loop)
|
|
|
|
|
|
///
|
|
|
|
|
|
AddOrOverwriteResult(tstRslt);
|
|
|
|
|
|
Bridge.OnTestCompleted(this, new TestCompletedEventArgs(tstRslt));
|
|
|
|
|
|
|
|
|
|
|
|
/// Append the results to the CSV-file
|
2015-02-02 10:38:42 +00:00
|
|
|
|
allResults.Info(TestResult2CsvLine(tstRslt));
|
2015-01-28 17:17:50 +00:00
|
|
|
|
|
|
|
|
|
|
stopTest:
|
|
|
|
|
|
|
|
|
|
|
|
///----------------------///
|
|
|
|
|
|
/// Quit this sequence ///
|
|
|
|
|
|
///----------------------///
|
|
|
|
|
|
|
|
|
|
|
|
State.Create("Adjustment : Stopping diverter, gate, etc.")
|
|
|
|
|
|
.AddOperation(checkUiOp)
|
|
|
|
|
|
.AddOperation(cBrd.StopPreviousOp())
|
|
|
|
|
|
.EnterState();
|
|
|
|
|
|
do
|
|
|
|
|
|
{
|
|
|
|
|
|
e = StateMachine.WaitRunDevsRunOps();
|
|
|
|
|
|
if (e.Contains(Event.UiCmdStop)) { retVal = Event.UiCmdStop; goto stopTest; }
|
|
|
|
|
|
}
|
|
|
|
|
|
while (!e.Contains(Event.PreviousStopped));
|
|
|
|
|
|
|
|
|
|
|
|
/// Transition sequence at the end of test
|
|
|
|
|
|
/// Prevent overwriting 'retVal' in case it was set to non-default value earlier
|
|
|
|
|
|
switch (Transition(transitionStop, TransitionContext.TestEnd))
|
|
|
|
|
|
{
|
|
|
|
|
|
case Event.Error: { if (retVal == Event.Done) retVal = Event.Error; break; }
|
|
|
|
|
|
case Event.UiCmdStop: { if (retVal == Event.Done) retVal = Event.UiCmdStop; break; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Create a list with one item 'retVal' (default is Event.Done) and return it
|
|
|
|
|
|
IList<Event> retList = new List<Event>();
|
|
|
|
|
|
retList.Add(retVal);
|
|
|
|
|
|
return retList;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|