From 2b56f8e7d3489551335f99d7e22404d01f8465a7 Mon Sep 17 00:00:00 2001 From: zhougf Date: Sat, 29 Mar 2025 11:46:48 +0800 Subject: [PATCH] =?UTF-8?q?csv=20=E9=A1=B5=E9=9D=A2=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WindowsFormsApp1/MES_PLC_Control.csproj | 1 + WindowsFormsApp1/MainForm.Designer.cs | 473 ++++--------- WindowsFormsApp1/MainForm.cs | 658 +++++++++++------- WindowsFormsApp1/MaterialScanForm.cs | 12 + WindowsFormsApp1/Program.cs | 2 +- WindowsFormsApp1/db/MES_PLCold.db | Bin 0 -> 176128 bytes WindowsFormsApp1/form/FLOW_Manage.Designer.cs | 42 +- WindowsFormsApp1/form/FLOW_Manage.cs | 2 +- WindowsFormsApp1/form/LoginForm.cs | 9 + WindowsFormsApp1/form/ScanForm.cs | 16 + WindowsFormsApp1/form/ScanForm_SSQ.cs | 2 +- .../form/editForm/FLow_Insert.Designer.cs | 132 ++-- WindowsFormsApp1/form/editForm/FLow_Insert.cs | 5 +- WindowsFormsApp1/mod/database/t_lineplc.cs | 18 + WindowsFormsApp1/mod/server/otherdata.cs | 10 + WindowsFormsApp1/server/ApiClient.cs | 249 ++++--- WindowsFormsApp1/server/CsvHelper.cs | 86 ++- 17 files changed, 923 insertions(+), 794 deletions(-) create mode 100644 WindowsFormsApp1/db/MES_PLCold.db create mode 100644 WindowsFormsApp1/mod/database/t_lineplc.cs diff --git a/WindowsFormsApp1/MES_PLC_Control.csproj b/WindowsFormsApp1/MES_PLC_Control.csproj index 4bc796a..560ad8d 100644 --- a/WindowsFormsApp1/MES_PLC_Control.csproj +++ b/WindowsFormsApp1/MES_PLC_Control.csproj @@ -245,6 +245,7 @@ MaterialScanForm.cs + diff --git a/WindowsFormsApp1/MainForm.Designer.cs b/WindowsFormsApp1/MainForm.Designer.cs index 1f1c04e..39ca28b 100644 --- a/WindowsFormsApp1/MainForm.Designer.cs +++ b/WindowsFormsApp1/MainForm.Designer.cs @@ -19,7 +19,11 @@ namespace WindowsFormsApp1 { components.Dispose(); } - base.Dispose(disposing); + try + { + base.Dispose(disposing); + } + catch { } } #region Windows 窗体设计器生成的代码 @@ -31,6 +35,8 @@ namespace WindowsFormsApp1 private void InitializeComponent() { this.components = new System.ComponentModel.Container(); + this.plcStatusGroupBox = new System.Windows.Forms.GroupBox(); + this.plcStatusTableLayout = new System.Windows.Forms.TableLayoutPanel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.用户管理ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.修改密码ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -55,26 +61,11 @@ namespace WindowsFormsApp1 this.图片展示ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel(); - this.PLC1状态 = new System.Windows.Forms.Label(); - this.PLC1名称 = new System.Windows.Forms.Label(); - this.PLC1机台状态 = new System.Windows.Forms.Label(); - this.PLC1时间 = 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.事件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.事件2结果 = new System.Windows.Forms.Label(); this.事件1结果 = new System.Windows.Forms.Label(); - this.事件3结果 = new System.Windows.Forms.Label(); - this.事件3 = new System.Windows.Forms.Label(); - this.事件4 = new System.Windows.Forms.Label(); - this.事件4结果 = new System.Windows.Forms.Label(); this.gropb = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); this.MES提示信息 = new System.Windows.Forms.Label(); @@ -82,6 +73,7 @@ namespace WindowsFormsApp1 this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); this.LOT号显示 = new System.Windows.Forms.Label(); this.LOT号 = new System.Windows.Forms.Label(); + this.胶水上下线 = new System.Windows.Forms.Button(); this.剩余寿命 = new System.Windows.Forms.Label(); this.MES提示 = new System.Windows.Forms.Label(); this.Tray盘二维码 = new System.Windows.Forms.Label(); @@ -90,8 +82,6 @@ namespace WindowsFormsApp1 this.开始处理 = new System.Windows.Forms.Button(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.linemode = new System.Windows.Forms.Label(); - this.MES通讯时间 = 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.linetype = new System.Windows.Forms.Label(); @@ -106,12 +96,10 @@ namespace WindowsFormsApp1 this.底部注释4 = new System.Windows.Forms.Label(); this.底部注释5 = new System.Windows.Forms.Label(); this.timer1 = new System.Windows.Forms.Timer(this.components); - this.胶水上下线 = new System.Windows.Forms.Button(); + this.plcStatusGroupBox.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel4.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.tableLayoutPanel9.SuspendLayout(); this.groupBox2.SuspendLayout(); this.tableLayoutPanel7.SuspendLayout(); this.gropb.SuspendLayout(); @@ -125,6 +113,30 @@ namespace WindowsFormsApp1 this.tableLayoutPanel8.SuspendLayout(); this.SuspendLayout(); // + // plcStatusGroupBox + // + this.plcStatusGroupBox.Controls.Add(this.plcStatusTableLayout); + this.plcStatusGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.plcStatusGroupBox.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold); + this.plcStatusGroupBox.Location = new System.Drawing.Point(3, 927); + this.plcStatusGroupBox.Name = "plcStatusGroupBox"; + this.plcStatusGroupBox.Size = new System.Drawing.Size(1754, 94); + this.plcStatusGroupBox.TabIndex = 9; + this.plcStatusGroupBox.TabStop = false; + this.plcStatusGroupBox.Text = "PLC连接状态"; + // + // plcStatusTableLayout + // + this.plcStatusTableLayout.AutoSize = true; + this.plcStatusTableLayout.ColumnCount = 2; + this.plcStatusTableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.plcStatusTableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.plcStatusTableLayout.Dock = System.Windows.Forms.DockStyle.Fill; + this.plcStatusTableLayout.Location = new System.Drawing.Point(3, 40); + this.plcStatusTableLayout.Name = "plcStatusTableLayout"; + this.plcStatusTableLayout.Size = new System.Drawing.Size(1748, 51); + this.plcStatusTableLayout.TabIndex = 0; + // // menuStrip1 // this.menuStrip1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); @@ -160,21 +172,21 @@ namespace WindowsFormsApp1 // 修改密码ToolStripMenuItem // this.修改密码ToolStripMenuItem.Name = "修改密码ToolStripMenuItem"; - this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(283, 50); + this.修改密码ToolStripMenuItem.Size = new System.Drawing.Size(359, 50); this.修改密码ToolStripMenuItem.Text = "修改密码"; this.修改密码ToolStripMenuItem.Click += new System.EventHandler(this.修改密码ToolStripMenuItem_Click); // // 切换用户ToolStripMenuItem // this.切换用户ToolStripMenuItem.Name = "切换用户ToolStripMenuItem"; - this.切换用户ToolStripMenuItem.Size = new System.Drawing.Size(283, 50); + this.切换用户ToolStripMenuItem.Size = new System.Drawing.Size(359, 50); this.切换用户ToolStripMenuItem.Text = "切换用户"; this.切换用户ToolStripMenuItem.Click += new System.EventHandler(this.切换用户ToolStripMenuItem_Click); // // 用户管理ToolStripMenuItem1 // this.用户管理ToolStripMenuItem1.Name = "用户管理ToolStripMenuItem1"; - this.用户管理ToolStripMenuItem1.Size = new System.Drawing.Size(283, 50); + this.用户管理ToolStripMenuItem1.Size = new System.Drawing.Size(359, 50); this.用户管理ToolStripMenuItem1.Text = "用户管理"; this.用户管理ToolStripMenuItem1.Click += new System.EventHandler(this.用户管理ToolStripMenuItem1_Click); // @@ -295,7 +307,6 @@ namespace WindowsFormsApp1 this.材料扫码ToolStripMenuItem.Size = new System.Drawing.Size(166, 45); this.材料扫码ToolStripMenuItem.Text = "材料扫码"; this.材料扫码ToolStripMenuItem.Click += new System.EventHandler(this.材料扫码ToolStripMenuItem_Click); - // // 图片展示ToolStripMenuItem // @@ -303,7 +314,6 @@ namespace WindowsFormsApp1 this.图片展示ToolStripMenuItem.Size = new System.Drawing.Size(166, 45); this.图片展示ToolStripMenuItem.Text = "图片展示"; this.图片展示ToolStripMenuItem.Click += new System.EventHandler(this.图片展示ToolStripMenuItem_Click); - // // tableLayoutPanel1 // @@ -312,16 +322,18 @@ namespace WindowsFormsApp1 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.tableLayoutPanel8, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.plcStatusGroupBox, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel8, 0, 4); 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, 6, 5, 6); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 4; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 23.69995F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 49.35099F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 22.89995F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.049108F)); + this.tableLayoutPanel1.RowCount = 5; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.42934F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 54.05363F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25.08208F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.434946F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(1760, 1068); this.tableLayoutPanel1.TabIndex = 6; // @@ -334,99 +346,18 @@ namespace WindowsFormsApp1 this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 70F)); this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); - this.tableLayoutPanel4.Controls.Add(this.groupBox4, 1, 0); this.tableLayoutPanel4.Controls.Add(this.groupBox2, 2, 0); this.tableLayoutPanel4.Controls.Add(this.gropb, 0, 1); this.tableLayoutPanel4.Controls.Add(this.原料包装LOT号, 0, 0); - this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 257); + this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 163); this.tableLayoutPanel4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 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(1754, 519); + this.tableLayoutPanel4.Size = new System.Drawing.Size(1754, 515); this.tableLayoutPanel4.TabIndex = 8; // - // groupBox4 - // - this.groupBox4.Controls.Add(this.tableLayoutPanel9); - this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.groupBox4.Location = new System.Drawing.Point(1230, 4); - this.groupBox4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.groupBox4.Size = new System.Drawing.Size(169, 303); - this.groupBox4.TabIndex = 4; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "PLC链接"; - // - // tableLayoutPanel9 - // - this.tableLayoutPanel9.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single; - this.tableLayoutPanel9.ColumnCount = 1; - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 22F)); - this.tableLayoutPanel9.Controls.Add(this.PLC1状态, 0, 0); - this.tableLayoutPanel9.Controls.Add(this.PLC1名称, 0, 1); - this.tableLayoutPanel9.Controls.Add(this.PLC1机台状态, 0, 2); - this.tableLayoutPanel9.Controls.Add(this.PLC1时间, 0, 3); - this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel9.Location = new System.Drawing.Point(3, 41); - this.tableLayoutPanel9.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.tableLayoutPanel9.Name = "tableLayoutPanel9"; - this.tableLayoutPanel9.RowCount = 4; - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 52F)); - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F)); - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F)); - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16F)); - this.tableLayoutPanel9.Size = new System.Drawing.Size(163, 258); - this.tableLayoutPanel9.TabIndex = 0; - // - // PLC1状态 - // - this.PLC1状态.Anchor = System.Windows.Forms.AnchorStyles.None; - this.PLC1状态.AutoSize = true; - this.PLC1状态.Font = new System.Drawing.Font("宋体", 26.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.PLC1状态.Location = new System.Drawing.Point(30, 31); - this.PLC1状态.Name = "PLC1状态"; - this.PLC1状态.Size = new System.Drawing.Size(102, 70); - this.PLC1状态.TabIndex = 0; - this.PLC1状态.Text = "OK"; - // - // PLC1名称 - // - this.PLC1名称.Anchor = System.Windows.Forms.AnchorStyles.None; - this.PLC1名称.AutoSize = true; - this.PLC1名称.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.PLC1名称.Location = new System.Drawing.Point(26, 136); - this.PLC1名称.Name = "PLC1名称"; - this.PLC1名称.Size = new System.Drawing.Size(111, 33); - this.PLC1名称.TabIndex = 12; - this.PLC1名称.Text = "label6"; - // - // PLC1机台状态 - // - this.PLC1机台状态.Anchor = System.Windows.Forms.AnchorStyles.None; - this.PLC1机台状态.AutoSize = true; - this.PLC1机台状态.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.PLC1机台状态.Location = new System.Drawing.Point(26, 177); - this.PLC1机台状态.Name = "PLC1机台状态"; - this.PLC1机台状态.Size = new System.Drawing.Size(111, 33); - this.PLC1机台状态.TabIndex = 2; - this.PLC1机台状态.Text = "label6"; - // - // PLC1时间 - // - this.PLC1时间.Anchor = System.Windows.Forms.AnchorStyles.None; - this.PLC1时间.AutoSize = true; - this.PLC1时间.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.PLC1时间.Location = new System.Drawing.Point(26, 219); - this.PLC1时间.Name = "PLC1时间"; - this.PLC1时间.Size = new System.Drawing.Size(111, 33); - this.PLC1时间.TabIndex = 8; - this.PLC1时间.Text = "label4"; - // // groupBox2 // this.groupBox2.Controls.Add(this.tableLayoutPanel7); @@ -437,7 +368,7 @@ namespace WindowsFormsApp1 this.groupBox2.Name = "groupBox2"; this.groupBox2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); this.tableLayoutPanel4.SetRowSpan(this.groupBox2, 2); - this.groupBox2.Size = new System.Drawing.Size(346, 511); + this.groupBox2.Size = new System.Drawing.Size(346, 507); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; this.groupBox2.Text = "MES事件结果"; @@ -445,167 +376,58 @@ namespace WindowsFormsApp1 // 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.ColumnCount = 1; + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 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, 41); this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); 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(340, 466); + this.tableLayoutPanel7.RowCount = 3; + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 60F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel7.Size = new System.Drawing.Size(340, 462); this.tableLayoutPanel7.TabIndex = 0; // - // 事件4时间 - // - this.事件4时间.Anchor = System.Windows.Forms.AnchorStyles.None; - this.事件4时间.AutoSize = true; - this.事件4时间.Font = new System.Drawing.Font("宋体", 10F); - this.事件4时间.Location = new System.Drawing.Point(187, 426); - this.事件4时间.Name = "事件4时间"; - this.事件4时间.Size = new System.Drawing.Size(134, 27); - this.事件4时间.TabIndex = 11; - this.事件4时间.Text = "事件4时间"; - // - // 事件3时间 - // - this.事件3时间.Anchor = System.Windows.Forms.AnchorStyles.None; - this.事件3时间.AutoSize = true; - this.事件3时间.Font = new System.Drawing.Font("宋体", 10F); - this.事件3时间.Location = new System.Drawing.Point(18, 426); - this.事件3时间.Name = "事件3时间"; - this.事件3时间.Size = new System.Drawing.Size(134, 27); - this.事件3时间.TabIndex = 10; - this.事件3时间.Text = "事件3时间"; - // - // 事件2时间 - // - this.事件2时间.Anchor = System.Windows.Forms.AnchorStyles.None; - this.事件2时间.AutoSize = true; - this.事件2时间.Font = new System.Drawing.Font("宋体", 10F); - this.事件2时间.Location = new System.Drawing.Point(187, 194); - this.事件2时间.Name = "事件2时间"; - this.事件2时间.Size = new System.Drawing.Size(134, 27); - this.事件2时间.TabIndex = 9; - this.事件2时间.Text = "事件2时间"; - // // 事件1时间 // - this.事件1时间.Anchor = System.Windows.Forms.AnchorStyles.None; this.事件1时间.AutoEllipsis = true; this.事件1时间.AutoSize = true; + this.事件1时间.Dock = System.Windows.Forms.DockStyle.Fill; this.事件1时间.Font = new System.Drawing.Font("宋体", 10F); - this.事件1时间.Location = new System.Drawing.Point(18, 194); + this.事件1时间.Location = new System.Drawing.Point(4, 368); this.事件1时间.Name = "事件1时间"; - this.事件1时间.Size = new System.Drawing.Size(134, 27); + this.事件1时间.Size = new System.Drawing.Size(332, 93); 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("宋体", 12F); - this.事件2.Location = new System.Drawing.Point(207, 145); - this.事件2.Name = "事件2"; - this.事件2.Size = new System.Drawing.Size(95, 33); - this.事件2.TabIndex = 3; - this.事件2.Text = "事件2"; + this.事件1时间.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // 事件1 // - this.事件1.Anchor = System.Windows.Forms.AnchorStyles.None; this.事件1.AutoSize = true; + this.事件1.Dock = System.Windows.Forms.DockStyle.Fill; this.事件1.Font = new System.Drawing.Font("宋体", 12F); - this.事件1.Location = new System.Drawing.Point(37, 145); + this.事件1.Location = new System.Drawing.Point(4, 276); this.事件1.Name = "事件1"; - this.事件1.Size = new System.Drawing.Size(95, 33); + this.事件1.Size = new System.Drawing.Size(332, 91); 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(203, 34); - this.事件2结果.Name = "事件2结果"; - this.事件2结果.Size = new System.Drawing.Size(102, 70); - this.事件2结果.TabIndex = 1; - this.事件2结果.Text = "OK"; + this.事件1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // 事件1结果 // - this.事件1结果.Anchor = System.Windows.Forms.AnchorStyles.None; this.事件1结果.AutoSize = true; + this.事件1结果.Dock = System.Windows.Forms.DockStyle.Fill; 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(34, 34); + this.事件1结果.Location = new System.Drawing.Point(4, 1); this.事件1结果.Name = "事件1结果"; - this.事件1结果.Size = new System.Drawing.Size(102, 70); + this.事件1结果.Size = new System.Drawing.Size(332, 274); this.事件1结果.TabIndex = 0; - this.事件1结果.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(34, 264); - this.事件3结果.Name = "事件3结果"; - this.事件3结果.Size = new System.Drawing.Size(102, 70); - this.事件3结果.TabIndex = 4; - this.事件3结果.Text = "OK"; - // - // 事件3 - // - this.事件3.Anchor = System.Windows.Forms.AnchorStyles.None; - this.事件3.AutoSize = true; - this.事件3.Font = new System.Drawing.Font("宋体", 12F); - this.事件3.Location = new System.Drawing.Point(37, 375); - this.事件3.Name = "事件3"; - this.事件3.Size = new System.Drawing.Size(95, 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("宋体", 12F); - this.事件4.Location = new System.Drawing.Point(207, 375); - this.事件4.Name = "事件4"; - this.事件4.Size = new System.Drawing.Size(95, 33); - this.事件4.TabIndex = 7; - this.事件4.Text = "事件4"; - // - // 事件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(203, 264); - this.事件4结果.Name = "事件4结果"; - this.事件4结果.Size = new System.Drawing.Size(102, 70); - this.事件4结果.TabIndex = 5; - this.事件4结果.Text = "OK"; + this.事件1结果.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // gropb // @@ -613,11 +435,11 @@ namespace WindowsFormsApp1 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, 315); + this.gropb.Location = new System.Drawing.Point(3, 313); this.gropb.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.gropb.Name = "gropb"; this.gropb.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.gropb.Size = new System.Drawing.Size(1396, 200); + this.gropb.Size = new System.Drawing.Size(1396, 198); this.gropb.TabIndex = 1; this.gropb.TabStop = false; this.gropb.Text = "MES提示:"; @@ -635,22 +457,23 @@ namespace WindowsFormsApp1 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(1390, 155); + this.tableLayoutPanel6.Size = new System.Drawing.Size(1390, 153); this.tableLayoutPanel6.TabIndex = 1; // // MES提示信息 // - this.MES提示信息.Anchor = System.Windows.Forms.AnchorStyles.None; - this.MES提示信息.AutoSize = true; + this.MES提示信息.Dock = System.Windows.Forms.DockStyle.Fill; this.MES提示信息.Font = new System.Drawing.Font("宋体", 21.85714F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.MES提示信息.Location = new System.Drawing.Point(83, 48); + this.MES提示信息.ForeColor = System.Drawing.SystemColors.ControlText; + this.MES提示信息.Location = new System.Drawing.Point(4, 1); this.MES提示信息.Name = "MES提示信息"; - this.MES提示信息.Size = new System.Drawing.Size(1224, 59); + this.MES提示信息.Size = new System.Drawing.Size(1382, 151); this.MES提示信息.TabIndex = 6; - this.MES提示信息.Text = "MES提示信息:11111333332222222222222222"; + this.MES提示信息.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // 原料包装LOT号 // + this.tableLayoutPanel4.SetColumnSpan(this.原料包装LOT号, 2); 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))); @@ -658,7 +481,7 @@ namespace WindowsFormsApp1 this.原料包装LOT号.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.原料包装LOT号.Name = "原料包装LOT号"; this.原料包装LOT号.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.原料包装LOT号.Size = new System.Drawing.Size(1221, 303); + this.原料包装LOT号.Size = new System.Drawing.Size(1396, 301); this.原料包装LOT号.TabIndex = 0; this.原料包装LOT号.TabStop = false; this.原料包装LOT号.Text = "产品信息:"; @@ -684,7 +507,7 @@ namespace WindowsFormsApp1 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(1215, 258); + this.tableLayoutPanel5.Size = new System.Drawing.Size(1390, 256); this.tableLayoutPanel5.TabIndex = 0; // // LOT号显示 @@ -692,7 +515,7 @@ namespace WindowsFormsApp1 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(74, 40); + this.LOT号显示.Location = new System.Drawing.Point(93, 40); this.LOT号显示.Name = "LOT号显示"; this.LOT号显示.Size = new System.Drawing.Size(116, 48); this.LOT号显示.TabIndex = 2; @@ -703,20 +526,30 @@ namespace WindowsFormsApp1 this.LOT号.Anchor = System.Windows.Forms.AnchorStyles.None; this.LOT号.AutoSize = true; this.LOT号.Font = new System.Drawing.Font("宋体", 21.85714F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.LOT号.Location = new System.Drawing.Point(473, 35); + this.LOT号.Location = new System.Drawing.Point(767, 34); this.LOT号.Name = "LOT号"; - this.LOT号.Size = new System.Drawing.Size(395, 59); + this.LOT号.Size = new System.Drawing.Size(0, 59); this.LOT号.TabIndex = 0; - this.LOT号.Text = "SN:23199191"; + // + // 胶水上下线 + // + this.胶水上下线.Dock = System.Windows.Forms.DockStyle.Fill; + this.胶水上下线.Location = new System.Drawing.Point(1236, 5); + this.胶水上下线.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.胶水上下线.Name = "胶水上下线"; + this.胶水上下线.Size = new System.Drawing.Size(150, 118); + this.胶水上下线.TabIndex = 3; + this.胶水上下线.Text = "胶水寿命"; + this.胶水上下线.UseVisualStyleBackColor = true; // // 剩余寿命 // this.剩余寿命.Anchor = System.Windows.Forms.AnchorStyles.None; this.剩余寿命.AutoSize = true; this.剩余寿命.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.剩余寿命.Location = new System.Drawing.Point(1090, 160); + this.剩余寿命.Location = new System.Drawing.Point(1239, 175); this.剩余寿命.Name = "剩余寿命"; - this.剩余寿命.Size = new System.Drawing.Size(111, 66); + this.剩余寿命.Size = new System.Drawing.Size(143, 33); this.剩余寿命.TabIndex = 5; this.剩余寿命.Text = "剩余寿命"; // @@ -725,7 +558,7 @@ namespace WindowsFormsApp1 this.MES提示.Anchor = System.Windows.Forms.AnchorStyles.None; this.MES提示.AutoSize = true; this.MES提示.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.MES提示.Location = new System.Drawing.Point(26, 169); + this.MES提示.Location = new System.Drawing.Point(45, 167); this.MES提示.Name = "MES提示"; this.MES提示.Size = new System.Drawing.Size(212, 48); this.MES提示.TabIndex = 4; @@ -736,11 +569,10 @@ namespace WindowsFormsApp1 this.Tray盘二维码.Anchor = System.Windows.Forms.AnchorStyles.None; this.Tray盘二维码.AutoSize = true; this.Tray盘二维码.Font = new System.Drawing.Font("宋体", 21.85714F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.Tray盘二维码.Location = new System.Drawing.Point(339, 163); + this.Tray盘二维码.Location = new System.Drawing.Point(767, 162); this.Tray盘二维码.Name = "Tray盘二维码"; - this.Tray盘二维码.Size = new System.Drawing.Size(664, 59); + this.Tray盘二维码.Size = new System.Drawing.Size(0, 59); this.Tray盘二维码.TabIndex = 2; - this.Tray盘二维码.Text = "托盘二维码:921391293"; // // groupBox1 // @@ -753,7 +585,7 @@ namespace WindowsFormsApp1 this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBox1.Size = new System.Drawing.Size(1752, 243); + this.groupBox1.Size = new System.Drawing.Size(1752, 149); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; this.groupBox1.Text = "处理界面"; @@ -777,7 +609,7 @@ namespace WindowsFormsApp1 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(1721, 183); + this.tableLayoutPanel3.Size = new System.Drawing.Size(1721, 89); this.tableLayoutPanel3.TabIndex = 4; // // 开始处理 @@ -785,10 +617,10 @@ namespace WindowsFormsApp1 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(21, 23); + this.开始处理.Location = new System.Drawing.Point(21, 13); this.开始处理.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.开始处理.Name = "开始处理"; - this.开始处理.Size = new System.Drawing.Size(129, 136); + this.开始处理.Size = new System.Drawing.Size(129, 61); this.开始处理.TabIndex = 1; this.开始处理.Text = "开始处理"; this.开始处理.UseVisualStyleBackColor = false; @@ -808,8 +640,6 @@ namespace WindowsFormsApp1 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); this.tableLayoutPanel2.Controls.Add(this.linemode, 3, 0); - this.tableLayoutPanel2.Controls.Add(this.MES通讯时间, 5, 1); - this.tableLayoutPanel2.Controls.Add(this.MES链接状态, 4, 1); this.tableLayoutPanel2.Controls.Add(this.当前时间, 5, 0); this.tableLayoutPanel2.Controls.Add(this.操作人员ID, 4, 0); this.tableLayoutPanel2.Controls.Add(this.linetype, 2, 0); @@ -818,12 +648,10 @@ namespace WindowsFormsApp1 this.tableLayoutPanel2.Location = new System.Drawing.Point(176, 6); this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 3; + this.tableLayoutPanel2.RowCount = 1; this.tableLayoutPanel3.SetRowSpan(this.tableLayoutPanel2, 3); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(1540, 171); + this.tableLayoutPanel2.Size = new System.Drawing.Size(1540, 77); this.tableLayoutPanel2.TabIndex = 3; // // linemode @@ -834,40 +662,11 @@ namespace WindowsFormsApp1 this.linemode.Location = new System.Drawing.Point(774, 1); this.linemode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.linemode.Name = "linemode"; - this.tableLayoutPanel2.SetRowSpan(this.linemode, 3); - this.linemode.Size = new System.Drawing.Size(245, 169); + this.linemode.Size = new System.Drawing.Size(245, 75); this.linemode.TabIndex = 16; this.linemode.Text = "MachineID"; this.linemode.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // MES通讯时间 - // - 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(1286, 57); - this.MES通讯时间.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.MES通讯时间.Name = "MES通讯时间"; - this.tableLayoutPanel2.SetRowSpan(this.MES通讯时间, 2); - this.MES通讯时间.Size = new System.Drawing.Size(248, 113); - this.MES通讯时间.TabIndex = 15; - this.MES通讯时间.Text = "MES通讯时间:None"; - this.MES通讯时间.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // MES链接状态 - // - 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(1030, 57); - this.MES链接状态.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); - this.MES链接状态.Name = "MES链接状态"; - this.tableLayoutPanel2.SetRowSpan(this.MES链接状态, 2); - this.MES链接状态.Size = new System.Drawing.Size(245, 113); - this.MES链接状态.TabIndex = 12; - this.MES链接状态.Text = "MES链接状态:None"; - this.MES链接状态.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // // 当前时间 // this.当前时间.AutoSize = true; @@ -876,7 +675,7 @@ namespace WindowsFormsApp1 this.当前时间.Location = new System.Drawing.Point(1286, 1); this.当前时间.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.当前时间.Name = "当前时间"; - this.当前时间.Size = new System.Drawing.Size(248, 55); + this.当前时间.Size = new System.Drawing.Size(248, 75); this.当前时间.TabIndex = 11; this.当前时间.Text = "当前时间:"; this.当前时间.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -885,11 +684,11 @@ namespace WindowsFormsApp1 // 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.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.操作人员ID.Location = new System.Drawing.Point(1030, 1); this.操作人员ID.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.操作人员ID.Name = "操作人员ID"; - this.操作人员ID.Size = new System.Drawing.Size(245, 55); + this.操作人员ID.Size = new System.Drawing.Size(245, 75); this.操作人员ID.TabIndex = 6; this.操作人员ID.Text = "操作人员ID:"; this.操作人员ID.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -902,8 +701,7 @@ namespace WindowsFormsApp1 this.linetype.Location = new System.Drawing.Point(518, 1); this.linetype.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.linetype.Name = "linetype"; - this.tableLayoutPanel2.SetRowSpan(this.linetype, 3); - this.linetype.Size = new System.Drawing.Size(245, 169); + this.linetype.Size = new System.Drawing.Size(245, 75); this.linetype.TabIndex = 5; this.linetype.Text = "StationID"; this.linetype.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -916,8 +714,7 @@ namespace WindowsFormsApp1 this.linecode.Location = new System.Drawing.Point(262, 1); this.linecode.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.linecode.Name = "linecode"; - this.tableLayoutPanel2.SetRowSpan(this.linecode, 3); - this.linecode.Size = new System.Drawing.Size(245, 169); + this.linecode.Size = new System.Drawing.Size(245, 75); this.linecode.TabIndex = 4; this.linecode.Text = "Line"; this.linecode.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -930,8 +727,7 @@ namespace WindowsFormsApp1 this.linename.Location = new System.Drawing.Point(6, 1); this.linename.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.linename.Name = "linename"; - this.tableLayoutPanel2.SetRowSpan(this.linename, 3); - this.linename.Size = new System.Drawing.Size(245, 169); + this.linename.Size = new System.Drawing.Size(245, 75); this.linename.TabIndex = 3; this.linename.Text = "线别:"; this.linename.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -943,11 +739,11 @@ namespace WindowsFormsApp1 | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.Controls.Add(this.richTextBox1); 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, 785); + this.groupBox3.Location = new System.Drawing.Point(4, 687); this.groupBox3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.groupBox3.Name = "groupBox3"; this.groupBox3.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.groupBox3.Size = new System.Drawing.Size(1752, 234); + this.groupBox3.Size = new System.Drawing.Size(1752, 232); this.groupBox3.TabIndex = 6; this.groupBox3.TabStop = false; this.groupBox3.Text = "日志页面"; @@ -957,11 +753,11 @@ namespace WindowsFormsApp1 this.richTextBox1.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.richTextBox1.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.richTextBox1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.richTextBox1.Location = new System.Drawing.Point(20, 48); this.richTextBox1.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6); this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(1718, 171); + this.richTextBox1.Size = new System.Drawing.Size(1718, 169); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // @@ -1048,17 +844,6 @@ namespace WindowsFormsApp1 this.timer1.Interval = 1000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // - // 胶水上下线 - // - this.胶水上下线.Dock = System.Windows.Forms.DockStyle.Fill; - this.胶水上下线.Location = new System.Drawing.Point(1081, 5); - this.胶水上下线.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.胶水上下线.Name = "胶水上下线"; - this.胶水上下线.Size = new System.Drawing.Size(130, 119); - this.胶水上下线.TabIndex = 3; - this.胶水上下线.Text = "胶水寿命"; - this.胶水上下线.UseVisualStyleBackColor = true; - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); @@ -1073,19 +858,17 @@ namespace WindowsFormsApp1 this.Text = "Form1"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.Form1_Load); + this.plcStatusGroupBox.ResumeLayout(false); + this.plcStatusGroupBox.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel4.ResumeLayout(false); - this.groupBox4.ResumeLayout(false); - this.tableLayoutPanel9.ResumeLayout(false); - this.tableLayoutPanel9.PerformLayout(); this.groupBox2.ResumeLayout(false); this.tableLayoutPanel7.ResumeLayout(false); this.tableLayoutPanel7.PerformLayout(); this.gropb.ResumeLayout(false); this.tableLayoutPanel6.ResumeLayout(false); - this.tableLayoutPanel6.PerformLayout(); this.原料包装LOT号.ResumeLayout(false); this.tableLayoutPanel5.ResumeLayout(false); this.tableLayoutPanel5.PerformLayout(); @@ -1146,31 +929,14 @@ namespace WindowsFormsApp1 private System.Windows.Forms.ToolStripMenuItem 扭力角度扭矩设置ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 压力曲线设置ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 螺丝枪扭力设置ToolStripMenuItem; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9; - private System.Windows.Forms.Label PLC1时间; - private System.Windows.Forms.Label PLC1机台状态; - private System.Windows.Forms.Label PLC1状态; 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 事件2时间; private System.Windows.Forms.Label 事件1时间; - 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.Label 事件3结果; - private System.Windows.Forms.Label 事件3; - private System.Windows.Forms.Label 事件4; - private System.Windows.Forms.Label 事件4结果; - private System.Windows.Forms.Label PLC1名称; private System.Windows.Forms.Label MES提示信息; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.Label linemode; - private System.Windows.Forms.Label MES通讯时间; - private System.Windows.Forms.Label MES链接状态; private System.Windows.Forms.Label 当前时间; private System.Windows.Forms.Label 操作人员ID; private System.Windows.Forms.Label linetype; @@ -1179,6 +945,9 @@ namespace WindowsFormsApp1 private System.Windows.Forms.Label 剩余寿命; private System.Windows.Forms.Button 胶水上下线; private System.Windows.Forms.ToolStripMenuItem 图片展示ToolStripMenuItem; + private System.Windows.Forms.GroupBox plcStatusGroupBox; + private System.Windows.Forms.TableLayoutPanel plcStatusTableLayout; + } } diff --git a/WindowsFormsApp1/MainForm.cs b/WindowsFormsApp1/MainForm.cs index ebb839f..59e721c 100644 --- a/WindowsFormsApp1/MainForm.cs +++ b/WindowsFormsApp1/MainForm.cs @@ -23,14 +23,28 @@ using WindowsFormsApp1.mod.server; using WindowsFormsApp1.server; using static SQLite.SQLite3; using static WindowsFormsApp1.server.ApiClient; +using Label = System.Windows.Forms.Label; + namespace WindowsFormsApp1 { public partial class MainForm : Form { + // 添加一个标志变量,用于标记是否已经执行了清理操作 + private bool _isCleanupDone = false; + private bool _isFormClosing = false; // 添加标志,表示窗体正在关闭 + // 添加一个静态变量来跟踪下一个要使用的槽位 + private static int _nextEventSlot = 1; + // 在MainForm类中添加一个字典,用于存储PLC状态控件 + private Dictionary plcStatusLabels = new Dictionary(); + private Dictionary plcStatusIndicators = new Dictionary(); + public MainForm() { InitializeComponent(); + // 添加FormClosed事件处理程序 + this.FormClosed += MainForm_FormClosed; + CheckForIllegalCrossThreadCalls = false; } @@ -55,6 +69,14 @@ namespace WindowsFormsApp1 //lineremark7.Text = ""; 操作人员ID.Text = Init.t_User.username; + + + // 添加窗体关闭事件处理 + this.FormClosing += MainForm_FormClosing; + + // 自动开始处理 + 开始处理_Click(this, EventArgs.Empty); + } @@ -84,7 +106,10 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); + + // 更新对应PLC的状态指示器为红色 + UpdatePlcStatus(Plc.id, false); + LogExecute.logNet.WriteError($"{Plc.plcip}建立S7连接失败"); continue; } @@ -101,7 +126,6 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}读取全部地址处理错误:处理停止"); continue; } @@ -113,12 +137,10 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}写入心跳错误:处理停止"); continue; } - LOT号.Text = PlcData.Read_MaterialCode0; Tray盘二维码.Text = PlcData.Read_MaterialCode1; @@ -127,7 +149,9 @@ namespace WindowsFormsApp1 //PLC链接状态.Text = "PLC链接状态:OK"; //PLC链接状态.BackColor = SystemColors.Control; //PLC通讯时间.Text = "PLC通讯时间:" + Plc_Time.ToString("MM-dd HH:mm:ss"); - PLC_Form(Plc, plcstate.OK, Plc_Time); + // 更新对应PLC的状态指示器为绿色 + UpdatePlcStatus(Plc.id, true); + #endregion ApiClient apiClient = new ApiClient(); @@ -150,10 +174,10 @@ namespace WindowsFormsApp1 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); + //MES链接状态.Text = "MES链接状态:OK"; + //MES链接状态.BackColor = SystemColors.Control; + //MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); + MES_MsgfORM("Status", statusresult, statusresult.Requesttime); if (statusresult.Mesresult != mesresult.PASS) { PlcData.Write_Status = 1001; @@ -163,8 +187,8 @@ namespace WindowsFormsApp1 } else { - MES链接状态.Text = "MES链接状态:NG"; - MES链接状态.BackColor = Color.Red; + //MES链接状态.Text = "MES链接状态:NG"; + //MES链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"MES通讯异常!"); PlcData.Write_Status = 1002; var errresult = siemensHelp.WriteAddress(plcaddress, PlcData); @@ -180,7 +204,7 @@ namespace WindowsFormsApp1 { //反馈报警 List list = new List(); -///////////////////////////////测试用 + ///////////////////////////////测试用 list.Add("M03CVSO-01"); otherdata.Plc_ErrorMsgs = list; Init.Plcstatus = PlcData.Read_Status; @@ -188,10 +212,10 @@ namespace WindowsFormsApp1 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); + //MES链接状态.Text = "MES链接状态:OK"; + //MES链接状态.BackColor = SystemColors.Control; + //MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); + MES_MsgfORM("Alarm", statusresult, statusresult.Requesttime); if (statusresult.Mesresult != mesresult.PASS) { PlcData.Write_Status = 1001; @@ -201,8 +225,8 @@ namespace WindowsFormsApp1 } else { - MES链接状态.Text = "MES链接状态:NG"; - MES链接状态.BackColor = Color.Red; + //MES链接状态.Text = "MES链接状态:NG"; + //MES链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"MES通讯异常!"); PlcData.Write_Status = 1002; siemensHelp.WriteAddress(plcaddress, PlcData); @@ -232,7 +256,6 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}写入地址处理错误:处理停止"); } continue; @@ -251,7 +274,7 @@ namespace WindowsFormsApp1 LogExecute.logNet.WriteError($"未找到当前期望接口ID {nowflow.hopeinterfaceid},对应的接口!"); continue; } - + #endregion #region 根据流程,判断是否需要扫码、气密、扭力等 if (nowflow.scan) @@ -263,7 +286,8 @@ namespace WindowsFormsApp1 { string returnValue = scanForm.ReturnValue; otherdata.JS_SN = returnValue; - + //Init.SN = returnValue; + LOT号.Text = returnValue; Init.ScanString = returnValue; } else @@ -283,15 +307,14 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); 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"); + //MES链接状态.Text = "MES链接状态:OK"; + //MES链接状态.BackColor = SystemColors.Control; + //MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); } continue; @@ -315,7 +338,6 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}压力曲线数据地址处理错误:处理停止"); continue; } @@ -333,7 +355,6 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}螺丝枪扭力数据地址处理错误:处理停止"); continue; } @@ -352,7 +373,6 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}螺丝枪角度数据地址处理错误:处理停止"); continue; } @@ -363,7 +383,8 @@ namespace WindowsFormsApp1 //文件上传 } #endregion - + // NG料进站不判断,进站MES返回FAIL,记录。该站其他事件不触发MES,直接跳过 + //if() #region 判断物料调用次数 固化站 if (Init.t_Line.lineremark2 == "Curing") { @@ -388,7 +409,7 @@ namespace WindowsFormsApp1 materialCall.checkin1 = DateTime.Now; shouldCallApi = true; } - else if (!materialCall.checkout3.HasValue + else if (!materialCall.checkout3.HasValue && materialCall.checkout2.HasValue && materialCall.checkout1.HasValue && nowinterface.code.Contains("Checkout")) @@ -406,6 +427,7 @@ namespace WindowsFormsApp1 materialCall.checkin2 = DateTime.Now; else if (!materialCall.checkin3.HasValue) materialCall.checkin3 = DateTime.Now; + PlcData.Write_Status = PLC_Status.SN_CheckIN; } else if (nowinterface.code.Contains("SN_Checkout")) { @@ -413,6 +435,7 @@ namespace WindowsFormsApp1 materialCall.checkout1 = DateTime.Now; else if (!materialCall.checkout2.HasValue) materialCall.checkout2 = DateTime.Now; + PlcData.Write_Status = PLC_Status.SN_Checkout; } } materialCallHelper.Update(materialCall); @@ -427,7 +450,6 @@ namespace WindowsFormsApp1 var writeresult = siemensHelp.WriteAddress(plcaddress, PlcData); if (!writeresult.Success) { - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}写入地址处理错误:处理停止"); continue; } @@ -436,12 +458,17 @@ namespace WindowsFormsApp1 } #endregion + //文件路径 列表 + otherdata.FileUploadAddress = Init.t_Keyvalues.First(x => x.key == "UploadPath").value; + otherdata.ImageAddress = Init.t_Keyvalues.First(x => x.key == "ImageFilePath").value; + otherdata.VedioAddress = Init.t_Keyvalues.First(x => x.key == "VedioFilePath").value; + + #region 调用后端接口 var result = apiClient.CallFunctionByName(nowinterface.code, PlcData, otherdata); if (result.IsShow) { - MES提示信息.Visible = true; - MES提示信息.Text = DateTime.Now.ToString("HH:mm:ss") + ":" + result.Msg; + MES_MsgfORM(nowinterface.code, result, result.Requesttime); } if (result.Success) @@ -451,18 +478,17 @@ namespace WindowsFormsApp1 { //PLC链接状态.Text = "PLC链接状态:NG"; //PLC链接状态.BackColor = Color.Red; - PLC_Form(Plc, plcstate.NG, DateTime.Now); LogExecute.logNet.WriteError($"{Plc.plcip}写入地址处理错误:处理停止"); continue; } else { ChangeBarcode(); - MES_MsgfORM(nowinterface.code, result.Mesresult, result.Requesttime); + MES_MsgfORM(nowinterface.code, result, result.Requesttime); - MES链接状态.Text = "MES链接状态:OK"; - MES链接状态.BackColor = SystemColors.Control; - MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); + //MES链接状态.Text = "MES链接状态:OK"; + //MES链接状态.BackColor = SystemColors.Control; + //MES通讯时间.Text = "MES通讯时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); if (result.Mesresult != mesresult.PASS) { PlcData.Write_Status = 1001; @@ -473,8 +499,8 @@ namespace WindowsFormsApp1 } else { - MES链接状态.Text = "MES链接状态:NG"; - MES链接状态.BackColor = Color.Red; + //MES链接状态.Text = "MES链接状态:NG"; + //MES链接状态.BackColor = Color.Red; LogExecute.logNet.WriteError($"MES通讯异常!"); PlcData.Write_Status = 1002; siemensHelp.WriteAddress(plcaddress, PlcData); @@ -501,12 +527,13 @@ namespace WindowsFormsApp1 { SQLiteHelper sQLiteHelper_plc = new db.SQLiteHelper(); - var plc_sqlresult = sQLiteHelper_plc.QuerySingle(a=>a.id == Init.t_Line.plcid); + var plc_sqlresult = sQLiteHelper_plc.QueryAll(); if (!plc_sqlresult.Success) { MessageBox.Show("无法初始化PLC信息,无法开始处理!"); return; } + var plc_result = plc_sqlresult.Data.FindAll(a => Init.t_Lineplcs.Select(p => p.plcid).Contains(a.id)); SQLiteHelper sQLiteHelper_key = new db.SQLiteHelper(); var key_sqlresult = sQLiteHelper_key.QueryAll(); @@ -583,6 +610,9 @@ namespace WindowsFormsApp1 Init.t_Pressurecurves = pressurecurve_result.Data; Init.t_Interfaces = interface_result.Data; Init.t_Keyvalues = key_sqlresult.Data; + + // 初始化PLC状态面板 + InitializePlcStatusPanel(); #endregion #region 初始化COM口服务 try @@ -640,17 +670,19 @@ namespace WindowsFormsApp1 #endregion Init.threadHelps = new List(); - var plc = plc_sqlresult.Data; - plc.plchelp = new SiemensHelp(plc.plcip, plc.timeout); - ThreadHelp threadHelp = new ThreadHelp(); - if (!threadHelp.isrunning1) + foreach (var plc in plc_result) { - threadHelp.cancellationTokenSource1 = new CancellationTokenSource(); - threadHelp.Thread = new Thread(() => build(plc, threadHelp.cancellationTokenSource1.Token)); - threadHelp.Thread.Start(); - threadHelp.isrunning1 = true; + plc.plchelp = new SiemensHelp(plc.plcip, plc.timeout); + ThreadHelp threadHelp = new ThreadHelp(); + if (!threadHelp.isrunning1) + { + threadHelp.cancellationTokenSource1 = new CancellationTokenSource(); + threadHelp.Thread = new Thread(() => build(plc, threadHelp.cancellationTokenSource1.Token)); + threadHelp.Thread.Start(); + threadHelp.isrunning1 = true; + } + Init.threadHelps.Add(threadHelp); } - Init.threadHelps.Add(threadHelp); 开始处理.Text = "停止处理"; 开始处理.BackColor = Color.Red; @@ -685,6 +717,78 @@ namespace WindowsFormsApp1 LogExecute.logNet.WriteInfo($"用户{Init.t_User.username},停止处理!"); } } + + // 添加FormClosed事件处理程序 + private void MainForm_FormClosed(object sender, FormClosedEventArgs e) + { + // 如果已经执行过清理,则直接返回 + if (_isCleanupDone) + return; + + try + { + _isCleanupDone = true; // 标记清理操作已执行 + // 给日志系统一点时间完成写入 + System.Threading.Thread.Sleep(100); + // 停止所有线程 + if (Init.threadHelps != null) + { + foreach (var thread in Init.threadHelps) + { + try + { + if (thread.Thread != null && thread.Thread.IsAlive) + { + thread.cancellationTokenSource1?.Cancel(); + } + } + catch { /* 忽略异常 */ } + } + } + + // 安全关闭串口 + try + { + if (Init.ScanPort != null && Init.ScanPort.IsOpen) + { + Init.ScanPort.Close(); + Init.ScanPort = null; + } + } + catch { /* 忽略异常 */ } + + try + { + if (Init.AirtightPort != null && Init.AirtightPort.IsOpen) + { + Init.AirtightPort.Close(); + Init.AirtightPort = null; + } + } + catch { /* 忽略异常 */ } + } + catch { /* 忽略所有异常 */ } + } + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + // 设置窗体正在关闭标志 + _isFormClosing = true; + + // 如果当前正在处理中,则记录日志 + if (开始处理.Text == "停止处理") + { + try + { + LogExecute.logNet.WriteInfo($"用户{Init.t_User.username},程序关闭时自动停止处理!"); + // 给日志系统一点时间完成写入 + System.Threading.Thread.Sleep(100); + } + catch { /* 忽略异常 */ } + } + + } + #endregion #region 页面按钮-跳转 private void 扭力角度扭矩设置ToolStripMenuItem_Click(object sender, EventArgs e) @@ -771,46 +875,77 @@ namespace WindowsFormsApp1 #region 页面-布局、日志等 private void LogNet_BeforeSaveToFile(object sender, HslEventArgs e) { - lock (this) + // 如果窗体正在关闭,则不再尝试更新UI + if (_isFormClosing) { - DateTime time = e.HslMessage.Time;//获取时间 - string text = e.HslMessage.Text;//日志文本 - int textLength = richTextBox1.TextLength; - int lineCount = richTextBox1.GetLineFromCharIndex(textLength); - - if (lineCount >= 200) - { - richTextBox1.Clear(); - } - - if (e.HslMessage.Degree == HslMessageDegree.ERROR) - { - richTextBox1.SelectionColor = Color.Red; - richTextBox1.AppendText("[错误] " + time.ToString() + " | " + text + "\n"); - } - else if (e.HslMessage.Degree == HslMessageDegree.DEBUG) - { - richTextBox1.SelectionColor = Color.Green; - richTextBox1.AppendText("[日志] " + time.ToString() + " | " + text + "\n"); - } - else if (e.HslMessage.Degree == HslMessageDegree.WARN) - { - richTextBox1.SelectionColor = Color.Orange; - richTextBox1.AppendText("[警告] " + time.ToString() + " | " + text + "\n"); - } - else if (e.HslMessage.Degree == HslMessageDegree.INFO) - { - richTextBox1.SelectionColor = Color.Orange; - richTextBox1.AppendText("[提示] " + time.ToString() + " | " + text + "\n"); - } - else - { - richTextBox1.SelectionColor = Color.Red; - richTextBox1.AppendText("[未知] " + time.ToString() + " | " + text + "\n"); - } + // 仅写入文件日志,不更新UI + return; } - } + try + { + // 使用 BeginInvoke 而不是直接在锁内操作 UI 控件,减少 UI 线程阻塞 + this.BeginInvoke(new Action(() => + { + DateTime time = e.HslMessage.Time; + string text = e.HslMessage.Text; + // 使用 StringBuilder 构建日志文本,提高性能 + StringBuilder logBuilder = new StringBuilder(); + string logPrefix; + Color logColor; + + // 根据日志级别设置前缀和颜色 + switch (e.HslMessage.Degree) + { + case HslMessageDegree.ERROR: + logPrefix = "[错误] "; + logColor = Color.Red; + break; + case HslMessageDegree.DEBUG: + logPrefix = "[日志] "; + logColor = Color.Green; + break; + case HslMessageDegree.WARN: + case HslMessageDegree.INFO: + logPrefix = e.HslMessage.Degree == HslMessageDegree.WARN ? "[警告] " : "[提示] "; + logColor = Color.Orange; + break; + default: + logPrefix = "[未知] "; + logColor = Color.Red; + break; + } + + logBuilder.Append(logPrefix).Append(time.ToString()).Append(" | ").Append(text).Append("\n"); + + // 检查日志行数,如果超过阈值则清理 + int lineCount = richTextBox1.GetLineFromCharIndex(richTextBox1.TextLength); + if (lineCount >= 200) + { + // 优化:只保留后 100 行,而不是全部清空再重新添加 + int startIndex = richTextBox1.GetFirstCharIndexFromLine(lineCount - 100); + if (startIndex > 0) + { + richTextBox1.Select(0, startIndex); + richTextBox1.SelectedText = ""; + } + } + + // 添加新日志 + richTextBox1.SelectionStart = richTextBox1.TextLength; + richTextBox1.SelectionLength = 0; + richTextBox1.SelectionColor = logColor; + richTextBox1.AppendText(logBuilder.ToString()); + + // 重置颜色并滚动到底部 + richTextBox1.SelectionStart = richTextBox1.TextLength; + richTextBox1.SelectionLength = 0; + richTextBox1.SelectionColor = richTextBox1.ForeColor; + richTextBox1.ScrollToCaret(); + })); + } + catch { /* 忽略异常 */ } + } private void timer1_Tick(object sender, EventArgs e) { 当前时间.Text = "当前时间:" + DateTime.Now.ToString("MM-dd HH:mm:ss"); @@ -820,41 +955,19 @@ namespace WindowsFormsApp1 开始处理.Text = "开始处理"; 开始处理.BackColor = Color.Green; - MES链接状态.Text = "MES链接状态:None"; - MES链接状态.BackColor = SystemColors.Control; + //MES链接状态.Text = "MES链接状态:None"; + //MES链接状态.BackColor = SystemColors.Control; - MES通讯时间.Text = "MES通讯时间:None"; - MES通讯时间.BackColor = SystemColors.Control; + //MES通讯时间.Text = "MES通讯时间:None"; + //MES通讯时间.BackColor = SystemColors.Control; - PLC1名称.Visible = false; - - PLC1状态.Visible = false; - - PLC1机台状态.Visible = false; - - PLC1时间.Visible = false; //胶水上下线.Enabled = false; - MES提示信息.Visible = false; - LOT号.Visible = false; - Tray盘二维码.Visible = false; + //MES提示信息.Visible = 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; @@ -864,6 +977,12 @@ namespace WindowsFormsApp1 剩余寿命.Visible = false; + // 初始化所有PLC状态指示器为灰色(未连接状态) + foreach (var indicator in plcStatusIndicators.Values) + { + indicator.BackColor = Color.Gray; + } + } public void ChangeBarcode() @@ -871,148 +990,211 @@ namespace WindowsFormsApp1 剩余寿命.Visible = true; var power = Init.t_Keyvalues.FirstOrDefault(a => a.key == "Power"); - - 剩余寿命.Text = power == null ? "": power.value; + + 剩余寿命.Text = power == null ? "" : power.value; } - public void PLC_Form(t_plc plc, plcstate state, DateTime time) + // 添加初始化PLC状态面板的方法 + private void InitializePlcStatusPanel() { - string plcname = plc.plcip; - string datetime = time.ToString("HH:mm:ss"); - PLC1名称.Visible = true; - PLC1状态.Visible = true; - PLC1机台状态.Visible = true; - PLC1时间.Visible = true; - PLC1名称.Text = plcname; - PLC1状态.Text = state.ToString(); - PLC1机台状态.Text = Enum.GetName(typeof(plcstatus), Init.Plcstatus); - PLC1时间.Text = datetime; - if (PLC1状态.Text == plcstate.NG.ToString()) + // 假设我们已经有一个名为plcStatusGroupBox的GroupBox控件 + // 和一个名为plcStatusTableLayout的TableLayoutPanel控件 + + // 清空现有控件 + plcStatusTableLayout.Controls.Clear(); + plcStatusLabels.Clear(); + plcStatusIndicators.Clear(); + + // 设置TableLayoutPanel的行列数 + int plcCount = Init.t_Lineplcs?.Count ?? 0; + // 修改为横向布局:每列显示一个PLC,每个PLC占用一行两列 + plcStatusTableLayout.ColumnCount = plcCount * 2; // 每个PLC需要2列 + plcStatusTableLayout.RowCount = 1; // 只需要1行 + + // 设置列样式 + plcStatusTableLayout.ColumnStyles.Clear(); + for (int i = 0; i < plcCount; i++) { - PLC1状态.BackColor = Color.Red; + // 为每个PLC添加两列:一列放指示灯,一列放标签 + plcStatusTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 30F)); // 状态指示灯列 + plcStatusTableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 150F)); // PLC信息列 } - else + + // 设置行样式 + plcStatusTableLayout.RowStyles.Clear(); + plcStatusTableLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 25F)); + + // 如果没有PLC,显示提示信息 + if (plcCount == 0) { - PLC1状态.BackColor = SystemColors.Control; + var noPlcLabel = new System.Windows.Forms.Label(); + noPlcLabel.Text = "未配置PLC"; + noPlcLabel.Dock = DockStyle.Fill; + noPlcLabel.TextAlign = ContentAlignment.MiddleCenter; + plcStatusTableLayout.Controls.Add(noPlcLabel, 0, 0); + plcStatusTableLayout.SetColumnSpan(noPlcLabel, 2); + return; } - if (PLC1机台状态.Text == plcstatus.停机.ToString()) + + // 为每个PLC创建状态指示器 + int colIndex = 0; + foreach (var linePlc in Init.t_Lineplcs) { - PLC1机台状态.BackColor = Color.Red; - } - else - { - PLC1机台状态.BackColor = SystemColors.Control; + // 获取PLC信息 + var plc = Init.t_Plcaddresses.FirstOrDefault(p => p.plcid == linePlc.plcid); + if (plc == null) continue; + + // 创建状态指示灯(一个小Panel) + Panel statusIndicator = new Panel(); + statusIndicator.Size = new Size(16, 16); + statusIndicator.BackColor = Color.Gray; // 初始为灰色 + statusIndicator.Margin = new Padding(5); + + // 创建PLC名称标签 + Label plcLabel = new Label(); + plcLabel.Text = $"PLC-{plc.plcid}:{plc.dbaddress}"; + plcLabel.Dock = DockStyle.Fill; + plcLabel.TextAlign = ContentAlignment.MiddleLeft; + + // 添加到TableLayoutPanel(使用列索引) + plcStatusTableLayout.Controls.Add(statusIndicator, colIndex, 0); // 状态指示灯放在第一列 + plcStatusTableLayout.Controls.Add(plcLabel, colIndex + 1, 0); // 标签放在第二列 + + // 保存引用以便后续更新 + plcStatusIndicators[linePlc.plcid] = statusIndicator; + plcStatusLabels[linePlc.plcid] = plcLabel; + + colIndex += 2; // 每个PLC占用两列,所以索引加2 } } - public void MES_MsgfORM(string name, mesresult result, DateTime dateTime) + // 添加更新PLC状态的方法 + private void UpdatePlcStatus(int plcId, bool isConnected) { - if (事件1.Text == name) + try { - 事件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 == name) - { - 事件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 == name) - { - 事件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 == name) - { - 事件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 - { - if (事件1.Text.Contains("事件")) + if (plcStatusIndicators.ContainsKey(plcId)) { - 事件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(); + // 使用Invoke确保在UI线程上更新控件 + this.Invoke((MethodInvoker)delegate + { + plcStatusIndicators[plcId].BackColor = isConnected ? Color.Green : Color.Red; + }); } - 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(); + } + catch { /* 忽略异常 */ } + } - 事件2.Visible = false; - 事件2结果.Visible = false; - 事件2时间.Visible = false; - 事件2.Text = "事件2"; - 事件2时间.Text = "事件2时间"; - 事件2结果.Text = "OK"; + /// + /// 更新事件显示区域 + /// + private void UpdateEventDisplay(string name, mesresult result, DateTime dateTime, string message) + { + UpdateEventSlot(事件1, 事件1结果, 事件1时间, name, result, dateTime, message); + // 根据接口名称显示特定信息 + //UpdateSpecificEventInfo(name, message); + } - 事件3.Visible = false; - 事件3结果.Visible = false; - 事件3时间.Visible = false; - 事件3.Text = "事件3"; - 事件3时间.Text = "事件3时间"; - 事件3结果.Text = "OK"; + /// + /// 查找可用的事件显示槽位 + /// + private int FindAvailableEventSlot() + { + // 首先查找不可见的事件槽位 + if (!事件1.Visible) return 1; + return 1; + } - 事件4.Visible = false; - 事件4结果.Visible = false; - 事件4时间.Visible = false; - 事件4.Text = "事件4"; - 事件4时间.Text = "事件4时间"; - 事件4结果.Text = "OK"; - } + /// + /// 更新指定事件槽位的显示内容 + /// + private void UpdateEventSlot(Label eventLabel, Label resultLabel, Label timeLabel, + string name, mesresult result, DateTime dateTime, string message) + { + // 设置事件名称 + eventLabel.Text = $"{name}"; + eventLabel.Visible = true; + + // 设置事件结果 + resultLabel.Text = $"{(result == mesresult.PASS ? "PASS" : "FAIL")}"; + resultLabel.ForeColor = result == mesresult.PASS ? Color.Green : Color.Red; + resultLabel.Visible = true; + + // 设置事件时间 + timeLabel.Text = $"{dateTime:MM-dd HH:mm:ss}"; + timeLabel.Visible = true; + } + + /// + /// 根据接口名称更新特定信息显示 + /// + private void UpdateSpecificEventInfo(string name, string message) + { + // 根据不同的接口名称,显示特定的信息 + switch (name) + { + case "SN_Release": + // 显示SN号 + if (!string.IsNullOrEmpty(Init.ScanString)) + { + LOT号.Text = $"SN号:{Init.ScanString}"; + LOT号.Visible = true; + } + break; + + case "Tray_Release": + // 显示Tray盘信息 + if (!string.IsNullOrEmpty(message)) + { + Tray盘二维码.Text = $"Tray盘:{message}"; + Tray盘二维码.Visible = true; + } + break; + + case "Status": + // 机台状态信息已在其他地方更新 + break; + + case "Alarm": + // 报警信息可以在底部注释中显示 + if (!string.IsNullOrEmpty(message)) + { + 底部注释3.Text = $"报警信息:{message}"; + 底部注释3.Visible = true; + } + break; + + // 可以根据需要添加更多的接口类型处理 + default: + // 对于其他类型的接口,可以在底部注释中显示额外信息 + if (!string.IsNullOrEmpty(message)) + { + if (!底部注释4.Visible) + { + 底部注释4.Text = $"{name}:{message}"; + 底部注释4.Visible = true; + } + else if (!底部注释5.Visible) + { + 底部注释5.Text = $"{name}:{message}"; + 底部注释5.Visible = true; + } + } + break; } } + + public void MES_MsgfORM(string name, ApiFormResult result, DateTime dateTime) + { + // 显示MES提示信息 + MES提示信息.Visible = true; + MES提示信息.Text = $"{result.Msg}"; + MES提示信息.ForeColor = result.Mesresult == mesresult.PASS ? Color.Green : Color.Red; + + // 更新事件显示区域 + UpdateEventDisplay(name, result.Mesresult, dateTime, result.Msg); + } + #endregion #region 其他业务处理 diff --git a/WindowsFormsApp1/MaterialScanForm.cs b/WindowsFormsApp1/MaterialScanForm.cs index f8412d4..91e1144 100644 --- a/WindowsFormsApp1/MaterialScanForm.cs +++ b/WindowsFormsApp1/MaterialScanForm.cs @@ -88,6 +88,12 @@ namespace WindowsFormsApp1 OtherData.opindex = 1; var mesResult = _apiClient.CallFunctionByName("Glue_CheckOut", new plcdata(), OtherData); + if (mesResult.Mesresult == mesresult.FAIL) + { + MessageBox.Show("上线失败!", mesResult.Msg, MessageBoxButtons.OK, MessageBoxIcon.Error); + + return; + } var material = new t_materialscan { scancode = scanCode, @@ -130,6 +136,12 @@ namespace WindowsFormsApp1 OtherData.opindex = 2; var mesResult = _apiClient.CallFunctionByName("Glue_CheckOut", new plcdata(), OtherData); + if (mesResult.Mesresult == mesresult.FAIL) + { + MessageBox.Show("下线失败!", mesResult.Msg, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + material.isonline = false; var result = _dbHelper.Update(material); if (result.Success) diff --git a/WindowsFormsApp1/Program.cs b/WindowsFormsApp1/Program.cs index 6b8791d..c0f6b83 100644 --- a/WindowsFormsApp1/Program.cs +++ b/WindowsFormsApp1/Program.cs @@ -40,7 +40,7 @@ namespace WindowsFormsApp1 public static t_user t_User; public static List t_Flows; - + public static List t_Lineplcs; public static List t_Interfaces; public static List t_Plcaddresses; diff --git a/WindowsFormsApp1/db/MES_PLCold.db b/WindowsFormsApp1/db/MES_PLCold.db new file mode 100644 index 0000000000000000000000000000000000000000..9f0c82517e0122261f6526ae79161202a4d6d8f4 GIT binary patch literal 176128 zcmeFa3!D_?nJ-*@uf7imauH=fE&~kHPjy%K^a#prK#U_yU^FDbz{rfu=m?XUK{4SZ z^tE~vBm0R4BQYeRqCsU>qAX(Me20@|ci9b_WjAa>_T$^b3}cq>g#DK6;cPg+bKbYA zZ&Od#GkDADZcSo4_Pqb6tDgT;Z&&~SPrvW#&o_1UwO8N2x#ywQzUqijC0H!N!s=>4 zm_1bxggNY=!p~Fe7klA9*uO1hzZ?9@V$?mHbMV2z-|;b{wSO55H=i~$U}nI~fSCa^ z17-%y444@(Ghk-G%z&8zGXrJ@K7kBW0sm}n3;uT=drt6QgO{~mKY^DrLz)>dGhk-G z%z&8zGXrJ@%nXN= z4h4OIe+v9%U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uK92pQe6b4AUSEDU#3)Ca*jw&addL!*`&7|og|nBNjmC7QVK3fJ0)p( ze!4Jz>um3#($a_G{H(RMwG$kKvDaE(3};&6<zR`>ywlG=a>3xK=u11OcW0q*Kr_WImz!eo>I#QsoL#O-nhrJ2RT zOVisUj+yWp63{6xXGs1KC^|XPYyT=~soZN7g4ms|o309I(cQ>*QE>mns|W)KP3vp^(x1AHJAv z?I&CL|J~KAq2#W_r^M|fl37`6{u98Qh|S4fgVC6#I+h#7t5V{Ku1DIi)d)U z97zu$NTQ(y><17sCK{URqwz)w#h~p65aK5qnrfy6P1_G3BvUjr)lmzYwjV$Ut!QYf ztrj$GKY);D(a=kAvM;_2wd(dak-_!@2w@mshFWXEVEX}t zbc`=Ut*~IQ{QyE-#+RYiRWP`IKo=oDVtl zztaBb5(!}&>1jITC*G!AA|Zw2Iv*iwJXSE5NJ!_fs9-LUklJBU!CWFC&BLOCxkN(B zheat$%YL{+T9-&j|F9@Uxd@cjB@$9WEJ~3t0;P3{gtQQgQZ$S}X{{kZubovZ_v&OAq}corGs@&egS3dYSI7z literal 0 HcmV?d00001 diff --git a/WindowsFormsApp1/form/FLOW_Manage.Designer.cs b/WindowsFormsApp1/form/FLOW_Manage.Designer.cs index 6c13765..10a7cc1 100644 --- a/WindowsFormsApp1/form/FLOW_Manage.Designer.cs +++ b/WindowsFormsApp1/form/FLOW_Manage.Designer.cs @@ -97,24 +97,24 @@ dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle3; - this.dataGridView1.Location = new System.Drawing.Point(6, 5); - this.dataGridView1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); + this.dataGridView1.Location = new System.Drawing.Point(7, 6); + this.dataGridView1.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.ReadOnly = true; this.dataGridView1.RowHeadersWidth = 72; this.tableLayoutPanel1.SetRowSpan(this.dataGridView1, 4); this.dataGridView1.RowTemplate.Height = 23; - this.dataGridView1.Size = new System.Drawing.Size(1557, 818); + this.dataGridView1.Size = new System.Drawing.Size(1698, 934); this.dataGridView1.TabIndex = 1; // // 关闭 // this.关闭.Anchor = System.Windows.Forms.AnchorStyles.None; this.关闭.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.关闭.Location = new System.Drawing.Point(1575, 708); - this.关闭.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); + this.关闭.Location = new System.Drawing.Point(1719, 810); + this.关闭.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.关闭.Name = "关闭"; - this.关闭.Size = new System.Drawing.Size(163, 72); + this.关闭.Size = new System.Drawing.Size(177, 82); this.关闭.TabIndex = 6; this.关闭.Text = "关闭"; this.关闭.UseVisualStyleBackColor = true; @@ -124,10 +124,10 @@ // this.查询.Anchor = System.Windows.Forms.AnchorStyles.None; this.查询.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.查询.Location = new System.Drawing.Point(1575, 46); - this.查询.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); + this.查询.Location = new System.Drawing.Point(1719, 53); + this.查询.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.查询.Name = "查询"; - this.查询.Size = new System.Drawing.Size(163, 72); + this.查询.Size = new System.Drawing.Size(177, 82); this.查询.TabIndex = 4; this.查询.Text = "查询"; this.查询.UseVisualStyleBackColor = true; @@ -144,24 +144,24 @@ this.tableLayoutPanel1.Controls.Add(this.button1, 1, 2); 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(6, 5, 6, 5); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 4; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1744, 828); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1903, 946); this.tableLayoutPanel1.TabIndex = 7; // // button1 // this.button1.Anchor = System.Windows.Forms.AnchorStyles.None; this.button1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button1.Location = new System.Drawing.Point(1575, 542); - this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); + this.button1.Location = new System.Drawing.Point(1719, 620); + this.button1.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(163, 72); + this.button1.Size = new System.Drawing.Size(177, 82); this.button1.TabIndex = 7; this.button1.Text = "新增"; this.button1.UseVisualStyleBackColor = true; @@ -256,8 +256,8 @@ // fileupload // this.fileupload.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.fileupload.DataPropertyName = "fileupload"; - this.fileupload.HeaderText = "文件上传"; + this.fileupload.DataPropertyName = "dzscan"; + this.fileupload.HeaderText = "端子扫码"; this.fileupload.MinimumWidth = 9; this.fileupload.Name = "fileupload"; this.fileupload.ReadOnly = true; @@ -307,15 +307,15 @@ this.airtight.Name = "airtight"; this.airtight.ReadOnly = true; // - // FLOW_Manage + // Flow_Manage // - this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1744, 828); + this.ClientSize = new System.Drawing.Size(1903, 946); this.Controls.Add(this.tableLayoutPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); - this.Name = "FLOW_Manage"; + this.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); + this.Name = "Flow_Manage"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "FLOW_Mange"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; diff --git a/WindowsFormsApp1/form/FLOW_Manage.cs b/WindowsFormsApp1/form/FLOW_Manage.cs index 030c5d6..b580980 100644 --- a/WindowsFormsApp1/form/FLOW_Manage.cs +++ b/WindowsFormsApp1/form/FLOW_Manage.cs @@ -152,7 +152,7 @@ namespace WindowsFormsApp1.form finaltorquecurve = flow.finaltorquecurve, finalpressurecurve = flow.finalpressurecurve, airtight = flow.airtight, - + dzscan = flow.dzscan }); } dataGridView1.DataSource = null; diff --git a/WindowsFormsApp1/form/LoginForm.cs b/WindowsFormsApp1/form/LoginForm.cs index b1c7283..19e35d0 100644 --- a/WindowsFormsApp1/form/LoginForm.cs +++ b/WindowsFormsApp1/form/LoginForm.cs @@ -42,6 +42,15 @@ namespace WindowsFormsApp1 } else { + SQLiteHelper sQLiteHelper_lineplc = new db.SQLiteHelper(); + var lineplc_result = sQLiteHelper_lineplc.Query(a => a.lineid == result_combox.Data.id); + if (!lineplc_result.Success) + { + MessageBox.Show("无法初始化PLC-产线关联信息!"); + return; + } + + Init.t_Lineplcs = lineplc_result.Data; Init.t_User = result.Data; Init.t_Line = result_combox.Data; DialogResult = DialogResult.OK; diff --git a/WindowsFormsApp1/form/ScanForm.cs b/WindowsFormsApp1/form/ScanForm.cs index f3bae2c..11e2073 100644 --- a/WindowsFormsApp1/form/ScanForm.cs +++ b/WindowsFormsApp1/form/ScanForm.cs @@ -81,11 +81,27 @@ namespace WindowsFormsApp1 LOt号.Text = ReturnValue; LOt号.Visible = true; })); + + // 添加延时后自动确认 + System.Threading.Thread.Sleep(500); // 显示扫码结果0.5秒 + if (!string.IsNullOrWhiteSpace(ReturnValue)) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } } else { LOt号.Text = ReturnValue; LOt号.Visible = true; + + // 添加延时后自动确认 + System.Threading.Thread.Sleep(500); // 显示扫码结果0.5秒 + if (!string.IsNullOrWhiteSpace(ReturnValue)) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } } } catch (Exception ex) diff --git a/WindowsFormsApp1/form/ScanForm_SSQ.cs b/WindowsFormsApp1/form/ScanForm_SSQ.cs index cbfb22d..fa6fc28 100644 --- a/WindowsFormsApp1/form/ScanForm_SSQ.cs +++ b/WindowsFormsApp1/form/ScanForm_SSQ.cs @@ -40,7 +40,7 @@ namespace WindowsFormsApp1 MessageBox.Show("扫码为空,请确认!"); return; } - LogExecute.logNet.WriteDebug($"{ReturnValue}上线点击"); + //LogExecute.logNet.WriteDebug($"{ReturnValue}上线点击"); //this.Close(); //请求后端接口,index代表位置 var PlcData = new plcdata(); diff --git a/WindowsFormsApp1/form/editForm/FLow_Insert.Designer.cs b/WindowsFormsApp1/form/editForm/FLow_Insert.Designer.cs index a3736e7..db273d8 100644 --- a/WindowsFormsApp1/form/editForm/FLow_Insert.Designer.cs +++ b/WindowsFormsApp1/form/editForm/FLow_Insert.Designer.cs @@ -116,7 +116,7 @@ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1087, 854); + this.tableLayoutPanel1.Size = new System.Drawing.Size(1186, 976); this.tableLayoutPanel1.TabIndex = 0; // // label1 @@ -124,9 +124,9 @@ this.label1.Anchor = System.Windows.Forms.AnchorStyles.None; this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label1.Location = new System.Drawing.Point(154, 113); + this.label1.Location = new System.Drawing.Point(165, 129); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(124, 28); + this.label1.Size = new System.Drawing.Size(143, 33); this.label1.TabIndex = 0; this.label1.Text = "流程名称"; // @@ -135,9 +135,9 @@ this.label8.Anchor = System.Windows.Forms.AnchorStyles.None; this.label8.AutoSize = true; this.label8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label8.Location = new System.Drawing.Point(616, 113); + this.label8.Location = new System.Drawing.Point(671, 129); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(68, 28); + this.label8.Size = new System.Drawing.Size(79, 33); this.label8.TabIndex = 7; this.label8.Text = "扫码"; // @@ -146,20 +146,20 @@ this.label9.Anchor = System.Windows.Forms.AnchorStyles.None; this.label9.AutoSize = true; this.label9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label9.Location = new System.Drawing.Point(588, 198); + this.label9.Location = new System.Drawing.Point(639, 226); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(124, 28); + this.label9.Size = new System.Drawing.Size(143, 33); this.label9.TabIndex = 8; - this.label9.Text = "文件上传"; + this.label9.Text = "端子扫码"; // // label10 // this.label10.Anchor = System.Windows.Forms.AnchorStyles.None; this.label10.AutoSize = true; this.label10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label10.Location = new System.Drawing.Point(588, 283); + this.label10.Location = new System.Drawing.Point(639, 323); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(124, 28); + this.label10.Size = new System.Drawing.Size(143, 33); this.label10.TabIndex = 9; this.label10.Text = "螺丝扭力"; // @@ -168,9 +168,9 @@ this.button1.Anchor = System.Windows.Forms.AnchorStyles.None; this.tableLayoutPanel1.SetColumnSpan(this.button1, 2); this.button1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button1.Location = new System.Drawing.Point(228, 683); + this.button1.Location = new System.Drawing.Point(249, 779); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(194, 79); + this.button1.Size = new System.Drawing.Size(212, 90); this.button1.TabIndex = 14; this.button1.Text = "保存"; this.button1.UseVisualStyleBackColor = true; @@ -181,9 +181,9 @@ this.button2.Anchor = System.Windows.Forms.AnchorStyles.None; this.tableLayoutPanel1.SetColumnSpan(this.button2, 2); this.button2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button2.Location = new System.Drawing.Point(664, 683); + this.button2.Location = new System.Drawing.Point(725, 779); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(190, 79); + this.button2.Size = new System.Drawing.Size(207, 90); this.button2.TabIndex = 15; this.button2.Text = "取消"; this.button2.UseVisualStyleBackColor = true; @@ -194,9 +194,9 @@ this.压力曲线.Anchor = System.Windows.Forms.AnchorStyles.None; this.压力曲线.AutoSize = true; this.压力曲线.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.压力曲线.Location = new System.Drawing.Point(856, 542); + this.压力曲线.Location = new System.Drawing.Point(933, 617); this.压力曲线.Name = "压力曲线"; - this.压力曲线.Size = new System.Drawing.Size(22, 21); + this.压力曲线.Size = new System.Drawing.Size(28, 27); this.压力曲线.TabIndex = 23; this.压力曲线.UseVisualStyleBackColor = true; // @@ -205,9 +205,9 @@ this.螺丝扭力.Anchor = System.Windows.Forms.AnchorStyles.None; this.螺丝扭力.AutoSize = true; this.螺丝扭力.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.螺丝扭力.Location = new System.Drawing.Point(856, 287); + this.螺丝扭力.Location = new System.Drawing.Point(933, 326); this.螺丝扭力.Name = "螺丝扭力"; - this.螺丝扭力.Size = new System.Drawing.Size(22, 21); + this.螺丝扭力.Size = new System.Drawing.Size(28, 27); this.螺丝扭力.TabIndex = 26; this.螺丝扭力.UseVisualStyleBackColor = true; // @@ -216,9 +216,9 @@ this.文件上传.Anchor = System.Windows.Forms.AnchorStyles.None; this.文件上传.AutoSize = true; this.文件上传.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.文件上传.Location = new System.Drawing.Point(856, 202); + this.文件上传.Location = new System.Drawing.Point(933, 229); this.文件上传.Name = "文件上传"; - this.文件上传.Size = new System.Drawing.Size(22, 21); + this.文件上传.Size = new System.Drawing.Size(28, 27); this.文件上传.TabIndex = 27; this.文件上传.UseVisualStyleBackColor = true; // @@ -226,9 +226,9 @@ // this.流程名称.Anchor = System.Windows.Forms.AnchorStyles.None; this.流程名称.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.流程名称.Location = new System.Drawing.Point(328, 108); + this.流程名称.Location = new System.Drawing.Point(358, 123); this.流程名称.Name = "流程名称"; - this.流程名称.Size = new System.Drawing.Size(211, 39); + this.流程名称.Size = new System.Drawing.Size(230, 44); this.流程名称.TabIndex = 16; // // 气密参数 @@ -236,9 +236,9 @@ this.气密参数.Anchor = System.Windows.Forms.AnchorStyles.None; this.气密参数.AutoSize = true; this.气密参数.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.气密参数.Location = new System.Drawing.Point(856, 627); + this.气密参数.Location = new System.Drawing.Point(933, 714); this.气密参数.Name = "气密参数"; - this.气密参数.Size = new System.Drawing.Size(22, 21); + this.气密参数.Size = new System.Drawing.Size(28, 27); this.气密参数.TabIndex = 22; this.气密参数.UseVisualStyleBackColor = true; // @@ -247,9 +247,9 @@ this.label6.Anchor = System.Windows.Forms.AnchorStyles.None; this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label6.Location = new System.Drawing.Point(126, 623); + this.label6.Location = new System.Drawing.Point(133, 711); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(180, 28); + this.label6.Size = new System.Drawing.Size(207, 33); this.label6.TabIndex = 5; this.label6.Text = "错误调用接口"; // @@ -258,9 +258,9 @@ this.label5.Anchor = System.Windows.Forms.AnchorStyles.None; this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(147, 538); + this.label5.Location = new System.Drawing.Point(157, 614); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(138, 28); + this.label5.Size = new System.Drawing.Size(159, 33); this.label5.TabIndex = 4; this.label5.Text = "错误PLC值"; // @@ -269,9 +269,9 @@ this.label4.Anchor = System.Windows.Forms.AnchorStyles.None; this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(126, 453); + this.label4.Location = new System.Drawing.Point(133, 517); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(180, 28); + this.label4.Size = new System.Drawing.Size(207, 33); this.label4.TabIndex = 3; this.label4.Text = "成功调用接口"; // @@ -280,9 +280,9 @@ this.label3.Anchor = System.Windows.Forms.AnchorStyles.None; this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label3.Location = new System.Drawing.Point(147, 368); + this.label3.Location = new System.Drawing.Point(157, 420); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(138, 28); + this.label3.Size = new System.Drawing.Size(159, 33); this.label3.TabIndex = 2; this.label3.Text = "期望PLC值"; // @@ -291,9 +291,9 @@ this.label2.Anchor = System.Windows.Forms.AnchorStyles.None; this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label2.Location = new System.Drawing.Point(182, 283); + this.label2.Location = new System.Drawing.Point(197, 323); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(68, 28); + this.label2.Size = new System.Drawing.Size(79, 33); this.label2.TabIndex = 1; this.label2.Text = "步骤"; // @@ -301,18 +301,18 @@ // this.期望PLC值.Anchor = System.Windows.Forms.AnchorStyles.None; this.期望PLC值.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.期望PLC值.Location = new System.Drawing.Point(328, 363); + this.期望PLC值.Location = new System.Drawing.Point(358, 414); this.期望PLC值.Name = "期望PLC值"; - this.期望PLC值.Size = new System.Drawing.Size(211, 39); + this.期望PLC值.Size = new System.Drawing.Size(230, 44); this.期望PLC值.TabIndex = 20; // // 步骤 // this.步骤.Anchor = System.Windows.Forms.AnchorStyles.None; this.步骤.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.步骤.Location = new System.Drawing.Point(328, 278); + this.步骤.Location = new System.Drawing.Point(358, 317); this.步骤.Name = "步骤"; - this.步骤.Size = new System.Drawing.Size(211, 39); + this.步骤.Size = new System.Drawing.Size(230, 44); this.步骤.TabIndex = 17; // // label7 @@ -320,9 +320,9 @@ this.label7.Anchor = System.Windows.Forms.AnchorStyles.None; this.label7.AutoSize = true; this.label7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label7.Location = new System.Drawing.Point(154, 198); + this.label7.Location = new System.Drawing.Point(165, 226); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(124, 28); + this.label7.Size = new System.Drawing.Size(143, 33); this.label7.TabIndex = 29; this.label7.Text = "流程编号"; // @@ -330,9 +330,9 @@ // this.流程编号.Anchor = System.Windows.Forms.AnchorStyles.None; this.流程编号.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.流程编号.Location = new System.Drawing.Point(328, 193); + this.流程编号.Location = new System.Drawing.Point(358, 220); this.流程编号.Name = "流程编号"; - this.流程编号.Size = new System.Drawing.Size(211, 39); + this.流程编号.Size = new System.Drawing.Size(230, 44); this.流程编号.TabIndex = 30; // // label11 @@ -340,9 +340,9 @@ this.label11.Anchor = System.Windows.Forms.AnchorStyles.None; this.label11.AutoSize = true; this.label11.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label11.Location = new System.Drawing.Point(588, 368); + this.label11.Location = new System.Drawing.Point(639, 420); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(124, 28); + this.label11.Size = new System.Drawing.Size(143, 33); this.label11.TabIndex = 10; this.label11.Text = "螺丝角度"; // @@ -351,9 +351,9 @@ this.螺丝角度.Anchor = System.Windows.Forms.AnchorStyles.None; this.螺丝角度.AutoSize = true; this.螺丝角度.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.螺丝角度.Location = new System.Drawing.Point(856, 372); + this.螺丝角度.Location = new System.Drawing.Point(933, 423); this.螺丝角度.Name = "螺丝角度"; - this.螺丝角度.Size = new System.Drawing.Size(22, 21); + this.螺丝角度.Size = new System.Drawing.Size(28, 27); this.螺丝角度.TabIndex = 24; this.螺丝角度.UseVisualStyleBackColor = true; // @@ -362,9 +362,9 @@ this.label12.Anchor = System.Windows.Forms.AnchorStyles.None; this.label12.AutoSize = true; this.label12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(588, 453); + this.label12.Location = new System.Drawing.Point(639, 517); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(124, 28); + this.label12.Size = new System.Drawing.Size(143, 33); this.label12.TabIndex = 11; this.label12.Text = "扭力曲线"; // @@ -373,9 +373,9 @@ this.扭力曲线.Anchor = System.Windows.Forms.AnchorStyles.None; this.扭力曲线.AutoSize = true; this.扭力曲线.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.扭力曲线.Location = new System.Drawing.Point(856, 457); + this.扭力曲线.Location = new System.Drawing.Point(933, 520); this.扭力曲线.Name = "扭力曲线"; - this.扭力曲线.Size = new System.Drawing.Size(22, 21); + this.扭力曲线.Size = new System.Drawing.Size(28, 27); this.扭力曲线.TabIndex = 25; this.扭力曲线.UseVisualStyleBackColor = true; // @@ -384,9 +384,9 @@ this.label13.Anchor = System.Windows.Forms.AnchorStyles.None; this.label13.AutoSize = true; this.label13.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label13.Location = new System.Drawing.Point(588, 538); + this.label13.Location = new System.Drawing.Point(639, 614); this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(124, 28); + this.label13.Size = new System.Drawing.Size(143, 33); this.label13.TabIndex = 12; this.label13.Text = "压力曲线"; // @@ -395,9 +395,9 @@ this.label14.Anchor = System.Windows.Forms.AnchorStyles.None; this.label14.AutoSize = true; this.label14.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label14.Location = new System.Drawing.Point(588, 623); + this.label14.Location = new System.Drawing.Point(639, 711); this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(124, 28); + this.label14.Size = new System.Drawing.Size(143, 33); this.label14.TabIndex = 13; this.label14.Text = "气密参数"; // @@ -406,9 +406,9 @@ this.扫码.Anchor = System.Windows.Forms.AnchorStyles.None; this.扫码.AutoSize = true; this.扫码.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.扫码.Location = new System.Drawing.Point(856, 117); + this.扫码.Location = new System.Drawing.Point(933, 132); this.扫码.Name = "扫码"; - this.扫码.Size = new System.Drawing.Size(22, 21); + this.扫码.Size = new System.Drawing.Size(28, 27); this.扫码.TabIndex = 28; this.扫码.UseVisualStyleBackColor = true; // @@ -416,9 +416,9 @@ // this.错误PLC值.Anchor = System.Windows.Forms.AnchorStyles.None; this.错误PLC值.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.错误PLC值.Location = new System.Drawing.Point(328, 533); + this.错误PLC值.Location = new System.Drawing.Point(358, 608); this.错误PLC值.Name = "错误PLC值"; - this.错误PLC值.Size = new System.Drawing.Size(211, 39); + this.错误PLC值.Size = new System.Drawing.Size(230, 44); this.错误PLC值.TabIndex = 18; // // 成功接口 @@ -426,9 +426,9 @@ this.成功接口.Anchor = System.Windows.Forms.AnchorStyles.None; this.成功接口.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.成功接口.FormattingEnabled = true; - this.成功接口.Location = new System.Drawing.Point(328, 453); + this.成功接口.Location = new System.Drawing.Point(358, 513); this.成功接口.Name = "成功接口"; - this.成功接口.Size = new System.Drawing.Size(211, 36); + this.成功接口.Size = new System.Drawing.Size(230, 41); this.成功接口.TabIndex = 31; // // 错误接口 @@ -436,19 +436,19 @@ this.错误接口.Anchor = System.Windows.Forms.AnchorStyles.None; this.错误接口.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.错误接口.FormattingEnabled = true; - this.错误接口.Location = new System.Drawing.Point(328, 623); + this.错误接口.Location = new System.Drawing.Point(358, 707); this.错误接口.Name = "错误接口"; - this.错误接口.Size = new System.Drawing.Size(211, 36); + this.错误接口.Size = new System.Drawing.Size(230, 41); this.错误接口.TabIndex = 32; // - // FLOW_Insert + // FLow_Insert // - this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 21F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1087, 854); + this.ClientSize = new System.Drawing.Size(1186, 976); this.Controls.Add(this.tableLayoutPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Name = "FLOW_Insert"; + this.Name = "FLow_Insert"; this.Text = "Form_Insert"; this.Load += new System.EventHandler(this.FLOW_Insert_Load); this.tableLayoutPanel1.ResumeLayout(false); diff --git a/WindowsFormsApp1/form/editForm/FLow_Insert.cs b/WindowsFormsApp1/form/editForm/FLow_Insert.cs index 912a07b..2032817 100644 --- a/WindowsFormsApp1/form/editForm/FLow_Insert.cs +++ b/WindowsFormsApp1/form/editForm/FLow_Insert.cs @@ -63,12 +63,13 @@ namespace WindowsFormsApp1.form t_Flow.errstatus = _错误PLC值; t_Flow.errinterfaceid = (int)错误接口.SelectedValue; t_Flow.scan = 扫码.Checked; - t_Flow.fileupload = 文件上传.Checked; + //t_Flow.fileupload = 文件上传.Checked; t_Flow.finaltorquevalue = 螺丝扭力.Checked; t_Flow.finalanglevaluue = 螺丝角度.Checked; t_Flow.finaltorquecurve = 扭力曲线.Checked; t_Flow.finalpressurecurve = 压力曲线.Checked; t_Flow.airtight = 气密参数.Checked; + t_Flow.dzscan = 文件上传.Checked; SQLiteHelper sQLiteHelper1 = new db.SQLiteHelper(); if (Operation == OperationType.Edit) @@ -145,7 +146,7 @@ namespace WindowsFormsApp1.form 错误PLC值.Text = DataToEdit.errstatus.ToString(); SelectItemByValue(错误接口, DataToEdit.errinterfaceid.ToString()); 扫码.Checked = DataToEdit.scan; - 文件上传.Checked = DataToEdit.fileupload; + 文件上传.Checked = DataToEdit.dzscan; 螺丝扭力.Checked = DataToEdit.finaltorquevalue; 螺丝角度.Checked = DataToEdit.finalanglevaluue; 扭力曲线.Checked = DataToEdit.finaltorquecurve; diff --git a/WindowsFormsApp1/mod/database/t_lineplc.cs b/WindowsFormsApp1/mod/database/t_lineplc.cs new file mode 100644 index 0000000..0539961 --- /dev/null +++ b/WindowsFormsApp1/mod/database/t_lineplc.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using SQLite; + +namespace WindowsFormsApp1.mod +{ + [Table("lineplc")] + public class t_lineplc + { + [PrimaryKey, AutoIncrement] + public int id { get; set; } + public int lineid { get; set; } + public int plcid { get; set; } + } +} diff --git a/WindowsFormsApp1/mod/server/otherdata.cs b/WindowsFormsApp1/mod/server/otherdata.cs index 70401c9..ff3be6a 100644 --- a/WindowsFormsApp1/mod/server/otherdata.cs +++ b/WindowsFormsApp1/mod/server/otherdata.cs @@ -23,6 +23,16 @@ namespace WindowsFormsApp1.mod.server /// public string FileUploadAddress { get; set; } + /// + /// 图片地址地址 + /// + public string ImageAddress { get; set; } + + /// + /// 视频地址 + /// + public string VedioAddress { get; set; } + /// /// 前端返回的扫码 /// diff --git a/WindowsFormsApp1/server/ApiClient.cs b/WindowsFormsApp1/server/ApiClient.cs index 12f5dad..7c5973e 100644 --- a/WindowsFormsApp1/server/ApiClient.cs +++ b/WindowsFormsApp1/server/ApiClient.cs @@ -34,6 +34,8 @@ namespace WindowsFormsApp1.server private readonly string _mold; private readonly string _token; private readonly string _fixsn; + private readonly string _logBasePath; + public ApiClient() { @@ -56,15 +58,62 @@ namespace WindowsFormsApp1.server _opID = Init.t_User.username; // 初始化 CsvLogger - CsvLogger.Initialize("D:/Logs/logs.csv"); + // 初始化日志路径 + _logBasePath = Path.Combine(@"D:\", "Logs", $"logs.csv"); - // 设置自定义表头 - //var customHeaders = new List { "SN", "值1", "消息", "异常" }; - //CsvLogger.SetHeaders(customHeaders); - //线别.Text = "线别:" + Init.t_Line.linename; - //段别.Text = "段别:" + Init.t_Line.linemode; - //机台编号.Text = "机台编号:" + Init.t_Line.linecode; - //操作人员ID.Text = "操作人员ID:" + Init.t_User.username; + // 初始化CSV日志记录器 + CsvLogger.Initialize(_logBasePath); + + // 根据站别设置不同的表头 + List headers = GetStationSpecificHeaders(); + CsvLogger.SetHeaders(headers); + } + + // 根据站别获取特定的表头 + private List GetStationSpecificHeaders() + { + // 基础表头,所有站别都需要的 + List headers = new List + { + "SN" + }; + + // 根据站别或产线代码添加特定表头 + var station = Init.t_Line.lineremark2.ToLower(); + switch (station) + { + case "wat": + headers.Add("充气压力"); + headers.Add("泄漏量"); + break; + case "potting": + case "thermalaste": + headers.Add("胶重"); + break; + case "vacuum": + headers.Add("腔体压力"); + headers.Add("保压时间"); + break; + case "sealant": + headers.Add("重量"); + headers.Add("宽度"); + break; + case "curing": + headers.Add("固化温度"); + headers.Add("固化时间"); + break; + } + if ("ScrewE,Assy2,Assy3,ScrewS,ScrewM,ScrewTC".ToLower().Contains(station)) + { + headers.Add("角度"); + headers.Add("扭矩"); + } + + if ("Assy2,Assy3,AOI,Assy5,Sealant,CCD,PrintLabel".ToLower().Contains(station)) + { + headers.Add("CCD"); + } + return headers; } // 通用API调用方法,减少代码重复 @@ -79,35 +128,8 @@ namespace WindowsFormsApp1.server // 调用接口 try { - // 测试 - //LogExecute.logNet.WriteDebug($"{eventName} 接口请求模拟测试成功\n请求:{jsonPayload}"); - - // 回写对应PLC - //if (statusCode > 0) - // PlcData.Write_Status = (short)statusCode; - //if (eventName == "SN_Release") - // PlcData.Write_stSN = "testsn"; - //if(eventName == "Glue_CheckOut") - //{ - // var station = Init.t_Line.lineremark2.ToLower(); - // switch (station) - // { - // case "potting"://灌胶 - // case "thermalpaste"://点胶&CCD检测 - // case "uvcoating"://三防漆涂覆 - // case "sealant"://点密封胶&CCD - // var power = Init.t_Keyvalues.First(x => x.key == "Power"); - // power.value = DateTime.Now.Millisecond.ToString(); - // SQLiteHelper kvHelper = new db.SQLiteHelper(); - // kvHelper.Update(power); - - // break; - // } - //} - //return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData, DateTime.Now); - #region MES交互 - + var response = _httpClient.PostAsync(url, httpContent).Result; // 检查响应状态码 if (response.IsSuccessStatusCode) @@ -162,8 +184,8 @@ namespace WindowsFormsApp1.server } } return result - ? ApiFormResult.Sucess(mesresult.PASS, false, res.Msg.Value, PlcData, DateTime.Now) - : ApiFormResult.Sucess(mesresult.FAIL, true, res.Msg.Value, PlcData, DateTime.Now); + ? ApiFormResult.Sucess(mesresult.PASS, true, res.Msg?.Value ?? "", PlcData, DateTime.Now) + : ApiFormResult.Sucess(mesresult.FAIL, true, res.Msg?.Value ?? "", PlcData, DateTime.Now); } else if (res.IsSuccess != null) // 打印 mes不返回result { @@ -172,7 +194,7 @@ namespace WindowsFormsApp1.server PlcData.Write_Status = (short)statusCode; return res.IsSuccess.Value == true ? ApiFormResult.Sucess(mesresult.PASS, true, res.Msg?.Value ?? "", PlcData, DateTime.Now) - : ApiFormResult.Sucess(mesresult.FAIL, false, res.Msg?.Value ?? "", PlcData, DateTime.Now); + : ApiFormResult.Sucess(mesresult.FAIL, true, res.Msg?.Value ?? "", PlcData, DateTime.Now); } } } @@ -180,19 +202,32 @@ namespace WindowsFormsApp1.server { throw new Exception($"请求失败,状态码:{response.StatusCode}"); } - - #endregion 测试不用 + + #endregion } catch (Exception ex) { LogExecute.logNet.WriteError($"{eventName} 接口请求失败: {ex.Message}"); - throw new Exception(ex.Message); + return ApiFormResult.Sucess(mesresult.PASS, true, "PASS", PlcData, DateTime.Now); + + //throw new Exception(ex.Message); } return ApiFormResult.Sucess(mesresult.PASS, false, "", PlcData, DateTime.Now); } public ApiFormResult SN_CheckIN(string url, plcdata PlcData, otherdata OtherData) { + // 换盘 老化上线 SN需要调用扫码的值 Init.Sn + var sn = ""; + var stationid = Init.t_Line.lineremark2.ToLower(); + if ("loadaging,exchange2,exchange1".Contains(stationid)) + { + sn = Init.SN; + } + else + { + sn = PlcData.Read_MaterialCode1; + } // 组装 request json var request = new { @@ -203,11 +238,10 @@ namespace WindowsFormsApp1.server OPID = _opID, Token = _token, FixSN = _fixsn, - SN = PlcData.Read_MaterialCode1, + SN = sn, CarrierID = "", SendTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") }; - // 1对4 有部分不需要 callapi todo return CallApi(url, request, "SN_CheckIN", PlcData, PLC_Status.SN_CheckIN); } @@ -273,7 +307,7 @@ namespace WindowsFormsApp1.server OPID = _opID, Token = _token, FixSN = _fixsn, - SN = OtherData.JS_SN??"test",//扫码 + SN = OtherData.JS_SN ?? "",//扫码 SendTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") }; @@ -343,7 +377,7 @@ namespace WindowsFormsApp1.server Token = _token, FixSN = _fixsn, SN = Init.ScanString, - CarrierID = PlcData.Read_MaterialCode1, + //CarrierID = PlcData.Read_MaterialCode1, SendTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") }; // 特殊处理:需要设置Write_stSN @@ -376,7 +410,7 @@ namespace WindowsFormsApp1.server locationindex = OtherData.locationindex; break; } - + var request = new { EventID = "Glue_CheckOut", @@ -425,7 +459,7 @@ namespace WindowsFormsApp1.server if (station == "vacuum") { // 抽真空 - foreach(var val in OtherData.FinalPressureCurve.Where(x => x > 0)) + foreach (var val in OtherData.FinalPressureCurve.Where(x => x > 0)) { request.DC_INFO.Add(new DCInfoItem { @@ -490,16 +524,20 @@ namespace WindowsFormsApp1.server var time = DateTime.Now.ToString("HHmmss"); var result = PlcData.Read_Result == 1 ? "OK" : "NG"; - OtherData.FileUploadAddress = @"W:\\"; - var sourceDirectory = @"D:\\"; var targetDirectory = $"{OtherData.FileUploadAddress}{_line.Substring(0, 2)}\\{month}\\{day}\\Line{_line.Substring(_line.Length - 2)}\\{_stationID}\\{_machineID}\\{result}"; var fileName = ""; try { - string[] sourceFolders = OtherData.FileUploadAddress.Split(';'); // 使用分号分隔多个源文件夹 - string targetFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UploadFiles"); + string[] sourceFolders = new string[] { + OtherData.ImageAddress, + OtherData.VedioAddress + }; + // 使用分号分隔多个源文件夹 + string targetFolder = targetDirectory; List fileList = new List(); + + //从数据库读 未上传的 todo string snNumber = PlcData.Read_MaterialCode0; if (string.IsNullOrEmpty(snNumber)) @@ -513,23 +551,45 @@ namespace WindowsFormsApp1.server Directory.CreateDirectory(targetFolder); } - foreach (string sourceFolder in sourceFolders) + foreach (string sourceFolder1 in sourceFolders) { + if (string.IsNullOrEmpty(sourceFolder1)) + { + continue; + } + string sourceFolder = sourceFolders[0]; + if (sourceFolder == sourceFolder1) + { + // 图片 + // 组装路径 可能需要从数据库读 result和sn和日期 + sourceFolder = Path.Combine(sourceFolder, DateTime.Now.ToString("yyyyMMdd"), "DCDC", result); + } + else + { + // 视频 + } if (Directory.Exists(sourceFolder.Trim())) { string[] files = Directory.GetFiles(sourceFolder.Trim()); + int num = 1; + var extensionstr = ""; foreach (string file in files) { string fileName1 = Path.GetFileName(file); + string filePath = ""; if (!fileName1.Contains(snNumber)) { continue; } - - string targetPath = Path.Combine(targetFolder, fileName); - File.Copy(file, targetPath, true); + extensionstr = Path.GetExtension(file); + fileName = $"{month}{day}_{_stationID}_{result}_{PlcData.Read_MaterialCode0}_{monthDay}_{time}_{_machineID}_01_Original{num}{extensionstr}"; + filePath = Path.Combine(sourceFolder, fileName1); + //string targetPath = Path.Combine(targetFolder, fileName); + //File.Copy(file, targetPath, true); + CopyFileToDirectory(filePath, targetFolder, fileName); fileList.Add(fileName); - LogExecute.logNet.WriteDebug($"文件 {fileName} 已从 {sourceFolder.Trim()} 复制到 {targetPath}"); + num++; + LogExecute.logNet.WriteDebug($"文件 {fileName} 已从 {sourceFolder.Trim()} 复制到 {targetFolder}"); } } else @@ -541,6 +601,7 @@ namespace WindowsFormsApp1.server if (fileList.Count == 0) { LogExecute.logNet.WriteDebug($"在所有源文件夹中未找到包含SN号 {snNumber} 的文件"); + return ApiFormResult.Error(mesresult.FAIL, false, "", PlcData, DateTime.Now); } // 组装 request json @@ -554,10 +615,10 @@ namespace WindowsFormsApp1.server { new { - SN = OtherData.JS_SN, + SN = PlcData.Read_MaterialCode0, FileInfo = fileList.Select(x => new { - FileName = fileName, + FileName = x, FilePath = targetFolder }).ToList() } @@ -722,14 +783,25 @@ namespace WindowsFormsApp1.server Value = Init.airtight.Leak_Value ?? "0", Result = result }); - CsvLogger.Log($"{PlcData.Read_MaterialCode0},{Init.airtight.Airtight_Value},{Init.airtight.Leak_Value},{DateTime.Now}"); + CsvLogger.Log($"{PlcData.Read_MaterialCode0},{Init.airtight.Airtight_Value},{Init.airtight.Leak_Value}"); } //扭力,角度 - if ("ScrewE,Assy2,Assy3,ScrewS,ScrewM".Contains(stationid)) + if ("ScrewE,Assy2,Assy3,ScrewS,ScrewM,ScrewTC".Contains(stationid)) { + var count = OtherData.FinalAngleValue.Count(x => x > 0); + for(int i = 0; i < count; i++) + { + if ("Assy2,Assy3".Contains(stationid)) + { + CsvLogger.Log($"{PlcData.Read_MaterialCode0},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]},{PlcData.Read_UploadData0.ToString()}"); + } + else + { + CsvLogger.Log($"{PlcData.Read_MaterialCode0},{OtherData.FinalAngleValue[i]},{OtherData.FinalTorqueValue[i]}"); + } + } + var AngleCount = 1; - OtherData.FinalAngleValue[0] = (float)12.8888; - OtherData.FinalAngleValue[1] = (float)11.9999; foreach (var item in OtherData.FinalAngleValue.Where(x => x > 0)) { //角度 @@ -739,13 +811,9 @@ namespace WindowsFormsApp1.server dcInfo.Result = result; sninfo.DC_INFO.Add(dcInfo); - LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}"); - AngleCount++; } var TorqueCount = 1; - OtherData.FinalTorqueValue[0] = (float)120; - OtherData.FinalTorqueValue[1] = (float)110; foreach (var item in OtherData.FinalTorqueValue.Where(x => x > 0)) { //扭力 @@ -755,41 +823,45 @@ namespace WindowsFormsApp1.server dcInfo.Result = result; sninfo.DC_INFO.Add(dcInfo); - LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}"); - TorqueCount++; } } - + //CCD if ("Assy2,Assy3,AOI,Assy5,Sealant,CCD,PrintLabel".Contains(stationid)) { dcInfo = new DCInfoItem(); - dcInfo.Item = stationid == "CCD"? "CCD" : $"{Init.t_Line.lineremark2}_CCD"; + dcInfo.Item = stationid == "CCD" ? "CCD" : $"{Init.t_Line.lineremark2}_CCD"; dcInfo.Value = PlcData.Read_UploadData0.ToString(); dcInfo.Result = result; sninfo.DC_INFO.Add(dcInfo); - - LogExecute.SNlogNet.WriteDebug($"追溯码:{PlcData.Read_MaterialCode0},检测结果:{logresult}"); + if (!"Assy2,Assy3".Contains(stationid)) + { + CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()}"); + } + //LogExecute.SNlogNet.WriteDebug($"追溯码:{PlcData.Read_MaterialCode0},检测结果:{logresult}"); } //抽真空 压力 if ("Vacuum".Contains(stationid)) { + var str = ""; var Chamber_Pressure = OtherData.FinalPressureCurve.First(); dcInfo = new DCInfoItem(); dcInfo.Item = $"Chamber_Pressure"; dcInfo.Value = Chamber_Pressure.ToString(); dcInfo.Result = result; - LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}"); - sninfo.DC_INFO.Add(dcInfo); + str += $"{PlcData.Read_MaterialCode0},{dcInfo.Value}"; + dcInfo = new DCInfoItem(); dcInfo.Item = $"Hold_Time"; - dcInfo.Value = PlcData.Read_Other0.ToString(); + dcInfo.Value = PlcData.Read_Other0.ToString() ?? "0"; dcInfo.Result = result; - LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}"); + sninfo.DC_INFO.Add(dcInfo); + str += $",{dcInfo.Value},"; + CsvLogger.Log(str); } //固化 时间 if ("Curing".Contains(stationid)) @@ -799,7 +871,7 @@ namespace WindowsFormsApp1.server if (material.Success) { // 计算加热时间 - var time = ((TimeSpan)(material.Data.checkin2 - material.Data.checkout1)).TotalMilliseconds; + var time = ((TimeSpan)(material.Data.checkin2 - material.Data.checkout1)).TotalMinutes; var jrTime = Convert.ToInt32(time).ToString(); sninfo.DC_INFO.Add(new DCInfoItem { @@ -815,7 +887,7 @@ namespace WindowsFormsApp1.server Down = "75", Result = result }); - + CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()},{jrTime}"); } else { @@ -823,22 +895,32 @@ namespace WindowsFormsApp1.server } } //胶重 - if ("Potting,ThermalPaste,Sealant".Contains(stationid)) + if ("Potting,ThermalPaste".Contains(stationid)) { + dcInfo = new DCInfoItem(); dcInfo.Item = $"{stationid}_Weight"; dcInfo.Value = PlcData.Read_UploadData0.ToString(); dcInfo.Result = result; - LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}"); + //LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}"); + CsvLogger.Log($"{PlcData.Read_MaterialCode0},{dcInfo.Value}"); sninfo.DC_INFO.Add(dcInfo); } - //胶宽 + //胶重 胶宽 if ("Sealant".Contains(stationid)) { + dcInfo = new DCInfoItem(); + dcInfo.Item = $"{stationid}_Weight"; + dcInfo.Value = PlcData.Read_UploadData0.ToString(); + dcInfo.Result = result; + + sninfo.DC_INFO.Add(dcInfo); + + dcInfo = new DCInfoItem(); dcInfo.Item = $"{stationid}_Width"; dcInfo.Value = PlcData.Read_UploadData1.ToString(); dcInfo.Result = result; - LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},{dcInfo.Item},{dcInfo.Value}"); + CsvLogger.Log($"{PlcData.Read_MaterialCode0},{PlcData.Read_UploadData0.ToString()},{PlcData.Read_UploadData1.ToString()}"); sninfo.DC_INFO.Add(dcInfo); } @@ -854,7 +936,6 @@ namespace WindowsFormsApp1.server sninfo.CompList.Add(compListItem); } - //LogExecute.SNlogNet.WriteDebug($"{PlcData.Read_MaterialCode0},胶水码:{OtherData.JS_SN},胶重:{PlcData.Read_UploadData0}"); } else //其他不传 { diff --git a/WindowsFormsApp1/server/CsvHelper.cs b/WindowsFormsApp1/server/CsvHelper.cs index bfe6627..da2c2a1 100644 --- a/WindowsFormsApp1/server/CsvHelper.cs +++ b/WindowsFormsApp1/server/CsvHelper.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Text; namespace WindowsFormsApp1 { @@ -20,16 +21,33 @@ namespace WindowsFormsApp1 { private static string _baseFilePath; private static List _customHeaders = new List(); + private static readonly object _lockObj = new object(); // 添加锁对象用于线程安全 + private static bool _initialized = false; public static void Initialize(string baseFilePath) { + if (string.IsNullOrEmpty(baseFilePath)) + throw new ArgumentNullException(nameof(baseFilePath), "日志文件路径不能为空"); + _baseFilePath = baseFilePath; + _initialized = true; + + // 确保目录存在 + string directory = Path.GetDirectoryName(baseFilePath); + if (!Directory.Exists(directory)) + Directory.CreateDirectory(directory); } // 设置自定义表头 public static void SetHeaders(List headers) { - _customHeaders = headers; + if (headers == null) + throw new ArgumentNullException(nameof(headers)); + + lock (_lockObj) + { + _customHeaders = new List(headers); // 创建副本 + } } private static string GetCurrentLogFilePath() @@ -37,48 +55,60 @@ namespace WindowsFormsApp1 var date = DateTime.Now.ToString("yyyy-MM-dd"); var fileExtension = Path.GetExtension(_baseFilePath); var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(_baseFilePath); - if (!Directory.Exists(Path.GetDirectoryName(_baseFilePath))) - { - Directory.CreateDirectory(Path.GetDirectoryName(_baseFilePath)); - } return $"{Path.GetDirectoryName(_baseFilePath)}/{fileNameWithoutExtension}_{date}{fileExtension}"; } public static void Log(string csvFormattedString) { - var filePath = GetCurrentLogFilePath(); - // 检查文件是否存在,如果不存在则创建并写入表头 - if (!File.Exists(filePath)) + if (!_initialized) + throw new InvalidOperationException("CsvLogger 未初始化,请先调用 Initialize 方法"); + + lock (_lockObj) { - using (var writer = new StreamWriter(filePath)) - using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + try { - if (_customHeaders.Count > 0) + var filePath = GetCurrentLogFilePath(); + bool fileExists = File.Exists(filePath); + + // 如果文件不存在,先写入表头 + if (!fileExists) { - foreach (var header in _customHeaders) + using (var writer = new StreamWriter(filePath, false, Encoding.UTF8)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) { - csv.WriteField(header); + if (_customHeaders.Count > 0) + { + foreach (var header in _customHeaders) + { + csv.WriteField(header); + } + csv.NextRecord(); + } + else + { + csv.WriteHeader(); + csv.NextRecord(); + } + } + } + + // 直接写入日志,不使用队列 + using (var writer = new StreamWriter(filePath, true, Encoding.UTF8)) + using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + { + var fields = csvFormattedString.Split(','); + foreach (var field in fields) + { + csv.WriteField(field); } csv.NextRecord(); } - else - { - csv.WriteHeader(); - csv.NextRecord(); - } } - } - - // 追加日志条目到文件 - using (var writer = new StreamWriter(filePath, true)) - using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) - { - var fields = csvFormattedString.Split(','); - foreach (var field in fields) + catch (Exception ex) { - csv.WriteField(field); + // 记录错误,但不抛出异常 + Console.WriteLine($"写入日志文件时出错: {ex.Message}"); } - csv.NextRecord(); } } }