vettori errori

This commit is contained in:
Samuele E. Locatelli
2016-04-27 18:05:12 +02:00
parent 78b74d4098
commit 3ce6388b0b
4 changed files with 202 additions and 97 deletions
Binary file not shown.
+130 -79
View File
@@ -29,7 +29,7 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.ERR_05 = new System.Windows.Forms.CheckBox();
this.PlcErr_02 = new System.Windows.Forms.CheckBox();
this.gather = new System.Windows.Forms.Timer(this.components);
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.label8 = new System.Windows.Forms.Label();
@@ -54,13 +54,13 @@
this.I = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.J = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.K = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ERR_06 = new System.Windows.Forms.CheckBox();
this.ERR_04 = new System.Windows.Forms.CheckBox();
this.PlcErr_03 = new System.Windows.Forms.CheckBox();
this.PlcErr_01 = new System.Windows.Forms.CheckBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.ERR_03 = new System.Windows.Forms.CheckBox();
this.ERR_00 = new System.Windows.Forms.CheckBox();
this.ERR_02 = new System.Windows.Forms.CheckBox();
this.ERR_01 = new System.Windows.Forms.CheckBox();
this.SysErr_03 = new System.Windows.Forms.CheckBox();
this.ErrRT_01 = new System.Windows.Forms.CheckBox();
this.SysErr_02 = new System.Windows.Forms.CheckBox();
this.SysErr_01 = new System.Windows.Forms.CheckBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.AxAccelAct = new System.Windows.Forms.TextBox();
this.label37 = new System.Windows.Forms.Label();
@@ -191,6 +191,10 @@
this.uoSpeed = new System.Windows.Forms.HScrollBar();
this.label46 = new System.Windows.Forms.Label();
this.uoLoad = new System.Windows.Forms.HScrollBar();
this.CncErr_02 = new System.Windows.Forms.CheckBox();
this.CncErr_03 = new System.Windows.Forms.CheckBox();
this.CncErr_01 = new System.Windows.Forms.CheckBox();
this.ErrRT_02 = new System.Windows.Forms.CheckBox();
this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PosAct)).BeginInit();
this.groupBox3.SuspendLayout();
@@ -214,15 +218,15 @@
this.groupBox5.SuspendLayout();
this.SuspendLayout();
//
// ERR_05
// PlcErr_02
//
this.ERR_05.AutoSize = true;
this.ERR_05.Location = new System.Drawing.Point(151, 43);
this.ERR_05.Name = "ERR_05";
this.ERR_05.Size = new System.Drawing.Size(67, 17);
this.ERR_05.TabIndex = 6;
this.ERR_05.Text = "ERR_05";
this.ERR_05.UseVisualStyleBackColor = true;
this.PlcErr_02.AutoSize = true;
this.PlcErr_02.Location = new System.Drawing.Point(96, 43);
this.PlcErr_02.Name = "PlcErr_02";
this.PlcErr_02.Size = new System.Drawing.Size(72, 17);
this.PlcErr_02.TabIndex = 6;
this.PlcErr_02.Text = "PlcErr_02";
this.PlcErr_02.UseVisualStyleBackColor = true;
//
// gather
//
@@ -426,82 +430,85 @@
this.K.Name = "K";
this.K.Width = 39;
//
// ERR_06
// PlcErr_03
//
this.ERR_06.AutoSize = true;
this.ERR_06.Location = new System.Drawing.Point(151, 66);
this.ERR_06.Name = "ERR_06";
this.ERR_06.Size = new System.Drawing.Size(67, 17);
this.ERR_06.TabIndex = 5;
this.ERR_06.Text = "ERR_06";
this.ERR_06.UseVisualStyleBackColor = true;
this.PlcErr_03.AutoSize = true;
this.PlcErr_03.Location = new System.Drawing.Point(96, 66);
this.PlcErr_03.Name = "PlcErr_03";
this.PlcErr_03.Size = new System.Drawing.Size(72, 17);
this.PlcErr_03.TabIndex = 5;
this.PlcErr_03.Text = "PlcErr_03";
this.PlcErr_03.UseVisualStyleBackColor = true;
//
// ERR_04
// PlcErr_01
//
this.ERR_04.AutoSize = true;
this.ERR_04.Location = new System.Drawing.Point(151, 20);
this.ERR_04.Name = "ERR_04";
this.ERR_04.Size = new System.Drawing.Size(67, 17);
this.ERR_04.TabIndex = 4;
this.ERR_04.Text = "ERR_04";
this.ERR_04.UseVisualStyleBackColor = true;
this.PlcErr_01.AutoSize = true;
this.PlcErr_01.Location = new System.Drawing.Point(96, 20);
this.PlcErr_01.Name = "PlcErr_01";
this.PlcErr_01.Size = new System.Drawing.Size(72, 17);
this.PlcErr_01.TabIndex = 4;
this.PlcErr_01.Text = "PlcErr_01";
this.PlcErr_01.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.ERR_05);
this.groupBox3.Controls.Add(this.ERR_06);
this.groupBox3.Controls.Add(this.ERR_04);
this.groupBox3.Controls.Add(this.ERR_03);
this.groupBox3.Controls.Add(this.ERR_00);
this.groupBox3.Controls.Add(this.ERR_02);
this.groupBox3.Controls.Add(this.ERR_01);
this.groupBox3.Controls.Add(this.ErrRT_02);
this.groupBox3.Controls.Add(this.CncErr_02);
this.groupBox3.Controls.Add(this.CncErr_03);
this.groupBox3.Controls.Add(this.CncErr_01);
this.groupBox3.Controls.Add(this.PlcErr_02);
this.groupBox3.Controls.Add(this.PlcErr_03);
this.groupBox3.Controls.Add(this.PlcErr_01);
this.groupBox3.Controls.Add(this.SysErr_03);
this.groupBox3.Controls.Add(this.ErrRT_01);
this.groupBox3.Controls.Add(this.SysErr_02);
this.groupBox3.Controls.Add(this.SysErr_01);
this.groupBox3.Location = new System.Drawing.Point(3, 504);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(375, 114);
this.groupBox3.Size = new System.Drawing.Size(379, 114);
this.groupBox3.TabIndex = 41;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Alarms";
//
// ERR_03
// SysErr_03
//
this.ERR_03.AutoSize = true;
this.ERR_03.Location = new System.Drawing.Point(7, 66);
this.ERR_03.Name = "ERR_03";
this.ERR_03.Size = new System.Drawing.Size(67, 17);
this.ERR_03.TabIndex = 3;
this.ERR_03.Text = "ERR_03";
this.ERR_03.UseVisualStyleBackColor = true;
this.SysErr_03.AutoSize = true;
this.SysErr_03.Location = new System.Drawing.Point(7, 66);
this.SysErr_03.Name = "SysErr_03";
this.SysErr_03.Size = new System.Drawing.Size(74, 17);
this.SysErr_03.TabIndex = 3;
this.SysErr_03.Text = "SysErr_03";
this.SysErr_03.UseVisualStyleBackColor = true;
//
// ERR_00
// ErrRT_01
//
this.ERR_00.AutoSize = true;
this.ERR_00.Location = new System.Drawing.Point(151, 89);
this.ERR_00.Name = "ERR_00";
this.ERR_00.Size = new System.Drawing.Size(112, 17);
this.ERR_00.TabIndex = 2;
this.ERR_00.Text = "ERR_00 (realtime)";
this.ERR_00.UseVisualStyleBackColor = true;
this.ERR_00.CheckedChanged += new System.EventHandler(this.ERR_00_CheckedChanged);
this.ErrRT_01.AutoSize = true;
this.ErrRT_01.Location = new System.Drawing.Point(268, 20);
this.ErrRT_01.Name = "ErrRT_01";
this.ErrRT_01.Size = new System.Drawing.Size(78, 17);
this.ErrRT_01.TabIndex = 2;
this.ErrRT_01.Text = "ERR_temp";
this.ErrRT_01.UseVisualStyleBackColor = true;
//
// ERR_02
// SysErr_02
//
this.ERR_02.AutoSize = true;
this.ERR_02.Location = new System.Drawing.Point(7, 43);
this.ERR_02.Name = "ERR_02";
this.ERR_02.Size = new System.Drawing.Size(67, 17);
this.ERR_02.TabIndex = 1;
this.ERR_02.Text = "ERR_02";
this.ERR_02.UseVisualStyleBackColor = true;
this.SysErr_02.AutoSize = true;
this.SysErr_02.Location = new System.Drawing.Point(7, 43);
this.SysErr_02.Name = "SysErr_02";
this.SysErr_02.Size = new System.Drawing.Size(74, 17);
this.SysErr_02.TabIndex = 1;
this.SysErr_02.Text = "SysErr_02";
this.SysErr_02.UseVisualStyleBackColor = true;
//
// ERR_01
// SysErr_01
//
this.ERR_01.AutoSize = true;
this.ERR_01.Location = new System.Drawing.Point(7, 20);
this.ERR_01.Name = "ERR_01";
this.ERR_01.Size = new System.Drawing.Size(67, 17);
this.ERR_01.TabIndex = 0;
this.ERR_01.Text = "ERR_01";
this.ERR_01.UseVisualStyleBackColor = true;
this.SysErr_01.AutoSize = true;
this.SysErr_01.Location = new System.Drawing.Point(7, 20);
this.SysErr_01.Name = "SysErr_01";
this.SysErr_01.Size = new System.Drawing.Size(74, 17);
this.SysErr_01.TabIndex = 0;
this.SysErr_01.Text = "SysErr_01";
this.SysErr_01.UseVisualStyleBackColor = true;
//
// groupBox2
//
@@ -1773,6 +1780,46 @@
this.uoLoad.TabIndex = 76;
this.uoLoad.Scroll += new System.Windows.Forms.ScrollEventHandler(this.uoLoad_Scroll);
//
// CncErr_02
//
this.CncErr_02.AutoSize = true;
this.CncErr_02.Location = new System.Drawing.Point(181, 43);
this.CncErr_02.Name = "CncErr_02";
this.CncErr_02.Size = new System.Drawing.Size(76, 17);
this.CncErr_02.TabIndex = 9;
this.CncErr_02.Text = "CncErr_02";
this.CncErr_02.UseVisualStyleBackColor = true;
//
// CncErr_03
//
this.CncErr_03.AutoSize = true;
this.CncErr_03.Location = new System.Drawing.Point(181, 66);
this.CncErr_03.Name = "CncErr_03";
this.CncErr_03.Size = new System.Drawing.Size(76, 17);
this.CncErr_03.TabIndex = 8;
this.CncErr_03.Text = "CncErr_03";
this.CncErr_03.UseVisualStyleBackColor = true;
//
// CncErr_01
//
this.CncErr_01.AutoSize = true;
this.CncErr_01.Location = new System.Drawing.Point(181, 20);
this.CncErr_01.Name = "CncErr_01";
this.CncErr_01.Size = new System.Drawing.Size(76, 17);
this.CncErr_01.TabIndex = 7;
this.CncErr_01.Text = "CncErr_01";
this.CncErr_01.UseVisualStyleBackColor = true;
//
// ErrRT_02
//
this.ErrRT_02.AutoSize = true;
this.ErrRT_02.Location = new System.Drawing.Point(268, 43);
this.ErrRT_02.Name = "ErrRT_02";
this.ErrRT_02.Size = new System.Drawing.Size(64, 17);
this.ErrRT_02.TabIndex = 10;
this.ErrRT_02.Text = "ERR_fill";
this.ErrRT_02.UseVisualStyleBackColor = true;
//
// CMS_MachineSim
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -1830,7 +1877,7 @@
#endregion
private System.Windows.Forms.CheckBox ERR_05;
private System.Windows.Forms.CheckBox PlcErr_02;
private System.Windows.Forms.Timer gather;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Label label8;
@@ -1849,13 +1896,13 @@
private System.Windows.Forms.ComboBox functionalMode;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.DataGridView PosAct;
private System.Windows.Forms.CheckBox ERR_06;
private System.Windows.Forms.CheckBox ERR_04;
private System.Windows.Forms.CheckBox PlcErr_03;
private System.Windows.Forms.CheckBox PlcErr_01;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox ERR_03;
private System.Windows.Forms.CheckBox ERR_00;
private System.Windows.Forms.CheckBox ERR_02;
private System.Windows.Forms.CheckBox ERR_01;
private System.Windows.Forms.CheckBox SysErr_03;
private System.Windows.Forms.CheckBox ErrRT_01;
private System.Windows.Forms.CheckBox SysErr_02;
private System.Windows.Forms.CheckBox SysErr_01;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox AxPositionValue;
private System.Windows.Forms.TextBox AxLoadValue;
@@ -1992,6 +2039,10 @@
private System.Windows.Forms.HScrollBar uoSpeed;
private System.Windows.Forms.Label label46;
private System.Windows.Forms.HScrollBar uoLoad;
private System.Windows.Forms.CheckBox ErrRT_02;
private System.Windows.Forms.CheckBox CncErr_02;
private System.Windows.Forms.CheckBox CncErr_03;
private System.Windows.Forms.CheckBox CncErr_01;
}
}
+71 -17
View File
@@ -254,16 +254,6 @@ namespace MTC_Sim
private void ERR_00_CheckedChanged(object sender, EventArgs e)
{
if (ERR_00.Checked)
((AdapterDemo)agObj).mFillLevel.Add(Condition.Level.WARNING, "ERR_00 Coolant Low", "COOL", "LOW");
else
((AdapterDemo)agObj).mFillLevel.Clear("COOL");
agObj.mAdapter.SendChanged();
}
// apro eseguibile dump
private void dump_Click(object sender, EventArgs e)
{
@@ -562,7 +552,7 @@ namespace MTC_Sim
#endregion
#region accesso dati produzione FROM/TO maschera
#region accesso dati produzione
/// <summary>
/// Dati di produzione (su form)
@@ -606,12 +596,12 @@ namespace MTC_Sim
// allarmi...
answ.err_01 = ERR_01.Checked;
answ.err_02 = ERR_02.Checked;
answ.err_03 = ERR_03.Checked;
answ.err_04 = ERR_04.Checked;
answ.err_05 = ERR_05.Checked;
answ.err_06 = ERR_06.Checked;
answ.err_01 = SysErr_01.Checked;
answ.err_02 = SysErr_02.Checked;
answ.err_03 = SysErr_03.Checked;
answ.err_04 = PlcErr_01.Checked;
answ.err_05 = PlcErr_02.Checked;
answ.err_06 = PlcErr_03.Checked;
// ritorno oggetto!
@@ -902,5 +892,69 @@ namespace MTC_Sim
#endregion
#region gestione allarmi
/// <summary>
/// Vettore errori system
/// </summary>
public List<int> systemAlarm
{
get
{
List<int> answ = new List<int>();
// controllo se ho valori errori checked...
if (SysErr_01.Checked) answ.Add(1);
if (SysErr_02.Checked) answ.Add(2);
if (SysErr_03.Checked) answ.Add(3);
return answ;
}
}
/// <summary>
/// Vettore errori PLC
/// </summary>
public List<int> plcAlarm
{
get
{
List<int> answ = new List<int>();
// controllo se ho valori errori checked...
if (PlcErr_01.Checked) answ.Add(1);
if (PlcErr_02.Checked) answ.Add(2);
if (PlcErr_03.Checked) answ.Add(3);
return answ;
}
}
/// <summary>
/// Vettore errori CNC
/// </summary>
public List<int> cncAlarm
{
get
{
List<int> answ = new List<int>();
// controllo se ho valori errori checked...
if (CncErr_01.Checked) answ.Add(1);
if (CncErr_02.Checked) answ.Add(2);
if (CncErr_03.Checked) answ.Add(3);
return answ;
}
}
public List<DataRefItem<int, string>> otherAlarm
{
get
{
List<DataRefItem<int, string>> answ = new List<DataRefItem<int, string>>();
if (ErrRT_01.Checked) answ.Add(new DataRefItem<int, string>(1, "TEMP"));
if (ErrRT_02.Checked) answ.Add(new DataRefItem<int, string>(1, "FILL"));
return answ;
}
}
#endregion
}
}
+1 -1
View File
@@ -156,7 +156,7 @@ namespace MTC_Sim
public bool err_05;
public bool err_06;
}
public struct PathData
{
public int PathSel;