From 16586d67aa15bc3b77966748424d9c990da1b700 Mon Sep 17 00:00:00 2001 From: bnala Date: Wed, 19 Feb 2025 13:39:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=83=A8=E5=88=86=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=9B=B4=E6=96=B0ApiFormResult=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WindowsFormsApp1/MES_PLC_Control.csproj | 4 +- WindowsFormsApp1/MainForm.Designer.cs | 849 ++++++++++++++++++----- WindowsFormsApp1/MainForm.cs | 255 +++++-- WindowsFormsApp1/MainForm.resx | 3 + WindowsFormsApp1/Program.cs | 4 + WindowsFormsApp1/db/MES_PLC.db | Bin 139264 -> 139264 bytes WindowsFormsApp1/mod/database/t_plc.cs | 4 +- WindowsFormsApp1/mod/enum/plc_emum.cs | 22 +- WindowsFormsApp1/mod/server/otherdata.cs | 9 +- WindowsFormsApp1/packages.config | 2 +- WindowsFormsApp1/server/ApiClient.cs | 34 +- WindowsFormsApp1/server/ApiFormResult.cs | 13 +- 12 files changed, 936 insertions(+), 263 deletions(-) diff --git a/WindowsFormsApp1/MES_PLC_Control.csproj b/WindowsFormsApp1/MES_PLC_Control.csproj index 1b2463a..a99a225 100644 --- a/WindowsFormsApp1/MES_PLC_Control.csproj +++ b/WindowsFormsApp1/MES_PLC_Control.csproj @@ -38,8 +38,8 @@ ..\packages\HslCommunication.7.0.1\lib\net451\HslCommunication.dll - - ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/WindowsFormsApp1/MainForm.Designer.cs b/WindowsFormsApp1/MainForm.Designer.cs index e384b47..19081c1 100644 --- a/WindowsFormsApp1/MainForm.Designer.cs +++ b/WindowsFormsApp1/MainForm.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.用户管理ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.修改密码ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -47,27 +48,65 @@ this.groupBox1 = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.label4 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); + this.PLC通讯时间 = new System.Windows.Forms.Label(); + this.MES通讯时间 = new System.Windows.Forms.Label(); + this.PLC链接状态 = new System.Windows.Forms.Label(); + this.MES链接状态 = new System.Windows.Forms.Label(); + this.当前时间 = new System.Windows.Forms.Label(); + this.操作人员ID = new System.Windows.Forms.Label(); + this.机台编号 = new System.Windows.Forms.Label(); + this.段别 = new System.Windows.Forms.Label(); + this.线别 = new System.Windows.Forms.Label(); this.开始处理 = new System.Windows.Forms.Button(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.操作页面 = new System.Windows.Forms.GroupBox(); - this.label9 = new System.Windows.Forms.Label(); - this.textBox1 = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel(); + this.底部注释1 = new System.Windows.Forms.Label(); + this.底部注释2 = new System.Windows.Forms.Label(); + this.底部注释3 = new System.Windows.Forms.Label(); + this.底部注释4 = new System.Windows.Forms.Label(); + this.底部注释5 = new System.Windows.Forms.Label(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.gropb = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); + this.Tray盘 = new System.Windows.Forms.Label(); + this.Tray盘二维码 = new System.Windows.Forms.Label(); + this.原料包装LOT号 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); + this.LOT号显示 = new System.Windows.Forms.Label(); + this.LOT号 = new System.Windows.Forms.Label(); + this.请扫描LOT号 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); + this.事件4 = new System.Windows.Forms.Label(); + this.事件3 = new System.Windows.Forms.Label(); + this.事件4结果 = new System.Windows.Forms.Label(); + this.事件3结果 = new System.Windows.Forms.Label(); + this.事件2 = new System.Windows.Forms.Label(); + this.事件1 = new System.Windows.Forms.Label(); + this.事件2结果 = new System.Windows.Forms.Label(); + this.事件1结果 = new System.Windows.Forms.Label(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.LOT号扫描 = new System.Windows.Forms.Label(); + this.事件1时间 = new System.Windows.Forms.Label(); + this.事件2时间 = new System.Windows.Forms.Label(); + this.事件3时间 = new System.Windows.Forms.Label(); + this.事件4时间 = new System.Windows.Forms.Label(); + this.机台状态 = new System.Windows.Forms.Label(); this.menuStrip1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.groupBox3.SuspendLayout(); - this.操作页面.SuspendLayout(); + this.tableLayoutPanel8.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + this.gropb.SuspendLayout(); + this.tableLayoutPanel6.SuspendLayout(); + this.原料包装LOT号.SuspendLayout(); + this.tableLayoutPanel5.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.tableLayoutPanel7.SuspendLayout(); this.SuspendLayout(); // // menuStrip1 @@ -86,7 +125,7 @@ this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2); - this.menuStrip1.Size = new System.Drawing.Size(2884, 44); + this.menuStrip1.Size = new System.Drawing.Size(1613, 44); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // @@ -103,21 +142,21 @@ // 修改密码ToolStripMenuItem // this.修改密码ToolStripMenuItem.Name = "修改密码ToolStripMenuItem"; - this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(247, 44); + this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(315, 44); this.修改密码ToolStripMenuItem.Text = "修改密码"; this.修改密码ToolStripMenuItem.Click += new System.EventHandler(this.修改密码ToolStripMenuItem_Click); // // 切换用户ToolStripMenuItem // this.切换用户ToolStripMenuItem.Name = "切换用户ToolStripMenuItem"; - this.切换用户ToolStripMenuItem.Size = new System.Drawing.Size(247, 44); + this.切换用户ToolStripMenuItem.Size = new System.Drawing.Size(315, 44); this.切换用户ToolStripMenuItem.Text = "切换用户"; this.切换用户ToolStripMenuItem.Click += new System.EventHandler(this.切换用户ToolStripMenuItem_Click); // // 用户管理ToolStripMenuItem1 // this.用户管理ToolStripMenuItem1.Name = "用户管理ToolStripMenuItem1"; - this.用户管理ToolStripMenuItem1.Size = new System.Drawing.Size(247, 44); + this.用户管理ToolStripMenuItem1.Size = new System.Drawing.Size(315, 44); this.用户管理ToolStripMenuItem1.Text = "用户管理"; this.用户管理ToolStripMenuItem1.Click += new System.EventHandler(this.用户管理ToolStripMenuItem1_Click); // @@ -140,14 +179,14 @@ // pLC通讯设置ToolStripMenuItem // this.pLC通讯设置ToolStripMenuItem.Name = "pLC通讯设置ToolStripMenuItem"; - this.pLC通讯设置ToolStripMenuItem.Size = new System.Drawing.Size(297, 44); + this.pLC通讯设置ToolStripMenuItem.Size = new System.Drawing.Size(315, 44); this.pLC通讯设置ToolStripMenuItem.Text = "PLC通讯设置"; this.pLC通讯设置ToolStripMenuItem.Click += new System.EventHandler(this.pLC通讯设置ToolStripMenuItem_Click); // // pLC地址设置ToolStripMenuItem // this.pLC地址设置ToolStripMenuItem.Name = "pLC地址设置ToolStripMenuItem"; - this.pLC地址设置ToolStripMenuItem.Size = new System.Drawing.Size(297, 44); + this.pLC地址设置ToolStripMenuItem.Size = new System.Drawing.Size(315, 44); this.pLC地址设置ToolStripMenuItem.Text = "PLC地址设置"; this.pLC地址设置ToolStripMenuItem.Click += new System.EventHandler(this.pLC地址设置ToolStripMenuItem_Click); // @@ -177,13 +216,13 @@ // 扫码枪配置ToolStripMenuItem1 // this.扫码枪配置ToolStripMenuItem1.Name = "扫码枪配置ToolStripMenuItem1"; - this.扫码枪配置ToolStripMenuItem1.Size = new System.Drawing.Size(303, 44); + this.扫码枪配置ToolStripMenuItem1.Size = new System.Drawing.Size(315, 44); this.扫码枪配置ToolStripMenuItem1.Text = "扫码枪配置"; // // 扭力曲线配置ToolStripMenuItem // this.扭力曲线配置ToolStripMenuItem.Name = "扭力曲线配置ToolStripMenuItem"; - this.扭力曲线配置ToolStripMenuItem.Size = new System.Drawing.Size(303, 44); + this.扭力曲线配置ToolStripMenuItem.Size = new System.Drawing.Size(315, 44); this.扭力曲线配置ToolStripMenuItem.Text = "扭力曲线配置"; // // 系统参数配置ToolStripMenuItem @@ -194,22 +233,22 @@ // // tableLayoutPanel1 // - this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel4, 0, 1); this.tableLayoutPanel1.Controls.Add(this.groupBox1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.groupBox3, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.操作页面, 0, 1); - this.tableLayoutPanel1.Location = new System.Drawing.Point(22, 52); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel8, 0, 3); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(5); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.28571F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 42.85714F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 42.85714F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(3304, 1743); + this.tableLayoutPanel1.RowCount = 4; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 13.69908F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 49.35109F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 32.90072F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.049116F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1613, 935); this.tableLayoutPanel1.TabIndex = 6; // // groupBox1 @@ -220,10 +259,10 @@ this.groupBox1.Controls.Add(this.tableLayoutPanel3); this.groupBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox1.Location = new System.Drawing.Point(4, 4); - this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.groupBox1.Size = new System.Drawing.Size(3296, 240); + this.groupBox1.Padding = new System.Windows.Forms.Padding(4); + this.groupBox1.Size = new System.Drawing.Size(1605, 120); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; this.groupBox1.Text = "处理界面"; @@ -241,13 +280,13 @@ this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel2, 3, 0); this.tableLayoutPanel3.Controls.Add(this.开始处理, 1, 1); this.tableLayoutPanel3.Location = new System.Drawing.Point(18, 42); - this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(5); this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.RowCount = 3; this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 80F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(3268, 188); + this.tableLayoutPanel3.Size = new System.Drawing.Size(1577, 68); this.tableLayoutPanel3.TabIndex = 4; // // tableLayoutPanel2 @@ -265,137 +304,153 @@ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 37F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 37F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 37F)); - this.tableLayoutPanel2.Controls.Add(this.label4, 3, 0); - this.tableLayoutPanel2.Controls.Add(this.label3, 2, 0); - this.tableLayoutPanel2.Controls.Add(this.label2, 1, 0); - this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.label5, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.label6, 1, 1); - this.tableLayoutPanel2.Controls.Add(this.label7, 2, 1); - this.tableLayoutPanel2.Controls.Add(this.label8, 3, 1); - this.tableLayoutPanel2.Location = new System.Drawing.Point(330, 5); - this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.tableLayoutPanel2.Controls.Add(this.机台状态, 3, 1); + this.tableLayoutPanel2.Controls.Add(this.PLC通讯时间, 4, 1); + this.tableLayoutPanel2.Controls.Add(this.MES通讯时间, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.PLC链接状态, 2, 1); + this.tableLayoutPanel2.Controls.Add(this.MES链接状态, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.当前时间, 4, 0); + this.tableLayoutPanel2.Controls.Add(this.操作人员ID, 3, 0); + this.tableLayoutPanel2.Controls.Add(this.机台编号, 2, 0); + this.tableLayoutPanel2.Controls.Add(this.段别, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.线别, 0, 0); + this.tableLayoutPanel2.Location = new System.Drawing.Point(161, 5); + this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(5); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; this.tableLayoutPanel2.RowCount = 2; this.tableLayoutPanel3.SetRowSpan(this.tableLayoutPanel2, 3); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(2933, 178); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(1411, 58); this.tableLayoutPanel2.TabIndex = 3; // - // label4 + // PLC通讯时间 // - this.label4.AutoSize = true; - this.label4.Dock = System.Windows.Forms.DockStyle.Fill; - this.label4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(1764, 1); - this.label4.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(575, 87); - this.label4.TabIndex = 6; - this.label4.Text = "label4"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.PLC通讯时间.AutoSize = true; + this.PLC通讯时间.Dock = System.Windows.Forms.DockStyle.Fill; + this.PLC通讯时间.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.PLC通讯时间.Location = new System.Drawing.Point(1134, 29); + this.PLC通讯时间.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.PLC通讯时间.Name = "PLC通讯时间"; + this.PLC通讯时间.Size = new System.Drawing.Size(271, 28); + this.PLC通讯时间.TabIndex = 16; + this.PLC通讯时间.Text = "PLC通讯时间:None"; + this.PLC通讯时间.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label3 + // MES通讯时间 // - this.label3.AutoSize = true; - this.label3.Dock = System.Windows.Forms.DockStyle.Fill; - this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(1178, 1); - this.label3.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(575, 87); - this.label3.TabIndex = 5; - this.label3.Text = "label3"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.MES通讯时间.AutoSize = true; + this.MES通讯时间.Dock = System.Windows.Forms.DockStyle.Fill; + this.MES通讯时间.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.MES通讯时间.Location = new System.Drawing.Point(288, 29); + this.MES通讯时间.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.MES通讯时间.Name = "MES通讯时间"; + this.MES通讯时间.Size = new System.Drawing.Size(271, 28); + this.MES通讯时间.TabIndex = 15; + this.MES通讯时间.Text = "MES通讯时间:None"; + this.MES通讯时间.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label2 + // PLC链接状态 // - this.label2.AutoSize = true; - this.label2.Dock = System.Windows.Forms.DockStyle.Fill; - this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(592, 1); - this.label2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(575, 87); - this.label2.TabIndex = 4; - this.label2.Text = "label2"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.PLC链接状态.AutoSize = true; + this.PLC链接状态.Dock = System.Windows.Forms.DockStyle.Fill; + this.PLC链接状态.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.PLC链接状态.Location = new System.Drawing.Point(570, 29); + this.PLC链接状态.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.PLC链接状态.Name = "PLC链接状态"; + this.PLC链接状态.Size = new System.Drawing.Size(271, 28); + this.PLC链接状态.TabIndex = 14; + this.PLC链接状态.Text = "PLC链接状态:None"; + this.PLC链接状态.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label1 + // MES链接状态 // - this.label1.AutoSize = true; - this.label1.Dock = System.Windows.Forms.DockStyle.Fill; - this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label1.Location = new System.Drawing.Point(6, 1); - this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(575, 87); - this.label1.TabIndex = 3; - this.label1.Text = "label1"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.MES链接状态.AutoSize = true; + this.MES链接状态.Dock = System.Windows.Forms.DockStyle.Fill; + this.MES链接状态.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.MES链接状态.Location = new System.Drawing.Point(6, 29); + this.MES链接状态.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.MES链接状态.Name = "MES链接状态"; + this.MES链接状态.Size = new System.Drawing.Size(271, 28); + this.MES链接状态.TabIndex = 12; + this.MES链接状态.Text = "MES链接状态:None"; + this.MES链接状态.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label5 + // 当前时间 // - this.label5.AutoSize = true; - this.label5.Dock = System.Windows.Forms.DockStyle.Fill; - this.label5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(6, 89); - this.label5.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(575, 88); - this.label5.TabIndex = 7; - this.label5.Text = "label5"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.当前时间.AutoSize = true; + this.当前时间.Dock = System.Windows.Forms.DockStyle.Fill; + this.当前时间.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.当前时间.Location = new System.Drawing.Point(1134, 1); + this.当前时间.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.当前时间.Name = "当前时间"; + this.当前时间.Size = new System.Drawing.Size(271, 27); + this.当前时间.TabIndex = 11; + this.当前时间.Text = "当前时间:"; + this.当前时间.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label6 + // 操作人员ID // - this.label6.AutoSize = true; - this.label6.Dock = System.Windows.Forms.DockStyle.Fill; - this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(592, 89); - this.label6.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(575, 88); - this.label6.TabIndex = 8; - this.label6.Text = "label6"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.操作人员ID.AutoSize = true; + this.操作人员ID.Dock = System.Windows.Forms.DockStyle.Fill; + this.操作人员ID.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.操作人员ID.Location = new System.Drawing.Point(852, 1); + this.操作人员ID.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.操作人员ID.Name = "操作人员ID"; + this.操作人员ID.Size = new System.Drawing.Size(271, 27); + this.操作人员ID.TabIndex = 6; + this.操作人员ID.Text = "操作人员ID:"; + this.操作人员ID.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label7 + // 机台编号 // - this.label7.AutoSize = true; - this.label7.Dock = System.Windows.Forms.DockStyle.Fill; - this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(1178, 89); - this.label7.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(575, 88); - this.label7.TabIndex = 9; - this.label7.Text = "label7"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.机台编号.AutoSize = true; + this.机台编号.Dock = System.Windows.Forms.DockStyle.Fill; + this.机台编号.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.机台编号.Location = new System.Drawing.Point(570, 1); + this.机台编号.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.机台编号.Name = "机台编号"; + this.机台编号.Size = new System.Drawing.Size(271, 27); + this.机台编号.TabIndex = 5; + this.机台编号.Text = "机台编号:"; + this.机台编号.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label8 + // 段别 // - this.label8.AutoSize = true; - this.label8.Dock = System.Windows.Forms.DockStyle.Fill; - this.label8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label8.Location = new System.Drawing.Point(1764, 89); - this.label8.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(575, 88); - this.label8.TabIndex = 10; - this.label8.Text = "label8"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.段别.AutoSize = true; + this.段别.Dock = System.Windows.Forms.DockStyle.Fill; + this.段别.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.段别.Location = new System.Drawing.Point(288, 1); + this.段别.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.段别.Name = "段别"; + this.段别.Size = new System.Drawing.Size(271, 27); + this.段别.TabIndex = 4; + this.段别.Text = "段别:"; + this.段别.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // 线别 + // + this.线别.AutoSize = true; + this.线别.Dock = System.Windows.Forms.DockStyle.Fill; + this.线别.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.线别.Location = new System.Drawing.Point(6, 1); + this.线别.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.线别.Name = "线别"; + this.线别.Size = new System.Drawing.Size(271, 27); + this.线别.TabIndex = 3; + this.线别.Text = "线别:"; + this.线别.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // 开始处理 // this.开始处理.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0))))); this.开始处理.Dock = System.Windows.Forms.DockStyle.Fill; this.开始处理.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.开始处理.Location = new System.Drawing.Point(36, 22); - this.开始处理.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.开始处理.Location = new System.Drawing.Point(19, 10); + this.开始处理.Margin = new System.Windows.Forms.Padding(4); this.开始处理.Name = "开始处理"; - this.开始处理.Size = new System.Drawing.Size(253, 142); + this.开始处理.Size = new System.Drawing.Size(118, 46); this.开始处理.TabIndex = 1; this.开始处理.Text = "开始处理"; this.开始处理.UseVisualStyleBackColor = false; @@ -407,12 +462,12 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.Controls.Add(this.richTextBox1); - this.groupBox3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.groupBox3.Location = new System.Drawing.Point(4, 999); - this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.groupBox3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox3.Location = new System.Drawing.Point(4, 593); + this.groupBox3.Margin = new System.Windows.Forms.Padding(4); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.groupBox3.Size = new System.Drawing.Size(3296, 740); + this.groupBox3.Padding = new System.Windows.Forms.Padding(4); + this.groupBox3.Size = new System.Drawing.Size(1605, 299); this.groupBox3.TabIndex = 6; this.groupBox3.TabStop = false; this.groupBox3.Text = "日志页面"; @@ -424,58 +479,433 @@ | System.Windows.Forms.AnchorStyles.Right))); this.richTextBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.richTextBox1.Location = new System.Drawing.Point(18, 42); - this.richTextBox1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.richTextBox1.Margin = new System.Windows.Forms.Padding(5); this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(3265, 685); + this.richTextBox1.Size = new System.Drawing.Size(1574, 244); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // - // 操作页面 + // tableLayoutPanel8 // - this.操作页面.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.tableLayoutPanel8.ColumnCount = 5; + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel8.Controls.Add(this.底部注释1, 0, 0); + this.tableLayoutPanel8.Controls.Add(this.底部注释2, 1, 0); + this.tableLayoutPanel8.Controls.Add(this.底部注释3, 2, 0); + this.tableLayoutPanel8.Controls.Add(this.底部注释4, 3, 0); + this.tableLayoutPanel8.Controls.Add(this.底部注释5, 4, 0); + this.tableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel8.Location = new System.Drawing.Point(3, 899); + this.tableLayoutPanel8.Name = "tableLayoutPanel8"; + this.tableLayoutPanel8.RowCount = 1; + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel8.Size = new System.Drawing.Size(1607, 33); + this.tableLayoutPanel8.TabIndex = 7; + // + // 底部注释1 + // + this.底部注释1.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.底部注释1.AutoSize = true; + this.底部注释1.Location = new System.Drawing.Point(3, 6); + this.底部注释1.Name = "底部注释1"; + this.底部注释1.Size = new System.Drawing.Size(105, 21); + this.底部注释1.TabIndex = 0; + this.底部注释1.Text = "底部注释1"; + // + // 底部注释2 + // + this.底部注释2.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.底部注释2.AutoSize = true; + this.底部注释2.Location = new System.Drawing.Point(324, 6); + this.底部注释2.Name = "底部注释2"; + this.底部注释2.Size = new System.Drawing.Size(105, 21); + this.底部注释2.TabIndex = 1; + this.底部注释2.Text = "底部注释2"; + // + // 底部注释3 + // + this.底部注释3.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.底部注释3.AutoSize = true; + this.底部注释3.Location = new System.Drawing.Point(645, 6); + this.底部注释3.Name = "底部注释3"; + this.底部注释3.Size = new System.Drawing.Size(105, 21); + this.底部注释3.TabIndex = 2; + this.底部注释3.Text = "底部注释3"; + // + // 底部注释4 + // + this.底部注释4.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.底部注释4.AutoSize = true; + this.底部注释4.Location = new System.Drawing.Point(966, 6); + this.底部注释4.Name = "底部注释4"; + this.底部注释4.Size = new System.Drawing.Size(105, 21); + this.底部注释4.TabIndex = 3; + this.底部注释4.Text = "底部注释4"; + // + // 底部注释5 + // + this.底部注释5.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.底部注释5.AutoSize = true; + this.底部注释5.Location = new System.Drawing.Point(1287, 6); + this.底部注释5.Name = "底部注释5"; + this.底部注释5.Size = new System.Drawing.Size(105, 21); + this.底部注释5.TabIndex = 4; + this.底部注释5.Text = "底部注释5"; + // + // tableLayoutPanel4 + // + this.tableLayoutPanel4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.操作页面.Controls.Add(this.label9); - this.操作页面.Controls.Add(this.textBox1); - this.操作页面.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.操作页面.Location = new System.Drawing.Point(4, 252); - this.操作页面.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.操作页面.Name = "操作页面"; - this.操作页面.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.操作页面.Size = new System.Drawing.Size(3296, 739); - this.操作页面.TabIndex = 5; - this.操作页面.TabStop = false; - this.操作页面.Text = "操作页面"; + this.tableLayoutPanel4.ColumnCount = 2; + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 76.54172F)); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 23.45828F)); + this.tableLayoutPanel4.Controls.Add(this.gropb, 0, 1); + this.tableLayoutPanel4.Controls.Add(this.原料包装LOT号, 0, 0); + this.tableLayoutPanel4.Controls.Add(this.groupBox2, 1, 0); + this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 131); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + this.tableLayoutPanel4.RowCount = 2; + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 60.04619F)); + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 39.95381F)); + this.tableLayoutPanel4.Size = new System.Drawing.Size(1607, 455); + this.tableLayoutPanel4.TabIndex = 8; // - // label9 + // gropb // - this.label9.AutoSize = true; - this.label9.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label9.Location = new System.Drawing.Point(44, 64); - this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(416, 56); - this.label9.TabIndex = 1; - this.label9.Text = "请扫描二维码:"; + this.gropb.Controls.Add(this.tableLayoutPanel6); + this.gropb.Dock = System.Windows.Forms.DockStyle.Fill; + this.gropb.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.gropb.Location = new System.Drawing.Point(3, 276); + this.gropb.Name = "gropb"; + this.gropb.Size = new System.Drawing.Size(1224, 176); + this.gropb.TabIndex = 1; + this.gropb.TabStop = false; + this.gropb.Text = "Tray盘二维码"; // - // textBox1 + // tableLayoutPanel6 // - this.textBox1.Font = new System.Drawing.Font("宋体", 26F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox1.Location = new System.Drawing.Point(54, 383); - this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(1224, 77); - this.textBox1.TabIndex = 0; + this.tableLayoutPanel6.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; + this.tableLayoutPanel6.ColumnCount = 2; + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); + this.tableLayoutPanel6.Controls.Add(this.Tray盘, 0, 0); + this.tableLayoutPanel6.Controls.Add(this.Tray盘二维码, 1, 0); + this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 35); + this.tableLayoutPanel6.Name = "tableLayoutPanel6"; + this.tableLayoutPanel6.RowCount = 1; + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel6.Size = new System.Drawing.Size(1218, 138); + this.tableLayoutPanel6.TabIndex = 1; + // + // Tray盘 + // + this.Tray盘.Anchor = System.Windows.Forms.AnchorStyles.None; + this.Tray盘.AutoSize = true; + this.Tray盘.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Tray盘.Location = new System.Drawing.Point(8, 27); + this.Tray盘.Name = "Tray盘"; + this.Tray盘.Size = new System.Drawing.Size(228, 84); + this.Tray盘.TabIndex = 3; + this.Tray盘.Text = "Tray盘二维码:"; + // + // Tray盘二维码 + // + this.Tray盘二维码.Anchor = System.Windows.Forms.AnchorStyles.None; + this.Tray盘二维码.AutoSize = true; + this.Tray盘二维码.Font = new System.Drawing.Font("宋体", 26.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.Tray盘二维码.Location = new System.Drawing.Point(397, 8); + this.Tray盘二维码.Name = "Tray盘二维码"; + this.Tray盘二维码.Size = new System.Drawing.Size(667, 122); + this.Tray盘二维码.TabIndex = 2; + this.Tray盘二维码.Text = "Tray盘二维码:92139129312381928938"; + // + // 原料包装LOT号 + // + this.原料包装LOT号.Controls.Add(this.tableLayoutPanel5); + this.原料包装LOT号.Dock = System.Windows.Forms.DockStyle.Fill; + this.原料包装LOT号.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.原料包装LOT号.Location = new System.Drawing.Point(3, 3); + this.原料包装LOT号.Name = "原料包装LOT号"; + this.原料包装LOT号.Size = new System.Drawing.Size(1224, 267); + this.原料包装LOT号.TabIndex = 0; + this.原料包装LOT号.TabStop = false; + this.原料包装LOT号.Text = "原料包装LOT号"; + // + // tableLayoutPanel5 + // + this.tableLayoutPanel5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.tableLayoutPanel5.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; + this.tableLayoutPanel5.ColumnCount = 2; + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); + this.tableLayoutPanel5.Controls.Add(this.LOT号扫描, 0, 0); + this.tableLayoutPanel5.Controls.Add(this.LOT号显示, 0, 1); + this.tableLayoutPanel5.Controls.Add(this.LOT号, 1, 1); + this.tableLayoutPanel5.Controls.Add(this.请扫描LOT号, 1, 0); + this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 35); + this.tableLayoutPanel5.Name = "tableLayoutPanel5"; + this.tableLayoutPanel5.RowCount = 2; + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel5.Size = new System.Drawing.Size(1218, 229); + this.tableLayoutPanel5.TabIndex = 0; + // + // LOT号显示 + // + this.LOT号显示.Anchor = System.Windows.Forms.AnchorStyles.None; + this.LOT号显示.AutoSize = true; + this.LOT号显示.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.LOT号显示.Location = new System.Drawing.Point(40, 129); + this.LOT号显示.Name = "LOT号显示"; + this.LOT号显示.Size = new System.Drawing.Size(165, 84); + this.LOT号显示.TabIndex = 2; + this.LOT号显示.Text = "LOT号显示:"; + // + // LOT号 + // + this.LOT号.Anchor = System.Windows.Forms.AnchorStyles.None; + this.LOT号.AutoSize = true; + this.LOT号.Font = new System.Drawing.Font("宋体", 26.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.LOT号.Location = new System.Drawing.Point(271, 141); + this.LOT号.Name = "LOT号"; + this.LOT号.Size = new System.Drawing.Size(919, 61); + this.LOT号.TabIndex = 0; + this.LOT号.Text = "LOT号:231321919199191919191"; + // + // 请扫描LOT号 + // + this.请扫描LOT号.Anchor = System.Windows.Forms.AnchorStyles.None; + this.请扫描LOT号.AutoSize = true; + this.请扫描LOT号.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.请扫描LOT号.ForeColor = System.Drawing.Color.Red; + this.请扫描LOT号.Location = new System.Drawing.Point(476, 29); + this.请扫描LOT号.Name = "请扫描LOT号"; + this.请扫描LOT号.Size = new System.Drawing.Size(510, 56); + this.请扫描LOT号.TabIndex = 1; + this.请扫描LOT号.Text = "请员工扫描LOT号:"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.tableLayoutPanel7); + this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.groupBox2.Location = new System.Drawing.Point(1233, 3); + this.groupBox2.Name = "groupBox2"; + this.tableLayoutPanel4.SetRowSpan(this.groupBox2, 2); + this.groupBox2.Size = new System.Drawing.Size(371, 449); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "MES事件结果"; + // + // tableLayoutPanel7 + // + this.tableLayoutPanel7.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; + this.tableLayoutPanel7.ColumnCount = 2; + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel7.Controls.Add(this.事件4时间, 1, 5); + this.tableLayoutPanel7.Controls.Add(this.事件3时间, 0, 5); + this.tableLayoutPanel7.Controls.Add(this.事件2时间, 1, 2); + this.tableLayoutPanel7.Controls.Add(this.事件1时间, 0, 2); + this.tableLayoutPanel7.Controls.Add(this.事件2, 1, 1); + this.tableLayoutPanel7.Controls.Add(this.事件1, 0, 1); + this.tableLayoutPanel7.Controls.Add(this.事件2结果, 1, 0); + this.tableLayoutPanel7.Controls.Add(this.事件1结果, 0, 0); + this.tableLayoutPanel7.Controls.Add(this.事件3结果, 0, 3); + this.tableLayoutPanel7.Controls.Add(this.事件3, 0, 4); + this.tableLayoutPanel7.Controls.Add(this.事件4, 1, 4); + this.tableLayoutPanel7.Controls.Add(this.事件4结果, 1, 3); + this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel7.Location = new System.Drawing.Point(3, 35); + this.tableLayoutPanel7.Name = "tableLayoutPanel7"; + this.tableLayoutPanel7.RowCount = 6; + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tableLayoutPanel7.Size = new System.Drawing.Size(365, 411); + this.tableLayoutPanel7.TabIndex = 0; + // + // 事件4 + // + this.事件4.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件4.AutoSize = true; + this.事件4.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件4.Location = new System.Drawing.Point(224, 330); + this.事件4.Name = "事件4"; + this.事件4.Size = new System.Drawing.Size(98, 33); + this.事件4.TabIndex = 7; + this.事件4.Text = "事件4"; + // + // 事件3 + // + this.事件3.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件3.AutoSize = true; + this.事件3.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件3.Location = new System.Drawing.Point(42, 330); + this.事件3.Name = "事件3"; + this.事件3.Size = new System.Drawing.Size(98, 33); + this.事件3.TabIndex = 6; + this.事件3.Text = "事件3"; + // + // 事件4结果 + // + this.事件4结果.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件4结果.AutoSize = true; + this.事件4结果.Font = new System.Drawing.Font("宋体", 26.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件4结果.Location = new System.Drawing.Point(228, 234); + this.事件4结果.Name = "事件4结果"; + this.事件4结果.Size = new System.Drawing.Size(91, 62); + this.事件4结果.TabIndex = 5; + this.事件4结果.Text = "OK"; + // + // 事件3结果 + // + this.事件3结果.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件3结果.AutoSize = true; + this.事件3结果.Font = new System.Drawing.Font("宋体", 26.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件3结果.Location = new System.Drawing.Point(46, 234); + this.事件3结果.Name = "事件3结果"; + this.事件3结果.Size = new System.Drawing.Size(91, 62); + this.事件3结果.TabIndex = 4; + this.事件3结果.Text = "OK"; + // + // 事件2 + // + this.事件2.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件2.AutoSize = true; + this.事件2.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件2.Location = new System.Drawing.Point(224, 126); + this.事件2.Name = "事件2"; + this.事件2.Size = new System.Drawing.Size(98, 33); + this.事件2.TabIndex = 3; + this.事件2.Text = "事件2"; + // + // 事件1 + // + this.事件1.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件1.AutoSize = true; + this.事件1.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件1.Location = new System.Drawing.Point(42, 126); + this.事件1.Name = "事件1"; + this.事件1.Size = new System.Drawing.Size(98, 33); + this.事件1.TabIndex = 2; + this.事件1.Text = "事件1"; + // + // 事件2结果 + // + this.事件2结果.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件2结果.AutoSize = true; + this.事件2结果.Font = new System.Drawing.Font("宋体", 26.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件2结果.Location = new System.Drawing.Point(228, 30); + this.事件2结果.Name = "事件2结果"; + this.事件2结果.Size = new System.Drawing.Size(91, 62); + this.事件2结果.TabIndex = 1; + this.事件2结果.Text = "OK"; + // + // 事件1结果 + // + this.事件1结果.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件1结果.AutoSize = true; + this.事件1结果.Font = new System.Drawing.Font("宋体", 26.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件1结果.Location = new System.Drawing.Point(46, 30); + this.事件1结果.Name = "事件1结果"; + this.事件1结果.Size = new System.Drawing.Size(91, 62); + this.事件1结果.TabIndex = 0; + this.事件1结果.Text = "OK"; + // + // timer1 + // + this.timer1.Enabled = true; + this.timer1.Interval = 1000; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // LOT号扫描 + // + this.LOT号扫描.Anchor = System.Windows.Forms.AnchorStyles.None; + this.LOT号扫描.AutoSize = true; + this.LOT号扫描.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.LOT号扫描.Location = new System.Drawing.Point(40, 15); + this.LOT号扫描.Name = "LOT号扫描"; + this.LOT号扫描.Size = new System.Drawing.Size(165, 84); + this.LOT号扫描.TabIndex = 3; + this.LOT号扫描.Text = "LOT号扫描:"; + // + // 事件1时间 + // + this.事件1时间.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件1时间.AutoSize = true; + this.事件1时间.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件1时间.Location = new System.Drawing.Point(9, 167); + this.事件1时间.Name = "事件1时间"; + this.事件1时间.Size = new System.Drawing.Size(164, 33); + this.事件1时间.TabIndex = 8; + this.事件1时间.Text = "事件1时间"; + // + // 事件2时间 + // + this.事件2时间.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件2时间.AutoSize = true; + this.事件2时间.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件2时间.Location = new System.Drawing.Point(191, 167); + this.事件2时间.Name = "事件2时间"; + this.事件2时间.Size = new System.Drawing.Size(164, 33); + this.事件2时间.TabIndex = 9; + this.事件2时间.Text = "事件2时间"; + // + // 事件3时间 + // + this.事件3时间.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件3时间.AutoSize = true; + this.事件3时间.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件3时间.Location = new System.Drawing.Point(9, 372); + this.事件3时间.Name = "事件3时间"; + this.事件3时间.Size = new System.Drawing.Size(164, 33); + this.事件3时间.TabIndex = 10; + this.事件3时间.Text = "事件3时间"; + // + // 事件4时间 + // + this.事件4时间.Anchor = System.Windows.Forms.AnchorStyles.None; + this.事件4时间.AutoSize = true; + this.事件4时间.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.事件4时间.Location = new System.Drawing.Point(191, 372); + this.事件4时间.Name = "事件4时间"; + this.事件4时间.Size = new System.Drawing.Size(164, 33); + this.事件4时间.TabIndex = 11; + this.事件4时间.Text = "事件4时间"; + // + // 机台状态 + // + this.机台状态.AutoSize = true; + this.机台状态.Dock = System.Windows.Forms.DockStyle.Fill; + this.机台状态.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.机台状态.Location = new System.Drawing.Point(852, 29); + this.机台状态.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); + this.机台状态.Name = "机台状态"; + this.机台状态.Size = new System.Drawing.Size(271, 28); + this.机台状态.TabIndex = 17; + this.机台状态.Text = "机台状态:None"; + this.机台状态.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(2884, 1764); + this.ClientSize = new System.Drawing.Size(1613, 935); this.Controls.Add(this.menuStrip1); this.Controls.Add(this.tableLayoutPanel1); this.MainMenuStrip = this.menuStrip1; - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Form1"; @@ -489,8 +919,18 @@ this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); this.groupBox3.ResumeLayout(false); - this.操作页面.ResumeLayout(false); - this.操作页面.PerformLayout(); + this.tableLayoutPanel8.ResumeLayout(false); + this.tableLayoutPanel8.PerformLayout(); + this.tableLayoutPanel4.ResumeLayout(false); + this.gropb.ResumeLayout(false); + this.tableLayoutPanel6.ResumeLayout(false); + this.tableLayoutPanel6.PerformLayout(); + this.原料包装LOT号.ResumeLayout(false); + this.tableLayoutPanel5.ResumeLayout(false); + this.tableLayoutPanel5.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.tableLayoutPanel7.ResumeLayout(false); + this.tableLayoutPanel7.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -513,24 +953,55 @@ private System.Windows.Forms.ToolStripMenuItem 用户管理ToolStripMenuItem1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.GroupBox 操作页面; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.ToolStripMenuItem 扭力曲线配置ToolStripMenuItem; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label 操作人员ID; + private System.Windows.Forms.Label 机台编号; + private System.Windows.Forms.Label 段别; + private System.Windows.Forms.Label 线别; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label8; private System.Windows.Forms.ToolStripMenuItem 产线管理ToolStripMenuItem; private System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; private System.Windows.Forms.Button 开始处理; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label MES链接状态; + private System.Windows.Forms.Label 当前时间; + private System.Windows.Forms.Label PLC通讯时间; + private System.Windows.Forms.Label MES通讯时间; + private System.Windows.Forms.Label PLC链接状态; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel8; + private System.Windows.Forms.Label 底部注释1; + private System.Windows.Forms.Label 底部注释2; + private System.Windows.Forms.Label 底部注释3; + private System.Windows.Forms.Label 底部注释4; + private System.Windows.Forms.Label 底部注释5; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; + private System.Windows.Forms.GroupBox gropb; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6; + private System.Windows.Forms.Label Tray盘; + private System.Windows.Forms.Label Tray盘二维码; + private System.Windows.Forms.GroupBox 原料包装LOT号; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; + private System.Windows.Forms.Label LOT号显示; + private System.Windows.Forms.Label LOT号; + private System.Windows.Forms.Label 请扫描LOT号; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7; + private System.Windows.Forms.Label 事件4; + private System.Windows.Forms.Label 事件3; + private System.Windows.Forms.Label 事件4结果; + private System.Windows.Forms.Label 事件3结果; + private System.Windows.Forms.Label 事件2; + private System.Windows.Forms.Label 事件1; + private System.Windows.Forms.Label 事件2结果; + private System.Windows.Forms.Label 事件1结果; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.Label LOT号扫描; + private System.Windows.Forms.Label 事件4时间; + private System.Windows.Forms.Label 事件3时间; + private System.Windows.Forms.Label 事件2时间; + private System.Windows.Forms.Label 事件1时间; + private System.Windows.Forms.Label 机台状态; } } diff --git a/WindowsFormsApp1/MainForm.cs b/WindowsFormsApp1/MainForm.cs index 46860e5..2c05e3b 100644 --- a/WindowsFormsApp1/MainForm.cs +++ b/WindowsFormsApp1/MainForm.cs @@ -35,19 +35,16 @@ namespace WindowsFormsApp1 private void Form1_Load(object sender, EventArgs e) { - label1.Visible = false; - label2.Visible = false; - label3.Visible = false; - label4.Visible = false; - label5.Visible = false; - label6.Visible = false; - label7.Visible = false; - label8.Visible = false; - LogExecute.logNet.BeforeSaveToFile += LogNet_BeforeSaveToFile; LogExecute.PlclogNet.BeforeSaveToFile += LogNet_BeforeSaveToFile; LogExecute.ApilogNet.BeforeSaveToFile += LogNet_BeforeSaveToFile; + Formrecover(); + + 线别.Text = "线别:" + Init.t_Line.linename; + 段别.Text = "段别:" + Init.t_Line.linemode; + 机台编号.Text = "机台编号:" + Init.t_Line.linecode; + 操作人员ID.Text = "操作人员ID:" + Init.t_User.username; } public void build(t_plc Plc, CancellationToken token) { @@ -71,8 +68,9 @@ namespace WindowsFormsApp1 var openresult = siemensHelp.OpenConn(); if (!openresult.Success) { - label8.Text = $"PLC:{Plc.id}:{Plc.plcip}建立S7连接失败"; - //LogExecute.logNet.WriteError($"{Plc.plcip}建立S7连接失败"); + PLC链接状态.Text = "PLC链接状态:NG"; + PLC链接状态.BackColor = Color.Red; + LogExecute.logNet.WriteError($"{Plc.plcip}建立S7连接失败"); continue; } @@ -82,7 +80,8 @@ namespace WindowsFormsApp1 var resdresult = siemensHelp.ReadAddress(plcaddress, PlcData); if (!resdresult.Success) { - label8.Text = $"PLC:{Plc.id}:{Plc.plcip}读取全部地址处理错误"; + PLC链接状态.Text = "PLC链接状态:NG"; + PLC链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"{Plc.plcip}读取全部地址处理错误:处理停止"); continue; } @@ -92,16 +91,18 @@ namespace WindowsFormsApp1 var haertresult = siemensHelp.WriteAddress(plcaddress, PlcData); if (!haertresult.Success) { - label8.Text = $"PLC:{Plc.id}:{Plc.plcip}写入心跳错误"; + PLC链接状态.Text = "PLC链接状态:NG"; + PLC链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"{Plc.plcip}写入心跳错误:处理停止"); continue; } - Plc.dateTime = DateTime.Now; + DateTime Plc_Time = DateTime.Now; + PLC链接状态.Text = "PLC链接状态:OK"; + PLC链接状态.BackColor = SystemColors.Control; + PLC通讯时间.Text = "PLC通讯时间:" + Plc_Time.ToString("MM-dd HH:mm:ss"); - label8.Text = Plc.dateTime.ToString(); - if (PlcData.Read_Trigger == 0 && PlcData.Write_Status == 0) { continue; @@ -116,49 +117,110 @@ namespace WindowsFormsApp1 var writeresult = siemensHelp.WriteAddress(plcaddress, PlcData); if (!writeresult.Success) { - label8.Text = $"PLC:{Plc.id}:{Plc.plcip}写入地址处理错误"; + PLC链接状态.Text = "PLC链接状态:NG"; + PLC链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"{Plc.plcip}写入地址处理错误:处理停止"); } continue; } + ApiClient apiClient = new ApiClient(); + otherdata otherdata = new otherdata(); + otherdata.JS_SN = "12345"; + + + //状态+报警 + if (Init.Plcstatus != PlcData.Read_Status || (Plc_Time - Init.Plcstatus_LastTime).TotalSeconds > 15) + { + //反馈状态 + var statusresult = apiClient.CallFunctionByName("Status", PlcData, otherdata); + if (statusresult.Success) + { + MES链接状态.Text = "MES链接状态:OK"; + MES链接状态.BackColor = SystemColors.Control; + MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); + MES_MsgfORM("Status", statusresult.Mesresult, statusresult.Requesttime); + } + else + { + MES链接状态.Text = "MES链接状态:NG"; + MES链接状态.BackColor = Color.Red; + LogExecute.logNet.WriteError($"MES通讯异常!"); + } + } + if (Init.Plcstatus == (short)plcstatus.运行 && PlcData.Read_Status == (short)plcstatus.停机) + { + 机台状态.BackColor = Color.Red; + //反馈报警 + var statusresult = apiClient.CallFunctionByName("Alarm", PlcData, otherdata); + if (statusresult.Success) + { + MES链接状态.Text = "MES链接状态:OK"; + MES链接状态.BackColor = SystemColors.Control; + MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); + MES_MsgfORM("Alarm", statusresult.Mesresult, statusresult.Requesttime); + } + else + { + MES链接状态.Text = "MES链接状态:NG"; + MES链接状态.BackColor = Color.Red; + LogExecute.logNet.WriteError($"MES通讯异常!"); + } + continue; + } + else + { + 机台状态.BackColor = SystemColors.Control; + } + + Init.Plcstatus = PlcData.Read_Status; + Init.Plcstatus_LastTime = DateTime.Now; + 机台状态.Text = Enum.GetName(typeof(plcstatus), Init.Plcstatus); + + + var nowflow = Init.t_Flows.FirstOrDefault(a => a.hopestatus == PlcData.Read_Trigger); if (nowflow == null) { - label8.Text = $"PLC:{Plc.id}:未找到当前触发字{PlcData.Read_Trigger},对应的流程"; LogExecute.logNet.WriteError($"未找到当前触发字{PlcData.Read_Trigger},对应的流程!"); continue; } var nowinterface = Init.t_Interfaces.FirstOrDefault(a => a.id == nowflow.hopeinterfaceid); if (nowinterface == null) { - label8.Text = $"PLC:{Plc.id}:未找到当前期望接口ID {nowflow.hopeinterfaceid},对应的接口"; LogExecute.logNet.WriteError($"未找到当前期望接口ID {nowflow.hopeinterfaceid},对应的接口!"); continue; } - otherdata otherdata = new otherdata(); - otherdata.JS_SN = "12345"; + - ApiClient apiClient = new ApiClient(); + var result = apiClient.CallFunctionByName(nowinterface.code,PlcData, otherdata); if (result.Success) { var writeresult = siemensHelp.WriteAddress(Init.t_Plcaddresses.FindAll(a => a.plcid == Plc.id),PlcData); if (!writeresult.Success) { - label8.Text = $"PLC:{Plc.id}:{Plc.plcip}写入地址处理错误"; + PLC链接状态.Text = "PLC链接状态:NG"; + PLC链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"{Plc.plcip}写入地址处理错误:处理停止"); continue; } + else + { + MES链接状态.Text = "MES链接状态:OK"; + MES链接状态.BackColor = SystemColors.Control; + MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); + } } else { - label8.Text = $"MES通讯异常!"; + MES链接状态.Text = "MES链接状态:NG"; + MES链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"MES通讯异常!"); } } @@ -253,20 +315,6 @@ namespace WindowsFormsApp1 开始处理.Text = "停止处理"; 开始处理.BackColor = Color.Red; - label1.Text = "MES站名:" + Init.t_Line.linename; - label2.Text = "MES站名:" + Init.t_Line.linecode; - label3.Text = "类型:" + Init.t_Line.linetype; - label4.Text = "模组:" + Init.t_Line.linemode; - - - label1.Visible = true; - label2.Visible = true; - label3.Visible = true; - label4.Visible = true; - label5.Visible = false; - label6.Visible = false; - label7.Visible = false; - label8.Visible = true; LogExecute.logNet.WriteInfo($"用户{Init.t_User.username},开始处理!"); } else @@ -290,10 +338,9 @@ namespace WindowsFormsApp1 Thread.Sleep(500); 开始处理.Text = "开始处理"; 开始处理.BackColor = Color.Green; - label1.Visible = false; - label2.Visible = false; - label3.Visible = false; - label4.Visible = false; + + Formrecover(); + LogExecute.logNet.WriteInfo($"用户{Init.t_User.username},停止处理!"); } } @@ -387,6 +434,130 @@ namespace WindowsFormsApp1 } } } + + private void timer1_Tick(object sender, EventArgs e) + { + 当前时间.Text = "当前时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); + } #endregion + + public void Formrecover() + { + MES链接状态.Text = "MES链接状态:None"; + MES链接状态.BackColor = SystemColors.Control; + + MES通讯时间.Text = "MES通讯时间:None"; + MES通讯时间.BackColor = SystemColors.Control; + + PLC链接状态.Text = "PLC链接状态:None"; + PLC链接状态.BackColor = SystemColors.Control; + + PLC通讯时间.Text = "PLC通讯时间:None"; + PLC通讯时间.BackColor = SystemColors.Control; + + 机台状态.Text = "机台状态:None"; + 机台状态.BackColor = SystemColors.Control; + + + 请扫描LOT号.Enabled = false; + LOT号.Visible = false; + Tray盘二维码.Visible = false; + + 事件1.Visible = false; + 事件1结果.Visible = false; + 事件1时间.Visible = false; + + 事件2.Visible = false; + 事件2结果.Visible = false; + 事件2时间.Visible = false; + + 事件3.Visible = false; + 事件3结果.Visible = false; + 事件3时间.Visible = false; + + 事件4.Visible = false; + 事件4结果.Visible = false; + 事件4时间.Visible = false; + + 底部注释1.Visible = false; + 底部注释2.Visible = false; + 底部注释3.Visible = false; + 底部注释4.Visible = false; + 底部注释5.Visible = false; + + } + + public void MES_MsgfORM(string name,mesresult result,DateTime dateTime) + { + if (事件1.Text.Contains("事件")) + { + 事件1.Visible = true; + 事件1结果.Visible = true; + 事件1时间.Visible = true; + 事件1.Text = name; + 事件1时间.Text = dateTime.ToString("MM-dd HH:mm:ss"); + 事件1结果.Text = result.ToString(); + } + else if (事件2.Text.Contains("事件")) + { + 事件2.Visible = true; + 事件2结果.Visible = true; + 事件2时间.Visible = true; + 事件2.Text = name; + 事件2时间.Text = dateTime.ToString("MM-dd HH:mm:ss"); + 事件2结果.Text = result.ToString(); + } + else if (事件3.Text.Contains("事件")) + { + 事件3.Visible = true; + 事件3结果.Visible = true; + 事件3时间.Visible = true; + 事件3.Text = name; + 事件3时间.Text = dateTime.ToString("MM-dd HH:mm:ss"); + 事件3结果.Text = result.ToString(); + } + else if (事件4.Text.Contains("事件")) + { + 事件4.Visible = true; + 事件4结果.Visible = true; + 事件4时间.Visible = true; + 事件4.Text = name; + 事件4时间.Text = dateTime.ToString("MM-dd HH:mm:ss"); + 事件4结果.Text = result.ToString(); + } + else + { + 事件1.Visible = true; + 事件1结果.Visible = true; + 事件1时间.Visible = true; + 事件1.Text = name; + 事件1时间.Text = dateTime.ToString("MM-dd HH:mm:ss"); + 事件1结果.Text = result.ToString(); + + 事件2.Visible = false; + 事件2结果.Visible = false; + 事件2时间.Visible = false; + 事件2.Text = "事件2"; + 事件2时间.Text = "事件2时间"; + 事件2结果.Text = "OK"; + + 事件3.Visible = false; + 事件3结果.Visible = false; + 事件3时间.Visible = false; + 事件3.Text = "事件3"; + 事件3时间.Text = "事件3时间"; + 事件3结果.Text = "OK"; + + 事件4.Visible = false; + 事件4结果.Visible = false; + 事件4时间.Visible = false; + 事件4.Text = "事件4"; + 事件4时间.Text = "事件4时间"; + 事件4结果.Text = "OK"; + + } + + + } } } diff --git a/WindowsFormsApp1/MainForm.resx b/WindowsFormsApp1/MainForm.resx index 7670a02..f92548f 100644 --- a/WindowsFormsApp1/MainForm.resx +++ b/WindowsFormsApp1/MainForm.resx @@ -120,6 +120,9 @@ 17, 17 + + 205, 17 + 79 diff --git a/WindowsFormsApp1/Program.cs b/WindowsFormsApp1/Program.cs index a328c0d..dd8be8a 100644 --- a/WindowsFormsApp1/Program.cs +++ b/WindowsFormsApp1/Program.cs @@ -50,5 +50,9 @@ namespace WindowsFormsApp1 public static int errinterface1 = 0; public static int errinterface2 = 0; + + public static short Plcstatus = 0; + public static DateTime Plcstatus_LastTime = DateTime.Now; + } } diff --git a/WindowsFormsApp1/db/MES_PLC.db b/WindowsFormsApp1/db/MES_PLC.db index 8ac556cdd97962eeabe25ceb9e8cfd2d1cc381c0..fbf34b1662205a6e887b910577189685c93afd70 100644 GIT binary patch delta 566 zcmZoTz|nAkV}i8cG6n_)B_QSmVhJD)nW$qdzl=f8zm}KHh=G$uor!-Pj~#nGt0l`i z7IkiJwqsmb8|${PvTztNOqn=wLPDdNBD=VyC1VqNNn%n?YJ7HTWm#fQX=;3aPD;Fy zfsv_!k)b7aQ5NSQSH}=ng%C$4A6Eq>?20D)vDh#J4V|3Ieu2?q<3tlCvqm{3c5zu* z#wLESl`tD&G%KpHFkz5E`aq77LWpZbhz>88f`Ss*rN{zBskwvnK!Sg=iGF=J{~ZPvNnvJ7PVBzm5MUPN zFD*_jG6RM&4-kU^j|j6YKg@lG9GuLej5(QkshYe%Sw{Z14E%3_7Ch#c6=Y;#P! zNh~Q%Ee^@dO*J%yC^^Kye+Z~#2fv*SBP&ozB8r-4b9O!L-|)O^+p~tor~SPzmvuaw zzU}4oE${bqJnfzOWN+{LJ+q!KpY(oDC(w-l@|y(=I0P8QCv!9yv$6qQz&_cbL7R~c OC^tpEX~D7uj12&Ov#Zbm delta 2463 zcma)--EZ4e6u|AoY3w-3?N`>OYe?2@WVD0W`Pf?2PD^PeG)-N^`oIHHS4aktqJola zNVJ>Nc8yoq)CG6Y34}6jYqtjiBU>wV67)|%NK8Uvh=)2!5f3~d;DHBD;y8G59ZlAK zx%&OiJ@?*ou2WlNYKy$Kw?nIlhV`vD!()3+2%g zT0lRbX>=0?eEAlp6A69~_oBnBAJS*xxaKz>A7f3fDRm#t^4td+1lw%oOxw~Sa?&A*y+<{9$|b0=M( z^Ym3ZOf$6J^w@OIG-Ent>ZW$6b!wgpQ4aDqa)Z1CLBDyX&-ZMYM8PgF42|XYxy~C2 z^aMMQ$+$R{-*3XG4!aH41u=PFU>>fU<8_g_G7fqjvhiaqa3z${T9sC@9Vb%Ij){gRSz#N1_17C03TPvetCa9^6eGaj_X+E z4im{xJUaDuFWxL2%;_=D_U4u1qX)(8Eb~0yCa>UBO46}diyy8RQnTWhpECRTRvEM- zA=ur4M0#@+xSCm_`xt~8F~WyUD$Gz^PsdC z0xPMbdLb&QZEULzmg(b-6$8r2t+=H`G9Kliny^iAA-}VnD=ywEd~(AFc#{@hrmrdK za$y^)G+rMZ=(9?gWe)R%4EI$s;iMWXrvmg~VR5DS*~jxH7uur3ACF)}ir8!O1q(r@dUaX;< zVpo+6NF@tzUHXE|N(UyLR|Rb<<-RRHbG62Hr)OmNV0~Po@bIJ3SJ#V=gu)k}GY8Vs z5*fsCXFaN`rT|ZcEB!$=B5AM3MCsMY;~}F9?-a - /// MES返回的SN + /// PLC反馈的机台状态 /// - public string MES_SN { get; set; } + public plcstatus Plc_Status { get; set; } + + /// + /// PLC反馈的机台报警 + /// + public string Plc_ErrorMsg { get; set; } /// /// 文件上传地址 diff --git a/WindowsFormsApp1/packages.config b/WindowsFormsApp1/packages.config index 0008a19..175d40e 100644 --- a/WindowsFormsApp1/packages.config +++ b/WindowsFormsApp1/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/WindowsFormsApp1/server/ApiClient.cs b/WindowsFormsApp1/server/ApiClient.cs index a943ec7..c900c8e 100644 --- a/WindowsFormsApp1/server/ApiClient.cs +++ b/WindowsFormsApp1/server/ApiClient.cs @@ -15,68 +15,68 @@ namespace WindowsFormsApp1.server { public ApiFormResult SN_CheckIN(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult Carrier_Check(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult SN_FeedingCheck(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult Link_Comp(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult SN_Release(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult Glue_CheckOut(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult Get_Para(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult DispatchPara(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult Data_Collection(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult Status(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult Alarm(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult OEEDataCollection(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData); + return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData,DateTime.Now); } public ApiFormResult SN_FileUpload(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData); + return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData,DateTime.Now); } public ApiFormResult Test(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData); + return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData,DateTime.Now); } public ApiFormResult SN_Checkout(plcdata PlcData, otherdata OtherData) { - return ApiFormResult.Sucess(mesresult.pass, false, "", PlcData); + return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData,DateTime.Now); } public ApiFormResult Initialization(plcdata PlcData, otherdata OtherData) { PlcData.Write_Status = 3; - return ApiFormResult.Sucess(mesresult.pass,false,"", PlcData); + return ApiFormResult.Sucess(mesresult.PASS,false,"", PlcData,DateTime.Now); } public ApiFormResult CallFunctionByName(string functionName, plcdata plcdata,otherdata otherdata) @@ -95,7 +95,7 @@ namespace WindowsFormsApp1.server else { LogExecute.logNet.WriteError($"未找到对应的函数{functionName}"); - return ApiFormResult.Error(mesresult.none, false, $"未找到对应的函数{functionName}", null); + return ApiFormResult.Error(mesresult.NONE, false, $"未找到对应的函数{functionName}", null,DateTime.Now); } } } diff --git a/WindowsFormsApp1/server/ApiFormResult.cs b/WindowsFormsApp1/server/ApiFormResult.cs index 1fc996f..5f54f84 100644 --- a/WindowsFormsApp1/server/ApiFormResult.cs +++ b/WindowsFormsApp1/server/ApiFormResult.cs @@ -11,13 +11,14 @@ namespace WindowsFormsApp1.server { public class ApiFormResult { - private ApiFormResult(bool success, mesresult mesresult, bool isShow, string msg, plcdata data) + private ApiFormResult(bool success, mesresult mesresult, bool isShow, string msg, plcdata data,DateTime requesttime) { Success = success; Msg = msg; Data = data; Mesresult = mesresult; IsShow = isShow; + Requesttime = requesttime; } public bool Success { get; set; } @@ -28,15 +29,17 @@ namespace WindowsFormsApp1.server public bool IsShow { get; set; } - public static ApiFormResult Sucess(mesresult mesresult, bool isShow, string msg, plcdata data) + public DateTime Requesttime { get; set; } + + public static ApiFormResult Sucess(mesresult mesresult, bool isShow, string msg, plcdata data, DateTime requesttime) { - return new ApiFormResult(true, mesresult, isShow, msg, data); + return new ApiFormResult(true, mesresult, isShow, msg, data, requesttime); } - public static ApiFormResult Error(mesresult mesresult, bool isShow, string msg, plcdata data) + public static ApiFormResult Error(mesresult mesresult, bool isShow, string msg, plcdata data, DateTime requesttime) { - return new ApiFormResult(false, mesresult, isShow, msg, data); + return new ApiFormResult(false, mesresult, isShow, msg, data,requesttime); } }