diff --git a/MTC_Sim/.vs/MTC_Sim/v14/.suo b/MTC_Sim/.vs/MTC_Sim/v14/.suo
index eb75bb9..dc8ead1 100644
Binary files a/MTC_Sim/.vs/MTC_Sim/v14/.suo and b/MTC_Sim/.vs/MTC_Sim/v14/.suo differ
diff --git a/MTC_Sim/MTC_AdapterTest/MTC_AdapterTest.csproj b/MTC_Sim/MTC_AdapterTest/MTC_AdapterTest.csproj
index 85e3aa3..1f59d90 100644
--- a/MTC_Sim/MTC_AdapterTest/MTC_AdapterTest.csproj
+++ b/MTC_Sim/MTC_AdapterTest/MTC_AdapterTest.csproj
@@ -22,6 +22,7 @@
DEBUG;TRACE
prompt
4
+ false
AnyCPU
diff --git a/MTC_Sim/MTC_Sim/AdapterConf.cs b/MTC_Sim/MTC_Sim/AdapterConf.cs
new file mode 100644
index 0000000..2f64f94
--- /dev/null
+++ b/MTC_Sim/MTC_Sim/AdapterConf.cs
@@ -0,0 +1,105 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace MTC_Sim
+{
+
+ #region -- AdapterConf Class --
+ ///
+ /// This Configuration class is basically just a set of
+ /// properties with a couple of static methods to manage
+ /// the serialization to and deserialization from a
+ /// simple XML file.
+ ///
+ [Serializable]
+ public class AdapterConf
+ {
+ string sNomeAdapt;
+ int nVers;
+
+ element[] _VacuumPump;
+ element[] _VacuumAct;
+
+ int nLubro;
+ int nCooler;
+ int nPress;
+ int nTemper;
+ int nAxis;
+ int nPath;
+ int nUnOp;
+
+ public AdapterConf()
+ {
+ sNomeAdapt = "";
+
+ nLubro = 0;
+ nCooler = 0;
+ nPress = 0;
+ nTemper = 0;
+ nAxis = 0;
+ nPath = 0;
+ nUnOp = 0;
+
+ }
+ public static void Serialize(string file, AdapterConf c)
+ {
+ System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(c.GetType());
+ StreamWriter writer = File.CreateText(file);
+ xs.Serialize(writer, c);
+ writer.Flush();
+ writer.Close();
+ }
+ public static AdapterConf Deserialize(string file)
+ {
+ System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(AdapterConf));
+ StreamReader reader = File.OpenText(file);
+ AdapterConf c = (AdapterConf)xs.Deserialize(reader);
+ reader.Close();
+ return c;
+ }
+ public int Version
+ {
+ get { return nVers; }
+ set { nVers = value; }
+ }
+ public string NomeAdapt
+ {
+ get { return sNomeAdapt; }
+ set { sNomeAdapt = value; }
+ }
+ public element[] VacuumPump
+ {
+ get { return _VacuumPump; }
+ set { _VacuumPump = value; }
+ }
+ public element[] VacuumAct
+ {
+ get { return _VacuumAct; }
+ set { _VacuumAct = value; }
+ }
+
+
+
+ }
+
+ public class element
+ {
+ public string idx;
+ public string alias;
+
+ public element()
+ {
+ idx = "";
+ alias = "";
+ }
+ public element(int Idx, string Alias)
+ {
+ idx = Idx.ToString();
+ alias = Alias;
+ }
+ }
+
+ #endregion
+}
diff --git a/MTC_Sim/MTC_Sim/AdapterConf/Demo.xml b/MTC_Sim/MTC_Sim/AdapterConf/Demo.xml
new file mode 100644
index 0000000..455d5f8
--- /dev/null
+++ b/MTC_Sim/MTC_Sim/AdapterConf/Demo.xml
@@ -0,0 +1,6 @@
+
+
+ 1
+ CMS_ADAPTER_ABC
+ 2456
+
\ No newline at end of file
diff --git a/MTC_Sim/MTC_Sim/AdapterGeneric.cs b/MTC_Sim/MTC_Sim/AdapterGeneric.cs
index 5077514..38a69d8 100644
--- a/MTC_Sim/MTC_Sim/AdapterGeneric.cs
+++ b/MTC_Sim/MTC_Sim/AdapterGeneric.cs
@@ -54,7 +54,7 @@ namespace MTC_Sim
mVacPumpId = new Event(string.Format("VacPump_{0}_Id", idx));
mVacPumpAlias = new Event(string.Format("VacPump_{0}_Alias", idx));
- mVacPumpStatus = new Event(string.Format("VacPump_{0}_Count", idx));
+ mVacPumpStatus = new Event(string.Format("VacPump_{0}_Status", idx));
}
}
@@ -189,7 +189,7 @@ namespace MTC_Sim
///
/// Singola Pressione rilevata, 0..n
///
- public class Pressione
+ public class Press
{
///
/// Id univoco
@@ -217,7 +217,7 @@ namespace MTC_Sim
///
/// Identificativo misura, salvato in event Press_{0}_Id dove {0}=ident
/// Alias misura, salvato in event Press_{0}_alias dove {0}=ident
- public Pressione(string ident, string alias)
+ public Press(string ident, string alias)
{
idx = ident;
descr = alias;
@@ -230,7 +230,7 @@ namespace MTC_Sim
///
/// Singola temperatura rilevata, 0..n
///
- public class Temperatura
+ public class Temper
{
///
/// Id univoco
@@ -258,7 +258,7 @@ namespace MTC_Sim
///
/// Identificativo misura, salvato in event Temp_{0}_Id dove {0}=ident
/// Alias misura, salvato in event Temp_{0}_alias dove {0}=ident
- public Temperatura(string ident, string alias)
+ public Temper(string ident, string alias)
{
idx = ident;
descr = alias;
@@ -271,7 +271,7 @@ namespace MTC_Sim
///
/// Asse singolo, 1..n
///
- public class Asse
+ public class Axis
{
///
/// Id univoco
@@ -351,7 +351,7 @@ namespace MTC_Sim
///
/// Identificativo misura, codice sarà Ax_{0} dove {0}= ident
/// Alias misura, salvato in event Ax_{0}_alias dove {0}=ident
- public Asse(string ident, string alias)
+ public Axis(string ident, string alias)
{
idx = ident;
descr = alias;
@@ -466,7 +466,7 @@ namespace MTC_Sim
///
/// Singolo mandrino, 1..n
///
- public class Mandrino
+ public class UnOp
{
///
/// Id univoco
@@ -514,11 +514,11 @@ namespace MTC_Sim
///
public Sample mUnOpAccTime;
///
- /// Classe Mandrino con Idx e descrizione
+ /// Classe Unita Operatrice (Mandrino) con Idx e descrizione
///
/// Identificativo misura, salvato in event UnOp_{0}_Id dove {0}=ident
/// Alias misura, salvato in event UnOp_{0}_alias dove {0}=ident
- public Mandrino(string ident, string alias)
+ public UnOp(string ident, string alias)
{
idx = ident;
descr = alias;
diff --git a/MTC_Sim/MTC_Sim/App.config b/MTC_Sim/MTC_Sim/App.config
index 5938053..8d8ab7a 100644
--- a/MTC_Sim/MTC_Sim/App.config
+++ b/MTC_Sim/MTC_Sim/App.config
@@ -13,6 +13,9 @@
+
+
+
@@ -23,5 +26,7 @@
+
+
\ No newline at end of file
diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs
index 8c8bc89..76592b1 100644
--- a/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs
+++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs
@@ -51,6 +51,12 @@
this.functionalMode = new System.Windows.Forms.ComboBox();
this.label12 = new System.Windows.Forms.Label();
this.PosAct = new System.Windows.Forms.DataGridView();
+ this.X = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Y = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Z = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ 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.groupBox6 = new System.Windows.Forms.GroupBox();
this.ERR_04 = new System.Windows.Forms.CheckBox();
@@ -86,6 +92,10 @@
this.program = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.groupBox7 = new System.Windows.Forms.GroupBox();
+ this.lblAT = new System.Windows.Forms.Label();
+ this.txtAccTime = new System.Windows.Forms.TextBox();
+ this.label30 = new System.Windows.Forms.Label();
+ this.txtPower = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
this.D1_UUID = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
@@ -95,6 +105,12 @@
this.estop = new System.Windows.Forms.CheckBox();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.groupBox9 = new System.Windows.Forms.GroupBox();
+ this.txtPzKo = new System.Windows.Forms.TextBox();
+ this.label25 = new System.Windows.Forms.Label();
+ this.txtPzOk = new System.Windows.Forms.TextBox();
+ this.label23 = new System.Windows.Forms.Label();
+ this.txtPzTot = new System.Windows.Forms.TextBox();
+ this.label21 = new System.Windows.Forms.Label();
this.OPERATOR_ID = new System.Windows.Forms.TextBox();
this.label19 = new System.Windows.Forms.Label();
this.PROG_ROW_NUM = new System.Windows.Forms.TextBox();
@@ -120,32 +136,21 @@
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.MainProgrBar = new System.Windows.Forms.ToolStripProgressBar();
this.groupBox13 = new System.Windows.Forms.GroupBox();
- this.txtPzTot = new System.Windows.Forms.TextBox();
- this.label21 = new System.Windows.Forms.Label();
- this.txtPzOk = new System.Windows.Forms.TextBox();
- this.label23 = new System.Windows.Forms.Label();
- this.txtPzKo = new System.Windows.Forms.TextBox();
- this.label25 = new System.Windows.Forms.Label();
- this.label26 = new System.Windows.Forms.Label();
- this.hsPathFeed = new System.Windows.Forms.HScrollBar();
- this.txtPathFeed = new System.Windows.Forms.TextBox();
- this.txtPathFeedOver = new System.Windows.Forms.TextBox();
- this.label27 = new System.Windows.Forms.Label();
- this.hsPathFeedOver = new System.Windows.Forms.HScrollBar();
+ this.label29 = new System.Windows.Forms.Label();
this.txtPathSpeedOver = new System.Windows.Forms.TextBox();
this.label28 = new System.Windows.Forms.Label();
this.hsPathSpeedOver = new System.Windows.Forms.HScrollBar();
- this.X = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Y = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Z = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.I = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.J = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.K = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.label29 = new System.Windows.Forms.Label();
- this.label30 = new System.Windows.Forms.Label();
- this.txtPower = new System.Windows.Forms.TextBox();
- this.lblAT = new System.Windows.Forms.Label();
- this.txtAccTime = new System.Windows.Forms.TextBox();
+ this.txtPathFeedOver = new System.Windows.Forms.TextBox();
+ this.label27 = new System.Windows.Forms.Label();
+ this.hsPathFeedOver = new System.Windows.Forms.HScrollBar();
+ this.txtPathFeed = new System.Windows.Forms.TextBox();
+ this.label26 = new System.Windows.Forms.Label();
+ this.hsPathFeed = new System.Windows.Forms.HScrollBar();
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.fILEToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.lOADADAPTERCONFToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.sETUPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.mANAGEADAPTERCONFIGURATIONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox4.SuspendLayout();
this.groupBox5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PosAct)).BeginInit();
@@ -162,6 +167,7 @@
this.groupBox12.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.groupBox13.SuspendLayout();
+ this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// ERR_05
@@ -184,7 +190,7 @@
this.groupBox4.Controls.Add(this.label7);
this.groupBox4.Controls.Add(this.messageText);
this.groupBox4.Controls.Add(this.messageCode);
- this.groupBox4.Location = new System.Drawing.Point(405, 253);
+ this.groupBox4.Location = new System.Drawing.Point(405, 277);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(379, 52);
this.groupBox4.TabIndex = 44;
@@ -251,7 +257,7 @@
this.groupBox5.Controls.Add(this.label10);
this.groupBox5.Controls.Add(this.label11);
this.groupBox5.Controls.Add(this.cLoad);
- this.groupBox5.Location = new System.Drawing.Point(405, 536);
+ this.groupBox5.Location = new System.Drawing.Point(405, 560);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(375, 70);
this.groupBox5.TabIndex = 45;
@@ -367,6 +373,48 @@
this.PosAct.Size = new System.Drawing.Size(287, 41);
this.PosAct.TabIndex = 32;
//
+ // X
+ //
+ this.X.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+ this.X.HeaderText = "X";
+ this.X.Name = "X";
+ this.X.Width = 39;
+ //
+ // Y
+ //
+ this.Y.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+ this.Y.HeaderText = "Y";
+ this.Y.Name = "Y";
+ this.Y.Width = 39;
+ //
+ // Z
+ //
+ this.Z.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+ this.Z.HeaderText = "Z";
+ this.Z.Name = "Z";
+ this.Z.Width = 39;
+ //
+ // I
+ //
+ this.I.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+ this.I.HeaderText = "I";
+ this.I.Name = "I";
+ this.I.Width = 35;
+ //
+ // J
+ //
+ this.J.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+ this.J.HeaderText = "J";
+ this.J.Name = "J";
+ this.J.Width = 37;
+ //
+ // K
+ //
+ this.K.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+ this.K.HeaderText = "K";
+ this.K.Name = "K";
+ this.K.Width = 39;
+ //
// ERR_06
//
this.ERR_06.AutoSize = true;
@@ -379,7 +427,7 @@
//
// groupBox6
//
- this.groupBox6.Location = new System.Drawing.Point(404, 456);
+ this.groupBox6.Location = new System.Drawing.Point(404, 480);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(380, 74);
this.groupBox6.TabIndex = 50;
@@ -403,7 +451,7 @@
this.groupBox1.Controls.Add(this.start);
this.groupBox1.Controls.Add(this.port);
this.groupBox1.Controls.Add(this.label1);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
+ this.groupBox1.Location = new System.Drawing.Point(12, 36);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(379, 43);
this.groupBox1.TabIndex = 34;
@@ -464,7 +512,7 @@
this.mode.Controls.Add(this.mdi);
this.mode.Controls.Add(this.manual);
this.mode.Controls.Add(this.automatic);
- this.mode.Location = new System.Drawing.Point(12, 93);
+ this.mode.Location = new System.Drawing.Point(12, 117);
this.mode.Name = "mode";
this.mode.Size = new System.Drawing.Size(379, 48);
this.mode.TabIndex = 36;
@@ -519,7 +567,7 @@
this.Execution.Controls.Add(this.feedhold);
this.Execution.Controls.Add(this.stopped);
this.Execution.Controls.Add(this.running);
- this.Execution.Location = new System.Drawing.Point(405, 93);
+ this.Execution.Location = new System.Drawing.Point(405, 117);
this.Execution.Name = "Execution";
this.Execution.Size = new System.Drawing.Size(380, 48);
this.Execution.TabIndex = 37;
@@ -578,7 +626,7 @@
this.groupBox3.Controls.Add(this.ERR_02);
this.groupBox3.Controls.Add(this.ERR_01);
this.groupBox3.Controls.Add(this.cuttingToolButton);
- this.groupBox3.Location = new System.Drawing.Point(12, 492);
+ this.groupBox3.Location = new System.Drawing.Point(12, 516);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(375, 114);
this.groupBox3.TabIndex = 41;
@@ -635,7 +683,7 @@
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.xLoad);
- this.groupBox2.Location = new System.Drawing.Point(404, 367);
+ this.groupBox2.Location = new System.Drawing.Point(404, 391);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(375, 70);
this.groupBox2.TabIndex = 40;
@@ -726,13 +774,45 @@
this.groupBox7.Controls.Add(this.D1_ID);
this.groupBox7.Controls.Add(this.label14);
this.groupBox7.Controls.Add(this.D1_NAME);
- this.groupBox7.Location = new System.Drawing.Point(405, 12);
+ this.groupBox7.Location = new System.Drawing.Point(405, 36);
this.groupBox7.Name = "groupBox7";
this.groupBox7.Size = new System.Drawing.Size(380, 75);
this.groupBox7.TabIndex = 53;
this.groupBox7.TabStop = false;
this.groupBox7.Text = "Macchina";
//
+ // lblAT
+ //
+ this.lblAT.AutoSize = true;
+ this.lblAT.Location = new System.Drawing.Point(189, 20);
+ this.lblAT.Name = "lblAT";
+ this.lblAT.Size = new System.Drawing.Size(43, 13);
+ this.lblAT.TabIndex = 63;
+ this.lblAT.Text = "AccMin";
+ //
+ // txtAccTime
+ //
+ this.txtAccTime.Location = new System.Drawing.Point(234, 17);
+ this.txtAccTime.Name = "txtAccTime";
+ this.txtAccTime.Size = new System.Drawing.Size(53, 20);
+ this.txtAccTime.TabIndex = 62;
+ //
+ // label30
+ //
+ this.label30.AutoSize = true;
+ this.label30.Location = new System.Drawing.Point(288, 20);
+ this.label30.Name = "label30";
+ this.label30.Size = new System.Drawing.Size(36, 13);
+ this.label30.TabIndex = 61;
+ this.label30.Text = "power";
+ //
+ // txtPower
+ //
+ this.txtPower.Location = new System.Drawing.Point(325, 17);
+ this.txtPower.Name = "txtPower";
+ this.txtPower.Size = new System.Drawing.Size(49, 20);
+ this.txtPower.TabIndex = 60;
+ //
// label16
//
this.label16.AutoSize = true;
@@ -795,7 +875,7 @@
// groupBox8
//
this.groupBox8.Controls.Add(this.estop);
- this.groupBox8.Location = new System.Drawing.Point(12, 56);
+ this.groupBox8.Location = new System.Drawing.Point(12, 80);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(196, 31);
this.groupBox8.TabIndex = 54;
@@ -820,13 +900,64 @@
this.groupBox9.Controls.Add(this.label13);
this.groupBox9.Controls.Add(this.functionalMode);
this.groupBox9.Controls.Add(this.label12);
- this.groupBox9.Location = new System.Drawing.Point(12, 147);
+ this.groupBox9.Location = new System.Drawing.Point(12, 171);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(379, 158);
this.groupBox9.TabIndex = 55;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "Produzione";
//
+ // txtPzKo
+ //
+ this.txtPzKo.Location = new System.Drawing.Point(313, 98);
+ this.txtPzKo.Name = "txtPzKo";
+ this.txtPzKo.Size = new System.Drawing.Size(60, 20);
+ this.txtPzKo.TabIndex = 59;
+ this.txtPzKo.TextChanged += new System.EventHandler(this.pzKo_TextChanged);
+ //
+ // label25
+ //
+ this.label25.AutoSize = true;
+ this.label25.Location = new System.Drawing.Point(269, 101);
+ this.label25.Name = "label25";
+ this.label25.Size = new System.Drawing.Size(37, 13);
+ this.label25.TabIndex = 58;
+ this.label25.Text = "Pz KO";
+ //
+ // txtPzOk
+ //
+ this.txtPzOk.Enabled = false;
+ this.txtPzOk.Location = new System.Drawing.Point(201, 98);
+ this.txtPzOk.Name = "txtPzOk";
+ this.txtPzOk.Size = new System.Drawing.Size(60, 20);
+ this.txtPzOk.TabIndex = 57;
+ //
+ // label23
+ //
+ this.label23.AutoSize = true;
+ this.label23.Location = new System.Drawing.Point(157, 101);
+ this.label23.Name = "label23";
+ this.label23.Size = new System.Drawing.Size(37, 13);
+ this.label23.TabIndex = 56;
+ this.label23.Text = "Pz OK";
+ //
+ // txtPzTot
+ //
+ this.txtPzTot.Enabled = false;
+ this.txtPzTot.Location = new System.Drawing.Point(80, 98);
+ this.txtPzTot.Name = "txtPzTot";
+ this.txtPzTot.Size = new System.Drawing.Size(60, 20);
+ this.txtPzTot.TabIndex = 55;
+ //
+ // label21
+ //
+ this.label21.AutoSize = true;
+ this.label21.Location = new System.Drawing.Point(33, 101);
+ this.label21.Name = "label21";
+ this.label21.Size = new System.Drawing.Size(38, 13);
+ this.label21.TabIndex = 54;
+ this.label21.Text = "Pz Tot";
+ //
// OPERATOR_ID
//
this.OPERATOR_ID.Location = new System.Drawing.Point(273, 45);
@@ -862,7 +993,7 @@
// groupBox10
//
this.groupBox10.Controls.Add(this.enableDataSim);
- this.groupBox10.Location = new System.Drawing.Point(214, 56);
+ this.groupBox10.Location = new System.Drawing.Point(214, 80);
this.groupBox10.Name = "groupBox10";
this.groupBox10.Size = new System.Drawing.Size(177, 31);
this.groupBox10.TabIndex = 56;
@@ -886,7 +1017,7 @@
this.groupBox11.Controls.Add(this.label18);
this.groupBox11.Controls.Add(this.STATUS_PLC_ADP);
this.groupBox11.Controls.Add(this.lblPLC_ADP);
- this.groupBox11.Location = new System.Drawing.Point(12, 612);
+ this.groupBox11.Location = new System.Drawing.Point(12, 636);
this.groupBox11.Name = "groupBox11";
this.groupBox11.Size = new System.Drawing.Size(773, 75);
this.groupBox11.TabIndex = 57;
@@ -938,7 +1069,7 @@
this.groupBox12.Controls.Add(this.lblCodaM);
this.groupBox12.Controls.Add(this.addCodM);
this.groupBox12.Controls.Add(this.label20);
- this.groupBox12.Location = new System.Drawing.Point(405, 147);
+ this.groupBox12.Location = new System.Drawing.Point(405, 171);
this.groupBox12.Name = "groupBox12";
this.groupBox12.Size = new System.Drawing.Size(380, 100);
this.groupBox12.TabIndex = 58;
@@ -1061,115 +1192,21 @@
this.groupBox13.Controls.Add(this.txtPathFeed);
this.groupBox13.Controls.Add(this.label26);
this.groupBox13.Controls.Add(this.hsPathFeed);
- this.groupBox13.Location = new System.Drawing.Point(12, 311);
+ this.groupBox13.Location = new System.Drawing.Point(12, 335);
this.groupBox13.Name = "groupBox13";
this.groupBox13.Size = new System.Drawing.Size(379, 148);
this.groupBox13.TabIndex = 60;
this.groupBox13.TabStop = false;
this.groupBox13.Text = "PATH";
//
- // txtPzTot
+ // label29
//
- this.txtPzTot.Enabled = false;
- this.txtPzTot.Location = new System.Drawing.Point(80, 98);
- this.txtPzTot.Name = "txtPzTot";
- this.txtPzTot.Size = new System.Drawing.Size(60, 20);
- this.txtPzTot.TabIndex = 55;
- //
- // label21
- //
- this.label21.AutoSize = true;
- this.label21.Location = new System.Drawing.Point(33, 101);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(38, 13);
- this.label21.TabIndex = 54;
- this.label21.Text = "Pz Tot";
- //
- // txtPzOk
- //
- this.txtPzOk.Enabled = false;
- this.txtPzOk.Location = new System.Drawing.Point(201, 98);
- this.txtPzOk.Name = "txtPzOk";
- this.txtPzOk.Size = new System.Drawing.Size(60, 20);
- this.txtPzOk.TabIndex = 57;
- //
- // label23
- //
- this.label23.AutoSize = true;
- this.label23.Location = new System.Drawing.Point(157, 101);
- this.label23.Name = "label23";
- this.label23.Size = new System.Drawing.Size(37, 13);
- this.label23.TabIndex = 56;
- this.label23.Text = "Pz OK";
- //
- // txtPzKo
- //
- this.txtPzKo.Location = new System.Drawing.Point(313, 98);
- this.txtPzKo.Name = "txtPzKo";
- this.txtPzKo.Size = new System.Drawing.Size(60, 20);
- this.txtPzKo.TabIndex = 59;
- this.txtPzKo.TextChanged += new System.EventHandler(this.pzKo_TextChanged);
- //
- // label25
- //
- this.label25.AutoSize = true;
- this.label25.Location = new System.Drawing.Point(269, 101);
- this.label25.Name = "label25";
- this.label25.Size = new System.Drawing.Size(37, 13);
- this.label25.TabIndex = 58;
- this.label25.Text = "Pz KO";
- //
- // label26
- //
- this.label26.AutoSize = true;
- this.label26.Location = new System.Drawing.Point(10, 20);
- this.label26.Name = "label26";
- this.label26.Size = new System.Drawing.Size(49, 13);
- this.label26.TabIndex = 24;
- this.label26.Text = "Feedrate";
- //
- // hsPathFeed
- //
- this.hsPathFeed.Location = new System.Drawing.Point(80, 20);
- this.hsPathFeed.Maximum = 150;
- this.hsPathFeed.Name = "hsPathFeed";
- this.hsPathFeed.Size = new System.Drawing.Size(213, 18);
- this.hsPathFeed.TabIndex = 23;
- this.hsPathFeed.ValueChanged += new System.EventHandler(this.hsPathFeed_ValueChanged);
- //
- // txtPathFeed
- //
- this.txtPathFeed.Location = new System.Drawing.Point(298, 17);
- this.txtPathFeed.Name = "txtPathFeed";
- this.txtPathFeed.Size = new System.Drawing.Size(74, 20);
- this.txtPathFeed.TabIndex = 26;
- this.txtPathFeed.TextChanged += new System.EventHandler(this.txtPathFeed_TextChanged);
- //
- // txtPathFeedOver
- //
- this.txtPathFeedOver.Location = new System.Drawing.Point(298, 43);
- this.txtPathFeedOver.Name = "txtPathFeedOver";
- this.txtPathFeedOver.Size = new System.Drawing.Size(74, 20);
- this.txtPathFeedOver.TabIndex = 29;
- this.txtPathFeedOver.TextChanged += new System.EventHandler(this.txtPathFeedOver_TextChanged);
- //
- // label27
- //
- this.label27.AutoSize = true;
- this.label27.Location = new System.Drawing.Point(10, 46);
- this.label27.Name = "label27";
- this.label27.Size = new System.Drawing.Size(60, 13);
- this.label27.TabIndex = 28;
- this.label27.Text = "Feed Over.";
- //
- // hsPathFeedOver
- //
- this.hsPathFeedOver.Location = new System.Drawing.Point(80, 46);
- this.hsPathFeedOver.Maximum = 150;
- this.hsPathFeedOver.Name = "hsPathFeedOver";
- this.hsPathFeedOver.Size = new System.Drawing.Size(213, 18);
- this.hsPathFeedOver.TabIndex = 27;
- this.hsPathFeedOver.ValueChanged += new System.EventHandler(this.hsPathFeedOver_ValueChanged);
+ this.label29.AutoSize = true;
+ this.label29.Location = new System.Drawing.Point(12, 113);
+ this.label29.Name = "label29";
+ this.label29.Size = new System.Drawing.Size(51, 13);
+ this.label29.TabIndex = 33;
+ this.label29.Text = "Posiz Act";
//
// txtPathSpeedOver
//
@@ -1197,88 +1234,97 @@
this.hsPathSpeedOver.TabIndex = 30;
this.hsPathSpeedOver.ValueChanged += new System.EventHandler(this.hsPathSpeedOver_ValueChanged);
//
- // X
+ // txtPathFeedOver
//
- this.X.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
- this.X.HeaderText = "X";
- this.X.Name = "X";
- this.X.Width = 39;
+ this.txtPathFeedOver.Location = new System.Drawing.Point(298, 43);
+ this.txtPathFeedOver.Name = "txtPathFeedOver";
+ this.txtPathFeedOver.Size = new System.Drawing.Size(74, 20);
+ this.txtPathFeedOver.TabIndex = 29;
+ this.txtPathFeedOver.TextChanged += new System.EventHandler(this.txtPathFeedOver_TextChanged);
//
- // Y
+ // label27
//
- this.Y.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
- this.Y.HeaderText = "Y";
- this.Y.Name = "Y";
- this.Y.Width = 39;
+ this.label27.AutoSize = true;
+ this.label27.Location = new System.Drawing.Point(10, 46);
+ this.label27.Name = "label27";
+ this.label27.Size = new System.Drawing.Size(60, 13);
+ this.label27.TabIndex = 28;
+ this.label27.Text = "Feed Over.";
//
- // Z
+ // hsPathFeedOver
//
- this.Z.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
- this.Z.HeaderText = "Z";
- this.Z.Name = "Z";
- this.Z.Width = 39;
+ this.hsPathFeedOver.Location = new System.Drawing.Point(80, 46);
+ this.hsPathFeedOver.Maximum = 150;
+ this.hsPathFeedOver.Name = "hsPathFeedOver";
+ this.hsPathFeedOver.Size = new System.Drawing.Size(213, 18);
+ this.hsPathFeedOver.TabIndex = 27;
+ this.hsPathFeedOver.ValueChanged += new System.EventHandler(this.hsPathFeedOver_ValueChanged);
//
- // I
+ // txtPathFeed
//
- this.I.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
- this.I.HeaderText = "I";
- this.I.Name = "I";
- this.I.Width = 35;
+ this.txtPathFeed.Location = new System.Drawing.Point(298, 17);
+ this.txtPathFeed.Name = "txtPathFeed";
+ this.txtPathFeed.Size = new System.Drawing.Size(74, 20);
+ this.txtPathFeed.TabIndex = 26;
+ this.txtPathFeed.TextChanged += new System.EventHandler(this.txtPathFeed_TextChanged);
//
- // J
+ // label26
//
- this.J.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
- this.J.HeaderText = "J";
- this.J.Name = "J";
- this.J.Width = 37;
+ this.label26.AutoSize = true;
+ this.label26.Location = new System.Drawing.Point(10, 20);
+ this.label26.Name = "label26";
+ this.label26.Size = new System.Drawing.Size(49, 13);
+ this.label26.TabIndex = 24;
+ this.label26.Text = "Feedrate";
//
- // K
+ // hsPathFeed
//
- this.K.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
- this.K.HeaderText = "K";
- this.K.Name = "K";
- this.K.Width = 39;
+ this.hsPathFeed.Location = new System.Drawing.Point(80, 20);
+ this.hsPathFeed.Maximum = 150;
+ this.hsPathFeed.Name = "hsPathFeed";
+ this.hsPathFeed.Size = new System.Drawing.Size(213, 18);
+ this.hsPathFeed.TabIndex = 23;
+ this.hsPathFeed.ValueChanged += new System.EventHandler(this.hsPathFeed_ValueChanged);
//
- // label29
+ // menuStrip1
//
- this.label29.AutoSize = true;
- this.label29.Location = new System.Drawing.Point(12, 113);
- this.label29.Name = "label29";
- this.label29.Size = new System.Drawing.Size(51, 13);
- this.label29.TabIndex = 33;
- this.label29.Text = "Posiz Act";
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fILEToolStripMenuItem,
+ this.sETUPToolStripMenuItem});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.Size = new System.Drawing.Size(794, 24);
+ this.menuStrip1.TabIndex = 61;
+ this.menuStrip1.Text = "menuStrip1";
//
- // label30
+ // fILEToolStripMenuItem
//
- this.label30.AutoSize = true;
- this.label30.Location = new System.Drawing.Point(288, 20);
- this.label30.Name = "label30";
- this.label30.Size = new System.Drawing.Size(36, 13);
- this.label30.TabIndex = 61;
- this.label30.Text = "power";
+ this.fILEToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.lOADADAPTERCONFToolStripMenuItem});
+ this.fILEToolStripMenuItem.Name = "fILEToolStripMenuItem";
+ this.fILEToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
+ this.fILEToolStripMenuItem.Text = "FILE";
//
- // txtPower
+ // lOADADAPTERCONFToolStripMenuItem
//
- this.txtPower.Location = new System.Drawing.Point(325, 17);
- this.txtPower.Name = "txtPower";
- this.txtPower.Size = new System.Drawing.Size(49, 20);
- this.txtPower.TabIndex = 60;
+ this.lOADADAPTERCONFToolStripMenuItem.Name = "lOADADAPTERCONFToolStripMenuItem";
+ this.lOADADAPTERCONFToolStripMenuItem.Size = new System.Drawing.Size(194, 22);
+ this.lOADADAPTERCONFToolStripMenuItem.Text = "LOAD ADAPTER CONF";
//
- // lblAT
+ // sETUPToolStripMenuItem
//
- this.lblAT.AutoSize = true;
- this.lblAT.Location = new System.Drawing.Point(189, 20);
- this.lblAT.Name = "lblAT";
- this.lblAT.Size = new System.Drawing.Size(43, 13);
- this.lblAT.TabIndex = 63;
- this.lblAT.Text = "AccMin";
+ this.sETUPToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mANAGEADAPTERCONFIGURATIONToolStripMenuItem});
+ this.sETUPToolStripMenuItem.Name = "sETUPToolStripMenuItem";
+ this.sETUPToolStripMenuItem.Size = new System.Drawing.Size(53, 20);
+ this.sETUPToolStripMenuItem.Text = "SETUP";
//
- // txtAccTime
+ // mANAGEADAPTERCONFIGURATIONToolStripMenuItem
//
- this.txtAccTime.Location = new System.Drawing.Point(234, 17);
- this.txtAccTime.Name = "txtAccTime";
- this.txtAccTime.Size = new System.Drawing.Size(53, 20);
- this.txtAccTime.TabIndex = 62;
+ this.mANAGEADAPTERCONFIGURATIONToolStripMenuItem.Name = "mANAGEADAPTERCONFIGURATIONToolStripMenuItem";
+ this.mANAGEADAPTERCONFIGURATIONToolStripMenuItem.Size = new System.Drawing.Size(274, 22);
+ this.mANAGEADAPTERCONFIGURATIONToolStripMenuItem.Text = "MANAGE ADAPTER CONFIGURATION";
+ this.mANAGEADAPTERCONFIGURATIONToolStripMenuItem.Click += new System.EventHandler(this.mANAGEADAPTERCONFIGURATIONToolStripMenuItem_Click);
//
// CMS_MachineSim
//
@@ -1287,6 +1333,7 @@
this.ClientSize = new System.Drawing.Size(794, 733);
this.Controls.Add(this.groupBox13);
this.Controls.Add(this.statusStrip1);
+ this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.groupBox12);
this.Controls.Add(this.groupBox11);
this.Controls.Add(this.groupBox10);
@@ -1302,6 +1349,7 @@
this.Controls.Add(this.Execution);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
+ this.MainMenuStrip = this.menuStrip1;
this.Name = "CMS_MachineSim";
this.Text = "CMS MTConn Adapter SIM";
this.groupBox4.ResumeLayout(false);
@@ -1335,6 +1383,8 @@
this.statusStrip1.PerformLayout();
this.groupBox13.ResumeLayout(false);
this.groupBox13.PerformLayout();
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -1459,6 +1509,11 @@
private System.Windows.Forms.TextBox txtAccTime;
private System.Windows.Forms.Label label30;
private System.Windows.Forms.TextBox txtPower;
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem fILEToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem lOADADAPTERCONFToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem sETUPToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem mANAGEADAPTERCONFIGURATIONToolStripMenuItem;
}
}
diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs
index 1b9b7b4..f766f7c 100644
--- a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs
+++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs
@@ -637,5 +637,11 @@ namespace MTC_Sim
txtPathSpeedOver.Text = hsPathSpeedOver.Value.ToString();
raiseFlag_FEED_SPEED();
}
+
+ private void mANAGEADAPTERCONFIGURATIONToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ SetupAdapter setupWIndow = new SetupAdapter();
+ setupWIndow.Show(this);
+ }
}
}
diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.resx b/MTC_Sim/MTC_Sim/CMS_MachineSim.resx
index c9e8fbb..707fc60 100644
--- a/MTC_Sim/MTC_Sim/CMS_MachineSim.resx
+++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.resx
@@ -138,7 +138,28 @@
True
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
104, 17
+
+ 220, 17
+
\ No newline at end of file
diff --git a/MTC_Sim/MTC_Sim/MTC_Sim.csproj b/MTC_Sim/MTC_Sim/MTC_Sim.csproj
index aeb77f3..9ae7e1a 100644
--- a/MTC_Sim/MTC_Sim/MTC_Sim.csproj
+++ b/MTC_Sim/MTC_Sim/MTC_Sim.csproj
@@ -48,6 +48,7 @@
+
@@ -60,6 +61,12 @@
+
+ Form
+
+
+ SetupAdapter.cs
+
CMS_MachineSim.cs
@@ -73,6 +80,9 @@
True
Resources.resx
+
+ SetupAdapter.cs
+
SettingsSingleFileGenerator
Settings.Designer.cs
@@ -93,6 +103,12 @@
+
+ Always
+
+
+ PreserveNewest
+
Always
diff --git a/MTC_Sim/MTC_Sim/SetupAdapter.Designer.cs b/MTC_Sim/MTC_Sim/SetupAdapter.Designer.cs
new file mode 100644
index 0000000..630ad57
--- /dev/null
+++ b/MTC_Sim/MTC_Sim/SetupAdapter.Designer.cs
@@ -0,0 +1,166 @@
+namespace MTC_Sim
+{
+ partial class SetupAdapter
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.txtAdapter = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.txtFileName = new System.Windows.Forms.TextBox();
+ this.btnSave = new System.Windows.Forms.Button();
+ this.btnLoad = new System.Windows.Forms.Button();
+ this.label3 = new System.Windows.Forms.Label();
+ this.nVacPump = new System.Windows.Forms.TextBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.nVacAct = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // txtAdapter
+ //
+ this.txtAdapter.Location = new System.Drawing.Point(91, 10);
+ this.txtAdapter.Name = "txtAdapter";
+ this.txtAdapter.Size = new System.Drawing.Size(252, 20);
+ this.txtAdapter.TabIndex = 0;
+ this.txtAdapter.Text = "CMS_ADAPTER_00";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(22, 13);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(58, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "ADAPTER";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(359, 13);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(63, 13);
+ this.label2.TabIndex = 3;
+ this.label2.Text = "FILE NAME";
+ //
+ // txtFileName
+ //
+ this.txtFileName.Location = new System.Drawing.Point(428, 10);
+ this.txtFileName.Name = "txtFileName";
+ this.txtFileName.Size = new System.Drawing.Size(252, 20);
+ this.txtFileName.TabIndex = 2;
+ this.txtFileName.Text = "Demo.xml";
+ //
+ // btnSave
+ //
+ this.btnSave.Location = new System.Drawing.Point(479, 467);
+ this.btnSave.Name = "btnSave";
+ this.btnSave.Size = new System.Drawing.Size(201, 38);
+ this.btnSave.TabIndex = 4;
+ this.btnSave.Text = "SAVE CONFIGURATION";
+ this.btnSave.UseVisualStyleBackColor = true;
+ this.btnSave.Click += new System.EventHandler(this.btnCreateFile_Click);
+ //
+ // btnLoad
+ //
+ this.btnLoad.Location = new System.Drawing.Point(16, 467);
+ this.btnLoad.Name = "btnLoad";
+ this.btnLoad.Size = new System.Drawing.Size(201, 38);
+ this.btnLoad.TabIndex = 5;
+ this.btnLoad.Text = "LOAD CONFIGURATION";
+ this.btnLoad.UseVisualStyleBackColor = true;
+ this.btnLoad.Click += new System.EventHandler(this.btnLoad_Click);
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(10, 39);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(75, 13);
+ this.label3.TabIndex = 7;
+ this.label3.Text = "n° VAC PUMP";
+ //
+ // nVacPump
+ //
+ this.nVacPump.Location = new System.Drawing.Point(91, 36);
+ this.nVacPump.Name = "nVacPump";
+ this.nVacPump.Size = new System.Drawing.Size(57, 20);
+ this.nVacPump.TabIndex = 6;
+ this.nVacPump.Text = "0";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(167, 39);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(60, 13);
+ this.label4.TabIndex = 9;
+ this.label4.Text = "n° VAC Act";
+ //
+ // nVacAct
+ //
+ this.nVacAct.Location = new System.Drawing.Point(248, 36);
+ this.nVacAct.Name = "nVacAct";
+ this.nVacAct.Size = new System.Drawing.Size(57, 20);
+ this.nVacAct.TabIndex = 8;
+ this.nVacAct.Text = "0";
+ //
+ // SetupAdapter
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(692, 517);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.nVacAct);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.nVacPump);
+ this.Controls.Add(this.btnLoad);
+ this.Controls.Add(this.btnSave);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.txtFileName);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.txtAdapter);
+ this.Name = "SetupAdapter";
+ this.Text = "SetupAdapter";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox txtAdapter;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox txtFileName;
+ private System.Windows.Forms.Button btnSave;
+ private System.Windows.Forms.Button btnLoad;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.TextBox nVacPump;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.TextBox nVacAct;
+ }
+}
\ No newline at end of file
diff --git a/MTC_Sim/MTC_Sim/SetupAdapter.cs b/MTC_Sim/MTC_Sim/SetupAdapter.cs
new file mode 100644
index 0000000..44a2a95
--- /dev/null
+++ b/MTC_Sim/MTC_Sim/SetupAdapter.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace MTC_Sim
+{
+ public partial class SetupAdapter : Form
+ {
+ public SetupAdapter()
+ {
+ InitializeComponent();
+ }
+ ///
+ /// Percorso file completo
+ ///
+ string filePath
+ {
+ get
+ {
+ return string.Format("{0}/{1}", utils.CRS("adapterConfPath"), txtFileName.Text);
+ }
+ }
+
+ int numVacPump
+ {
+ get
+ {
+ int answ = 0;
+ try
+ {
+ answ = Convert.ToInt32(nVacPump.Text);
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+ int numVacAct
+ {
+ get
+ {
+ int answ = 0;
+ try
+ {
+ answ = Convert.ToInt32(nVacAct.Text);
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+
+ private void btnCreateFile_Click(object sender, EventArgs e)
+ {
+ // creo un nuovo file adapter...
+ AdapterConf c = new AdapterConf();
+ c.NomeAdapt = txtAdapter.Text;
+ c.Version = 1;
+ // inizializzo tamte pompe quanto richieste...
+ if (numVacPump > 0)
+ {
+ element[] VacuumPump = new element[numVacPump];
+ for (int i = 0; i < numVacPump; i++)
+ {
+ VacuumPump[i] = new element(i + 1, string.Format("Pompa {0}", i + 1));
+ }
+ // salvo oggetto
+ c.VacuumPump = VacuumPump;
+ }
+ // inizializzo tamte pompe quanto richieste...
+ if (numVacAct > 0)
+ {
+ element[] VacuumAct = new element[numVacAct];
+ for (int i = 0; i < numVacAct; i++)
+ {
+ VacuumAct[i] = new element(i + 1, string.Format("Attuatore vuoto {0}", i + 1));
+ }
+ // salvo oggetto
+ c.VacuumAct = VacuumAct;
+ }
+ // Serialize the configuration object to a file
+ AdapterConf.Serialize(filePath, c);
+
+
+ }
+
+ private void btnLoad_Click(object sender, EventArgs e)
+ {
+ // Read the configuration object from a file
+ AdapterConf c2 = AdapterConf.Deserialize(filePath);
+
+ txtAdapter.Text = c2.NomeAdapt;
+ }
+ }
+}
diff --git a/MTC_Sim/MTC_Sim/SetupAdapter.resx b/MTC_Sim/MTC_Sim/SetupAdapter.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/MTC_Sim/MTC_Sim/SetupAdapter.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file