Bozza costruttore files config dell'Adapter

This commit is contained in:
Samuele E. Locatelli
2016-04-22 07:46:30 +02:00
parent 54f6df4cad
commit 03358f0200
13 changed files with 812 additions and 210 deletions
Binary file not shown.
@@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
+105
View File
@@ -0,0 +1,105 @@
using System;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
namespace MTC_Sim
{
#region -- AdapterConf Class --
/// <summary>
/// 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.
/// </summary>
[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
}
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<AdapterConf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Version>1</Version>
<StringItem>CMS_ADAPTER_ABC</StringItem>
<IntItem>2456</IntItem>
</AdapterConf>
+10 -10
View File
@@ -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
/// <summary>
/// Singola Pressione rilevata, 0..n
/// </summary>
public class Pressione
public class Press
{
/// <summary>
/// Id univoco
@@ -217,7 +217,7 @@ namespace MTC_Sim
/// </summary>
/// <param name="ident">Identificativo misura, salvato in event Press_{0}_Id dove {0}=ident</param>
/// <param name="alias">Alias misura, salvato in event Press_{0}_alias dove {0}=ident</param>
public Pressione(string ident, string alias)
public Press(string ident, string alias)
{
idx = ident;
descr = alias;
@@ -230,7 +230,7 @@ namespace MTC_Sim
/// <summary>
/// Singola temperatura rilevata, 0..n
/// </summary>
public class Temperatura
public class Temper
{
/// <summary>
/// Id univoco
@@ -258,7 +258,7 @@ namespace MTC_Sim
/// </summary>
/// <param name="ident">Identificativo misura, salvato in event Temp_{0}_Id dove {0}=ident</param>
/// <param name="alias">Alias misura, salvato in event Temp_{0}_alias dove {0}=ident</param>
public Temperatura(string ident, string alias)
public Temper(string ident, string alias)
{
idx = ident;
descr = alias;
@@ -271,7 +271,7 @@ namespace MTC_Sim
/// <summary>
/// Asse singolo, 1..n
/// </summary>
public class Asse
public class Axis
{
/// <summary>
/// Id univoco
@@ -351,7 +351,7 @@ namespace MTC_Sim
/// </summary>
/// <param name="ident">Identificativo misura, codice sarà Ax_{0} dove {0}= ident</param>
/// <param name="alias">Alias misura, salvato in event Ax_{0}_alias dove {0}=ident</param>
public Asse(string ident, string alias)
public Axis(string ident, string alias)
{
idx = ident;
descr = alias;
@@ -466,7 +466,7 @@ namespace MTC_Sim
/// <summary>
/// Singolo mandrino, 1..n
/// </summary>
public class Mandrino
public class UnOp
{
/// <summary>
/// Id univoco
@@ -514,11 +514,11 @@ namespace MTC_Sim
/// </summary>
public Sample mUnOpAccTime;
/// <summary>
/// Classe Mandrino con Idx e descrizione
/// Classe Unita Operatrice (Mandrino) con Idx e descrizione
/// </summary>
/// <param name="ident">Identificativo misura, salvato in event UnOp_{0}_Id dove {0}=ident</param>
/// <param name="alias">Alias misura, salvato in event UnOp_{0}_alias dove {0}=ident</param>
public Mandrino(string ident, string alias)
public UnOp(string ident, string alias)
{
idx = ident;
descr = alias;
+5
View File
@@ -13,6 +13,9 @@
<add key="STATUS_PLC_ADP" value="0"/>
<add key="STATUS_ADP_PLC" value="0"/>
<!--conf file-->
<add key="adapterConfPath" value="AdapterConf"/>
<!--Cardinalità: conf x numero assi, UnitaOperatrici, ...-->
<add key="NumUnOp" value="1"/>
<add key="NumEvtUnOp" value="2"/>
@@ -23,5 +26,7 @@
<add key="NumMand" value="1"/>
<add key="NumAllarmi" value="1"/>
</appSettings>
</configuration>
+255 -200
View File
@@ -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;
}
}
+6
View File
@@ -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);
}
}
}
+21
View File
@@ -138,7 +138,28 @@
<metadata name="K.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="X.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Y.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Z.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="I.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="J.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="K.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>220, 17</value>
</metadata>
</root>
+16
View File
@@ -48,6 +48,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AdapterConf.cs" />
<Compile Include="AdapterGeneric.cs" />
<Compile Include="AdapterDemo.cs" />
<Compile Include="AdapterFanuc.cs" />
@@ -60,6 +61,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SetupAdapter.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SetupAdapter.Designer.cs">
<DependentUpon>SetupAdapter.cs</DependentUpon>
</Compile>
<Compile Include="utils.cs" />
<EmbeddedResource Include="CMS_MachineSim.resx">
<DependentUpon>CMS_MachineSim.cs</DependentUpon>
@@ -73,6 +80,9 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="SetupAdapter.resx">
<DependentUpon>SetupAdapter.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -93,6 +103,12 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="AdapterConf\Demo.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="AdapterConf\Demo.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="HaltTypeList.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+166
View File
@@ -0,0 +1,166 @@
namespace MTC_Sim
{
partial class SetupAdapter
{
/// <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.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;
}
}
+101
View File
@@ -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();
}
/// <summary>
/// Percorso file completo
/// </summary>
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;
}
}
}
+120
View 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>