Sequences cleaned-up

This commit is contained in:
Milan Hanajik 2014-08-13 16:20:00 +02:00
parent c56848958e
commit e128784bb8
5 changed files with 890 additions and 136 deletions

View File

@ -0,0 +1,525 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.2">
<zoom_level>8</zoom_level>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>0</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.InitialState</type>
<coordinates>
<x>416</x>
<y>8</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes>i</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>48</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>'Test Start' transition sequence</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>56</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>96</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>88</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>128</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Initialize (single) test results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>136</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>176</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>184</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>224</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>272</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>232</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>264</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>304</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Make the water tank empty</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>312</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>352</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>344</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>272</x>
<y>168</y>
<w>160</w>
<h>128</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Emptying always]</panel_attributes>
<additional_attributes>144;112;24;112;24;24;136;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>408</x>
<y>216</y>
<w>176</w>
<h>160</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Enough room in tank]</panel_attributes>
<additional_attributes>24;144;160;144;160;24;32;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>384</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Set the required water flow</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>392</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>432</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Measure the 'start' mass of water</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>440</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>480</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Start the test (diverter, etc.)</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>488</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>528</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>560</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Read intermediate results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>520</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>568</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>608</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>272</x>
<y>512</y>
<w>160</w>
<h>128</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Test in progress]</panel_attributes>
<additional_attributes>144;24;24;24;24;112;136;112</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>616</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>424</x>
<y>640</y>
<w>104</w>
<h>24</h>
</coordinates>
<panel_attributes>[Test completed]</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>664</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Measure the 'end' mass of water</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>712</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Calculate and save this test results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>672</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>720</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>760</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>768</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>408</x>
<y>80</y>
<w>216</w>
<h>712</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[More repetitions to be done]</panel_attributes>
<additional_attributes>24;24;200;24;200;696;32;696</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>264</x>
<y>792</y>
<w>160</w>
<h>24</h>
</coordinates>
<panel_attributes>[All test repetitions completed]</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>816</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Stop any running tests, etc. (?)</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>864</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>'Test End' transition sequence</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>824</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>872</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.FinalState</type>
<coordinates>
<x>416</x>
<y>920</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
</diagram>

261
Doc/MainSeq.uxf Normal file
View File

@ -0,0 +1,261 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.2">
<zoom_level>10</zoom_level>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>120</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Load the default
procedure
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>40</y>
<w>50</w>
<h>100</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;80;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.InitialState</type>
<coordinates>
<x>450</x>
<y>60</y>
<w>20</w>
<h>20</h>
</coordinates>
<panel_attributes>i</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>190</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Reset valves,
pumps, etc.
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>130</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>260</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Detect cameras</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>200</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>370</x>
<y>550</y>
<w>180</w>
<h>110</h>
</coordinates>
<panel_attributes>complex
state
--
some more...
-.</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>370</x>
<y>390</y>
<w>180</w>
<h>60</h>
</coordinates>
<panel_attributes>Display prompt, enable
'Cycle' and 'Test' buttons
and wait for a selection</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>320</y>
<w>50</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;70;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>450</x>
<y>330</y>
<w>20</w>
<h>20</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>270</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>440</x>
<y>480</y>
<w>40</w>
<h>40</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>420</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>490</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>620</x>
<y>430</y>
<w>160</w>
<h>40</h>
</coordinates>
<panel_attributes>Disable 'Cycle'
and 'Test' buttons</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>620</x>
<y>360</y>
<w>160</w>
<h>40</h>
</coordinates>
<panel_attributes>Empty the tank</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>450</x>
<y>440</y>
<w>270</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>250;30;250;60;30;60</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>670</x>
<y>370</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;30;30;60</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>440</x>
<y>310</y>
<w>280</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;30;260;30;260;50</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>490</x>
<y>480</y>
<w>180</w>
<h>20</h>
</coordinates>
<panel_attributes>'Empty a tank' selected
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>290</x>
<y>520</y>
<w>160</w>
<h>20</h>
</coordinates>
<panel_attributes>'Cycle' or 'Test' selected
</panel_attributes>
<additional_attributes/>
</element>
</diagram>

View File

