From 1497a1fedf1457c6d28f0939393f40c762d49f92 Mon Sep 17 00:00:00 2001 From: 17860779768 <3219079380@qq.com> Date: Fri, 24 Mar 2023 09:54:33 +0800 Subject: [PATCH] 20230324Change --- src/BRS.Process.A020/A020Process_Operation.cs | 3 +- .../UI/ContorlShaft.Designer.cs | 776 ++++++++++-------- src/BRS.Process.A020/UI/ContorlShaft.cs | 174 ++-- 3 files changed, 522 insertions(+), 431 deletions(-) diff --git a/src/BRS.Process.A020/A020Process_Operation.cs b/src/BRS.Process.A020/A020Process_Operation.cs index df4ff18..dd8da77 100644 --- a/src/BRS.Process.A020/A020Process_Operation.cs +++ b/src/BRS.Process.A020/A020Process_Operation.cs @@ -2048,7 +2048,8 @@ namespace BRS.Process.A020 { ProcessWriteInt(MelsecPLC, "D3", "int", "0");//D3置0 //ProcessWriteInt(MelsecPLC, "D171", "int", "3000");//最大扭矩3000 - ProcessWriteInt(MelsecPLC, "D53", "int", "1");//手动拧紧螺丝D51置1 + ProcessWriteInt(MelsecPLC, "D57", "int", "1");//自动拧松螺丝D57置1 + ProcessWriteInt(MelsecPLC, "D155", "int", "10");//扭矩到目标设定值计时设定值,设为1秒 machineState = MachineState.Waiting;//设备启动完成后保持状态 LogAsync(DateTime.Now, LogLevel.Detail, "设备已启动,请勿其他操作!!"); } diff --git a/src/BRS.Process.A020/UI/ContorlShaft.Designer.cs b/src/BRS.Process.A020/UI/ContorlShaft.Designer.cs index 53a3f4e..e0cef57 100644 --- a/src/BRS.Process.A020/UI/ContorlShaft.Designer.cs +++ b/src/BRS.Process.A020/UI/ContorlShaft.Designer.cs @@ -46,20 +46,41 @@ namespace BRS.Process.A020.UI this.StopStateLabel = new Sunny.UI.UILabel(); this.chart2 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.uiPanel1 = new Sunny.UI.UIPanel(); + this.BtnSeries = new Sunny.UI.UIPanel(); this.ManualLoosenBtn = new Sunny.UI.UIButton(); - this.ManualToughBtn = new Sunny.UI.UIButton(); - this.AutoLoosenBtn1 = new Sunny.UI.UIButton(); this.AutoToughBtn1 = new Sunny.UI.UIButton(); + this.AutoLoosenBtn1 = new Sunny.UI.UIButton(); + this.ManualToughBtn = new Sunny.UI.UIButton(); + this.ParameterSetting = new Sunny.UI.UIPanel(); + this.label10 = new System.Windows.Forms.Label(); this.OKBtn = new Sunny.UI.UIButton(); - this.label5 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.ResettingBtn = new Sunny.UI.UIButton(); + this.label6 = new System.Windows.Forms.Label(); + this.textBox5 = new System.Windows.Forms.TextBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.textBox4 = new System.Windows.Forms.TextBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.LightSeries = new Sunny.UI.UIPanel(); + this.MoveStateLight1 = new BRS.Process.A020.UI.CircleButton(); + this.StopStateLight1 = new BRS.Process.A020.UI.CircleButton(); + this.ToughLight1 = new BRS.Process.A020.UI.CircleButton(); + this.LoosenLight1 = new BRS.Process.A020.UI.CircleButton(); this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.uiPanel2 = new Sunny.UI.UIPanel(); + this.AutoBtn1 = new BRS.Process.A020.UI.CircleButton(); + this.ManualBtn1 = new BRS.Process.A020.UI.CircleButton(); this.TestBtn = new Sunny.UI.UIButton(); this.StopBtn2 = new Sunny.UI.UIButton(); this.StartBtn1 = new Sunny.UI.UIButton(); + this.ESBtn = new BRS.Process.A020.UI.CircleButton(); this.AutoLoosenBtn = new Sunny.UI.UIButton(); this.AutoToughBtn = new Sunny.UI.UIButton(); this.uiLabel2 = new Sunny.UI.UILabel(); @@ -68,36 +89,19 @@ namespace BRS.Process.A020.UI this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.uiButton1 = new Sunny.UI.UIButton(); this.timer2 = new System.Windows.Forms.Timer(this.components); - this.label6 = new System.Windows.Forms.Label(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.label7 = new System.Windows.Forms.Label(); - this.textBox3 = new System.Windows.Forms.TextBox(); - this.label8 = new System.Windows.Forms.Label(); - this.textBox4 = new System.Windows.Forms.TextBox(); - this.label9 = new System.Windows.Forms.Label(); - this.textBox5 = new System.Windows.Forms.TextBox(); - this.ResettingBtn = new Sunny.UI.UIButton(); - this.uiPanel2 = new Sunny.UI.UIPanel(); - this.LightSeries = new Sunny.UI.UIPanel(); - this.ParameterSetting = new Sunny.UI.UIPanel(); - this.label10 = new System.Windows.Forms.Label(); - this.BtnSeries = new Sunny.UI.UIPanel(); - this.MoveStateLight1 = new BRS.Process.A020.UI.CircleButton(); - this.StopStateLight1 = new BRS.Process.A020.UI.CircleButton(); - this.ToughLight1 = new BRS.Process.A020.UI.CircleButton(); - this.LoosenLight1 = new BRS.Process.A020.UI.CircleButton(); this.ManualLight = new BRS.Process.A020.UI.CircleButton(); this.AutoLight = new BRS.Process.A020.UI.CircleButton(); - this.AutoBtn1 = new BRS.Process.A020.UI.CircleButton(); - this.ManualBtn1 = new BRS.Process.A020.UI.CircleButton(); - this.ESBtn = new BRS.Process.A020.UI.CircleButton(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.chart2)).BeginInit(); this.uiPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); - this.uiPanel2.SuspendLayout(); - this.LightSeries.SuspendLayout(); - this.ParameterSetting.SuspendLayout(); this.BtnSeries.SuspendLayout(); + this.ParameterSetting.SuspendLayout(); + this.LightSeries.SuspendLayout(); + this.uiPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); this.SuspendLayout(); // // TorqueSettingBtn @@ -233,7 +237,6 @@ namespace BRS.Process.A020.UI this.uiPanel1.Controls.Add(this.TestBtn); this.uiPanel1.Controls.Add(this.StopBtn2); this.uiPanel1.Controls.Add(this.StartBtn1); - this.uiPanel1.Controls.Add(this.ESBtn); this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Left; this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiPanel1.Location = new System.Drawing.Point(0, 0); @@ -247,11 +250,29 @@ namespace BRS.Process.A020.UI this.uiPanel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.uiPanel1.Load += new System.EventHandler(this.uiPanel1_Load); // + // BtnSeries + // + this.BtnSeries.Controls.Add(this.label13); + this.BtnSeries.Controls.Add(this.ManualLoosenBtn); + this.BtnSeries.Controls.Add(this.AutoToughBtn1); + this.BtnSeries.Controls.Add(this.AutoLoosenBtn1); + this.BtnSeries.Controls.Add(this.ManualToughBtn); + this.BtnSeries.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.BtnSeries.Location = new System.Drawing.Point(335, 201); + this.BtnSeries.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.BtnSeries.MinimumSize = new System.Drawing.Size(1, 1); + this.BtnSeries.Name = "BtnSeries"; + this.BtnSeries.Size = new System.Drawing.Size(368, 345); + this.BtnSeries.TabIndex = 40; + this.BtnSeries.Text = null; + this.BtnSeries.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + this.BtnSeries.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + // // ManualLoosenBtn // this.ManualLoosenBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.ManualLoosenBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.ManualLoosenBtn.Location = new System.Drawing.Point(3, 133); + this.ManualLoosenBtn.Location = new System.Drawing.Point(3, 206); this.ManualLoosenBtn.MinimumSize = new System.Drawing.Size(1, 1); this.ManualLoosenBtn.Name = "ManualLoosenBtn"; this.ManualLoosenBtn.Size = new System.Drawing.Size(150, 75); @@ -262,11 +283,39 @@ namespace BRS.Process.A020.UI this.ManualLoosenBtn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ManualLoosenBtn_MouseDown); this.ManualLoosenBtn.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ManualLoosenBtn_MouseUp); // + // AutoToughBtn1 + // + this.AutoToughBtn1.Cursor = System.Windows.Forms.Cursors.Hand; + this.AutoToughBtn1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.AutoToughBtn1.Location = new System.Drawing.Point(212, 85); + this.AutoToughBtn1.MinimumSize = new System.Drawing.Size(1, 1); + this.AutoToughBtn1.Name = "AutoToughBtn1"; + this.AutoToughBtn1.Size = new System.Drawing.Size(150, 75); + this.AutoToughBtn1.TabIndex = 11; + this.AutoToughBtn1.Text = "自动拧紧"; + this.AutoToughBtn1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.AutoToughBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + this.AutoToughBtn1.Click += new System.EventHandler(this.AutoToughBtn1_Click); + // + // AutoLoosenBtn1 + // + this.AutoLoosenBtn1.Cursor = System.Windows.Forms.Cursors.Hand; + this.AutoLoosenBtn1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.AutoLoosenBtn1.Location = new System.Drawing.Point(212, 206); + this.AutoLoosenBtn1.MinimumSize = new System.Drawing.Size(1, 1); + this.AutoLoosenBtn1.Name = "AutoLoosenBtn1"; + this.AutoLoosenBtn1.Size = new System.Drawing.Size(150, 75); + this.AutoLoosenBtn1.TabIndex = 12; + this.AutoLoosenBtn1.Text = "自动拧松"; + this.AutoLoosenBtn1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.AutoLoosenBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + this.AutoLoosenBtn1.Click += new System.EventHandler(this.AutoLoosenBtn1_Click); + // // ManualToughBtn // this.ManualToughBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.ManualToughBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.ManualToughBtn.Location = new System.Drawing.Point(3, 12); + this.ManualToughBtn.Location = new System.Drawing.Point(3, 85); this.ManualToughBtn.MinimumSize = new System.Drawing.Size(1, 1); this.ManualToughBtn.Name = "ManualToughBtn"; this.ManualToughBtn.Size = new System.Drawing.Size(150, 75); @@ -277,39 +326,48 @@ namespace BRS.Process.A020.UI this.ManualToughBtn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ManualToughBtn_MouseDown); this.ManualToughBtn.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ManualToughBtn_MouseUp); // - // AutoLoosenBtn1 + // ParameterSetting // - this.AutoLoosenBtn1.Cursor = System.Windows.Forms.Cursors.Hand; - this.AutoLoosenBtn1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.AutoLoosenBtn1.Location = new System.Drawing.Point(212, 133); - this.AutoLoosenBtn1.MinimumSize = new System.Drawing.Size(1, 1); - this.AutoLoosenBtn1.Name = "AutoLoosenBtn1"; - this.AutoLoosenBtn1.Size = new System.Drawing.Size(150, 75); - this.AutoLoosenBtn1.TabIndex = 12; - this.AutoLoosenBtn1.Text = "自动拧松"; - this.AutoLoosenBtn1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.AutoLoosenBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - this.AutoLoosenBtn1.Click += new System.EventHandler(this.AutoLoosenBtn1_Click); + this.ParameterSetting.Controls.Add(this.label10); + this.ParameterSetting.Controls.Add(this.OKBtn); + this.ParameterSetting.Controls.Add(this.textBox1); + this.ParameterSetting.Controls.Add(this.label5); + this.ParameterSetting.Controls.Add(this.ResettingBtn); + this.ParameterSetting.Controls.Add(this.label6); + this.ParameterSetting.Controls.Add(this.textBox5); + this.ParameterSetting.Controls.Add(this.textBox2); + this.ParameterSetting.Controls.Add(this.label9); + this.ParameterSetting.Controls.Add(this.label7); + this.ParameterSetting.Controls.Add(this.textBox4); + this.ParameterSetting.Controls.Add(this.textBox3); + this.ParameterSetting.Controls.Add(this.label8); + this.ParameterSetting.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.ParameterSetting.Location = new System.Drawing.Point(12, 201); + this.ParameterSetting.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.ParameterSetting.MinimumSize = new System.Drawing.Size(1, 1); + this.ParameterSetting.Name = "ParameterSetting"; + this.ParameterSetting.Size = new System.Drawing.Size(317, 345); + this.ParameterSetting.TabIndex = 39; + this.ParameterSetting.Text = null; + this.ParameterSetting.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + this.ParameterSetting.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); // - // AutoToughBtn1 + // label10 // - this.AutoToughBtn1.Cursor = System.Windows.Forms.Cursors.Hand; - this.AutoToughBtn1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.AutoToughBtn1.Location = new System.Drawing.Point(212, 12); - this.AutoToughBtn1.MinimumSize = new System.Drawing.Size(1, 1); - this.AutoToughBtn1.Name = "AutoToughBtn1"; - this.AutoToughBtn1.Size = new System.Drawing.Size(150, 75); - this.AutoToughBtn1.TabIndex = 11; - this.AutoToughBtn1.Text = "自动拧紧"; - this.AutoToughBtn1.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.AutoToughBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - this.AutoToughBtn1.Click += new System.EventHandler(this.AutoToughBtn1_Click); + this.label10.BackColor = System.Drawing.Color.Transparent; + this.label10.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label10.Location = new System.Drawing.Point(3, 3); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(123, 47); + this.label10.TabIndex = 36; + this.label10.Text = "参数设置"; + this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // OKBtn // this.OKBtn.Cursor = System.Windows.Forms.Cursors.Hand; this.OKBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.OKBtn.Location = new System.Drawing.Point(230, 221); + this.OKBtn.Location = new System.Drawing.Point(226, 250); this.OKBtn.MinimumSize = new System.Drawing.Size(1, 1); this.OKBtn.Name = "OKBtn"; this.OKBtn.Size = new System.Drawing.Size(70, 31); @@ -319,58 +377,180 @@ namespace BRS.Process.A020.UI this.OKBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.OKBtn.Click += new System.EventHandler(this.OKBtn_Click); // - // label5 - // - this.label5.BackColor = System.Drawing.Color.Transparent; - this.label5.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label5.Location = new System.Drawing.Point(30, 49); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(114, 30); - this.label5.TabIndex = 25; - this.label5.Text = "扭矩设置:"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(166, 49); + this.textBox1.Location = new System.Drawing.Point(162, 78); this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(134, 30); this.textBox1.TabIndex = 24; this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // - // label4 + // label5 // - this.label4.AutoSize = true; - this.label4.BackColor = System.Drawing.Color.Silver; - this.label4.Location = new System.Drawing.Point(420, 100); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(106, 42); - this.label4.TabIndex = 23; - this.label4.Text = "手动拧松状态\r\n指示灯"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label5.BackColor = System.Drawing.Color.Transparent; + this.label5.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.Location = new System.Drawing.Point(26, 78); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(114, 30); + this.label5.TabIndex = 25; + this.label5.Text = "扭矩设置:"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label3 + // ResettingBtn // - this.label3.AutoSize = true; - this.label3.BackColor = System.Drawing.Color.Silver; - this.label3.Location = new System.Drawing.Point(279, 100); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(106, 42); - this.label3.TabIndex = 22; - this.label3.Text = "手动拧紧状态\r\n指示灯"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.ResettingBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.ResettingBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.ResettingBtn.Location = new System.Drawing.Point(150, 250); + this.ResettingBtn.MinimumSize = new System.Drawing.Size(1, 1); + this.ResettingBtn.Name = "ResettingBtn"; + this.ResettingBtn.Size = new System.Drawing.Size(70, 31); + this.ResettingBtn.TabIndex = 35; + this.ResettingBtn.Text = "重置"; + this.ResettingBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.ResettingBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + this.ResettingBtn.Click += new System.EventHandler(this.ResettingBtn_Click); // - // label2 + // label6 // - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.Silver; - this.label2.Location = new System.Drawing.Point(151, 100); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(74, 42); - this.label2.TabIndex = 21; - this.label2.Text = "停止状态\r\n指示灯"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label6.BackColor = System.Drawing.Color.Transparent; + this.label6.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.Location = new System.Drawing.Point(6, 112); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(150, 30); + this.label6.TabIndex = 27; + this.label6.Text = "最小旋转圈数:"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // textBox5 + // + this.textBox5.Location = new System.Drawing.Point(162, 214); + this.textBox5.Multiline = true; + this.textBox5.Name = "textBox5"; + this.textBox5.Size = new System.Drawing.Size(134, 30); + this.textBox5.TabIndex = 34; + this.textBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(162, 114); + this.textBox2.Multiline = true; + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(134, 30); + this.textBox2.TabIndex = 28; + this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label9 + // + this.label9.BackColor = System.Drawing.Color.Transparent; + this.label9.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.Location = new System.Drawing.Point(6, 214); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(150, 30); + this.label9.TabIndex = 33; + this.label9.Text = "拧紧超时设置:"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label7 + // + this.label7.BackColor = System.Drawing.Color.Transparent; + this.label7.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.Location = new System.Drawing.Point(6, 147); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(150, 30); + this.label7.TabIndex = 29; + this.label7.Text = "最大旋转圈数:"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // textBox4 + // + this.textBox4.Location = new System.Drawing.Point(162, 181); + this.textBox4.Multiline = true; + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(134, 30); + this.textBox4.TabIndex = 32; + this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(162, 147); + this.textBox3.Multiline = true; + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(134, 30); + this.textBox3.TabIndex = 30; + this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label8 + // + this.label8.BackColor = System.Drawing.Color.Transparent; + this.label8.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label8.Location = new System.Drawing.Point(26, 181); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(114, 30); + this.label8.TabIndex = 31; + this.label8.Text = "目标扭矩:"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // LightSeries + // + this.LightSeries.Controls.Add(this.label12); + this.LightSeries.Controls.Add(this.label11); + this.LightSeries.Controls.Add(this.ManualLight); + this.LightSeries.Controls.Add(this.AutoLight); + this.LightSeries.Controls.Add(this.MoveStateLight1); + this.LightSeries.Controls.Add(this.StopStateLight1); + this.LightSeries.Controls.Add(this.ToughLight1); + this.LightSeries.Controls.Add(this.LoosenLight1); + this.LightSeries.Controls.Add(this.label1); + this.LightSeries.Controls.Add(this.label2); + this.LightSeries.Controls.Add(this.label3); + this.LightSeries.Controls.Add(this.label4); + this.LightSeries.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.LightSeries.Location = new System.Drawing.Point(189, 12); + this.LightSeries.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.LightSeries.MinimumSize = new System.Drawing.Size(1, 1); + this.LightSeries.Name = "LightSeries"; + this.LightSeries.Size = new System.Drawing.Size(812, 148); + this.LightSeries.TabIndex = 38; + this.LightSeries.Text = null; + this.LightSeries.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + this.LightSeries.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + // + // MoveStateLight1 + // + this.MoveStateLight1.BackColor = System.Drawing.Color.Gray; + this.MoveStateLight1.Location = new System.Drawing.Point(17, 7); + this.MoveStateLight1.Name = "MoveStateLight1"; + this.MoveStateLight1.Size = new System.Drawing.Size(90, 90); + this.MoveStateLight1.TabIndex = 3; + this.MoveStateLight1.UseVisualStyleBackColor = false; + // + // StopStateLight1 + // + this.StopStateLight1.BackColor = System.Drawing.Color.Gray; + this.StopStateLight1.Location = new System.Drawing.Point(148, 7); + this.StopStateLight1.Name = "StopStateLight1"; + this.StopStateLight1.Size = new System.Drawing.Size(90, 90); + this.StopStateLight1.TabIndex = 15; + this.StopStateLight1.UseVisualStyleBackColor = false; + // + // ToughLight1 + // + this.ToughLight1.BackColor = System.Drawing.Color.Gray; + this.ToughLight1.Location = new System.Drawing.Point(279, 7); + this.ToughLight1.Name = "ToughLight1"; + this.ToughLight1.Size = new System.Drawing.Size(90, 90); + this.ToughLight1.TabIndex = 16; + this.ToughLight1.UseVisualStyleBackColor = false; + // + // LoosenLight1 + // + this.LoosenLight1.BackColor = System.Drawing.Color.Gray; + this.LoosenLight1.Location = new System.Drawing.Point(410, 7); + this.LoosenLight1.Name = "LoosenLight1"; + this.LoosenLight1.Size = new System.Drawing.Size(90, 90); + this.LoosenLight1.TabIndex = 17; + this.LoosenLight1.UseVisualStyleBackColor = false; // // label1 // @@ -383,6 +563,80 @@ namespace BRS.Process.A020.UI this.label1.Text = "启动状态\r\n指示灯"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // + // label2 + // + this.label2.AutoSize = true; + this.label2.BackColor = System.Drawing.Color.Silver; + this.label2.Location = new System.Drawing.Point(155, 100); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(74, 42); + this.label2.TabIndex = 21; + this.label2.Text = "停止状态\r\n指示灯"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.BackColor = System.Drawing.Color.Silver; + this.label3.Location = new System.Drawing.Point(271, 100); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(106, 42); + this.label3.TabIndex = 22; + this.label3.Text = "手动拧紧状态\r\n指示灯"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.BackColor = System.Drawing.Color.Silver; + this.label4.Location = new System.Drawing.Point(405, 100); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(106, 42); + this.label4.TabIndex = 23; + this.label4.Text = "手动拧松状态\r\n指示灯"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // uiPanel2 + // + this.uiPanel2.Controls.Add(this.label14); + this.uiPanel2.Controls.Add(this.AutoBtn1); + this.uiPanel2.Controls.Add(this.ManualBtn1); + this.uiPanel2.Controls.Add(this.ESBtn); + this.uiPanel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiPanel2.Location = new System.Drawing.Point(711, 201); + this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1); + this.uiPanel2.Name = "uiPanel2"; + this.uiPanel2.Size = new System.Drawing.Size(290, 345); + this.uiPanel2.TabIndex = 37; + this.uiPanel2.Text = null; + this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + this.uiPanel2.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); + // + // AutoBtn1 + // + this.AutoBtn1.BackColor = System.Drawing.Color.Gray; + this.AutoBtn1.Cursor = System.Windows.Forms.Cursors.Hand; + this.AutoBtn1.Location = new System.Drawing.Point(3, 73); + this.AutoBtn1.Name = "AutoBtn1"; + this.AutoBtn1.Size = new System.Drawing.Size(104, 104); + this.AutoBtn1.TabIndex = 18; + this.AutoBtn1.Text = "自动按钮"; + this.AutoBtn1.UseVisualStyleBackColor = false; + this.AutoBtn1.Click += new System.EventHandler(this.AutoBtn1_Click); + // + // ManualBtn1 + // + this.ManualBtn1.BackColor = System.Drawing.Color.Gray; + this.ManualBtn1.Cursor = System.Windows.Forms.Cursors.Hand; + this.ManualBtn1.Location = new System.Drawing.Point(3, 183); + this.ManualBtn1.Name = "ManualBtn1"; + this.ManualBtn1.Size = new System.Drawing.Size(104, 104); + this.ManualBtn1.TabIndex = 19; + this.ManualBtn1.Text = "手动按钮"; + this.ManualBtn1.UseVisualStyleBackColor = false; + this.ManualBtn1.Click += new System.EventHandler(this.ManualBtn1_Click); + // // TestBtn // this.TestBtn.Cursor = System.Windows.Forms.Cursors.Hand; @@ -424,6 +678,18 @@ namespace BRS.Process.A020.UI this.StartBtn1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); this.StartBtn1.Click += new System.EventHandler(this.StartBtn1_Click); // + // ESBtn + // + this.ESBtn.BackColor = System.Drawing.Color.Red; + this.ESBtn.Cursor = System.Windows.Forms.Cursors.Hand; + this.ESBtn.Location = new System.Drawing.Point(150, 107); + this.ESBtn.Name = "ESBtn"; + this.ESBtn.Size = new System.Drawing.Size(137, 137); + this.ESBtn.TabIndex = 0; + this.ESBtn.Text = "急停"; + this.ESBtn.UseVisualStyleBackColor = false; + this.ESBtn.Click += new System.EventHandler(this.ESBtn_Click); + // // AutoLoosenBtn // this.AutoLoosenBtn.Cursor = System.Windows.Forms.Cursors.Hand; @@ -515,233 +781,15 @@ namespace BRS.Process.A020.UI this.timer2.Interval = 1000; this.timer2.Tick += new System.EventHandler(this.timer2_Tick); // - // label6 - // - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label6.Location = new System.Drawing.Point(10, 83); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(150, 30); - this.label6.TabIndex = 27; - this.label6.Text = "最小旋转圈数:"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // textBox2 - // - this.textBox2.Location = new System.Drawing.Point(166, 85); - this.textBox2.Multiline = true; - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(134, 30); - this.textBox2.TabIndex = 28; - this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // label7 - // - this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label7.Location = new System.Drawing.Point(10, 118); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(150, 30); - this.label7.TabIndex = 29; - this.label7.Text = "最大旋转圈数:"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // textBox3 - // - this.textBox3.Location = new System.Drawing.Point(166, 118); - this.textBox3.Multiline = true; - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(134, 30); - this.textBox3.TabIndex = 30; - this.textBox3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // label8 - // - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label8.Location = new System.Drawing.Point(30, 152); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(114, 30); - this.label8.TabIndex = 31; - this.label8.Text = "目标扭矩:"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // textBox4 - // - this.textBox4.Location = new System.Drawing.Point(166, 152); - this.textBox4.Multiline = true; - this.textBox4.Name = "textBox4"; - this.textBox4.Size = new System.Drawing.Size(134, 30); - this.textBox4.TabIndex = 32; - this.textBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // label9 - // - this.label9.BackColor = System.Drawing.Color.Transparent; - this.label9.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label9.Location = new System.Drawing.Point(10, 185); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(150, 30); - this.label9.TabIndex = 33; - this.label9.Text = "拧紧超时设置:"; - this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // textBox5 - // - this.textBox5.Location = new System.Drawing.Point(166, 185); - this.textBox5.Multiline = true; - this.textBox5.Name = "textBox5"; - this.textBox5.Size = new System.Drawing.Size(134, 30); - this.textBox5.TabIndex = 34; - this.textBox5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // - // ResettingBtn - // - this.ResettingBtn.Cursor = System.Windows.Forms.Cursors.Hand; - this.ResettingBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.ResettingBtn.Location = new System.Drawing.Point(154, 221); - this.ResettingBtn.MinimumSize = new System.Drawing.Size(1, 1); - this.ResettingBtn.Name = "ResettingBtn"; - this.ResettingBtn.Size = new System.Drawing.Size(70, 31); - this.ResettingBtn.TabIndex = 35; - this.ResettingBtn.Text = "重置"; - this.ResettingBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.ResettingBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - this.ResettingBtn.Click += new System.EventHandler(this.ResettingBtn_Click); - // - // uiPanel2 - // - this.uiPanel2.Controls.Add(this.ManualLight); - this.uiPanel2.Controls.Add(this.AutoLight); - this.uiPanel2.Controls.Add(this.AutoBtn1); - this.uiPanel2.Controls.Add(this.ManualBtn1); - this.uiPanel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiPanel2.Location = new System.Drawing.Point(753, 201); - this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1); - this.uiPanel2.Name = "uiPanel2"; - this.uiPanel2.Size = new System.Drawing.Size(278, 223); - this.uiPanel2.TabIndex = 37; - this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; - this.uiPanel2.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - // - // LightSeries - // - this.LightSeries.Controls.Add(this.MoveStateLight1); - this.LightSeries.Controls.Add(this.StopStateLight1); - this.LightSeries.Controls.Add(this.ToughLight1); - this.LightSeries.Controls.Add(this.LoosenLight1); - this.LightSeries.Controls.Add(this.label1); - this.LightSeries.Controls.Add(this.label2); - this.LightSeries.Controls.Add(this.label3); - this.LightSeries.Controls.Add(this.label4); - this.LightSeries.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.LightSeries.Location = new System.Drawing.Point(189, 12); - this.LightSeries.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.LightSeries.MinimumSize = new System.Drawing.Size(1, 1); - this.LightSeries.Name = "LightSeries"; - this.LightSeries.Size = new System.Drawing.Size(539, 148); - this.LightSeries.TabIndex = 38; - this.LightSeries.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; - this.LightSeries.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - // - // ParameterSetting - // - this.ParameterSetting.Controls.Add(this.label10); - this.ParameterSetting.Controls.Add(this.OKBtn); - this.ParameterSetting.Controls.Add(this.textBox1); - this.ParameterSetting.Controls.Add(this.label5); - this.ParameterSetting.Controls.Add(this.ResettingBtn); - this.ParameterSetting.Controls.Add(this.label6); - this.ParameterSetting.Controls.Add(this.textBox5); - this.ParameterSetting.Controls.Add(this.textBox2); - this.ParameterSetting.Controls.Add(this.label9); - this.ParameterSetting.Controls.Add(this.label7); - this.ParameterSetting.Controls.Add(this.textBox4); - this.ParameterSetting.Controls.Add(this.textBox3); - this.ParameterSetting.Controls.Add(this.label8); - this.ParameterSetting.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.ParameterSetting.Location = new System.Drawing.Point(12, 201); - this.ParameterSetting.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.ParameterSetting.MinimumSize = new System.Drawing.Size(1, 1); - this.ParameterSetting.Name = "ParameterSetting"; - this.ParameterSetting.Size = new System.Drawing.Size(307, 261); - this.ParameterSetting.TabIndex = 39; - this.ParameterSetting.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; - this.ParameterSetting.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - // - // label10 - // - this.label10.BackColor = System.Drawing.Color.Transparent; - this.label10.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label10.Location = new System.Drawing.Point(3, 3); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(123, 47); - this.label10.TabIndex = 36; - this.label10.Text = "参数设置"; - this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // BtnSeries - // - this.BtnSeries.Controls.Add(this.ManualLoosenBtn); - this.BtnSeries.Controls.Add(this.AutoToughBtn1); - this.BtnSeries.Controls.Add(this.AutoLoosenBtn1); - this.BtnSeries.Controls.Add(this.ManualToughBtn); - this.BtnSeries.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.BtnSeries.Location = new System.Drawing.Point(360, 201); - this.BtnSeries.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.BtnSeries.MinimumSize = new System.Drawing.Size(1, 1); - this.BtnSeries.Name = "BtnSeries"; - this.BtnSeries.Size = new System.Drawing.Size(368, 223); - this.BtnSeries.TabIndex = 40; - this.BtnSeries.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; - this.BtnSeries.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0); - // - // MoveStateLight1 - // - this.MoveStateLight1.BackColor = System.Drawing.Color.Gray; - this.MoveStateLight1.Location = new System.Drawing.Point(17, 7); - this.MoveStateLight1.Name = "MoveStateLight1"; - this.MoveStateLight1.Size = new System.Drawing.Size(90, 90); - this.MoveStateLight1.TabIndex = 3; - this.MoveStateLight1.UseVisualStyleBackColor = false; - // - // StopStateLight1 - // - this.StopStateLight1.BackColor = System.Drawing.Color.Gray; - this.StopStateLight1.Location = new System.Drawing.Point(148, 7); - this.StopStateLight1.Name = "StopStateLight1"; - this.StopStateLight1.Size = new System.Drawing.Size(90, 90); - this.StopStateLight1.TabIndex = 15; - this.StopStateLight1.UseVisualStyleBackColor = false; - // - // ToughLight1 - // - this.ToughLight1.BackColor = System.Drawing.Color.Gray; - this.ToughLight1.Location = new System.Drawing.Point(283, 7); - this.ToughLight1.Name = "ToughLight1"; - this.ToughLight1.Size = new System.Drawing.Size(90, 90); - this.ToughLight1.TabIndex = 16; - this.ToughLight1.UseVisualStyleBackColor = false; - // - // LoosenLight1 - // - this.LoosenLight1.BackColor = System.Drawing.Color.Gray; - this.LoosenLight1.Location = new System.Drawing.Point(424, 7); - this.LoosenLight1.Name = "LoosenLight1"; - this.LoosenLight1.Size = new System.Drawing.Size(90, 90); - this.LoosenLight1.TabIndex = 17; - this.LoosenLight1.UseVisualStyleBackColor = false; - // // ManualLight // this.ManualLight.BackColor = System.Drawing.Color.Gray; this.ManualLight.Cursor = System.Windows.Forms.Cursors.Hand; this.ManualLight.Enabled = false; - this.ManualLight.Location = new System.Drawing.Point(169, 117); + this.ManualLight.Location = new System.Drawing.Point(672, 7); this.ManualLight.Name = "ManualLight"; - this.ManualLight.Size = new System.Drawing.Size(104, 104); - this.ManualLight.TabIndex = 21; + this.ManualLight.Size = new System.Drawing.Size(90, 90); + this.ManualLight.TabIndex = 25; this.ManualLight.UseVisualStyleBackColor = false; // // AutoLight @@ -749,47 +797,55 @@ namespace BRS.Process.A020.UI this.AutoLight.BackColor = System.Drawing.Color.Gray; this.AutoLight.Cursor = System.Windows.Forms.Cursors.Hand; this.AutoLight.Enabled = false; - this.AutoLight.Location = new System.Drawing.Point(169, 3); + this.AutoLight.Location = new System.Drawing.Point(541, 7); this.AutoLight.Name = "AutoLight"; - this.AutoLight.Size = new System.Drawing.Size(104, 104); - this.AutoLight.TabIndex = 20; + this.AutoLight.Size = new System.Drawing.Size(90, 90); + this.AutoLight.TabIndex = 24; this.AutoLight.UseVisualStyleBackColor = false; // - // AutoBtn1 + // label11 // - this.AutoBtn1.BackColor = System.Drawing.Color.Gray; - this.AutoBtn1.Cursor = System.Windows.Forms.Cursors.Hand; - this.AutoBtn1.Location = new System.Drawing.Point(3, 3); - this.AutoBtn1.Name = "AutoBtn1"; - this.AutoBtn1.Size = new System.Drawing.Size(104, 104); - this.AutoBtn1.TabIndex = 18; - this.AutoBtn1.Text = "自动按钮"; - this.AutoBtn1.UseVisualStyleBackColor = false; - this.AutoBtn1.Click += new System.EventHandler(this.AutoBtn1_Click); + this.label11.AutoSize = true; + this.label11.BackColor = System.Drawing.Color.Silver; + this.label11.Location = new System.Drawing.Point(537, 100); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(106, 42); + this.label11.TabIndex = 26; + this.label11.Text = "自动拧紧状态\r\n指示灯"; + this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // ManualBtn1 + // label12 // - this.ManualBtn1.BackColor = System.Drawing.Color.Gray; - this.ManualBtn1.Cursor = System.Windows.Forms.Cursors.Hand; - this.ManualBtn1.Location = new System.Drawing.Point(3, 117); - this.ManualBtn1.Name = "ManualBtn1"; - this.ManualBtn1.Size = new System.Drawing.Size(104, 104); - this.ManualBtn1.TabIndex = 19; - this.ManualBtn1.Text = "手动按钮"; - this.ManualBtn1.UseVisualStyleBackColor = false; - this.ManualBtn1.Click += new System.EventHandler(this.ManualBtn1_Click); + this.label12.AutoSize = true; + this.label12.BackColor = System.Drawing.Color.Silver; + this.label12.Location = new System.Drawing.Point(668, 100); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(106, 42); + this.label12.TabIndex = 27; + this.label12.Text = "自动拧松状态\r\n指示灯"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // ESBtn + // label13 // - this.ESBtn.BackColor = System.Drawing.Color.Red; - this.ESBtn.Cursor = System.Windows.Forms.Cursors.Hand; - this.ESBtn.Location = new System.Drawing.Point(894, 12); - this.ESBtn.Name = "ESBtn"; - this.ESBtn.Size = new System.Drawing.Size(137, 137); - this.ESBtn.TabIndex = 0; - this.ESBtn.Text = "急停"; - this.ESBtn.UseVisualStyleBackColor = false; - this.ESBtn.Click += new System.EventHandler(this.ESBtn_Click); + this.label13.BackColor = System.Drawing.Color.Transparent; + this.label13.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label13.Location = new System.Drawing.Point(1, 3); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(123, 47); + this.label13.TabIndex = 37; + this.label13.Text = "操作按钮"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label14 + // + this.label14.BackColor = System.Drawing.Color.Transparent; + this.label14.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label14.Location = new System.Drawing.Point(3, 3); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(123, 47); + this.label14.TabIndex = 38; + this.label14.Text = "操作按钮"; + this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // 扭矩轴控制 // @@ -804,13 +860,13 @@ namespace BRS.Process.A020.UI this.Load += new System.EventHandler(this.扭矩轴控制_Load); ((System.ComponentModel.ISupportInitialize)(this.chart2)).EndInit(); this.uiPanel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); - this.uiPanel2.ResumeLayout(false); - this.LightSeries.ResumeLayout(false); - this.LightSeries.PerformLayout(); + this.BtnSeries.ResumeLayout(false); this.ParameterSetting.ResumeLayout(false); this.ParameterSetting.PerformLayout(); - this.BtnSeries.ResumeLayout(false); + this.LightSeries.ResumeLayout(false); + this.LightSeries.PerformLayout(); + this.uiPanel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); this.ResumeLayout(false); } @@ -875,8 +931,12 @@ namespace BRS.Process.A020.UI private Sunny.UI.UIPanel ParameterSetting; private System.Windows.Forms.Label label10; private Sunny.UI.UIPanel LightSeries; + private Sunny.UI.UIPanel BtnSeries; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label11; private CircleButton ManualLight; private CircleButton AutoLight; - private Sunny.UI.UIPanel BtnSeries; + private System.Windows.Forms.Label label14; } } \ No newline at end of file diff --git a/src/BRS.Process.A020/UI/ContorlShaft.cs b/src/BRS.Process.A020/UI/ContorlShaft.cs index 1c8b498..4f64c3f 100644 --- a/src/BRS.Process.A020/UI/ContorlShaft.cs +++ b/src/BRS.Process.A020/UI/ContorlShaft.cs @@ -29,6 +29,7 @@ namespace BRS.Process.A020.UI private bool isOpenAuto { get; set; } = false;//是否正在自动操作 int resValue1; int resValue2; + ShaftMachineState shaftState=ShaftMachineState.Unknown; A020Process ProcessA020 => Process as A020Process; A020Config Config => Process?.IConfig as A020Config; @@ -496,7 +497,7 @@ namespace BRS.Process.A020.UI private void StartBtn1_Click(object sender, EventArgs e) { - //var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase; + var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase; if (Process == null) { MessageBox.Show("无法操作空流程"); @@ -529,11 +530,24 @@ namespace BRS.Process.A020.UI this.ManualBtn1.Enabled = true; //设置开始按钮状态 StartBtn1.Enabled = true; + shaftState = ShaftMachineState.Emergency; + ESBtn.BackColor = Color.Red; + ESBtn.Text = "急停"; + ProcessWriteInt(MelsecPLC, "D19", "int", "0"); } - } private void StopBtn2_Click(object sender, EventArgs e) { + if (shaftState == ShaftMachineState.Emergency) + { + LogAsync(DateTime.Now, LogLevel.Error, "当前急停,无法操作"); + return; + } + else if (MoveStateLight1.BackColor == Color.Gray && StopStateLight1.BackColor == Color.Gray) + { + LogAsync(DateTime.Now, LogLevel.Error, "当前流程未启动,无法操作"); + return; + } var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase; ProcessWriteInt(MelsecPLC, "D3", "int", "1"); ProcessWriteInt(MelsecPLC, "D55", "int", "0"); @@ -825,6 +839,7 @@ namespace BRS.Process.A020.UI } else { + isOpenAuto = false; LogAsync(DateTime.Now, LogLevel.Error, $"当前流程未启动"); } } @@ -835,7 +850,7 @@ namespace BRS.Process.A020.UI string torsionValue = ProcessReadInt(MelsecPLC, "D251", "int"); string angleValue = ProcessReadInt(MelsecPLC, "D351", "int"); resValue1 = Convert.ToInt32(torsionValue);//将接收到的返回值转为int类型 - resValue2 = Convert.ToInt32(angleValue); + resValue2 = Convert.ToInt32(angleValue)/200000; int MaxAngleValue = Convert.ToInt32(ProcessReadInt(MelsecPLC, "D163", "int"));//读取旋转所需圈数的最大值 int MinAngleValue = Convert.ToInt32(ProcessReadInt(MelsecPLC, "D161", "int"));//最小值 @@ -848,10 +863,11 @@ namespace BRS.Process.A020.UI //ProcessA020.StopProcess(); ProcessWriteInt(MelsecPLC, "D55", "int", "0");//到位时,D55置0停止 LogAsync(DateTime.Now, LogLevel.Information, "已完成"); - timer2.Stop(); - timer1.Stop(); + if (MinAngleValue <= resValue2 && resValue2 <= MaxAngleValue) { + timer2.Stop(); + timer1.Stop(); LogAsync(DateTime.Now, LogLevel.Information, "产品合格"); isOpenAuto = false; //机械手控制螺丝机退出螺丝, @@ -859,6 +875,8 @@ namespace BRS.Process.A020.UI } else if (resValue2 < MinAngleValue) { + timer2.Stop(); + timer1.Stop(); LogAsync(DateTime.Now, LogLevel.Error, "螺丝卡丝"); isOpenAuto = false; return; @@ -872,6 +890,7 @@ namespace BRS.Process.A020.UI } else if (resValue2 > MaxAngleValue) { + Thread.Sleep(100); timer2.Stop(); LogAsync(DateTime.Now, LogLevel.Error, "螺丝滑丝"); isOpenAuto = false; @@ -886,81 +905,87 @@ namespace BRS.Process.A020.UI private void ESBtn_Click(object sender, EventArgs e) { var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase; - //if (MoveStateLight1.BackColor == Color.GreenYellow) - //{ - // if (ESBtn.Text == "急停" && ESBtn.BackColor == Color.Red) - // { - // ProcessWriteInt(MelsecPLC, "D3", "int", "1");//D3写入1,使上位机停止 - // ProcessWriteInt(MelsecPLC, "D19", "int", "1"); - // ProcessWriteInt(MelsecPLC, "D7", "int", "0"); - // ProcessWriteInt(MelsecPLC, "D51", "int", "0"); - // ProcessWriteInt(MelsecPLC, "D53", "int", "0"); - // ProcessWriteInt(MelsecPLC, "D55", "int", "0"); - - // this.StopStateLight1.BackColor = Color.Red; - // this.MoveStateLight1.BackColor = Color.Gray; - // this.ToughLight1.BackColor = Color.Gray; - // this.LoosenLight1.BackColor = Color.Gray; - // //将急停按钮变为复位按钮 - // ESBtn.Text = "复位"; - // ESBtn.BackColor = Color.GreenYellow; - // //将自动手动按钮颜色恢复为灰色 - // this.AutoBtn1.BackColor = Color.Gray; - // this.ManualBtn1.BackColor = Color.Gray; - // //点击停止后初始化图表 - // InitChart(); - // timer1.Stop(); - // timer2.Stop(); - // isOpenAuto = false; - // } - // else - // { - // ProcessWriteInt(MelsecPLC, "D19", "int", "0"); - // ESBtn.Text = "急停"; - // ESBtn.BackColor = Color.Red; - // this.StopStateLight1.BackColor = Color.Gray; - // this.MoveStateLight1.BackColor = Color.GreenYellow; - // } - //} - //else - //{ - // LogAsync(DateTime.Now, LogLevel.Error, "当前流程未启动"); - //} - - if (Process == null) + + if (MoveStateLight1.BackColor == Color.GreenYellow) { - MessageBox.Show("无法操作空流程"); - return; - } - - StopBtn2.Enabled = false; - - try - { - //ProcessOperation(true);//点击开始按钮后执行 - if (isStart) + if (ESBtn.Text == "急停" && ESBtn.BackColor == Color.Red) { - ProcessOperation(false); - //ProcessOperation(true); + ProcessWriteInt(MelsecPLC, "D3", "int", "1");//D3写入1,使上位机停止 + ProcessWriteInt(MelsecPLC, "D19", "int", "1"); + ProcessWriteInt(MelsecPLC, "D7", "int", "0"); + ProcessWriteInt(MelsecPLC, "D51", "int", "0"); + ProcessWriteInt(MelsecPLC, "D53", "int", "0"); + ProcessWriteInt(MelsecPLC, "D55", "int", "0"); + + shaftState = ShaftMachineState.Emergency; + + this.StopStateLight1.BackColor = Color.Red; + this.MoveStateLight1.BackColor = Color.Gray; + this.ToughLight1.BackColor = Color.Gray; + this.LoosenLight1.BackColor = Color.Gray; + //将急停按钮变为复位按钮 + ESBtn.Text = "复位"; + ESBtn.BackColor = Color.GreenYellow; + //将自动手动按钮颜色恢复为灰色 + this.AutoBtn1.BackColor = Color.Gray; + this.ManualBtn1.BackColor = Color.Gray; + //点击停止后初始化图表 + InitChart(); + timer1.Stop(); + timer2.Stop(); + isOpenAuto = false; } } - catch (Exception ex) + else if(shaftState==ShaftMachineState.Emergency) { - //MessageBox.Show(ex.GetExceptionMessage()); + ProcessWriteInt(MelsecPLC, "D19", "int", "0"); + ESBtn.Text = "急停"; + ESBtn.BackColor = Color.Red; + this.StopStateLight1.BackColor = Color.Gray; + this.MoveStateLight1.BackColor = Color.GreenYellow; + shaftState = ShaftMachineState.Reset; + } - finally + else { - //this.MoveStateLight1.BackColor = Color.GreenYellow; - //this.StopStateLight1.BackColor = Color.Gray; - //this.ToughLight1.BackColor = Color.Gray; - //this.LoosenLight1.BackColor = Color.Gray; - ////当流程启动时,自动手动按钮可用 - //this.AutoBtn1.Enabled = true; - //this.ManualBtn1.Enabled = true; - //设置开始按钮状态 - StopBtn2.Enabled = true; + LogAsync(DateTime.Now, LogLevel.Error, "当前流程未启动"); + return; } +#if false + // if (Process == null) + // { + // MessageBox.Show("无法操作空流程"); + // return; + // } + //StopBtn2.Enabled = false; + + // try + // { + // //ProcessOperation(true);//点击开始按钮后执行 + // if (isStart) + // { + // ProcessOperation(false); + // //ProcessOperation(true); + // } + // } + // catch (Exception ex) + // { + // //MessageBox.Show(ex.GetExceptionMessage()); + // } + // finally + // { + // //this.MoveStateLight1.BackColor = Color.GreenYellow; + // //this.StopStateLight1.BackColor = Color.Gray; + // //this.ToughLight1.BackColor = Color.Gray; + // //this.LoosenLight1.BackColor = Color.Gray; + // ////当流程启动时,自动手动按钮可用 + // //this.AutoBtn1.Enabled = true; + // //this.ManualBtn1.Enabled = true; + // //设置开始按钮状态 + // StopBtn2.Enabled = true; + // } +#endif } private void OKBtn_Click(object sender, EventArgs e) @@ -979,7 +1004,12 @@ namespace BRS.Process.A020.UI Normal,//正常状态 Sliding,//滑丝状态 } - + public enum ShaftMachineState + { + Unknown, + Emergency, + Reset, + } private void uiPanel1_Load(object sender, EventArgs e) {