20230321Change

This commit is contained in:
17860779768 2023-03-21 08:27:10 +08:00
parent 59e525792d
commit 229ec1a92d
5 changed files with 630 additions and 247 deletions

View File

@ -1806,6 +1806,7 @@ namespace BRS.Process.A020
{
ShaftOperateOnce(MelsecPLC, addD1, 500);//D1置1延时500后置0
});
@ -1984,7 +1985,13 @@ namespace BRS.Process.A020
{
ProcessWriteInt(MelsecPLC, "D3", "int", "0");//D3置0
//ProcessWriteInt(MelsecPLC, "D171", "int", "3000");//最大扭矩3000
ProcessWriteInt(MelsecPLC, "D51", "int", "1");//手动拧紧螺丝D51置1
ProcessWriteInt(MelsecPLC, "D55", "int", "1");//自动拧紧螺丝D55置1
ProcessWriteInt(MelsecPLC, "D155", "int", "10");//扭矩到目标设定值计时设定值设为1秒
//ProcessWriteInt(MelsecPLC, "D161", "int", "200");//D161,旋转所需圈数最小值
//ProcessWriteInt(MelsecPLC, "D163", "int", "400");//D163,旋转所需圈数最大值
//ProcessWriteInt(MelsecPLC, "D151", "int", "200");//高速拧紧超时计时设定值设为20s
//ProcessWriteInt(MelsecPLC, "D173", "int", "300");//目标扭矩设定值最大扭矩返回值设为300当达到这个值时停止
machineState = MachineState.Waiting;//设备启动完成后保持状态
LogAsync(DateTime.Now, LogLevel.Detail, "设备已启动,请勿其他操作!!");
}
@ -1999,6 +2006,7 @@ namespace BRS.Process.A020
Task.Run(() =>
{
ShaftOperateOnce(MelsecPLC, "D1", 500);//D1置1延时500后置0
//ShaftOperateOnce(MelsecPLC, "D55", 500);//自动拧紧螺丝标志位先置10.5s后置0
});
IsSingleStepOperating = false;
}
@ -2065,8 +2073,11 @@ namespace BRS.Process.A020
public void StopProcess()
{
var MelsecPLC = DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
//将四种模式下的停止地址都赋值0
ProcessWriteInt(MelsecPLC, "D3", "int", "1");//D3置0
ProcessWriteInt(MelsecPLC, "D53", "int", "0");//手动拧紧螺丝D53置0
ProcessWriteInt(MelsecPLC, "D51", "int", "0");
ProcessWriteInt(MelsecPLC, "D55", "int", "0");//
}
#endregion

View File

