From 77015cd2508dd6dfe04af290e3a6aa63ae2b11ce Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Wed, 27 Apr 2016 16:28:36 +0200 Subject: [PATCH] Portata gestione path in vettoriale --- MTC_Sim/.vs/MTC_Sim/v14/.suo | Bin 109568 -> 117760 bytes MTC_Sim/MTC_Sim/AdapterDemo.cs | 59 ++- MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs | 73 ++- MTC_Sim/MTC_Sim/CMS_MachineSim.cs | 502 ++++++++++----------- MTC_Sim/MTC_Sim/CMS_MachineSim.resx | 18 - MTC_Sim/MTC_Sim/utils.cs | 67 +-- 6 files changed, 357 insertions(+), 362 deletions(-) diff --git a/MTC_Sim/.vs/MTC_Sim/v14/.suo b/MTC_Sim/.vs/MTC_Sim/v14/.suo index 9859f922ba332d75e00d7e672b6cc58b565327a9..1bf06b45a771c793173b2bcc2d7319a680f2b2d0 100644 GIT binary patch delta 7539 zcmeHLdsLK1map41(4b=T27#u5<{@J9h~SH8gZKs%#YfQiLPsGgAYc@Xw2zoX9mT%J zVv~vSolK6aVkhckG6^P5G?|P+C!2AN>!{;qXC@n0&&J7`b4K=8-$x^H;z=_9Oy-=a zKEM7|)mK%w>fT$o>ie7*e4H)5&AFj|LI^M5ZbwH4NXy5zmP8o>L}+zDupo_gPVFFrv&r@rvp8K z6F@ZJ155|-xFZPc-I)&t|101Rm;f{23zPz??V(N%1xEmJz+X^r11njc)LRIHuwWYD z+p0}|F?gz;^yd=$jBV9}62m(yJk3?tGSqGAtbY_do9n&HjgKS8m%N(;ZpJ^_r5N!b z#Td2i_it5r6#pwERe1HAeT>fcIz2O4A03}PojC>#v1Ox*i zKq%mO?%_VDivps77{CI=0#+anhzAk?8;}Sj0m(oL&=*Jr`jN;IX~?KS?cj7E1IPrj zfQNtqKsJyA39-NcFJ9q zYpSgq0`NqeHO13Ou@#kymCq&sYOf{&NdULl*4sRd$Dv|8;3+Gf&{<|jqSd5=lG>)c zC~>;6KMc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028a42..786989a 100644 --- a/MTC_Sim/MTC_Sim/AdapterDemo.cs +++ b/MTC_Sim/MTC_Sim/AdapterDemo.cs @@ -110,40 +110,50 @@ namespace MTC_Sim { base.getPath(); - -#if false - mxLoad.Value = parentForm.datiProd.xLoad; - mcLoad.Value = parentForm.datiProd.cLoad; -#endif + PathData PtData = parentForm.CurrPath; + if(PtData.PathSel>=0) + { + vettPath[PtData.PathSel].mPathFeed.Value = PtData.PathFeedrate; + vettPath[PtData.PathSel].mPathFeedOver.Value = PtData.PathFeedrateOver; + vettPath[PtData.PathSel].mPathSpeedOver.Value = PtData.PathSpeedrateOver; + vettPath[PtData.PathSel].mPathPosActX.Value = PtData.PathPosAct.x; + vettPath[PtData.PathSel].mPathPosActY.Value = PtData.PathPosAct.y; + vettPath[PtData.PathSel].mPathPosActZ.Value = PtData.PathPosAct.z; + vettPath[PtData.PathSel].mPathPosActI.Value = PtData.PathPosAct.i; + vettPath[PtData.PathSel].mPathPosActJ.Value = PtData.PathPosAct.j; + vettPath[PtData.PathSel].mPathPosActK.Value = PtData.PathPosAct.k; + } } public override void getAxis() { base.getAxis(); - if (parentForm.AxisSel >= 0) + AxisData AxData = parentForm.CurrAxis; + if (AxData.AxisSel >= 0) { // USO asse selezionato + dati visualizzati e di conseguenza aggiorno... - vettAxis[parentForm.AxisSel].mAxMainProc.Value = parentForm.AxisMainProc; - vettAxis[parentForm.AxisSel].mAxIsMaster.Value = parentForm.AxisIsMaster; - vettAxis[parentForm.AxisSel].mAxMastId.Value = parentForm.AxisMastId; - vettAxis[parentForm.AxisSel].mAxType.Value = parentForm.AxisType; - vettAxis[parentForm.AxisSel].mAxDir.Value = parentForm.AxisDir; - vettAxis[parentForm.AxisSel].mAxLoad.Value = parentForm.AxisLoad; - vettAxis[parentForm.AxisSel].mAxPosAct.Value = parentForm.AxisPosAct; - vettAxis[parentForm.AxisSel].mAxPosTgt.Value = parentForm.AxisPosTgt; - vettAxis[parentForm.AxisSel].mAxFeedAct.Value = parentForm.AxisFeedAct; - vettAxis[parentForm.AxisSel].mAxFeedOver.Value = parentForm.AxisFeedOver; - vettAxis[parentForm.AxisSel].mAxAccelAct.Value = parentForm.AxisAccel; - vettAxis[parentForm.AxisSel].mAxAccTime.Value = parentForm.AxisAccTime; - vettAxis[parentForm.AxisSel].mAxBattery.Value = parentForm.AxisBattery; + vettAxis[AxData.AxisSel].mAxMainProc.Value = AxData.AxisMainProc; + vettAxis[AxData.AxisSel].mAxIsMaster.Value = AxData.AxisIsMaster; + vettAxis[AxData.AxisSel].mAxMastId.Value = AxData.AxisMastId; + vettAxis[AxData.AxisSel].mAxType.Value = AxData.AxisType; + vettAxis[AxData.AxisSel].mAxDir.Value = AxData.AxisDir; + vettAxis[AxData.AxisSel].mAxLoad.Value = AxData.AxisLoad; + vettAxis[AxData.AxisSel].mAxPosAct.Value = AxData.AxisPosAct; + vettAxis[AxData.AxisSel].mAxPosTgt.Value = AxData.AxisPosTgt; + vettAxis[AxData.AxisSel].mAxFeedAct.Value = AxData.AxisFeedAct; + vettAxis[AxData.AxisSel].mAxFeedOver.Value = AxData.AxisFeedOver; + vettAxis[AxData.AxisSel].mAxAccelAct.Value = AxData.AxisAccel; + vettAxis[AxData.AxisSel].mAxAccTime.Value = AxData.AxisAccTime; + vettAxis[AxData.AxisSel].mAxBattery.Value = AxData.AxisBattery; } } +#if false public override int FeedRate { get { - return parentForm.datiProd.PathFeedrate; + return parentForm.CurrPath.PathFeedrate; } } @@ -151,7 +161,7 @@ namespace MTC_Sim { get { - return parentForm.datiProd.PathFeedrateOver; + return parentForm.CurrPath.PathFeedrateOver; } } @@ -159,7 +169,7 @@ namespace MTC_Sim { get { - return parentForm.datiProd.PathSpeedrateOver; + return parentForm.CurrPath.PathSpeedrateOver; } } @@ -167,10 +177,11 @@ namespace MTC_Sim { get { - position answ = parentForm.datiProd.PosAct; + position answ = parentForm.CurrPath.PathPosAct; return answ; } - } + } +#endif /// /// Recupero dati da form... diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs index cd81350..fc67b9a 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.Designer.cs @@ -170,6 +170,8 @@ this.label36 = new System.Windows.Forms.Label(); this.AxAccelAct = new System.Windows.Forms.TextBox(); this.label37 = new System.Windows.Forms.Label(); + this.cbPathSel = new System.Windows.Forms.ComboBox(); + this.label38 = new System.Windows.Forms.Label(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.PosAct)).BeginInit(); this.groupBox3.SuspendLayout(); @@ -212,7 +214,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(386, 243); + this.groupBox4.Location = new System.Drawing.Point(4, 418); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(379, 52); this.groupBox4.TabIndex = 44; @@ -356,10 +358,10 @@ this.I, this.J, this.K}); - this.PosAct.Location = new System.Drawing.Point(85, 99); + this.PosAct.Location = new System.Drawing.Point(80, 115); this.PosAct.Name = "PosAct"; this.PosAct.ScrollBars = System.Windows.Forms.ScrollBars.None; - this.PosAct.Size = new System.Drawing.Size(287, 41); + this.PosAct.Size = new System.Drawing.Size(292, 41); this.PosAct.TabIndex = 32; // // X @@ -433,7 +435,7 @@ this.groupBox3.Controls.Add(this.ERR_00); this.groupBox3.Controls.Add(this.ERR_02); this.groupBox3.Controls.Add(this.ERR_01); - this.groupBox3.Location = new System.Drawing.Point(3, 412); + this.groupBox3.Location = new System.Drawing.Point(3, 504); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(375, 114); this.groupBox3.TabIndex = 41; @@ -513,7 +515,7 @@ this.groupBox2.Controls.Add(this.label4); this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.AxLoad); - this.groupBox2.Location = new System.Drawing.Point(385, 301); + this.groupBox2.Location = new System.Drawing.Point(385, 418); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(375, 225); this.groupBox2.TabIndex = 40; @@ -610,7 +612,7 @@ 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(3, 94); + this.groupBox9.Location = new System.Drawing.Point(3, 148); this.groupBox9.Name = "groupBox9"; this.groupBox9.Size = new System.Drawing.Size(379, 158); this.groupBox9.TabIndex = 55; @@ -752,7 +754,7 @@ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1, this.MainProgrBar}); - this.statusStrip1.Location = new System.Drawing.Point(0, 618); + this.statusStrip1.Location = new System.Drawing.Point(0, 725); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Size = new System.Drawing.Size(794, 22); this.statusStrip1.TabIndex = 59; @@ -771,6 +773,8 @@ // // groupBox13 // + this.groupBox13.Controls.Add(this.cbPathSel); + this.groupBox13.Controls.Add(this.label38); this.groupBox13.Controls.Add(this.label29); this.groupBox13.Controls.Add(this.PosAct); this.groupBox13.Controls.Add(this.txtPathSpeedOver); @@ -782,9 +786,9 @@ 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(3, 258); + this.groupBox13.Location = new System.Drawing.Point(385, 84); this.groupBox13.Name = "groupBox13"; - this.groupBox13.Size = new System.Drawing.Size(379, 148); + this.groupBox13.Size = new System.Drawing.Size(379, 167); this.groupBox13.TabIndex = 60; this.groupBox13.TabStop = false; this.groupBox13.Text = "PATH"; @@ -792,7 +796,7 @@ // label29 // this.label29.AutoSize = true; - this.label29.Location = new System.Drawing.Point(12, 113); + this.label29.Location = new System.Drawing.Point(12, 133); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(51, 13); this.label29.TabIndex = 33; @@ -800,7 +804,7 @@ // // txtPathSpeedOver // - this.txtPathSpeedOver.Location = new System.Drawing.Point(298, 68); + this.txtPathSpeedOver.Location = new System.Drawing.Point(298, 88); this.txtPathSpeedOver.Name = "txtPathSpeedOver"; this.txtPathSpeedOver.Size = new System.Drawing.Size(74, 20); this.txtPathSpeedOver.TabIndex = 32; @@ -809,7 +813,7 @@ // label28 // this.label28.AutoSize = true; - this.label28.Location = new System.Drawing.Point(10, 71); + this.label28.Location = new System.Drawing.Point(10, 91); this.label28.Name = "label28"; this.label28.Size = new System.Drawing.Size(67, 13); this.label28.TabIndex = 31; @@ -817,7 +821,7 @@ // // hsPathSpeedOver // - this.hsPathSpeedOver.Location = new System.Drawing.Point(80, 71); + this.hsPathSpeedOver.Location = new System.Drawing.Point(80, 91); this.hsPathSpeedOver.Maximum = 150; this.hsPathSpeedOver.Name = "hsPathSpeedOver"; this.hsPathSpeedOver.Size = new System.Drawing.Size(213, 18); @@ -826,7 +830,7 @@ // // txtPathFeedOver // - this.txtPathFeedOver.Location = new System.Drawing.Point(298, 43); + this.txtPathFeedOver.Location = new System.Drawing.Point(298, 63); this.txtPathFeedOver.Name = "txtPathFeedOver"; this.txtPathFeedOver.Size = new System.Drawing.Size(74, 20); this.txtPathFeedOver.TabIndex = 29; @@ -835,7 +839,7 @@ // label27 // this.label27.AutoSize = true; - this.label27.Location = new System.Drawing.Point(10, 46); + this.label27.Location = new System.Drawing.Point(10, 66); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(60, 13); this.label27.TabIndex = 28; @@ -843,7 +847,7 @@ // // hsPathFeedOver // - this.hsPathFeedOver.Location = new System.Drawing.Point(80, 46); + this.hsPathFeedOver.Location = new System.Drawing.Point(80, 66); this.hsPathFeedOver.Maximum = 150; this.hsPathFeedOver.Name = "hsPathFeedOver"; this.hsPathFeedOver.Size = new System.Drawing.Size(213, 18); @@ -852,7 +856,7 @@ // // txtPathFeed // - this.txtPathFeed.Location = new System.Drawing.Point(298, 17); + this.txtPathFeed.Location = new System.Drawing.Point(298, 37); this.txtPathFeed.Name = "txtPathFeed"; this.txtPathFeed.Size = new System.Drawing.Size(74, 20); this.txtPathFeed.TabIndex = 26; @@ -861,7 +865,7 @@ // label26 // this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(10, 20); + this.label26.Location = new System.Drawing.Point(10, 40); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(49, 13); this.label26.TabIndex = 24; @@ -869,7 +873,7 @@ // // hsPathFeed // - this.hsPathFeed.Location = new System.Drawing.Point(80, 20); + this.hsPathFeed.Location = new System.Drawing.Point(80, 40); this.hsPathFeed.Maximum = 150; this.hsPathFeed.Name = "hsPathFeed"; this.hsPathFeed.Size = new System.Drawing.Size(213, 18); @@ -939,7 +943,7 @@ this.tabCtrlMain.Location = new System.Drawing.Point(0, 50); this.tabCtrlMain.Name = "tabCtrlMain"; this.tabCtrlMain.SelectedIndex = 0; - this.tabCtrlMain.Size = new System.Drawing.Size(794, 568); + this.tabCtrlMain.Size = new System.Drawing.Size(794, 675); this.tabCtrlMain.TabIndex = 65; // // tpStatus @@ -1043,7 +1047,7 @@ this.tpSIM.Controls.Add(this.groupBox12); this.tpSIM.Location = new System.Drawing.Point(4, 22); this.tpSIM.Name = "tpSIM"; - this.tpSIM.Size = new System.Drawing.Size(786, 542); + this.tpSIM.Size = new System.Drawing.Size(786, 649); this.tpSIM.TabIndex = 2; this.tpSIM.Text = "SIMULATION"; // @@ -1053,7 +1057,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(386, 84); + this.Execution.Location = new System.Drawing.Point(3, 94); this.Execution.Name = "Execution"; this.Execution.Size = new System.Drawing.Size(380, 48); this.Execution.TabIndex = 61; @@ -1399,7 +1403,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(386, 138); + this.groupBox12.Location = new System.Drawing.Point(3, 312); this.groupBox12.Name = "groupBox12"; this.groupBox12.Size = new System.Drawing.Size(380, 100); this.groupBox12.TabIndex = 58; @@ -1553,11 +1557,30 @@ this.label37.TabIndex = 42; this.label37.Text = "Accel Act"; // + // cbPathSel + // + this.cbPathSel.DisplayMember = "Name"; + this.cbPathSel.FormattingEnabled = true; + this.cbPathSel.Location = new System.Drawing.Point(80, 16); + this.cbPathSel.Name = "cbPathSel"; + this.cbPathSel.Size = new System.Drawing.Size(121, 21); + this.cbPathSel.TabIndex = 63; + this.cbPathSel.ValueMember = "Value"; + // + // label38 + // + this.label38.AutoSize = true; + this.label38.Location = new System.Drawing.Point(11, 20); + this.label38.Name = "label38"; + this.label38.Size = new System.Drawing.Size(54, 13); + this.label38.TabIndex = 62; + this.label38.Text = "Path Num"; + // // CMS_MachineSim // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(794, 640); + this.ClientSize = new System.Drawing.Size(794, 747); this.Controls.Add(this.tabCtrlMain); this.Controls.Add(this.lblCurrAdapt); this.Controls.Add(this.statusStrip1); @@ -1749,6 +1772,8 @@ private System.Windows.Forms.Label label35; private System.Windows.Forms.Label label34; private System.Windows.Forms.ComboBox cbAxType; + private System.Windows.Forms.ComboBox cbPathSel; + private System.Windows.Forms.Label label38; } } diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs index 4567132..8cbfb62 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.cs +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.cs @@ -37,6 +37,8 @@ namespace MTC_Sim /// protected tipoAdapter tipoScelto = tipoAdapter.Demo; + #region utils ed helpers + public static void EnableTab(TabPage page, bool enable) { EnableControls(page.Controls, enable); @@ -49,6 +51,17 @@ namespace MTC_Sim EnableControls(ctl.Controls, enable); } } + private class Item + { + public string Name; + public int Value; + public Item(string name, int value) + { + Name = name; Value = value; + } + } + + #endregion public CMS_MachineSim() { @@ -151,7 +164,19 @@ namespace MTC_Sim string[] row = { "0", "0", "0", "0", "0", "0" }; PosAct.Rows.Add(row); - // fix componenti vettoriali... + // fix componenti vettoriali PATH, UNOP, ASSI... + for (int i = 0; i < adpConf.nPath; i++) + { + cbPathSel.Items.Insert(i, adpConf.Path[i].alias); + } + if (adpConf.nPath > 0) cbPathSel.SelectedIndex = 0; + + for (int i = 0; i < adpConf.nUnOp; i++) + { + //cbAxNum.Items.Insert(i, adpConf.Axis[i].alias); + } + //if (adpConf.nUnOp > 0) cbAxNum.SelectedIndex = 0; + for (int i = 0; i < adpConf.nAxis; i++) { cbAxNum.Items.Insert(i, adpConf.Axis[i].alias); @@ -160,15 +185,7 @@ namespace MTC_Sim } - private class Item - { - public string Name; - public int Value; - public Item(string name, int value) - { - Name = name; Value = value; - } - } + /// /// Avvio dell'adapter /// @@ -224,85 +241,7 @@ namespace MTC_Sim } - #region accesso dati FROM/TO maschera - /// - /// Dati di produzione (su form) - /// - public prodData datiProd - { - get - { - prodData answ = new prodData(); - // carico da form - answ.ProgramName = program.Text; - answ.ProgrRow = PROG_ROW_NUM.Text; - answ.PartId = partID.Text; - answ.Operator = OPERATOR_ID.Text; - - // variabili lette da + controlli - answ.Status = stop.Enabled; - answ.Power = Power; - answ.AccTime = AccTime; - answ.EmrStop = estop.Checked; - if (automatic.Checked) answ.RunMode = "AUTOMATIC"; - else if (mdi.Checked) answ.RunMode = "MANUAL_DATA_INPUT"; - else if (edit.Checked) answ.RunMode = "EDIT"; - else answ.RunMode = "MANUAL"; - - if (running.Checked) answ.ExeMode = "ACTIVE"; - else if (feedhold.Checked) answ.ExeMode = "FEED_HOLD"; - else if (stopped.Checked) answ.ExeMode = "STOPPED"; - else if (ready.Checked) answ.ExeMode = "READY"; - - - answ.FuncMode = ((KeyValuePair)functionalMode.SelectedItem).Key; - - answ.MessageCode = messageCode.Text; - answ.MessageText = messageText.Text; - - // pezzi - answ.pzOk = pzOk; - answ.pzKo = pzKo; - answ.pzTot = pzOk + pzKo; - - // FEED/SPEED - answ.PathFeedrate = hsPathFeed.Value; - answ.PathFeedrateOver = hsPathFeedOver.Value; - answ.PathSpeedrateOver = hsPathSpeedOver.Value; - - // posizione attuale - position posAct = new position(); - DataGridViewCellCollection cells = PosAct.Rows[0].Cells; - float.TryParse(cells[0].Value.ToString(), out posAct.x); - float.TryParse(cells[1].Value.ToString(), out posAct.y); - float.TryParse(cells[2].Value.ToString(), out posAct.z); - float.TryParse(cells[3].Value.ToString(), out posAct.i); - float.TryParse(cells[4].Value.ToString(), out posAct.j); - float.TryParse(cells[5].Value.ToString(), out posAct.k); - answ.PosAct = posAct; - - // load... - answ.xLoad = AxLoad.Value; - answ.cLoad = AxFeedAct.Value; - - // allarmi... - answ.err_01 = ERR_01.Checked; - answ.err_02 = ERR_02.Checked; - answ.err_03 = ERR_03.Checked; - answ.err_04 = ERR_04.Checked; - answ.err_05 = ERR_05.Checked; - answ.err_06 = ERR_06.Checked; - - - // ritorno oggetto! - return answ; - } - } - - - - #endregion private void message_Leave(object sender, EventArgs e) @@ -324,93 +263,6 @@ namespace MTC_Sim agObj.mAdapter.SendChanged(); } - private void pzKo_TextChanged(object sender, EventArgs e) - { - agObj.STROBE_PLC = agObj.STROBE_PLC | Strobe.PZ_KO; - txtPzTot.Text = pzTot.ToString(); - } - - protected int Power - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtPower.Text.Trim()); - } - catch - { } - return answ; - } - set - { - txtPower.Text = value.ToString(); - } - } - protected int AccTime - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtAccTime.Text.Trim()); - } - catch - { } - return answ; - } - set - { - txtAccTime.Text = value.ToString(); - } - } - protected int pzOk - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtPzOk.Text.Trim()); - } - catch - { } - return answ; - } - set - { - txtPzOk.Text = value.ToString(); - txtPzTot.Text = pzTot.ToString(); - } - } - protected int pzKo - { - get - { - int answ = 0; - try - { - answ = Convert.ToInt32(txtPzKo.Text.Trim()); - } - catch - { } - return answ; - } - set - { - txtPzKo.Text = value.ToString(); - txtPzTot.Text = pzTot.ToString(); - } - } - protected int pzTot - { - get - { - return pzOk + pzKo; - } - } // apro eseguibile dump private void dump_Click(object sender, EventArgs e) @@ -708,6 +560,193 @@ namespace MTC_Sim } } + #endregion + + #region accesso dati produzione FROM/TO maschera + + /// + /// Dati di produzione (su form) + /// + public prodData datiProd + { + get + { + prodData answ = new prodData(); + // carico da form + answ.ProgramName = program.Text; + answ.ProgrRow = PROG_ROW_NUM.Text; + answ.PartId = partID.Text; + answ.Operator = OPERATOR_ID.Text; + + // variabili lette da + controlli + answ.Status = stop.Enabled; + answ.Power = Power; + answ.AccTime = AccTime; + answ.EmrStop = estop.Checked; + if (automatic.Checked) answ.RunMode = "AUTOMATIC"; + else if (mdi.Checked) answ.RunMode = "MANUAL_DATA_INPUT"; + else if (edit.Checked) answ.RunMode = "EDIT"; + else answ.RunMode = "MANUAL"; + + if (running.Checked) answ.ExeMode = "ACTIVE"; + else if (feedhold.Checked) answ.ExeMode = "FEED_HOLD"; + else if (stopped.Checked) answ.ExeMode = "STOPPED"; + else if (ready.Checked) answ.ExeMode = "READY"; + + + answ.FuncMode = ((KeyValuePair)functionalMode.SelectedItem).Key; + + answ.MessageCode = messageCode.Text; + answ.MessageText = messageText.Text; + + // pezzi + answ.pzOk = pzOk; + answ.pzKo = pzKo; + answ.pzTot = pzOk + pzKo; + + + // allarmi... + answ.err_01 = ERR_01.Checked; + answ.err_02 = ERR_02.Checked; + answ.err_03 = ERR_03.Checked; + answ.err_04 = ERR_04.Checked; + answ.err_05 = ERR_05.Checked; + answ.err_06 = ERR_06.Checked; + + + // ritorno oggetto! + return answ; + } + } + + private void pzKo_TextChanged(object sender, EventArgs e) + { + agObj.STROBE_PLC = agObj.STROBE_PLC | Strobe.PZ_KO; + txtPzTot.Text = pzTot.ToString(); + } + protected int Power + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(txtPower.Text.Trim()); + } + catch + { } + return answ; + } + set + { + txtPower.Text = value.ToString(); + } + } + protected int AccTime + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(txtAccTime.Text.Trim()); + } + catch + { } + return answ; + } + set + { + txtAccTime.Text = value.ToString(); + } + } + protected int pzOk + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(txtPzOk.Text.Trim()); + } + catch + { } + return answ; + } + set + { + txtPzOk.Text = value.ToString(); + txtPzTot.Text = pzTot.ToString(); + } + } + protected int pzKo + { + get + { + int answ = 0; + try + { + answ = Convert.ToInt32(txtPzKo.Text.Trim()); + } + catch + { } + return answ; + } + set + { + txtPzKo.Text = value.ToString(); + txtPzTot.Text = pzTot.ToString(); + } + } + protected int pzTot + { + get + { + return pzOk + pzKo; + } + } + + #endregion + + #region gestione Path + + /// + /// Dati PATH + /// + public PathData CurrPath + { + get + { + PathData answ = new PathData(); + + answ.PathSel = cbPathSel.SelectedIndex; + // FEED/SPEED + answ.PathFeedrate = hsPathFeed.Value; + answ.PathFeedrateOver = hsPathFeedOver.Value; + answ.PathSpeedrateOver = hsPathSpeedOver.Value; + + // posizione attuale + position posAct = new position(); + DataGridViewCellCollection cells = PosAct.Rows[0].Cells; + float.TryParse(cells[0].Value.ToString(), out posAct.x); + float.TryParse(cells[1].Value.ToString(), out posAct.y); + float.TryParse(cells[2].Value.ToString(), out posAct.z); + float.TryParse(cells[3].Value.ToString(), out posAct.i); + float.TryParse(cells[4].Value.ToString(), out posAct.j); + float.TryParse(cells[5].Value.ToString(), out posAct.k); + answ.PathPosAct = posAct; + + // ritorno oggetto! + return answ; + } + } + + #endregion + + #region gestione UnOp + + + #endregion #region gestione assi @@ -729,35 +768,36 @@ namespace MTC_Sim AxBatt.Text = "100"; } - public int AxisSel + /// + /// Dati di produzione (su form) + /// + public AxisData CurrAxis { get { - return cbAxNum.SelectedIndex; + Random rnd = new Random(); + AxisData answ = new AxisData(); + answ.AxisSel= cbAxNum.SelectedIndex; + answ.AxisMainProc = AxMainProc.Text; + answ.AxisIsMaster = AxIsMaster.Checked; + answ.AxisMastId = AxMastId.Text; + answ.AxisType = AxisType; + answ.AxisDir = AxDir.Text; + answ.AxisLoad = AxLoad.Value; + answ.AxisPosAct = AxPosition.Value + rnd.Next(-2, 2); + answ.AxisPosTgt = AxPosition.Value; + answ.AxisFeedAct = AxFeedAct.Value; + answ.AxisFeedOver = AxFeedOver.Value; + answ.AxisAccel = AxAccelAct.Text; + answ.AxisAccTime = AxAccTime.Text; + answ.AxisBattery = AxBatt.Text; + + // restituisco oggetto + return answ; } } - public string AxisMainProc - { - get - { - return AxMainProc.Text; - } - } - public bool AxisIsMaster - { - get - { - return AxIsMaster.Checked; - } - } - public string AxisMastId - { - get - { - return AxMastId.Text; - } - } - public string AxisType + + protected string AxisType { get { @@ -771,70 +811,6 @@ namespace MTC_Sim return answ; } } - public string AxisDir - { - get - { - return AxDir.Text; - } - } - public int AxisLoad - { - get - { - return AxLoad.Value; - } - } - public int AxisPosAct - { - get - { - Random rnd = new Random(); - return AxPosition.Value + rnd.Next(-2, 2); - } - } - public int AxisPosTgt - { - get - { - return AxPosition.Value; - } - } - public int AxisFeedAct - { - get - { - return AxFeedAct.Value; - } - } - public int AxisFeedOver - { - get - { - return AxFeedOver.Value; - } - } - public string AxisAccel - { - get - { - return AxAccelAct.Text; - } - } - public string AxisAccTime - { - get - { - return AxAccTime.Text; - } - } - public string AxisBattery - { - get - { - return AxBatt.Text; - } - } private void xLoad_Scroll(object sender, ScrollEventArgs e) { diff --git a/MTC_Sim/MTC_Sim/CMS_MachineSim.resx b/MTC_Sim/MTC_Sim/CMS_MachineSim.resx index 707fc60..d24e7d7 100644 --- a/MTC_Sim/MTC_Sim/CMS_MachineSim.resx +++ b/MTC_Sim/MTC_Sim/CMS_MachineSim.resx @@ -138,24 +138,6 @@ True - - True - - - True - - - True - - - True - - - True - - - True - 104, 17 diff --git a/MTC_Sim/MTC_Sim/utils.cs b/MTC_Sim/MTC_Sim/utils.cs index ad9495b..0f54272 100644 --- a/MTC_Sim/MTC_Sim/utils.cs +++ b/MTC_Sim/MTC_Sim/utils.cs @@ -80,28 +80,6 @@ namespace MTC_Sim return answ; } -#if false - public DataSet DS_lists - { - get - { - DataTable tbl = new DataTable("HaltType"); - tbl.Columns.Add("label"); - tbl.Columns.Add("value"); - tbl.Rows.Add("COD001", 001); - tbl.Rows.Add("COD002", 002); - tbl.Rows.Add("COD003", 003); - - // Create a DataSet. - DataSet set = new DataSet("MTC-ADAPT"); - set.Tables.Add(tbl); - set.Namespace = "adapt"; - set.Prefix = "mtc"; - - return set; - } - } -#endif } @@ -169,17 +147,7 @@ namespace MTC_Sim public int pzTot; public int pzOk; public int pzKo; - - public int PathFeedrate; - public int PathFeedrateOver; - public int PathSpeedrateOver; - - public position PosAct; - - public int xLoad; - public int yLoad; - public int zLoad; - public int cLoad; + public bool err_01; public bool err_02; @@ -189,6 +157,39 @@ namespace MTC_Sim public bool err_06; } + public struct PathData + { + public int PathSel; + public int PathFeedrate; + public int PathFeedrateOver; + public int PathSpeedrateOver; + public position PathPosAct; + } + + + public struct UnOpData + { + + } + + public struct AxisData + { + public int AxisSel; + public string AxisMainProc; + public bool AxisIsMaster; + public string AxisMastId; + public string AxisType; + public string AxisDir; + public int AxisLoad; + public int AxisPosAct; + public int AxisPosTgt; + public int AxisFeedAct; + public int AxisFeedOver; + public string AxisAccel; + public string AxisAccTime; + public string AxisBattery; + } + /// /// Vettore completo posizione (X-Y-Z con versori i-j-k) ///