From 214ac85bafbe125995bfc84844c2a2d30f17322d Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 31 Mar 2016 12:03:42 +0200 Subject: [PATCH] Aggiunti primi campi definiti in variabili_00 --- MTC_Sim/.vs/MTC_Sim/v14/.suo | Bin 70656 -> 95744 bytes MTC_Sim/MTC_Sim/App.config | 6 + MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs | 177 +++++++++++++++++---- MTC_Sim/MTC_Sim/CMS_MachineSim.cs | 85 +++++++++- MTC_Sim/MTC_Sim/MTC_Sim.csproj | 2 + MTC_Sim/MTC_Sim/utils.cs | 46 ++++++ 6 files changed, 277 insertions(+), 39 deletions(-) create mode 100644 MTC_Sim/MTC_Sim/utils.cs diff --git a/MTC_Sim/.vs/MTC_Sim/v14/.suo b/MTC_Sim/.vs/MTC_Sim/v14/.suo index 5a35cc52d7b6c9625ed924321a9cd92bbeb1e5eb..b0cfd0ffe01085f1638a0b4709ed08dbfe001873 100644 GIT binary patch delta 5412 zcmds*dr;KZ6~}+~w+ph%vMejY@={q4K^`uGh>E%(8tQ|G_-f)LKJbAr2(nhuxNHBg zlWMAPG-TS^TF~e?tr`4f#zYZU%Q%`Ez{k{fOcVbwO((TJ60nx4^m~5nlJzy!#>}+6 zGoQWpp8GoY-gD0H_gmKit?Rnqj+_A|Ns=_+K~GN)GD!euQ%RI;v@LwimAUo2h=Roa z64l6s0o)n=dZ^YMFGmZyBX9Db1=$%b)o5yhPM~a3GLA7fhY|CVIUF&gCGzB z`T?FykDLdEg8m*E%ilwpwTec*5sa!WS*m;z5H0*RqjsO}iwa}q{twGp$9PCwtYeKF z^Qc<>XV7@fNZtJ+g9f4)2Y7yS?ew9-zqX{m&H{-R>_#PK5DGeA1py!yuo^>asY+adHF|21$IW zF@SsWZ8mmB2+?2ZiVPIbtTnG>z^dOyYo5bLV^*iB0$PVwi$KK@S|q47*5=QvoR+D3 zXtyY(u4t#2L5`Rr17A;q&nBods@TA0#M5x%ol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0;wE{K7)0OA^3%?qefB*mh diff --git a/MTC_Sim/MTC_Sim/App.config b/MTC_Sim/MTC_Sim/App.config index 88fa402..16ed0cd 100644 --- a/MTC_Sim/MTC_Sim/App.config +++ b/MTC_Sim/MTC_Sim/App.config @@ -3,4 +3,10 @@ + + + + + + \ 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 737dac6..df5f2e7 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs @@ -68,7 +68,6 @@ this.mdi = new System.Windows.Forms.RadioButton(); this.manual = new System.Windows.Forms.RadioButton(); this.automatic = new System.Windows.Forms.RadioButton(); - this.estop = new System.Windows.Forms.CheckBox(); this.Execution = new System.Windows.Forms.GroupBox(); this.ready = new System.Windows.Forms.RadioButton(); this.feedhold = new System.Windows.Forms.RadioButton(); @@ -89,6 +88,16 @@ this.xLoad = new System.Windows.Forms.HScrollBar(); this.program = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.label14 = new System.Windows.Forms.Label(); + this.D1_NAME = new System.Windows.Forms.TextBox(); + this.estop = new System.Windows.Forms.CheckBox(); + this.label15 = new System.Windows.Forms.Label(); + this.D1_ID = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.D1_UUID = new System.Windows.Forms.TextBox(); + this.dump = new System.Windows.Forms.Button(); + this.groupBox8 = new System.Windows.Forms.GroupBox(); this.groupBox4.SuspendLayout(); this.groupBox5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.commonVariables)).BeginInit(); @@ -98,6 +107,8 @@ this.Execution.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox2.SuspendLayout(); + this.groupBox7.SuspendLayout(); + this.groupBox8.SuspendLayout(); this.SuspendLayout(); // // flazBat @@ -126,7 +137,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(20, 269); + this.groupBox4.Location = new System.Drawing.Point(11, 330); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(375, 52); this.groupBox4.TabIndex = 44; @@ -169,14 +180,14 @@ // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(21, 306); + this.label6.Location = new System.Drawing.Point(12, 367); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(0, 13); this.label6.TabIndex = 43; // // cuttingToolButton // - this.cuttingToolButton.Location = new System.Drawing.Point(512, 344); + this.cuttingToolButton.Location = new System.Drawing.Point(511, 657); this.cuttingToolButton.Name = "cuttingToolButton"; this.cuttingToolButton.Size = new System.Drawing.Size(75, 23); this.cuttingToolButton.TabIndex = 42; @@ -193,7 +204,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(411, 103); + this.groupBox5.Location = new System.Drawing.Point(410, 416); this.groupBox5.Name = "groupBox5"; this.groupBox5.Size = new System.Drawing.Size(375, 70); this.groupBox5.TabIndex = 45; @@ -258,7 +269,7 @@ // // partID // - this.partID.Location = new System.Drawing.Point(286, 240); + this.partID.Location = new System.Drawing.Point(277, 301); this.partID.Name = "partID"; this.partID.Size = new System.Drawing.Size(100, 20); this.partID.TabIndex = 49; @@ -266,7 +277,7 @@ // label13 // this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(220, 243); + this.label13.Location = new System.Drawing.Point(211, 304); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(40, 13); this.label13.TabIndex = 48; @@ -281,7 +292,7 @@ "TEARDOWN", "MAINTENANCE", "PROCESS_DEVELOPMENT"}); - this.functionalMode.Location = new System.Drawing.Point(111, 212); + this.functionalMode.Location = new System.Drawing.Point(102, 273); this.functionalMode.Name = "functionalMode"; this.functionalMode.Size = new System.Drawing.Size(121, 21); this.functionalMode.TabIndex = 47; @@ -290,7 +301,7 @@ // label12 // this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(22, 215); + this.label12.Location = new System.Drawing.Point(13, 276); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(86, 13); this.label12.TabIndex = 46; @@ -345,7 +356,7 @@ // groupBox6 // this.groupBox6.Controls.Add(this.commonVariables); - this.groupBox6.Location = new System.Drawing.Point(21, 327); + this.groupBox6.Location = new System.Drawing.Point(12, 388); this.groupBox6.Name = "groupBox6"; this.groupBox6.Size = new System.Drawing.Size(374, 74); this.groupBox6.TabIndex = 50; @@ -364,20 +375,21 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.dump); this.groupBox1.Controls.Add(this.stop); 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(21, 27); + this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(322, 43); + this.groupBox1.Size = new System.Drawing.Size(379, 43); this.groupBox1.TabIndex = 34; this.groupBox1.TabStop = false; this.groupBox1.Text = "Server Info"; // // stop // - this.stop.Location = new System.Drawing.Point(213, 14); + this.stop.Location = new System.Drawing.Point(202, 15); this.stop.Name = "stop"; this.stop.Size = new System.Drawing.Size(75, 23); this.stop.TabIndex = 3; @@ -387,7 +399,7 @@ // // start // - this.start.Location = new System.Drawing.Point(132, 14); + this.start.Location = new System.Drawing.Point(121, 15); this.start.Name = "start"; this.start.Size = new System.Drawing.Size(75, 23); this.start.TabIndex = 2; @@ -419,7 +431,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(21, 103); + this.mode.Location = new System.Drawing.Point(12, 93); this.mode.Name = "mode"; this.mode.Size = new System.Drawing.Size(379, 48); this.mode.TabIndex = 36; @@ -468,24 +480,13 @@ this.automatic.Text = "Automatic"; this.automatic.UseVisualStyleBackColor = true; // - // estop - // - this.estop.AutoSize = true; - this.estop.Location = new System.Drawing.Point(21, 79); - this.estop.Name = "estop"; - this.estop.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.estop.Size = new System.Drawing.Size(104, 17); - this.estop.TabIndex = 35; - this.estop.Text = "Emergency Stop"; - this.estop.UseVisualStyleBackColor = true; - // // Execution // this.Execution.Controls.Add(this.ready); 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(21, 154); + this.Execution.Location = new System.Drawing.Point(406, 93); this.Execution.Name = "Execution"; this.Execution.Size = new System.Drawing.Size(379, 48); this.Execution.TabIndex = 37; @@ -543,7 +544,7 @@ this.groupBox3.Controls.Add(this.coolant); this.groupBox3.Controls.Add(this.noProgram); this.groupBox3.Controls.Add(this.overload); - this.groupBox3.Location = new System.Drawing.Point(411, 179); + this.groupBox3.Location = new System.Drawing.Point(410, 492); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(375, 114); this.groupBox3.TabIndex = 41; @@ -600,7 +601,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(411, 27); + this.groupBox2.Location = new System.Drawing.Point(410, 340); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(375, 70); this.groupBox2.TabIndex = 40; @@ -665,7 +666,7 @@ // // program // - this.program.Location = new System.Drawing.Point(111, 240); + this.program.Location = new System.Drawing.Point(102, 301); this.program.Name = "program"; this.program.Size = new System.Drawing.Size(100, 20); this.program.TabIndex = 39; @@ -673,17 +674,113 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(22, 243); + this.label2.Location = new System.Drawing.Point(13, 304); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(46, 13); this.label2.TabIndex = 38; this.label2.Text = "Program"; // + // groupBox7 + // + this.groupBox7.Controls.Add(this.label16); + this.groupBox7.Controls.Add(this.D1_UUID); + this.groupBox7.Controls.Add(this.label15); + 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.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(380, 75); + this.groupBox7.TabIndex = 53; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "Macchina"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(10, 20); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(35, 13); + this.label14.TabIndex = 54; + this.label14.Text = "Nome"; + // + // D1_NAME + // + this.D1_NAME.Location = new System.Drawing.Point(51, 17); + this.D1_NAME.Name = "D1_NAME"; + this.D1_NAME.Size = new System.Drawing.Size(174, 20); + this.D1_NAME.TabIndex = 53; + // + // estop + // + this.estop.AutoSize = true; + this.estop.Location = new System.Drawing.Point(269, 8); + this.estop.Name = "estop"; + this.estop.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.estop.Size = new System.Drawing.Size(104, 17); + this.estop.TabIndex = 55; + this.estop.Text = "Emergency Stop"; + this.estop.UseVisualStyleBackColor = true; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(10, 53); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(18, 13); + this.label15.TabIndex = 57; + this.label15.Text = "ID"; + // + // D1_ID + // + this.D1_ID.Location = new System.Drawing.Point(51, 50); + this.D1_ID.Name = "D1_ID"; + this.D1_ID.Size = new System.Drawing.Size(124, 20); + this.D1_ID.TabIndex = 56; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(193, 53); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(34, 13); + this.label16.TabIndex = 59; + this.label16.Text = "UUID"; + // + // D1_UUID + // + this.D1_UUID.Location = new System.Drawing.Point(234, 50); + this.D1_UUID.Name = "D1_UUID"; + this.D1_UUID.Size = new System.Drawing.Size(140, 20); + this.D1_UUID.TabIndex = 58; + // + // dump + // + this.dump.Location = new System.Drawing.Point(298, 15); + this.dump.Name = "dump"; + this.dump.Size = new System.Drawing.Size(75, 23); + this.dump.TabIndex = 4; + this.dump.Text = "Show Dump"; + this.dump.UseVisualStyleBackColor = true; + this.dump.Click += new System.EventHandler(this.dump_Click); + // + // groupBox8 + // + this.groupBox8.Controls.Add(this.estop); + this.groupBox8.Location = new System.Drawing.Point(12, 56); + this.groupBox8.Name = "groupBox8"; + this.groupBox8.Size = new System.Drawing.Size(379, 31); + this.groupBox8.TabIndex = 54; + this.groupBox8.TabStop = false; + this.groupBox8.Text = "Sicurezze"; + // // CMS_MachineSim // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(834, 434); + this.ClientSize = new System.Drawing.Size(794, 733); + this.Controls.Add(this.groupBox8); + this.Controls.Add(this.groupBox7); this.Controls.Add(this.groupBox4); this.Controls.Add(this.label6); this.Controls.Add(this.cuttingToolButton); @@ -695,7 +792,6 @@ this.Controls.Add(this.groupBox6); this.Controls.Add(this.groupBox1); this.Controls.Add(this.mode); - this.Controls.Add(this.estop); this.Controls.Add(this.Execution); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); @@ -719,6 +815,10 @@ this.groupBox3.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + this.groupBox7.ResumeLayout(false); + this.groupBox7.PerformLayout(); + this.groupBox8.ResumeLayout(false); + this.groupBox8.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -765,7 +865,6 @@ private System.Windows.Forms.RadioButton mdi; private System.Windows.Forms.RadioButton manual; private System.Windows.Forms.RadioButton automatic; - private System.Windows.Forms.CheckBox estop; private System.Windows.Forms.GroupBox Execution; private System.Windows.Forms.RadioButton ready; private System.Windows.Forms.RadioButton feedhold; @@ -786,6 +885,16 @@ private System.Windows.Forms.HScrollBar xLoad; private System.Windows.Forms.TextBox program; private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button dump; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.TextBox D1_UUID; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.TextBox D1_ID; + private System.Windows.Forms.CheckBox estop; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.TextBox D1_NAME; + private System.Windows.Forms.GroupBox groupBox8; } } diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs index 807e628..611b600 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs @@ -18,18 +18,60 @@ using System.Windows.Forms; namespace MTC_Sim { using MTConnect; + using System.Configuration; + using System.Diagnostics; public partial class CMS_MachineSim : Form { + ///

+ /// adapter globale + /// Adapter mAdapter = new Adapter(); + + /// + /// D.D1.AVAIL - disponibilità + /// Event mAvail = new Event("avail"); + /// + /// XX.XX.STOP - stop per pressione emergenze + /// Event mEStop = new Event("estop"); + /// + /// D.D1.NAME + /// + Event mName = new Event("NAME"); + /// + /// D.D1.ID + /// + Event mID = new Event("ID"); + /// + /// D.D1.UUID + /// + Event mUUID = new Event("UUID"); + /// + /// D.D1.SAMPLE_INTERVAL + /// + Event mSampleInt = new Event("SampleInt"); + + + + + /// + /// D.D1.P1.PATH_MODE - modalità esecuzione + /// Event mMode = new Event("mode"); + /// + /// D.D1.P1.PATH_STATUS - status macchina + /// Event mExec = new Event("exec"); - Event mFunctionalMode = new Event("func"); + /// + /// - programma in esecuzione + /// Event mProgram = new Event("program"); + + Event mFunctionalMode = new Event("func"); Message mMessage = new Message("message"); Sample mPosition = new Sample("xPosition"); @@ -49,13 +91,24 @@ namespace MTC_Sim public CMS_MachineSim() { InitializeComponent(); - stop.Enabled = false; + // carico i default values + setDefaults(); + stop.Enabled = false; + + // item disponibilità mAdapter.AddDataItem(mAvail); mAvail.Value = "AVAILABLE"; - + // emergency stop mAdapter.AddDataItem(mEStop); + // nome ed ID/UUID - e li imposto... + mAdapter.AddDataItem(mName); + mAdapter.AddDataItem(mID); + mAdapter.AddDataItem(mUUID); + + + mAdapter.AddDataItem(mMode); mAdapter.AddDataItem(mExec); @@ -80,6 +133,15 @@ namespace MTC_Sim string[] row = { "1", "2", "3", "4" }; commonVariables.Rows.Add(row); } + /// + /// impostazione valori defaults + /// + private void setDefaults() + { + D1_NAME.Text = utils.CRS("D1_NAME"); + D1_ID.Text = utils.CRS("D1_ID"); + D1_UUID.Text = utils.CRS("D1_UUID"); + } private void start_Click(object sender, EventArgs e) { @@ -87,12 +149,13 @@ namespace MTC_Sim mAdapter.Port = Convert.ToInt32(port.Text); mAdapter.Start(); - // Disable start and enable stop. + // Disable start and enable stop/dump. start.Enabled = false; stop.Enabled = true; + dump.Enabled = true; // Start our periodic timer - gather.Interval = 1000; + gather.Interval = utils.CRI("timerInt"); gather.Enabled = true; mSystem.Normal(); @@ -109,6 +172,7 @@ namespace MTC_Sim // Stop everything... mAdapter.Stop(); stop.Enabled = false; + dump.Enabled = false; start.Enabled = true; gather.Enabled = false; } @@ -117,6 +181,10 @@ namespace MTC_Sim { mAdapter.Begin(); + mName.Value = D1_NAME.Text; + mID.Value = D1_ID.Text; + mUUID.Value = D1_UUID.Text; + if (estop.Checked) mEStop.Value = "TRIGGERED"; else @@ -229,5 +297,12 @@ namespace MTC_Sim toolWindow.Show(this); #endif } + + // apro eseguibile dump + private void dump_Click(object sender, EventArgs e) + { + string path = Application.StartupPath; + Process.Start(string.Format(@"{0}\..\..\dump\dump.exe",path)); + } } } diff --git a/MTC_Sim/MTC_Sim/MTC_Sim.csproj b/MTC_Sim/MTC_Sim/MTC_Sim.csproj index 73c2864..2cb8ade 100644 --- a/MTC_Sim/MTC_Sim/MTC_Sim.csproj +++ b/MTC_Sim/MTC_Sim/MTC_Sim.csproj @@ -34,6 +34,7 @@ + @@ -54,6 +55,7 @@ + CMS_MachineSim.cs diff --git a/MTC_Sim/MTC_Sim/utils.cs b/MTC_Sim/MTC_Sim/utils.cs new file mode 100644 index 0000000..8cf59c2 --- /dev/null +++ b/MTC_Sim/MTC_Sim/utils.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MTC_Sim +{ + public class utils + { + + /// + /// legge conf in formato stringa + /// + /// + /// + public static string CRS(string key) + { + string answ = ""; + try + { + answ = ConfigurationManager.AppSettings[key].ToString(); + } + catch + { } + return answ; + } + /// + /// legge conf in formato INT + /// + /// + /// + public static Int32 CRI(string key) + { + int answ = 0; + try + { + answ = Convert.ToInt32(CRS(key)); + } + catch + { } + return answ; + } + } +}