@ -46,6 +46,10 @@ 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.ManualLoosenBtn = new Sunny.UI.UIButton();
this.ManualToughBtn = new Sunny.UI.UIButton();
this.AutoLoosenBtn1 = new Sunny.UI.UIButton();
this.AutoToughBtn1 = new Sunny.UI.UIButton();
this.OKBtn = new Sunny.UI.UIButton();
this.label5 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
@ -54,10 +58,6 @@ namespace BRS.Process.A020.UI
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.TestBtn = new Sunny.UI.UIButton();
this.AutoLoosenBtn1 = new Sunny.UI.UIButton();
this.AutoToughBtn1 = new Sunny.UI.UIButton();
this.ManualLoosenBtn = new Sunny.UI.UIButton();
this.ManualToughBtn = new Sunny.UI.UIButton();
this.StopBtn2 = new Sunny.UI.UIButton();
this.StartBtn1 = new Sunny.UI.UIButton();
this.AutoLoosenBtn = new Sunny.UI.UIButton();
@ -68,16 +68,36 @@ 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.ManualBtn1 = new BRS.Process.A020.UI.CircleButton();
this.AutoBtn1 = new BRS.Process.A020.UI.CircleButton();
this.LoosenLight1 = new BRS.Process.A020.UI.CircleButton();
this.ToughLight1 = new BRS.Process.A020.UI.CircleButton();
this.StopStateLight1 = new BRS.Process.A020.UI.CircleButton();
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();
((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.SuspendLayout();
//
// TorqueSettingBtn
@ -190,14 +210,14 @@ namespace BRS.Process.A020.UI
legend1.Name = "Legend1";
legend1.Title = "图例";
this.chart2.Legends.Add(legend1);
this.chart2.Location = new System.Drawing.Point(1130, 0);
this.chart2.Location = new System.Drawing.Point(1445, 0);
this.chart2.Name = "chart2";
series1.ChartArea = "ChartArea1";
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
series1.Legend = "Legend1";
series1.Name = "扭矩";
this.chart2.Series.Add(series1);
this.chart2.Size = new System.Drawing.Size(380, 543);
this.chart2.Size = new System.Drawing.Size(380, 601);
this.chart2.TabIndex = 14;
this.chart2.Text = "扭矩时间变化曲线";
title1.Name = "Title1";
@ -206,26 +226,13 @@ namespace BRS.Process.A020.UI
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.ManualLoosenBtn);
this.uiPanel1.Controls.Add(this.ManualToughBtn);
this.uiPanel1.Controls.Add(this.AutoLoosenBtn1);
this.uiPanel1.Controls.Add(this.AutoToughBtn1);
this.uiPanel1.Controls.Add(this.OKBtn);
this.uiPanel1.Controls.Add(this.label5);
this.uiPanel1.Controls.Add(this.textBox1);
this.uiPanel1.Controls.Add(this.label4);
this.uiPanel1.Controls.Add(this.label3);
this.uiPanel1.Controls.Add(this.label2);
this.uiPanel1.Controls.Add(this.label1);
this.uiPanel1.Controls.Add(this.ManualBtn1);
this.uiPanel1.Controls.Add(this.AutoBtn1);
this.uiPanel1.Controls.Add(this.LoosenLight1);
this.uiPanel1.Controls.Add(this.ToughLight1);
this.uiPanel1.Controls.Add(this.StopStateLight1);
this.uiPanel1.Controls.Add(this.BtnSeries);
this.uiPanel1.Controls.Add(this.ParameterSetting);
this.uiPanel1.Controls.Add(this.LightSeries);
this.uiPanel1.Controls.Add(this.uiPanel2);
this.uiPanel1.Controls.Add(this.TestBtn);
this.uiPanel1.Controls.Add(this.StopBtn2);
this.uiPanel1.Controls.Add(this.StartBtn1);
this.uiPanel1.Controls.Add(this.MoveStateLight1);
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)));
@ -233,138 +240,21 @@ namespace BRS.Process.A020.UI
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.Size = new System.Drawing.Size(680, 543);
this.uiPanel1.Size = new System.Drawing.Size(1038, 601);
this.uiPanel1.TabIndex = 16;
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiPanel1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// 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(412, 230);
this.OKBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.OKBtn.Name = "OKBtn";
this.OKBtn.Size = new System.Drawing.Size(100, 45);
this.OKBtn.TabIndex = 26;
this.OKBtn.Text = "确定";
this.OKBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.OKBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
this.OKBtn.Click += new System.EventHandler(this.OKBtn_Click);
//
// label5
//
this.label5.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(145, 230);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(114, 45);
this.label5.TabIndex = 25;
this.label5.Text = "扭矩设置:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(265, 230);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(141, 45);
this.textBox1.TabIndex = 24;
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Silver;
this.label4.Location = new System.Drawing.Point(416, 134);
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;
//
// label3
//
this.label3.AutoSize = true;
this.label3.BackColor = System.Drawing.Color.Silver;
this.label3.Location = new System.Drawing.Point(275, 134);
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;
//
// label2
//
this.label2.AutoSize = true;
this.label2.BackColor = System.Drawing.Color.Silver;
this.label2.Location = new System.Drawing.Point(153, 134);
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;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Silver;
this.label1.Location = new System.Drawing.Point(20, 134);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 42);
this.label1.TabIndex = 20;
this.label1.Text = "启动状态\r\n指示灯";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// TestBtn
//
this.TestBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.TestBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TestBtn.Location = new System.Drawing.Point(3, 505);
this.TestBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.TestBtn.Name = "TestBtn";
this.TestBtn.Size = new System.Drawing.Size(100, 35);
this.TestBtn.TabIndex = 14;
this.TestBtn.Text = "测试按钮";
this.TestBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TestBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// 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(392, 385);
this.AutoLoosenBtn1.MinimumSize = new System.Drawing.Size(1, 1);
this.AutoLoosenBtn1.Name = "AutoLoosenBtn1";
this.AutoLoosenBtn1.Size = new System.Drawing.Size(120, 45);
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);
//
// 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(392, 315);
this.AutoToughBtn1.MinimumSize = new System.Drawing.Size(1, 1);
this.AutoToughBtn1.Name = "AutoToughBtn1";
this.AutoToughBtn1.Size = new System.Drawing.Size(120, 45);
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.uiPanel1.Load += new System.EventHandler(this.uiPanel1_Load);
//
// 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(149, 385);
this.ManualLoosenBtn.Location = new System.Drawing.Point(3, 133);
this.ManualLoosenBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.ManualLoosenBtn.Name = "ManualLoosenBtn";
this.ManualLoosenBtn.Size = new System.Drawing.Size(120, 45);
this.ManualLoosenBtn.Size = new System.Drawing.Size(150, 75);
this.ManualLoosenBtn.TabIndex = 10;
this.ManualLoosenBtn.Text = "手动拧松";
this.ManualLoosenBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@ -376,10 +266,10 @@ namespace BRS.Process.A020.UI
//
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(149, 315);
this.ManualToughBtn.Location = new System.Drawing.Point(3, 12);
this.ManualToughBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.ManualToughBtn.Name = "ManualToughBtn";
this.ManualToughBtn.Size = new System.Drawing.Size(120, 45);
this.ManualToughBtn.Size = new System.Drawing.Size(150, 75);
this.ManualToughBtn.TabIndex = 9;
this.ManualToughBtn.Text = "手动拧紧";
this.ManualToughBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@ -387,11 +277,130 @@ 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
//
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);
//
// 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, 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);
//
// 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.MinimumSize = new System.Drawing.Size(1, 1);
this.OKBtn.Name = "OKBtn";
this.OKBtn.Size = new System.Drawing.Size(70, 31);
this.OKBtn.TabIndex = 26;
this.OKBtn.Text = "确定";
this.OKBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
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.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
//
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;
//
// label3
//
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;
//
// label2
//
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;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.Color.Silver;
this.label1.Location = new System.Drawing.Point(24, 100);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 42);
this.label1.TabIndex = 20;
this.label1.Text = "启动状态\r\n指示灯";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// TestBtn
//
this.TestBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.TestBtn.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TestBtn.Location = new System.Drawing.Point(8, 554);
this.TestBtn.MinimumSize = new System.Drawing.Size(1, 1);
this.TestBtn.Name = "TestBtn";
this.TestBtn.Size = new System.Drawing.Size(100, 35);
this.TestBtn.TabIndex = 14;
this.TestBtn.Text = "测试按钮";
this.TestBtn.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.TestBtn.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
//
// StopBtn2
//
this.StopBtn2.Cursor = System.Windows.Forms.Cursors.Hand;
this.StopBtn2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StopBtn2.Location = new System.Drawing.Point(12, 323);
this.StopBtn2.Location = new System.Drawing.Point(12, 105);
this.StopBtn2.MinimumSize = new System.Drawing.Size(1, 1);
this.StopBtn2.Name = "StopBtn2";
this.StopBtn2.Size = new System.Drawing.Size(96, 85);
@ -405,7 +414,7 @@ namespace BRS.Process.A020.UI
//
this.StartBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.StartBtn1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.StartBtn1.Location = new System.Drawing.Point(12, 230);
this.StartBtn1.Location = new System.Drawing.Point(12, 12);
this.StartBtn1.MinimumSize = new System.Drawing.Size(1, 1);
this.StartBtn1.Name = "StartBtn1";
this.StartBtn1.Size = new System.Drawing.Size(96, 85);
@ -474,16 +483,16 @@ namespace BRS.Process.A020.UI
//
chartArea2.Name = "ChartArea1";
this.chart1.ChartAreas.Add(chartArea2);
this.chart1.Dock = System.Windows.Forms.DockStyle.Right;
this.chart1.Dock = System.Windows.Forms.DockStyle.Fill;
legend2.Name = "Legend1";
this.chart1.Legends.Add(legend2);
this.chart1.Location = new System.Drawing.Point(730, 0);
this.chart1.Location = new System.Drawing.Point(1038, 0);
this.chart1.Name = "chart1";
series2.ChartArea = "ChartArea1";
series2.Legend = "Legend1";
series2.Name = "Series1";
this.chart1.Series.Add(series2);
this.chart1.Size = new System.Drawing.Size(400, 543);
this.chart1.Size = new System.Drawing.Size(407, 601);
this.chart1.TabIndex = 17;
this.chart1.Text = "chart1";
//
@ -506,73 +515,277 @@ namespace BRS.Process.A020.UI
this.timer2.Interval = 1000;
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
//
// ManualBtn1
// label6
//
this.ManualBtn1.BackColor = System.Drawing.Color.Gray;
this.ManualBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.ManualBtn1.Location = new System.Drawing.Point(560, 270);
this.ManualBtn1.Name = "ManualBtn1";
this.ManualBtn1.Size = new System.Drawing.Size(104, 90);
this.ManualBtn1.TabIndex = 19;
this.ManualBtn1.Text = "手动按钮";
this.ManualBtn1.UseVisualStyleBackColor = false;
this.ManualBtn1.Click += new System.EventHandler(this.ManualBtn1_Click);
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.Name = "ManualLight";
this.ManualLight.Size = new System.Drawing.Size(104, 104);
this.ManualLight.TabIndex = 21;
this.ManualLight.UseVisualStyleBackColor = false;
//
// AutoLight
//
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.Name = "AutoLight";
this.AutoLight.Size = new System.Drawing.Size(104, 104);
this.AutoLight.TabIndex = 20;
this.AutoLight.UseVisualStyleBackColor = false;
//
// AutoBtn1
//
this.AutoBtn1.BackColor = System.Drawing.Color.Gray;
this.AutoBtn1.Cursor = System.Windows.Forms.Cursors.Hand;
this.AutoBtn1.Location = new System.Drawing.Point(560, 160);
this.AutoBtn1.Location = new System.Drawing.Point(3, 3);
this.AutoBtn1.Name = "AutoBtn1";
this.AutoBtn1.Size = new System.Drawing.Size(104, 90);
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);
//
// LoosenLight1
// ManualBtn1
//
this.LoosenLight1.BackColor = System.Drawing.Color.Gray;
this.LoosenLight1.Location = new System.Drawing.Point(420, 28);
this.LoosenLight1.Name = "LoosenLight1";
this.LoosenLight1.Size = new System.Drawing.Size(89, 89);
this.LoosenLight1.TabIndex = 17;
this.LoosenLight1.UseVisualStyleBackColor = false;
//
// ToughLight1
//
this.ToughLight1.BackColor = System.Drawing.Color.Gray;
this.ToughLight1.Location = new System.Drawing.Point(279, 28);
this.ToughLight1.Name = "ToughLight1";
this.ToughLight1.Size = new System.Drawing.Size(89, 89);
this.ToughLight1.TabIndex = 16;
this.ToughLight1.UseVisualStyleBackColor = false;
//
// StopStateLight1
//
this.StopStateLight1.BackColor = System.Drawing.Color.Gray;
this.StopStateLight1.Location = new System.Drawing.Point(144, 28);
this.StopStateLight1.Name = "StopStateLight1";
this.StopStateLight1.Size = new System.Drawing.Size(89, 89);
this.StopStateLight1.TabIndex = 15;
this.StopStateLight1.UseVisualStyleBackColor = false;
//
// MoveStateLight1
//
this.MoveStateLight1.BackColor = System.Drawing.Color.Gray;
this.MoveStateLight1.Location = new System.Drawing.Point(13, 28);
this.MoveStateLight1.Name = "MoveStateLight1";
this.MoveStateLight1.Size = new System.Drawing.Size(89, 89);
this.MoveStateLight1.TabIndex = 3;
this.MoveStateLight1.UseVisualStyleBackColor = false;
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);
//
// ESBtn
//
this.ESBtn.BackColor = System.Drawing.Color.Red;
this.ESBtn.Cursor = System.Windows.Forms.Cursors.Hand;
this.ESBtn.Location = new System.Drawing.Point(553, 28);
this.ESBtn.Location = new System.Drawing.Point(894, 12);
this.ESBtn.Name = "ESBtn";
this.ESBtn.Size = new System.Drawing.Size(111, 109);
this.ESBtn.Size = new System.Drawing.Size(137, 137);
this.ESBtn.TabIndex = 0;
this.ESBtn.Text = "急停";
this.ESBtn.UseVisualStyleBackColor = false;
@ -582,7 +795,7 @@ namespace BRS.Process.A020.UI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1510, 543);
this.ClientSize = new System.Drawing.Size(1825, 601);
this.Controls.Add(this.chart1);
this.Controls.Add(this.uiPanel1);
this.Controls.Add(this.chart2);
@ -591,8 +804,13 @@ namespace BRS.Process.A020.UI
this.Load += new System.EventHandler(this._Load);
((System.ComponentModel.ISupportInitialize)(this.chart2)).EndInit();
this.uiPanel1.ResumeLayout(false);
this.uiPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit();
this.uiPanel2.ResumeLayout(false);
this.LightSeries.ResumeLayout(false);
this.LightSeries.PerformLayout();
this.ParameterSetting.ResumeLayout(false);
this.ParameterSetting.PerformLayout();
this.BtnSeries.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -644,5 +862,21 @@ namespace BRS.Process.A020.UI
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label5;
private Sunny.UI.UIButton OKBtn;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label8;
private Sunny.UI.UIButton ResettingBtn;
private Sunny.UI.UIPanel uiPanel2;
private Sunny.UI.UIPanel ParameterSetting;
private System.Windows.Forms.Label label10;
private Sunny.UI.UIPanel LightSeries;
private CircleButton ManualLight;
private CircleButton AutoLight;
private Sunny.UI.UIPanel BtnSeries;
}
}