@ -82,8 +82,8 @@ namespace TBF.BenchControl.Sequences
if (e.Contains(Event.CameraOpFailed)) goto error; /// TODO: resolve in some other way
//--------------------------------------------------------------------------------------------
select_procedure:
//----------------------------------------------------------
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
//--------------------------------
@ -96,9 +96,9 @@ namespace TBF.BenchControl.Sequences
Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure));
/// Find purge suquences
Entities.TransitionSequence purgeBegin = null;
Entities.TransitionSequence purgeEnd = null;
///
foreach (var transition in StateMachine.TransitionSequences)
{
if (transition.Name == StateMachine.Procedure.TransitionStart) purgeBegin = transition;

View File

@ -23,19 +23,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
IList<Event> e; /// Events from currently running operations
//--------------------------------
State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.UiCmdStop)) goto stopTest;
}
while (!e.Contains(Event.PreviousStopped));
/// Notes:
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
/// float timeSec = 3600.0f * timeHr;
@ -54,7 +41,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
switch (Transition(transitionStart, "FlyingStartCollectionMethod : " + Strings.Test_start_sequence_i_n))
{
case Event.Error: goto error;
case Event.UiCmdStop: goto stopTest;
case Event.UiCmdStop: goto stopTestAndRunningWater;
}
}
else
@ -68,7 +55,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.UiCmdStop)) goto stopTest;
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
}
while (!e.Contains(Event.ValvesSet));
}
@ -80,9 +67,11 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
Entities.TestResult tstRslt = new Entities.TestResult(test, repetitionNr, Entities.MetersKind.Single);
if (!test.Emptying) /// Do not skip emptying if test.Emptying==true
if (!test.Emptying) /// If condition met skip measuring and force emptying
{
//--------------------------------
///
/// Measure the weight and skip emptying if there is enough room in the tank
///
State.Create("FlyingStartCollectionMethod : Measuring the mass of water in the tank")
.AddOperation(checkUiOp)
.AddOperation(outPath.Balance.ReadMassOp(ref mass))
@ -91,7 +80,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.UiCmdStop)) goto stopTest;
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
}
while (!e.Contains(Event.BalanceDone));
@ -102,11 +91,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
}
}
// Empty the water tank
///
/// Empty the water tank
///
switch (EmptyTheTank(outPath.EmptyTankValve, outPath.Balance))
{
case Event.Error: goto error;
case Event.UiCmdStop: goto stopTest;
case Event.UiCmdStop: goto stopTestAndRunningWater;
}
set_flow:
@ -130,7 +121,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress));
if (e.Contains(Event.UiCmdStop)) goto stopTest;
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
}
while (!e.Contains(Event.ValvesSet));
@ -147,7 +138,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
float progress = Formulas.TestProgress(flowSetTime, estFlowSetTime, test.TstTime);
Bridge.OnTestProgress(this, GetTestProgressData(test, tstRslt, cBrd, flowSetTime, progress));
if (e.Contains(Event.UiCmdStop)) goto stopTest;
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
if (e.Contains(Event.OpArgumentError))
if (e.Contains(Event.RegulValveTimeOut)) goto error;
if (e.Contains(Event.Next)) goto flow_set;
@ -178,7 +169,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.UiCmdStop)) goto stopTest;
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
}
while (!e.Contains(Event.BalanceDone));
@ -198,7 +189,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.UiCmdStop)) goto stopTest;
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
}
while (!e.Contains(Event.MeasurementStarted));
@ -218,8 +209,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
switch (ReadRegistersTempPressAmbient(measureOperations, true))
{
case Event.Error: goto error;
case Event.UiCmdStop: goto stopTest;
case Event.MeasurementCompleted: goto measurement_completed;
case Event.UiCmdStop: goto stopTestAndRunningWater;
case Event.MeasurementCompleted: goto test_completed;
}
if (firstTime)
@ -260,7 +251,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
}
/// Measurement loop - end
measurement_completed:
test_completed:
//------------------------------------------------
Bridge.OnActivity(this, Strings.Measuring_the_weight);
@ -274,86 +265,60 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (e.Contains(Event.UiCmdStop)) goto stopTest;
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
}
while (!e.Contains(Event.BalanceDone));
///
tstRslt.MassEndRaw = endMass.Val;
tstRslt.TimeEnd = DateTime.Now;
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_completed);
//------------------------------------------------
cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps
State.Create("FlyingStartCollectionMethod : Stopping the pump")
.AddOperation(checkUiOp)
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
.AddOperation(cBrd.UpdateTankWeightOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.UiCmdStop)) goto stopTest;
}
while (!e.Contains(Event.ValvesSet));
//--------------------------------
State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.UiCmdStop)) goto stopTest;
}
while (!e.Contains(Event.PreviousStopped));
//------------------------------------------------
Bridge.OnActivity(this, Strings.Test_completed);
//------------------------------------------------
///
/// Populate TestResult data entity with data
/// Populate TestResult data entity with data
///
tstRslt.TimeEnd = DateTime.Now;
tstRslt.TimeEnd = DateTime.Now;
UpdateTestRsltWithAveragedData(tstRslt);
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
tstRslt.Time = cBrd.TTime; /// [s] measurement time
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster;
/// Corrected master pulses per liter
if (tstRslt.VolumeCTV <= float.Epsilon)
{
tstRslt.ErrorMaster = 0.1f;
}
else
{
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
}
tstRslt.TimeDivStart0 = 0;
tstRslt.TimeDivStart1 = 0;
tstRslt.TimeDivStart2 = 0;
tstRslt.TimeDivStart3 = 0;
tstRslt.TimeDivStart4 = 0;
tstRslt.TimeDivStart5 = 0;
tstRslt.TimeDivEnd0 = 0;
tstRslt.TimeDivEnd1 = 0;
tstRslt.TimeDivEnd2 = 0;
tstRslt.TimeDivEnd3 = 0;
tstRslt.TimeDivEnd4 = 0;
tstRslt.TimeDivEnd5 = 0;
for (int i = 0; i < Program.WMsCount; i++)
{
if (sensPath.RegisterReaders[i] != null)
{
tstRslt.MassStart = Formulas.CorrectedValue(tstRslt.MassStartRaw, outPath.Balance.Corrections);
tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, outPath.Balance.Corrections);
tstRslt.MassDiff = tstRslt.MassEnd - tstRslt.MassStart;
tstRslt.DensityIn = Formulas.WaterDensityFromTemp(tstRslt.TempInAvrg); /// [kg/m3]
tstRslt.DensityOut = Formulas.WaterDensityFromTemp(tstRslt.TempOutAvrg); /// [kg/m3]
tstRslt.DensityDiv = Formulas.WaterDensityFromTemp(tstRslt.TempDivAvrg); /// [kg/m3]
tstRslt.Time = cBrd.TTime; /// [s] measurement time
tstRslt.FlowMass = 3600.0f * tstRslt.MassDiff / tstRslt.Time; /// [kg/h]
tstRslt.FlowVolume = 3600.0f * ltrPerRefPulse * cBrd.EtPulses(0) / tstRslt.Time; /// [l/h]
tstRslt.VolumeCTV = 1.00103f * 1000.0f * tstRslt.MassDiff / tstRslt.DensityOut; /// [l] 1000.0f is because density is in [kg/m3]
tstRslt.VolumeMaster = ltrPerRefPulse * cBrd.EtPulses(0); /// [l] volume from the master flow meter
tstRslt.PulsesMaster = cBrd.EtPulses(0); /// Pulses of the master flow meter (test total)
tstRslt.ConstMaster = ltrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster;
/// Corrected master pulses per liter
if (tstRslt.VolumeCTV <= float.Epsilon)
{
tstRslt.ErrorMaster = 0.1f;
}
else
{
tstRslt.ErrorMaster = 100 * (tstRslt.VolumeMaster - tstRslt.VolumeCTV) / tstRslt.VolumeCTV;
}
tstRslt.TimeDivStart0 = 0;
tstRslt.TimeDivStart1 = 0;
tstRslt.TimeDivStart2 = 0;
tstRslt.TimeDivStart3 = 0;
tstRslt.TimeDivStart4 = 0;
tstRslt.TimeDivStart5 = 0;
tstRslt.TimeDivEnd0 = 0;
tstRslt.TimeDivEnd1 = 0;
tstRslt.TimeDivEnd2 = 0;
tstRslt.TimeDivEnd3 = 0;
tstRslt.TimeDivEnd4 = 0;
tstRslt.TimeDivEnd5 = 0;
for (int i = 0; i < Program.WMsCount; i++)
{
if (sensPath.RegisterReaders[i] != null)
{
tstRslt.Meters[i].SerialNr = "wm" + (i + 1).ToString();
tstRslt.Meters[i].VolumeStart = 0; /// liter
tstRslt.Meters[i].VolumeEnd = 0; /// liter
@ -376,7 +341,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
tstRslt.Meters[i].Passed = (tstRslt.ErrLimLo <= tstRslt.Meters[i].VolumeErrorPct) && (tstRslt.Meters[i].VolumeErrorPct <= tstRslt.ErrLimHi);
}
}
/// Add data - end
/// Add data - end
AddOrOverwriteResult(tstRslt);
@ -385,36 +350,40 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
/// Append the results to the CSV-file
allResults.Info(TestResult2CsvLine(tstRslt, cBrd.EtPulses(0)));
FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt);
FluentCommon.SaveToDb(StateMachine.WtSession, tstRslt);
if (++repetitionNr <= test.Repeats)
{
goto loop;
}
///----------------------///
/// Quit this sequence ///
///----------------------///
/// Stop the pump
State.Create("FlyingStartCollectionMethod : Test(s) completed -> Stopping the pump")
.AddOperation(checkUiOp)
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
if (++repetitionNr <= test.Repeats)
{
goto loop;
}
while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone)));
///----------------------///
/// Quit this sequence ///
///----------------------///
//--------------------------------
State.Create("FlyingStartCollectionMethod : Stopping diverter, gate, etc.")
.AddOperation(checkUiOp)
.AddOperation(cBrd.StopPreviousOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.UiCmdStop)) goto stopTestAndRunningWater;
}
while (!e.Contains(Event.PreviousStopped));
stopTestAndRunningWater:
///--------------------------------
/// Transition or SetRoute - End
if (transitionStop != null)
{
switch (Transition(transitionStop, "FlyingStartCollectionMethod : " + Strings.Test_stop_sequence_i_n))
{
case Event.Error: goto error;
case Event.UiCmdStop: goto stopTest;
case Event.UiCmdStop: goto stopTestAndRunningWater;
}
}
else
@ -423,35 +392,34 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
.AddOperation(checkUiOp)
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
.EnterState();
do {
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
}
while (!e.Contains(Event.ValvesSet));
}
/// Create the return value - a list with one event Event.Done - and return
IList<Event> retval = new List<Event>();
retval.Add(Event.Done);
return retval;
//====================================
stopTest:
State.Create("FlyingStartCollectionMethod : User selected STOP -> Closing the valves")
///--------------------------------
/// Stop the pump
cBrd.SetFMFreq(0, 0); /// Stop FM controlled pumps
State.Create("FlyingStartCollectionMethod : Test(s) completed -> Stopping the pump")
.AddOperation(checkUiOp)
.AddOperation((inPath != null && inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
.AddOperation((inPath.Pump is GenericDevices.IPumpFM) ? (inPath.Pump as GenericDevices.IPumpFM).TurnOff() : null)
.AddOperation(cBrd.SetValvesOp(null, inPath.Pump))
.AddOperation(cBrd.UpdateTankWeightOp())
.EnterState();
do
{
e = StateMachine.WaitRunDevsRunOps();
if (e.Contains(Event.Error)) goto error;
}
while (!e.Contains(Event.ValvesSet));
while (!e.Contains(Event.ValvesSet) || ((inPath.Pump is GenericDevices.IPumpFM) && !e.Contains(Event.TurnPumpOnOffDone)));
IList<Event> retval2 = new List<Event>();
retval2.Add(Event.UiCmdStop);
return retval2;
/// Create the return value - a list with one event Event.Done - and return
IList<Event> retval = new List<Event>();
retval.Add(Event.Done);
return retval;
//====================================
error: