Dnes koncim
This commit is contained in:
parent
38a88e841b
commit
f4e7c7e88d
@ -28,60 +28,60 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.yesButton = new System.Windows.Forms.Button();
|
||||
this.noButton = new System.Windows.Forms.Button();
|
||||
this.questionLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// yesButton
|
||||
//
|
||||
this.yesButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.yesButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.yesButton.Location = new System.Drawing.Point(200, 96);
|
||||
this.yesButton.Name = "yesButton";
|
||||
this.yesButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.yesButton.TabIndex = 1;
|
||||
this.yesButton.Text = "Yes";
|
||||
this.yesButton.UseVisualStyleBackColor = true;
|
||||
this.yesButton.Click += new System.EventHandler(this.yesButton_Click);
|
||||
//
|
||||
// noButton
|
||||
//
|
||||
this.noButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.noButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.noButton.Location = new System.Drawing.Point(65, 96);
|
||||
this.noButton.Name = "noButton";
|
||||
this.noButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.noButton.TabIndex = 2;
|
||||
this.noButton.Text = "No";
|
||||
this.noButton.UseVisualStyleBackColor = true;
|
||||
this.noButton.Click += new System.EventHandler(this.noButton_Click);
|
||||
//
|
||||
// questionLabel
|
||||
//
|
||||
this.questionLabel.AutoSize = true;
|
||||
this.questionLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.questionLabel.Location = new System.Drawing.Point(34, 38);
|
||||
this.questionLabel.Name = "questionLabel";
|
||||
this.questionLabel.Size = new System.Drawing.Size(300, 23);
|
||||
this.questionLabel.TabIndex = 4;
|
||||
this.questionLabel.Text = "Fill the test bench with water?";
|
||||
//
|
||||
// AskYesNoForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Goldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(363, 201);
|
||||
this.Controls.Add(this.questionLabel);
|
||||
this.Controls.Add(this.noButton);
|
||||
this.Controls.Add(this.yesButton);
|
||||
this.Name = "AskYesNoForm";
|
||||
this.Text = "Question";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.AskYesNoForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
this.yesButton = new System.Windows.Forms.Button();
|
||||
this.noButton = new System.Windows.Forms.Button();
|
||||
this.questionLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// yesButton
|
||||
//
|
||||
this.yesButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.yesButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.yesButton.Location = new System.Drawing.Point(244, 99);
|
||||
this.yesButton.Name = "yesButton";
|
||||
this.yesButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.yesButton.TabIndex = 1;
|
||||
this.yesButton.Text = "Yes";
|
||||
this.yesButton.UseVisualStyleBackColor = true;
|
||||
this.yesButton.Click += new System.EventHandler(this.yesButton_Click);
|
||||
//
|
||||
// noButton
|
||||
//
|
||||
this.noButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.noButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.noButton.Location = new System.Drawing.Point(109, 99);
|
||||
this.noButton.Name = "noButton";
|
||||
this.noButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.noButton.TabIndex = 2;
|
||||
this.noButton.Text = "No";
|
||||
this.noButton.UseVisualStyleBackColor = true;
|
||||
this.noButton.Click += new System.EventHandler(this.noButton_Click);
|
||||
//
|
||||
// questionLabel
|
||||
//
|
||||
this.questionLabel.AutoSize = true;
|
||||
this.questionLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.questionLabel.Location = new System.Drawing.Point(34, 39);
|
||||
this.questionLabel.Name = "questionLabel";
|
||||
this.questionLabel.Size = new System.Drawing.Size(105, 23);
|
||||
this.questionLabel.TabIndex = 4;
|
||||
this.questionLabel.Text = "Question?";
|
||||
//
|
||||
// AskYesNoForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Goldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(454, 201);
|
||||
this.Controls.Add(this.questionLabel);
|
||||
this.Controls.Add(this.noButton);
|
||||
this.Controls.Add(this.yesButton);
|
||||
this.Name = "AskYesNoForm";
|
||||
this.Text = "Question";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.AskYesNoForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
||||
94
TestBenchFramework/BenchControl/Operations/MessageBoxForm.Designer.cs
generated
Normal file
94
TestBenchFramework/BenchControl/Operations/MessageBoxForm.Designer.cs
generated
Normal file
@ -0,0 +1,94 @@
|
||||
namespace TBF.BenchControl.Operations
|
||||
{
|
||||
partial class MessageBoxForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.yesButton = new System.Windows.Forms.Button();
|
||||
this.noButton = new System.Windows.Forms.Button();
|
||||
this.questionLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// yesButton
|
||||
//
|
||||
this.yesButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.yesButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.yesButton.Location = new System.Drawing.Point(244, 99);
|
||||
this.yesButton.Name = "yesButton";
|
||||
this.yesButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.yesButton.TabIndex = 1;
|
||||
this.yesButton.Text = "Yes";
|
||||
this.yesButton.UseVisualStyleBackColor = true;
|
||||
this.yesButton.Click += new System.EventHandler(this.yesButton_Click);
|
||||
//
|
||||
// noButton
|
||||
//
|
||||
this.noButton.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.noButton.ForeColor = System.Drawing.Color.Black;
|
||||
this.noButton.Location = new System.Drawing.Point(109, 99);
|
||||
this.noButton.Name = "noButton";
|
||||
this.noButton.Size = new System.Drawing.Size(98, 63);
|
||||
this.noButton.TabIndex = 2;
|
||||
this.noButton.Text = "No";
|
||||
this.noButton.UseVisualStyleBackColor = true;
|
||||
this.noButton.Click += new System.EventHandler(this.noButton_Click);
|
||||
//
|
||||
// questionLabel
|
||||
//
|
||||
this.questionLabel.AutoSize = true;
|
||||
this.questionLabel.Font = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.questionLabel.Location = new System.Drawing.Point(34, 39);
|
||||
this.questionLabel.Name = "questionLabel";
|
||||
this.questionLabel.Size = new System.Drawing.Size(105, 23);
|
||||
this.questionLabel.TabIndex = 4;
|
||||
this.questionLabel.Text = "Question?";
|
||||
//
|
||||
// MessageBoxForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Goldenrod;
|
||||
this.ClientSize = new System.Drawing.Size(454, 201);
|
||||
this.Controls.Add(this.questionLabel);
|
||||
this.Controls.Add(this.noButton);
|
||||
this.Controls.Add(this.yesButton);
|
||||
this.Name = "MessageBoxForm";
|
||||
this.Text = "Question";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.AskYesNoForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button yesButton;
|
||||
private System.Windows.Forms.Button noButton;
|
||||
private System.Windows.Forms.Label questionLabel;
|
||||
}
|
||||
}
|
||||
38
TestBenchFramework/BenchControl/Operations/MessageBoxForm.cs
Normal file
38
TestBenchFramework/BenchControl/Operations/MessageBoxForm.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Operations
|
||||
{
|
||||
public partial class MessageBoxForm : Form
|
||||
{
|
||||
public string Question;
|
||||
public bool CompletedYes;
|
||||
public bool CompletedNo;
|
||||
|
||||
public MessageBoxForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void AskYesNoForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Text = Strings.Question;
|
||||
questionLabel.Text = Strings.Fill_with_water;
|
||||
yesButton.Text = Strings.YesBtn;
|
||||
noButton.Text = Strings.NoBtn;
|
||||
}
|
||||
|
||||
private void yesButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
CompletedYes = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void noButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
CompletedNo = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
TestBenchFramework/BenchControl/Operations/MessageBoxForm.resx
Normal file
120
TestBenchFramework/BenchControl/Operations/MessageBoxForm.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
53
TestBenchFramework/BenchControl/Operations/MessageBoxOp.cs
Normal file
53
TestBenchFramework/BenchControl/Operations/MessageBoxOp.cs
Normal file
@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl;
|
||||
|
||||
namespace TBF.BenchControl.Operations
|
||||
{
|
||||
public class MessageBoxOp : IOperation
|
||||
{
|
||||
MessageBoxForm modelessDlg;
|
||||
|
||||
string question;
|
||||
|
||||
/// <returns>Reference to the operation</returns>
|
||||
public MessageBoxOp()
|
||||
{
|
||||
}
|
||||
|
||||
public MessageBoxOp(string question)
|
||||
{
|
||||
this.question = question;
|
||||
}
|
||||
|
||||
delegate void AskYesNoFormDlgt(MessageBoxOp myRef);
|
||||
///
|
||||
void OpenFormDlg(MessageBoxOp myRef)
|
||||
{
|
||||
myRef.modelessDlg = new MessageBoxForm();
|
||||
myRef.modelessDlg.Question = this.question;
|
||||
modelessDlg.Show();
|
||||
}
|
||||
|
||||
/// <summary>Start this operation</summary>
|
||||
public void Start()
|
||||
{
|
||||
Program.MainWnd.Invoke(new AskYesNoFormDlgt(OpenFormDlg), this);
|
||||
}
|
||||
|
||||
/// <summary>Run this operation</summary>
|
||||
/// <returns>Event.ResultsPrinted</returns>
|
||||
public Event Run()
|
||||
{
|
||||
if (modelessDlg.CompletedYes) return Event.Yes;
|
||||
if (modelessDlg.CompletedNo) return Event.No;
|
||||
return Event.None;
|
||||
}
|
||||
|
||||
/// <summary>Stop this operation</summary>
|
||||
public void Stop()
|
||||
{
|
||||
modelessDlg = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,38 +17,22 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
public override string ToString() { return "Sequences.MainSeq"; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the selection done in the main sequence
|
||||
/// </summary>
|
||||
public enum Selection
|
||||
|
||||
/// <summary> Constructor </summary>
|
||||
public MainSeq()
|
||||
{
|
||||
None,
|
||||
Cycle,
|
||||
Test,
|
||||
Q1,
|
||||
Q2,
|
||||
Q3,
|
||||
Stop,
|
||||
PurgeBegin,
|
||||
PurgeEnd,
|
||||
EmptyTank1,
|
||||
EmptyTank2,
|
||||
EmptyTank3,
|
||||
CloseTank1,
|
||||
CloseTank2,
|
||||
CloseTank3,
|
||||
}
|
||||
|
||||
public MainSeq()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Main sequence
|
||||
/// </summary>
|
||||
/// <param name="dummyArg"></param>
|
||||
/// <returns></returns>
|
||||
public IList<Event> Execute(Entities.Test dummyArg)
|
||||
{
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
|
||||
/// Operations running in more then one state
|
||||
IOperation checkUiOp = new CheckUIOp(true);
|
||||
checkUiOp = new CheckUIOp(true);
|
||||
|
||||
IList<Event> e;
|
||||
Selection selection;
|
||||
@ -63,7 +47,8 @@ namespace TBF.BenchControl.Sequences
|
||||
//------------------------------------------------
|
||||
State.Create("MainSeq : Setting valves to the default state")
|
||||
.AddOperation(new MettlerToledo.ReadMassesOp())
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -97,158 +82,15 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
if (e.Contains(Event.CameraOpFailed)) goto error; /// TODO: resolve in some other way
|
||||
|
||||
idle:
|
||||
|
||||
bool emptying1 = false;
|
||||
bool emptying2 = false;
|
||||
bool emptying3 = false;
|
||||
do
|
||||
{
|
||||
/// Used for emptying
|
||||
FloatBox mass1 = new FloatBox();
|
||||
FloatBox mass2 = new FloatBox();
|
||||
FloatBox mass3 = new FloatBox();
|
||||
|
||||
//---------------------------------------------------------
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
else
|
||||
Bridge.OnActivity(this, Strings.Please_select_a_procedure);
|
||||
//---------------------------------------------------------
|
||||
|
||||
/// Start something buttons are hidden when emptyign is in progress
|
||||
Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
((emptying1 || emptying2 || emptying3) ? 0 :
|
||||
(ButtonsEtc.StartCycleBtnEn | ButtonsEtc.StartTestBtnsEn |
|
||||
ButtonsEtc.PurgeBeginBtnEn | ButtonsEtc.SensitivityTestBtnEn |
|
||||
((Cameras.Count > 0) ? ButtonsEtc.CalibrationBtnEn : 0) |
|
||||
ButtonsEtc.TryOpticalHeadsBtnEn)) |
|
||||
(((StateMachine.Balance1 != null) && !emptying1) ? ButtonsEtc.EmptyTankBtn1En : 0) |
|
||||
(((StateMachine.Balance2 != null) && !emptying2) ? ButtonsEtc.EmptyTankBtn2En : 0) |
|
||||
(((StateMachine.Balance3 != null) && !emptying3) ? ButtonsEtc.EmptyTankBtn3En : 0));
|
||||
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : Select a procedure")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((StateMachine.Balance1 != null) ? StateMachine.Balance1.ReadMassOp(ref mass1) : null)
|
||||
.AddOperation((StateMachine.Balance2 != null) ? StateMachine.Balance2.ReadMassOp(ref mass2) : null)
|
||||
.AddOperation((StateMachine.Balance3 != null) ? StateMachine.Balance3.ReadMassOp(ref mass3) : null)
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
else if (e.Contains(Event.UiCmdStop)) selection = Selection.Stop;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank1)) selection = Selection.EmptyTank1;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank2)) selection = Selection.EmptyTank2;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank3)) selection = Selection.EmptyTank3;
|
||||
else if (emptying1 && (mass1.Val < (StateMachine.Balance1.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank1;
|
||||
else if (emptying2 && (mass2.Val < (StateMachine.Balance2.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank2;
|
||||
else if (emptying3 && (mass3.Val < (StateMachine.Balance3.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank3;
|
||||
else if (e.Contains(Event.UiCmdPurgeBegin)) selection = Selection.PurgeBegin;
|
||||
else if (e.Contains(Event.UiCmdStartTest)) selection = Selection.Test;
|
||||
else if (e.Contains(Event.UiCmdStartQ1)) selection = Selection.Q1;
|
||||
else if (e.Contains(Event.UiCmdStartQ2)) selection = Selection.Q2;
|
||||
else if (e.Contains(Event.UiCmdStartQ3)) selection = Selection.Q3;
|
||||
else if (e.Contains(Event.UiCmdStartCycle)) selection = Selection.Cycle;
|
||||
else if (e.Contains(Event.UiCmdCameraTest)) goto camera_test;
|
||||
}
|
||||
while (selection == Selection.None);
|
||||
|
||||
if (selection == Selection.Stop)
|
||||
{
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
{
|
||||
IList<IValve> valvesClose = new List<IValve>();
|
||||
if (emptying1) valvesClose.Add(StateMachine.EmptyTankValve1);
|
||||
if (emptying2) valvesClose.Add(StateMachine.EmptyTankValve2);
|
||||
if (emptying3) valvesClose.Add(StateMachine.EmptyTankValve3);
|
||||
|
||||
State.Create("MainSeq : Close emptying valve(s)")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, valvesClose))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = emptying2 = emptying3 = false;
|
||||
}
|
||||
selection = Selection.None;
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank1) && (emptying1 == false))
|
||||
{
|
||||
emptying1 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying2 ? 0 : ButtonsEtc.EmptyTankBtn2En));
|
||||
State.Create("MainSeq : Open tank 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve1, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank2) && (emptying2 == false))
|
||||
{
|
||||
emptying2 = true;
|
||||
Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En));
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
State.Create("MainSeq : Open tank 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve2, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank3) && (emptying3 == false))
|
||||
{
|
||||
emptying3 = true;
|
||||
Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En));
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
State.Create("MainSeq : Open tank 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve3, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if (selection == Selection.CloseTank1)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve1))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank2)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve2))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying2 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank3)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve3))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying3 = false;
|
||||
}
|
||||
}
|
||||
while ((selection != Selection.Cycle) && (selection != Selection.Test)
|
||||
&& (selection != Selection.Q1) && (selection != Selection.Q2) && (selection != Selection.Q3)
|
||||
|| emptying1 || emptying2 || emptying3);
|
||||
select_procedure:
|
||||
//----------------------------------------------------------
|
||||
selection = MakeSelection(MKSelContext.ProcedureNotSelected);
|
||||
|
||||
//--------------------------------
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
StateMachine.LoadProcedure(false);
|
||||
if (StateMachine.Procedure == null)
|
||||
{
|
||||
goto idle;
|
||||
}
|
||||
if (StateMachine.Procedure == null) goto select_procedure;
|
||||
|
||||
StateMachine.LoadProcedureParams(StateMachine.Procedure);
|
||||
ResetResults();
|
||||
Bridge.OnProcedureSelected(this, new ProcedureSelectedEventArgs(StateMachine.Procedure));
|
||||
@ -273,14 +115,14 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : Answer a question")
|
||||
.AddOperation(new Operations.AskYesNoOp())
|
||||
.AddOperation(new Operations.AskYesNoOp(Strings.Purge_bench_qm))
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.No)) goto assume_bench_filled;
|
||||
if (e.Contains(Event.UiCmdStop)) goto idle;
|
||||
if (e.Contains(Event.UiCmdStop)) goto select_procedure;
|
||||
}
|
||||
while (!e.Contains(Event.Yes));
|
||||
}
|
||||
@ -315,177 +157,48 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
if (selection != Selection.PurgeBegin)
|
||||
{
|
||||
goto cycle_or_test;
|
||||
goto cycle_or_test_selected;
|
||||
}
|
||||
|
||||
ready:
|
||||
select_cycle_or_test:
|
||||
//----------------------------------------------------------
|
||||
selection = MakeSelection(MKSelContext.InsideProcedure);
|
||||
///
|
||||
if (selection == Selection.PurgeBegin) goto fill_the_bench;
|
||||
if (selection == Selection.PurgeEnd) goto purge_end;
|
||||
if (selection == Selection.SaveResults) goto save_results;
|
||||
|
||||
emptying1 = false;
|
||||
emptying2 = false;
|
||||
emptying3 = false;
|
||||
do
|
||||
{
|
||||
/// Used for emptying
|
||||
FloatBox mass1 = new FloatBox();
|
||||
FloatBox mass2 = new FloatBox();
|
||||
FloatBox mass3 = new FloatBox();
|
||||
|
||||
//------------------------------------------------
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
else
|
||||
Bridge.OnActivity(this, Strings.Please_select_a_cycle_a_test_or_empty);
|
||||
//------------------------------------------------
|
||||
|
||||
Bridge.Bench2UI(ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
((emptying1 || emptying2 || emptying3) ? 0 :
|
||||
(ButtonsEtc.StartCycleBtnEn | ButtonsEtc.StartTestBtnsEn |
|
||||
ButtonsEtc.PurgeBeginBtnEn | ButtonsEtc.SensitivityTestBtnEn |
|
||||
((Cameras.Count > 0) ? ButtonsEtc.CalibrationBtnEn : 0) |
|
||||
ButtonsEtc.TryOpticalHeadsBtnEn)) |
|
||||
(((StateMachine.Balance1 != null) && !emptying1) ? ButtonsEtc.EmptyTankBtn1En : 0) |
|
||||
(((StateMachine.Balance2 != null) && !emptying2) ? ButtonsEtc.EmptyTankBtn2En : 0) |
|
||||
(((StateMachine.Balance3 != null) && !emptying3) ? ButtonsEtc.EmptyTankBtn3En : 0));
|
||||
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : Select an activity for the selected procedure")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((StateMachine.Balance1 != null) ? StateMachine.Balance1.ReadMassOp(ref mass1) : null)
|
||||
.AddOperation((StateMachine.Balance2 != null) ? StateMachine.Balance2.ReadMassOp(ref mass2) : null)
|
||||
.AddOperation((StateMachine.Balance3 != null) ? StateMachine.Balance3.ReadMassOp(ref mass3) : null)
|
||||
.AddOperation(cBrd.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
else if (e.Contains(Event.UiCmdStop)) selection = Selection.Stop;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank1)) selection = Selection.EmptyTank1;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank2)) selection = Selection.EmptyTank2;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank3)) selection = Selection.EmptyTank3;
|
||||
else if (emptying1 && (mass1.Val < (StateMachine.Balance1.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank1;
|
||||
else if (emptying2 && (mass2.Val < (StateMachine.Balance2.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank2;
|
||||
else if (emptying3 && (mass3.Val < (StateMachine.Balance3.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank3;
|
||||
else if (e.Contains(Event.UiCmdPurgeBegin))
|
||||
{
|
||||
selection = Selection.PurgeBegin; /// Value used to branch the code later on
|
||||
goto fill_the_bench;
|
||||
}
|
||||
else if (e.Contains(Event.UiCmdPurgeEnd)) goto purge_end;
|
||||
else if (e.Contains(Event.UiCmdStartTest)) selection = Selection.Test;
|
||||
else if (e.Contains(Event.UiCmdStartQ1)) selection = Selection.Q1;
|
||||
else if (e.Contains(Event.UiCmdStartQ2)) selection = Selection.Q2;
|
||||
else if (e.Contains(Event.UiCmdStartQ3)) selection = Selection.Q3;
|
||||
else if (e.Contains(Event.UiCmdStartCycle)) selection = Selection.Cycle;
|
||||
else if (e.Contains(Event.UiCmdAcceptResults)) goto save_results;
|
||||
}
|
||||
while (selection == Selection.None);
|
||||
|
||||
if (selection == Selection.Stop)
|
||||
{
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
{
|
||||
IList<IValve> valvesClose = new List<IValve>();
|
||||
if (emptying1) valvesClose.Add(StateMachine.EmptyTankValve1);
|
||||
if (emptying2) valvesClose.Add(StateMachine.EmptyTankValve2);
|
||||
if (emptying3) valvesClose.Add(StateMachine.EmptyTankValve3);
|
||||
|
||||
State.Create("MainSeq : Close emptying valve(s)")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, valvesClose))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = emptying2 = emptying3 = false;
|
||||
}
|
||||
selection = Selection.None;
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank1) && (emptying1 == false))
|
||||
{
|
||||
emptying1 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying2 ? 0 : ButtonsEtc.EmptyTankBtn2En));
|
||||
State.Create("MainSeq : Open emptying valve 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve1, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank2) && (emptying2 == false))
|
||||
{
|
||||
emptying2 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En));
|
||||
State.Create("MainSeq : Open emptying valve 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve2, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank3) && (emptying3 == false))
|
||||
{
|
||||
emptying3 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(ButtonsEtc.ProcedureCmbBoxEn | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En));
|
||||
State.Create("MainSeq : Open emptying valve 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve3, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if (selection == Selection.CloseTank1)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve1))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank2)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve2))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying2 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank3)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve3))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying3 = false;
|
||||
}
|
||||
}
|
||||
while ((selection != Selection.Cycle) && (selection != Selection.Test)
|
||||
&& (selection != Selection.Q1) && (selection != Selection.Q2) && (selection != Selection.Q3)
|
||||
|| emptying1 || emptying2 || emptying3);
|
||||
|
||||
cycle_or_test:
|
||||
cycle_or_test_selected:
|
||||
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn); /// Hide buttons
|
||||
|
||||
if (selection == Selection.Cycle)
|
||||
{
|
||||
TimeEstimateTotal = 0;
|
||||
foreach (var test in StateMachine.Tests) TimeEstimateTotal += (test.Repeats * (test.TstTime + 10.0f));
|
||||
foreach (var test in StateMachine.Tests)
|
||||
{
|
||||
TimeEstimateTotal += (test.Repeats * (test.TstTime + 10.0f));
|
||||
|
||||
/// Try to fetch all test paths and transitions
|
||||
/// to detect configuration errors as early as possible.
|
||||
if (!StateMachine.GetPaths(test, out inPath, out benchPath,
|
||||
out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop))
|
||||
{
|
||||
goto config_error;
|
||||
}
|
||||
}
|
||||
|
||||
TimeEstimateBeginRpts = 0;
|
||||
foreach (var test in StateMachine.Tests)
|
||||
{
|
||||
transitionStart = null;
|
||||
transitionStop = null;
|
||||
foreach (var transition in StateMachine.TransitionSequences)
|
||||
{
|
||||
if (transition.Name == test.TransitionStart) transitionStart = transition;
|
||||
if (transition.Name == test.TransitionEnd) transitionStop = transition;
|
||||
}
|
||||
/// Fetch the test paths and transitions
|
||||
if (!StateMachine.GetPaths(test, out inPath, out benchPath,
|
||||
out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop))
|
||||
{
|
||||
goto config_error;
|
||||
}
|
||||
|
||||
TimeEstimateOneTest = test.TstTime + 10.0f;
|
||||
//--------------------------------------------------------------
|
||||
@ -506,18 +219,19 @@ namespace TBF.BenchControl.Sequences
|
||||
{
|
||||
Entities.Test test = StateMachine.GetTest(selection);
|
||||
|
||||
/// Fetch the test paths and transitions
|
||||
if (!StateMachine.GetPaths(test, out inPath, out benchPath,
|
||||
out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop))
|
||||
{
|
||||
goto config_error;
|
||||
}
|
||||
|
||||
|
||||
TimeEstimateTotal = test.Repeats * (test.TstTime + 10.0f);
|
||||
TimeEstimateOneTest = test.TstTime + 10.0f;
|
||||
TimeEstimateBeginRpts = 0;
|
||||
|
||||
transitionStart = null;
|
||||
transitionStop = null;
|
||||
foreach (var transition in StateMachine.TransitionSequences)
|
||||
{
|
||||
if (transition.Name == test.TransitionStart) transitionStart = transition;
|
||||
if (transition.Name == test.TransitionEnd) transitionStop = transition;
|
||||
}
|
||||
|
||||
ISequence testMethodSequence = TbfComponents.FindComponent(test.Method) as ISequence;
|
||||
if (testMethodSequence != null)
|
||||
{
|
||||
@ -538,7 +252,7 @@ namespace TBF.BenchControl.Sequences
|
||||
Bridge.Bench2UI(ButtonsEtc.ResetResultsBtnEn);
|
||||
}
|
||||
|
||||
goto ready;
|
||||
goto select_cycle_or_test;
|
||||
|
||||
purge_end:
|
||||
save_results:
|
||||
@ -635,96 +349,14 @@ namespace TBF.BenchControl.Sequences
|
||||
benchFilled = false;
|
||||
Bridge.Bench2UI(ButtonsEtc.ShowBenchEmpty);
|
||||
|
||||
goto idle;
|
||||
|
||||
camera_test:
|
||||
|
||||
Bridge.OnActivity(this, "Camera test");
|
||||
//---------------------------------------------------------
|
||||
Bridge.Bench2UI(ButtonsEtc.StartTestBtnsEn | ButtonsEtc.StopBtnEn);
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : 1 = Grab, 2 = Live, 3 = Focus, Stop = Quit camera test")
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop))
|
||||
{
|
||||
goto idle;
|
||||
}
|
||||
if (e.Contains(Event.UiCmdStartQ1)) goto grab;
|
||||
if (e.Contains(Event.UiCmdStartQ2)) goto live;
|
||||
if (e.Contains(Event.UiCmdStartQ3)) goto focus;
|
||||
}
|
||||
while (true);
|
||||
|
||||
grab:
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : Press 'Stop' to continue")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].GrabOp() : null)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
||||
}
|
||||
while (true);
|
||||
|
||||
live:
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : Press 'Stop' to stop.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].LiveOp() : null)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
||||
}
|
||||
while (true);
|
||||
|
||||
focus:
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : Press 'Stop' to stop.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].FocusOp() : null)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
||||
}
|
||||
while (true);
|
||||
goto select_procedure;
|
||||
|
||||
stop:
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : Turning IDLE -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -733,7 +365,7 @@ namespace TBF.BenchControl.Sequences
|
||||
}
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
|
||||
goto idle;
|
||||
goto select_procedure;
|
||||
|
||||
config_error:
|
||||
//--------------------------------
|
||||
@ -745,7 +377,8 @@ namespace TBF.BenchControl.Sequences
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : ERROR -> Closing the valves")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.SetValvesOp(StateMachine.DefaultValvesOpen, StateMachine.DefaultValvesClose))
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.DefaultValvesOpen,
|
||||
StateMachine.DefaultValvesClose))
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
@ -755,8 +388,328 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
//--------------------------------
|
||||
State.Create("MainSeq : ERROR state")
|
||||
.EnterState();
|
||||
.EnterState();
|
||||
while (true) StateMachine.WaitRunDevsRunOps();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// MakeSelection() call context
|
||||
/// </summary>
|
||||
enum MKSelContext
|
||||
{
|
||||
ProcedureNotSelected,
|
||||
InsideProcedure,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection done in MakeSelection()
|
||||
/// </summary>
|
||||
public enum Selection
|
||||
{
|
||||
/// Handled inside MakeSelection()
|
||||
None,
|
||||
EmptyTank1,
|
||||
EmptyTank2,
|
||||
EmptyTank3,
|
||||
CloseTank1,
|
||||
CloseTank2,
|
||||
CloseTank3,
|
||||
CameraTest,
|
||||
|
||||
/// Used as return values
|
||||
Cycle,
|
||||
Test,
|
||||
Q1,
|
||||
Q2,
|
||||
Q3,
|
||||
Stop,
|
||||
PurgeBegin,
|
||||
PurgeEnd,
|
||||
SaveResults,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Idle loop to make a procedure or test selection.
|
||||
/// Handles tank emptying, camera test.
|
||||
/// </summary>
|
||||
/// <param name="context">Context where MakeSelection() is called</param>
|
||||
/// <returns>
|
||||
/// Selection.Cycle
|
||||
/// Selection.Test
|
||||
/// Selection.Q1
|
||||
/// Selection.Q2
|
||||
/// Selection.Q3
|
||||
/// Selection.Stop
|
||||
/// Selection.PurgeBegin
|
||||
/// Selection.PurgeEnd
|
||||
/// </returns>
|
||||
private Selection MakeSelection(MKSelContext context)
|
||||
{
|
||||
/// Tank emptying valves states
|
||||
bool emptying1 = false;
|
||||
bool emptying2 = false;
|
||||
bool emptying3 = false;
|
||||
|
||||
/// Measured masses to control emptying
|
||||
FloatBox mass1 = new FloatBox();
|
||||
FloatBox mass2 = new FloatBox();
|
||||
FloatBox mass3 = new FloatBox();
|
||||
|
||||
IList<Event> e;
|
||||
Selection selection;
|
||||
|
||||
while (true)
|
||||
{
|
||||
/// Display an appropriate activity message
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
}
|
||||
else if (context == MKSelContext.ProcedureNotSelected)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Please_select_a_procedure);
|
||||
}
|
||||
else if (context == MKSelContext.InsideProcedure)
|
||||
{
|
||||
Bridge.OnActivity(this, Strings.Please_select_a_cycle_a_test_or_empty);
|
||||
}
|
||||
|
||||
/// Enable appropriate UI controls and buttons
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn |
|
||||
ButtonsEtc.StopBtnEn |
|
||||
((emptying1 || emptying2 || emptying3) ? 0 :
|
||||
(ButtonsEtc.StartCycleBtnEn |
|
||||
ButtonsEtc.StartTestBtnsEn |
|
||||
ButtonsEtc.PurgeBeginBtnEn |
|
||||
((context == MKSelContext.InsideProcedure) ? ButtonsEtc.PurgeEndBtnEn : 0) |
|
||||
ButtonsEtc.SensitivityTestBtnEn |
|
||||
((Cameras.Count > 0) ? ButtonsEtc.CalibrationBtnEn : 0) |
|
||||
ButtonsEtc.TryOpticalHeadsBtnEn)) |
|
||||
(((StateMachine.Balance1 != null) && !emptying1) ? ButtonsEtc.EmptyTankBtn1En : 0) |
|
||||
(((StateMachine.Balance2 != null) && !emptying2) ? ButtonsEtc.EmptyTankBtn2En : 0) |
|
||||
(((StateMachine.Balance3 != null) && !emptying3) ? ButtonsEtc.EmptyTankBtn3En : 0));
|
||||
|
||||
selection = Selection.None;
|
||||
State.Create("MainSeq : Select an activity")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((StateMachine.Balance1 != null) ? StateMachine.Balance1.ReadMassOp(ref mass1) : null)
|
||||
.AddOperation((StateMachine.Balance2 != null) ? StateMachine.Balance2.ReadMassOp(ref mass2) : null)
|
||||
.AddOperation((StateMachine.Balance3 != null) ? StateMachine.Balance3.ReadMassOp(ref mass3) : null)
|
||||
.AddOperation(StateMachine.ControlBoard.UpdateTankWeightOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
else if (e.Contains(Event.UiCmdStop)) selection = Selection.Stop;
|
||||
else if (e.Contains(Event.UiCmdCameraTest)) selection = Selection.CameraTest;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank1)) selection = Selection.EmptyTank1;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank2)) selection = Selection.EmptyTank2;
|
||||
else if (e.Contains(Event.UiCmdEmptyTank3)) selection = Selection.EmptyTank3;
|
||||
else if (emptying1 && (mass1.Val < (StateMachine.Balance1.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank1;
|
||||
else if (emptying2 && (mass2.Val < (StateMachine.Balance2.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank2;
|
||||
else if (emptying3 && (mass3.Val < (StateMachine.Balance3.Capacity / 100.0f + 20.0f))) selection = Selection.CloseTank3;
|
||||
else if (e.Contains(Event.UiCmdPurgeBegin)) return Selection.PurgeBegin; /// Value used to branch the code later on
|
||||
else if (e.Contains(Event.UiCmdPurgeEnd)) return Selection.PurgeEnd;
|
||||
else if (e.Contains(Event.UiCmdStartTest)) return Selection.Test;
|
||||
else if (e.Contains(Event.UiCmdStartQ1)) return Selection.Q1;
|
||||
else if (e.Contains(Event.UiCmdStartQ2)) return Selection.Q2;
|
||||
else if (e.Contains(Event.UiCmdStartQ3)) return Selection.Q3;
|
||||
else if (e.Contains(Event.UiCmdStartCycle)) return Selection.Cycle;
|
||||
else if (e.Contains(Event.UiCmdAcceptResults)) return Selection.SaveResults;
|
||||
}
|
||||
while (selection == Selection.None);
|
||||
|
||||
if (selection == Selection.CameraTest)
|
||||
{
|
||||
CameraTest();
|
||||
}
|
||||
else if (selection == Selection.Stop)
|
||||
{
|
||||
if (emptying1 || emptying2 || emptying3)
|
||||
{
|
||||
IList<IValve> valvesClose = new List<IValve>();
|
||||
if (emptying1) valvesClose.Add(StateMachine.EmptyTankValve1);
|
||||
if (emptying2) valvesClose.Add(StateMachine.EmptyTankValve2);
|
||||
if (emptying3) valvesClose.Add(StateMachine.EmptyTankValve3);
|
||||
|
||||
State.Create("MainSeq : Close emptying valve(s)")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, valvesClose))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = emptying2 = emptying3 = false;
|
||||
}
|
||||
selection = Selection.None;
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank1) && !emptying1)
|
||||
{
|
||||
emptying1 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying2 ? 0 : ButtonsEtc.EmptyTankBtn2En) |
|
||||
(emptying3 ? 0 : ButtonsEtc.EmptyTankBtn3En));
|
||||
State.Create("MainSeq : Open tank 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve1, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank2) && !emptying2)
|
||||
{
|
||||
emptying2 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En) |
|
||||
(emptying3 ? 0 : ButtonsEtc.EmptyTankBtn3En));
|
||||
State.Create("MainSeq : Open tank 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve2, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if ((selection == Selection.EmptyTank3) && !emptying3)
|
||||
{
|
||||
emptying3 = true;
|
||||
Bridge.OnActivity(this, Strings.Emptying_tank);
|
||||
Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) |
|
||||
ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn |
|
||||
(emptying1 ? 0 : ButtonsEtc.EmptyTankBtn1En) |
|
||||
(emptying2 ? 0 : ButtonsEtc.EmptyTankBtn2En));
|
||||
State.Create("MainSeq : Open tank 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(StateMachine.EmptyTankValve3, null))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
}
|
||||
else if (selection == Selection.CloseTank1)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 1")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve1))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying1 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank2)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 2")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve2))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying2 = false;
|
||||
}
|
||||
else if (selection == Selection.CloseTank3)
|
||||
{
|
||||
State.Create("MainSeq : Close tank 3")
|
||||
.AddOperation(StateMachine.ControlBoard.SetValvesOp(null, StateMachine.EmptyTankValve3))
|
||||
.EnterState();
|
||||
do { e = StateMachine.WaitRunDevsRunOps(); }
|
||||
while (!e.Contains(Event.ValvesSet));
|
||||
emptying3 = false;
|
||||
}
|
||||
}
|
||||
|
||||
error:
|
||||
Bridge.OnActivity(this, Strings.Error);
|
||||
State.Create("MainSeq : ERROR state")
|
||||
.EnterState();
|
||||
while (true) StateMachine.WaitRunDevsRunOps();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Perform a camera test
|
||||
/// </summary>
|
||||
void CameraTest()
|
||||
{
|
||||
IList<Event> e;
|
||||
|
||||
camera_test:
|
||||
Bridge.OnActivity(this, "Camera test");
|
||||
//---------------------------------------------------------
|
||||
Bridge.Bench2UI(ButtonsEtc.StartTestBtnsEn | ButtonsEtc.StopBtnEn);
|
||||
State.Create("MainSeq : 1 = Grab, 2 = Live, 3 = Focus, Stop = Quit camera test")
|
||||
.AddOperation(checkUiOp)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop)) return;
|
||||
if (e.Contains(Event.UiCmdStartQ1)) goto grab;
|
||||
if (e.Contains(Event.UiCmdStartQ2)) goto live;
|
||||
if (e.Contains(Event.UiCmdStartQ3)) goto focus;
|
||||
}
|
||||
while (true);
|
||||
|
||||
grab:
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
State.Create("MainSeq : Press 'Stop' to continue")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].GrabOp() : null)
|
||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].GrabOp() : null)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
||||
}
|
||||
while (true);
|
||||
|
||||
live:
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
State.Create("MainSeq : Press 'Stop' to stop.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].LiveOp() : null)
|
||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].LiveOp() : null)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
||||
}
|
||||
while (true);
|
||||
|
||||
focus:
|
||||
Bridge.Bench2UI(ButtonsEtc.StopBtnEn);
|
||||
State.Create("MainSeq : Press 'Stop' to stop.")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation((Cameras.Count > 0 && Cameras[0] != null && (Cameras[0].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[0].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 1 && Cameras[1] != null && (Cameras[1].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[1].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 2 && Cameras[2] != null && (Cameras[2].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[2].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 3 && Cameras[3] != null && (Cameras[3].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[3].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 4 && Cameras[4] != null && (Cameras[4].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[4].FocusOp() : null)
|
||||
.AddOperation((Cameras.Count > 5 && Cameras[5] != null && (Cameras[5].Cfg.DebugLevel != Entities.DebugMode.DetectedOff)) ? Cameras[5].FocusOp() : null)
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
if (e.Contains(Event.Error)) goto error;
|
||||
if (e.Contains(Event.UiCmdStop)) goto camera_test;
|
||||
}
|
||||
while (true);
|
||||
|
||||
error:
|
||||
Bridge.OnActivity(this, Strings.Error);
|
||||
State.Create("MainSeq : ERROR state")
|
||||
.EnterState();
|
||||
while (true) StateMachine.WaitRunDevsRunOps();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,7 +117,6 @@ namespace TBF.BenchControl.Sequences
|
||||
protected BenchControl.BenchPath benchPath;
|
||||
protected BenchControl.OutputPath outPath;
|
||||
protected BenchControl.MetersPath sensPath;
|
||||
|
||||
protected Entities.TransitionSequence transitionStart;
|
||||
protected Entities.TransitionSequence transitionStop;
|
||||
|
||||
|
||||
@ -18,16 +18,13 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
{
|
||||
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
|
||||
|
||||
/// Operations running in more then one state
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
|
||||
//--------------------------------
|
||||
State.Create("RoiDetection : Starting the detection sequence")
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StopPreviousOp())
|
||||
.EnterState();
|
||||
.AddOperation(checkUiOp)
|
||||
.AddOperation(cBrd.StopPreviousOp())
|
||||
.EnterState();
|
||||
do
|
||||
{
|
||||
e = StateMachine.WaitRunDevsRunOps();
|
||||
@ -35,10 +32,6 @@ namespace TBF.BenchControl.TestMethods.CameraRoiDetection
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
/// Fetch the test, the paths
|
||||
bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop);
|
||||
if (!success) goto error;
|
||||
|
||||
//====================================
|
||||
/// Start the test, initialize test results
|
||||
|
||||
@ -23,9 +23,6 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
/// Specific for combined meters
|
||||
int[] lastWMPulses = new int[Program.WMsCount];
|
||||
|
||||
/// Operations running in more then one state
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
|
||||
//--------------------------------
|
||||
@ -40,10 +37,6 @@ namespace TBF.BenchControl.TestMethods.CombinedMeters
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
/// Fetch the test, the paths
|
||||
bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop);
|
||||
if (!success) goto error;
|
||||
|
||||
/// Notes:
|
||||
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
||||
|
||||
@ -24,9 +24,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
/// Specific for combined meters
|
||||
int[] lastWMPulses = new int[Program.WMsCount];
|
||||
|
||||
/// Operations running in more then one state
|
||||
checkUiOp = new Operations.CheckUIOp(true);
|
||||
|
||||
IList<Event> e; /// Events from currently running operations
|
||||
|
||||
//--------------------------------
|
||||
@ -41,10 +38,6 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
/// Fetch the test, the paths
|
||||
bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop);
|
||||
if (!success) goto error;
|
||||
|
||||
/// Notes:
|
||||
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
||||
|
||||
@ -35,10 +35,6 @@ namespace TBF.BenchControl.TestMethods.FlyingStartCollectionMethod
|
||||
}
|
||||
while (!e.Contains(Event.PreviousStopped));
|
||||
|
||||
/// Fetch the test, the paths
|
||||
bool success = StateMachine.GetPaths(test, out inPath, out benchPath, out outPath, out sensPath,
|
||||
out transitionStart, out transitionStop);
|
||||
if (!success) goto error;
|
||||
|
||||
/// Notes:
|
||||
/// float timeHr = volumeLtr / (1000.0f * targetFlow);
|
||||
|
||||
9
TestBenchFramework/Resources/Strings.Designer.cs
generated
9
TestBenchFramework/Resources/Strings.Designer.cs
generated
@ -1284,6 +1284,15 @@ namespace TBF.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Fill the test bench with water?.
|
||||
/// </summary>
|
||||
internal static string Purge_bench_qm {
|
||||
get {
|
||||
return ResourceManager.GetString("Purge_bench_qm", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Purging.
|
||||
/// </summary>
|
||||
|
||||
@ -753,4 +753,7 @@
|
||||
<data name="SupressWMTrills" xml:space="preserve">
|
||||
<value>Supress trills</value>
|
||||
</data>
|
||||
<data name="Purge_bench_qm" xml:space="preserve">
|
||||
<value>Prüfstand befüllen?</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -814,4 +814,7 @@
|
||||
<data name="SupressWMTrills" xml:space="preserve">
|
||||
<value>Supress WM trills</value>
|
||||
</data>
|
||||
<data name="Purge_bench_qm" xml:space="preserve">
|
||||
<value>Fill the test bench with water?</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -318,6 +318,13 @@
|
||||
<DependentUpon>AskYesNoForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Operations\LoadProcedureOp.cs" />
|
||||
<Compile Include="BenchControl\Operations\MessageBoxForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Operations\MessageBoxForm.designer.cs">
|
||||
<DependentUpon>MessageBoxForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BenchControl\Operations\MessageBoxOp.cs" />
|
||||
<Compile Include="BenchControl\Operations\ReadMoreRegistersOp.cs" />
|
||||
<Compile Include="BenchControl\MetersPath.cs" />
|
||||
<Compile Include="BenchControl\BenchPath.cs" />
|
||||
@ -903,6 +910,9 @@
|
||||
<EmbeddedResource Include="BenchControl\Operations\AskYesNoForm.resx">
|
||||
<DependentUpon>AskYesNoForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\Operations\MessageBoxForm.resx">
|
||||
<DependentUpon>MessageBoxForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="BenchControl\ResultsPrinters\Basic\PrinterCfgCtrl.resx">
|
||||
<DependentUpon>PrinterCfgCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user