View File

@ -19,16 +19,16 @@ using static BRS.Common.Model.Helper.EnumHelper;
namespace BRS.Process.A020.UI
{
[MenuNode("ControlShaft", "扭矩轴控制", 5, "View2", true)]
[MenuNode("ControlShaft", "拧紧轴轴控制", 5, "View2", true)]
public partial class : MenuFormBase, IRunCtrl
{
private DateTime X_minValue;//横坐标最初值
private bool is_btn_manual { get; set; } = false;//是否手动
private bool isOpenAuto { get; set; } = false;//是否正在自动操作
int resValue1;
int resValue2;
int resValue2;
A020Process ProcessA020 => Process as A020Process;
A020Config Config => Process?.IConfig as A020Config;
@ -150,6 +150,8 @@ namespace BRS.Process.A020.UI
private void _Load(object sender, EventArgs e)
{
InitChart();
}
#if false
private void Init_Chart()
@ -191,7 +193,7 @@ namespace BRS.Process.A020.UI
this.chart2.Series[0].Points.AddXY(DateTime.Now.ToOADate(), ProcessReadInt(MelsecPlc, "D251", "int"));
this.chart2.ChartAreas[0].AxisX.Maximum = DateTime.Now.AddSeconds(1).ToOADate();//X坐标后移1秒
this.chart2.ChartAreas[0].AxisX.Minimum = DateTime.Now.AddSeconds(-5).ToOADate();//此刻后十秒钟作为最初X轴
this.chart1.Series[0].Points.AddXY(DateTime.Now.ToOADate(), ProcessReadInt(MelsecPlc, "D351", "int"));
this.chart1.ChartAreas[0].AxisX.Maximum = DateTime.Now.AddSeconds(1).ToOADate();//X坐标后移1秒
this.chart1.ChartAreas[0].AxisX.Minimum = DateTime.Now.AddSeconds(-5).ToOADate();//此刻后十秒钟作为最初X轴
@ -494,6 +496,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;
if (Process == null)
{
MessageBox.Show("无法操作空流程");
@ -504,12 +507,12 @@ namespace BRS.Process.A020.UI
try
{
ProcessOperation(true);//点击开始按钮后执行
//if (isStart)
//{
// await ProcessOperation(true);
// //ProcessOperation(true);
//}
//ProcessOperation(true);//点击开始按钮后执行
if (isStart)
{
ProcessOperation(true);
//ProcessOperation(true);
}
}
catch (Exception ex)
{
@ -527,12 +530,14 @@ namespace BRS.Process.A020.UI
//设置开始按钮状态
StartBtn1.Enabled = true;
}
}
private void StopBtn2_Click(object sender, EventArgs e)
{
var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
ProcessWriteInt(MelsecPLC, "D3", "int", "1");
//ProcessWriteInt(MelsecPLC, "D7", "int", "0");
ProcessWriteInt(MelsecPLC, "D55", "int", "0");
ProcessWriteInt(MelsecPLC, "D171", "int", "0");
this.StopStateLight1.BackColor = Color.Red;
this.MoveStateLight1.BackColor = Color.Gray;
timer1.Stop();
@ -702,6 +707,7 @@ namespace BRS.Process.A020.UI
{
var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
if (MoveStateLight1.BackColor == Color.GreenYellow)
{
if (isOpenAuto == true)
@ -730,10 +736,30 @@ namespace BRS.Process.A020.UI
{
var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
string addressD07 = ProcessReadInt(MelsecPLC, "D07", "int");
if (MoveStateLight1.BackColor == Color.GreenYellow)
string addD201 = ProcessReadInt(MelsecPLC, "D201", "int");
string addD19 = ProcessReadInt(MelsecPLC, "D19", "int");
//string MaxAngleValue = ProcessReadInt(MelsecPLC, "D163", "int");//读取旋转所需圈数的最大值
//string MinAngleValue = ProcessReadInt(MelsecPLC, "D161", "int");//最小值
//string overtime = ProcessReadInt(MelsecPLC, "D151", "int");//拧紧超时设定值,当空转达到设定的值时会停止
//string MaxSettingTorsionValue = ProcessReadInt(MelsecPLC, "D173", "int");//最大扭矩设定值,当达到这一个值时会停止
//string torsionTime = ProcessReadInt(MelsecPLC, "D155", "int");//扭矩到目标设定值计时设定值
string MaxAngleValue = textBox3.Text;
string MinAngleValue = textBox2.Text;
string overtime = textBox5.Text;
string MaxSettingTorsionValue = textBox4.Text;
string shaftValue = textBox1.Text;
if (shaftValue==""||MaxAngleValue == "" || MinAngleValue == "" || overtime == "" || MaxSettingTorsionValue == "")
{
LogAsync(DateTime.Now, LogLevel.Error, "请输入参数!");
return;
}
else if (MoveStateLight1.BackColor == Color.GreenYellow && addD201 == "111" && addD19 == "0")
{
if (addressD07 == "1")
{
{
if (!ProcessA020.IsSingleStepOperating)
{
if (isOpenAuto == true)
@ -757,6 +783,7 @@ namespace BRS.Process.A020.UI
}
else
{
isOpenAuto = false;
LogAsync(DateTime.Now, LogLevel.Error, $"当前流程未启动");
}
}
@ -769,7 +796,9 @@ namespace BRS.Process.A020.UI
{
var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
string addressD07 = ProcessReadInt(MelsecPLC, "D07", "int");
if (MoveStateLight1.BackColor == Color.GreenYellow)
string addD201 = ProcessReadInt(MelsecPLC, "D201", "int");
string addD19 = ProcessReadInt(MelsecPLC, "D19", "int");
if (MoveStateLight1.BackColor == Color.GreenYellow && addD201 == "111" && addD19 == "0")
{
if (addressD07 == "1")
{
@ -799,6 +828,7 @@ namespace BRS.Process.A020.UI
LogAsync(DateTime.Now, LogLevel.Error, $"当前流程未启动");
}
}
private void timer2_Tick(object sender, EventArgs e)
{
var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
@ -806,12 +836,45 @@ namespace BRS.Process.A020.UI
string angleValue = ProcessReadInt(MelsecPLC, "D351", "int");
resValue1 = Convert.ToInt32(torsionValue);//将接收到的返回值转为int类型
resValue2 = Convert.ToInt32(angleValue);
while (resValue1 >= 200 && resValue2 <= 6)
int MaxAngleValue = Convert.ToInt32(ProcessReadInt(MelsecPLC, "D163", "int"));//读取旋转所需圈数的最大值
int MinAngleValue = Convert.ToInt32(ProcessReadInt(MelsecPLC, "D161", "int"));//最小值
int overtime = Convert.ToInt32(ProcessReadInt(MelsecPLC, "D151", "int"));//拧紧超时设定值,当空转达到设定的值时会停止
int MaxSettingTorsionValue = Convert.ToInt32(ProcessReadInt(MelsecPLC, "D173", "int"));//最大扭矩设定值,当达到这一个值时会停止
int torsionTime = Convert.ToInt32(ProcessReadInt(MelsecPLC, "D155", "int"));//扭矩到目标设定值计时设定值
if (resValue1 >= MaxSettingTorsionValue)
{
ProcessA020.StopProcess();
//ProcessA020.StopProcess();
ProcessWriteInt(MelsecPLC, "D55", "int", "0");//到位时D55置0停止
LogAsync(DateTime.Now, LogLevel.Information, "已完成");
timer2.Stop();
timer1.Stop();
if (MinAngleValue <= resValue2 && resValue2 <= MaxAngleValue)
{
LogAsync(DateTime.Now, LogLevel.Information, "产品合格");
isOpenAuto = false;
//机械手控制螺丝机退出螺丝,
return;
}
else if (resValue2 < MinAngleValue)
{
LogAsync(DateTime.Now, LogLevel.Error, "螺丝卡丝");
isOpenAuto = false;
return;
}
//else if (resValue2 > MaxAngleValue)
//{
// LogAsync(DateTime.Now, LogLevel.Error, "螺丝滑丝");
// isOpenAuto = false;
// break;
//}
}
else if (resValue2 > MaxAngleValue)
{
timer2.Stop();
LogAsync(DateTime.Now, LogLevel.Error, "螺丝滑丝");
isOpenAuto = false;
return;
}
}
@ -823,20 +886,63 @@ namespace BRS.Process.A020.UI
private void ESBtn_Click(object sender, EventArgs e)
{
var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
ProcessWriteInt(MelsecPLC, "D3", "int", "1");//D3写入1使上位机停止
ProcessWriteInt(MelsecPLC, "D7", "int", "0");
//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)
{
MessageBox.Show("无法操作空流程");
return;
}
}
StopBtn2.Enabled = false;
try
{
ProcessOperation(false);
//if (isStart)
//{
// await ProcessOperation(false);
//}
//ProcessOperation(true);//点击开始按钮后执行
if (isStart)
{
ProcessOperation(false);
//ProcessOperation(true);
}
}
catch (Exception ex)
{
@ -844,25 +950,57 @@ namespace BRS.Process.A020.UI
}
finally
{
this.StopStateLight1.BackColor = Color.Gray;
this.MoveStateLight1.BackColor = Color.Gray;
this.ToughLight1.BackColor = Color.Gray;
this.LoosenLight1.BackColor = Color.Gray;
//将自动手动按钮颜色恢复为灰色
this.AutoBtn1.BackColor = Color.Gray;
this.ManualBtn1.BackColor = Color.Gray;
//点击停止后初始化图表
InitChart();
timer1.Stop();
timer2.Stop();
isOpenAuto = false;
//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;
}
}
private void OKBtn_Click(object sender, EventArgs e)
{
var MelsecPLC = ProcessA020.DeviceCollection.FirstOrDefault(u => u is PLCBase) as PLCBase;
ProcessWriteInt(MelsecPLC, "D171", "int", textBox1.Text);
//实际操作使用
ProcessWriteInt(MelsecPLC, "D161", "int", textBox2.Text);
ProcessWriteInt(MelsecPLC, "D163", "int", textBox3.Text);
ProcessWriteInt(MelsecPLC, "D173", "int", textBox4.Text);
ProcessWriteInt(MelsecPLC, "D151", "int", textBox5.Text);
}
public enum ShaftState
{
Idling,//空转状态
Normal,//正常状态
Sliding,//滑丝状态
}
private void uiPanel1_Load(object sender, EventArgs e)
{
}
private void ResettingBtn_Click(object sender, EventArgs e)
{
if (isOpenAuto == true)
{
LogAsync(DateTime.Now, LogLevel.Error, "正在进行自动流程,请勿清空参数");
}
else
{
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox5.Clear();
}
}
}
}

View File

@ -325,7 +325,7 @@ namespace XKRS.Device.MelsecPLC
{
try
{
melsecMc.ConnectClose();
// 断开连接
// melsecMc.RemoteStop();
// OmronUDPNet.Stop();

View File

@ -26,9 +26,9 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Optimize>false</Optimize>
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>