From ffdf02a1244c2103dc914384d16b5f3ac46d75ab Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 26 Apr 2016 12:32:26 +0200 Subject: [PATCH] Spostato strobes in tab completata lettura conf XML --- MTC_Sim/.vs/MTC_Sim/v14/.suo | Bin 125440 -> 115200 bytes MTC_Sim/MTC_Sim/AdapterConf.cs | 15 +++++++++++++++ MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs | 18 ++++++++++++++++-- MTC_Sim/MTC_Sim/CMS_MachineSim.cs | 12 ++---------- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/MTC_Sim/.vs/MTC_Sim/v14/.suo b/MTC_Sim/.vs/MTC_Sim/v14/.suo index 583bd10b1a1c0c497202b8b2c5b6b5132e291f3a..04ab8feb35da8a9aef2bde883a788fb1dfd88980 100644 GIT binary patch delta 514 zcmZp;!rsurKEYu62N6b22>}KMWd;TYW+49e|Nnm=#lQ%}sv85PnOF+~j!#{-xsd5J zqpTQEPzZ<>fLI2IfolJ6hSG+UBU#iXLxDUcAO@Pqzy`$pK>Qb|N@Zf8Fr(n+wJiG? zSr0ru)d)0@tzUAH9@8QvrbR+blN;<=HnXVxVPB-cw8@}?lTmzgrDZ$EA{C}ZE-Z^Q zm=<}kEHYx+6yVG~+1b)?a!GW+xBn|)WMbwPmtnq0mSsO9Ys2H~ zPD?izvh_(ksNyvjm4`{$- z0e6kfB`OmbH?#QJ^Kvri0>$*9;*(3F1129~GHCu1z5Pox<6EZbTjLq;Opi}wyfyt{ z9OD(n%hMAQ8Lw>TOJ-coIQ_XfqvUi0bH>)`3nnmfOgB$t)Y!f?g;AALP!eb!1SlM^ z1u|5&zs_akVQ2raUlGU?-TtqHk%^g6a5`fg%xKJf3h30tcplpTMXvUGN~|`)!jLUo#1I!R15_Yyq;R bxBr>K$fCP!8Y9c}4J#RywkyqJyr&ER(TIyH diff --git a/MTC_Sim/MTC_Sim/AdapterConf.cs b/MTC_Sim/MTC_Sim/AdapterConf.cs index 949a629..b3483cd 100644 --- a/MTC_Sim/MTC_Sim/AdapterConf.cs +++ b/MTC_Sim/MTC_Sim/AdapterConf.cs @@ -67,6 +67,21 @@ namespace MTC_Sim reader.Close(); return c; } + /// + /// restitusice forma XML grezza del file + /// + /// + /// + public static string rawXml(string file) + { + string answ = ""; + System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(AdapterConf)); + StreamReader reader = File.OpenText(file); + answ = reader.ReadToEnd(); + reader.Close(); + return answ; + } + public int Version { get { return nVers; } diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs index 413401e..8ac5184 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs @@ -156,6 +156,7 @@ this.enableDataSim = new System.Windows.Forms.CheckBox(); this.groupBox8 = new System.Windows.Forms.GroupBox(); this.estop = new System.Windows.Forms.CheckBox(); + this.wbXmlConf = new System.Windows.Forms.WebBrowser(); this.groupBox4.SuspendLayout(); this.groupBox5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.PosAct)).BeginInit(); @@ -170,6 +171,7 @@ this.tabCtrlMain.SuspendLayout(); this.tpStatus.SuspendLayout(); this.groupBox1.SuspendLayout(); + this.tbConf.SuspendLayout(); this.tpSIM.SuspendLayout(); this.Execution.SuspendLayout(); this.mode.SuspendLayout(); @@ -712,7 +714,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, 739); + this.groupBox11.Location = new System.Drawing.Point(3, 108); this.groupBox11.Name = "groupBox11"; this.groupBox11.Size = new System.Drawing.Size(773, 75); this.groupBox11.TabIndex = 57; @@ -1049,6 +1051,7 @@ // tpStatus // this.tpStatus.Controls.Add(this.groupBox1); + this.tpStatus.Controls.Add(this.groupBox11); this.tpStatus.Location = new System.Drawing.Point(4, 22); this.tpStatus.Name = "tpStatus"; this.tpStatus.Padding = new System.Windows.Forms.Padding(3); @@ -1121,6 +1124,7 @@ // // tbConf // + this.tbConf.Controls.Add(this.wbXmlConf); this.tbConf.Location = new System.Drawing.Point(4, 22); this.tbConf.Name = "tbConf"; this.tbConf.Padding = new System.Windows.Forms.Padding(3); @@ -1394,6 +1398,15 @@ this.estop.Text = "Emergency Stop"; this.estop.UseVisualStyleBackColor = true; // + // wbXmlConf + // + this.wbXmlConf.Dock = System.Windows.Forms.DockStyle.Fill; + this.wbXmlConf.Location = new System.Drawing.Point(3, 3); + this.wbXmlConf.MinimumSize = new System.Drawing.Size(20, 20); + this.wbXmlConf.Name = "wbXmlConf"; + this.wbXmlConf.Size = new System.Drawing.Size(765, 183); + this.wbXmlConf.TabIndex = 0; + // // CMS_MachineSim // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1405,7 +1418,6 @@ this.Controls.Add(this.statusStrip1); this.Controls.Add(this.menuStrip1); this.Controls.Add(this.groupBox12); - this.Controls.Add(this.groupBox11); this.Controls.Add(this.groupBox9); this.Controls.Add(this.groupBox4); this.Controls.Add(this.label6); @@ -1441,6 +1453,7 @@ this.tpStatus.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); + this.tbConf.ResumeLayout(false); this.tpSIM.ResumeLayout(false); this.Execution.ResumeLayout(false); this.Execution.PerformLayout(); @@ -1586,6 +1599,7 @@ private System.Windows.Forms.CheckBox enableDataSim; private System.Windows.Forms.GroupBox groupBox8; private System.Windows.Forms.CheckBox estop; + private System.Windows.Forms.WebBrowser wbXmlConf; } } diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs index ec7aca4..dee6318 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs @@ -719,16 +719,8 @@ namespace MTC_Sim // indico quale sia il tipo di adapter tipoScelto = adpConf.TipoAdapt; loadAdapter(); - //switch (adpConf.TipoAdapt) - //{ - // case tipoAdapter.Fanuc: - // break; - // case tipoAdapter.HMI: - // break; - // case tipoAdapter.Demo: - // default: - // break; - //} + // carico file XML in web browser... + wbXmlConf.DocumentText = AdapterConf.rawXml(openFileDial.FileName); // avvio macchina con adapter specificato...