From 5301b9f103e45cd8f1451cd78448377efabcc452 Mon Sep 17 00:00:00 2001 From: "GukSang.Jin" Date: Tue, 27 Jan 2026 09:29:23 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 全自动水压检测仪/DATA/DatabaseInitializer.cs | 10 +++++----- 全自动水压检测仪/DATA/LoginDebugHelper.cs | 8 ++++---- 全自动水压检测仪/Program.cs | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/全自动水压检测仪/DATA/DatabaseInitializer.cs b/全自动水压检测仪/DATA/DatabaseInitializer.cs index 0910757..c792123 100644 --- a/全自动水压检测仪/DATA/DatabaseInitializer.cs +++ b/全自动水压检测仪/DATA/DatabaseInitializer.cs @@ -41,12 +41,12 @@ namespace 全自动水压检测仪.DATA try { // 删除现有的默认用户 - connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'cgx')"); + connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'csi')"); Debug.WriteLine("已删除现有默认用户"); // 重新创建 CreateUserIfNotExists(connection, "admin", "admin123", 1); - CreateUserIfNotExists(connection, "cgx", "123", 0); + CreateUserIfNotExists(connection, "csi", "123456", 0); Debug.WriteLine("默认用户重置完成!"); } @@ -119,9 +119,9 @@ namespace 全自动水压检测仪.DATA // 创建默认管理员账户 admin / admin123 CreateUserIfNotExists(connection, "admin", "admin123", 1); - - // 创建默认普通用户账户 cgx / 123 - CreateUserIfNotExists(connection, "cgx", "123", 0); + + // 创建默认普通用户账户 csi / 123456 + CreateUserIfNotExists(connection, "csi", "123456", 0); } catch (Exception ex) { diff --git a/全自动水压检测仪/DATA/LoginDebugHelper.cs b/全自动水压检测仪/DATA/LoginDebugHelper.cs index 8ed3ed2..6bce43f 100644 --- a/全自动水压检测仪/DATA/LoginDebugHelper.cs +++ b/全自动水压检测仪/DATA/LoginDebugHelper.cs @@ -87,7 +87,7 @@ namespace 全自动水压检测仪.DATA connection.Open(); // 删除现有用户 - connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'cgx')"); + connection.Execute("DELETE FROM sys_users WHERE username IN ('admin', 'csi')"); Debug.WriteLine("已删除现有默认用户"); // 重新创建 admin @@ -101,12 +101,12 @@ namespace 全自动水压检测仪.DATA // 重新创建 cgx string salt2 = PasswordHelper.GenerateSalt(); - string hash2 = PasswordHelper.HashPassword("123", salt2); + string hash2 = PasswordHelper.HashPassword("123456", salt2); connection.Execute(@" INSERT INTO sys_users (username, password_hash, salt, user_role, status, create_time) VALUES (@username, @hash, @salt, @role, 1, NOW())", - new { username = "cgx", hash = hash2, salt = salt2, role = 0 }); - Debug.WriteLine("✓ 创建普通用户: cgx / 123"); + new { username = "csi", hash = hash2, salt = salt2, role = 0 }); + Debug.WriteLine("✓ 创建普通用户: csi / 123456"); Debug.WriteLine("默认用户重置完成!"); } diff --git a/全自动水压检测仪/Program.cs b/全自动水压检测仪/Program.cs index 063cbc2..b64b38e 100644 --- a/全自动水压检测仪/Program.cs +++ b/全自动水压检测仪/Program.cs @@ -35,7 +35,7 @@ namespace 全自动水压检测仪 if (forceReset) { var result = MessageBox.Show( - "确定要重置默认用户吗?\n\n这将删除并重新创建:\n• admin / admin123 (管理员)\n• cgx / 123 (普通用户)\n\n其他用户不受影响。", + "确定要重置默认用户吗?\n\n这将删除并重新创建:\n• admin / admin123 (管理员)\n• csi / 123456 (普通用户)\n\n其他用户不受影响。", "重置默认用户", MessageBoxButtons.YesNo, MessageBoxIcon.Question); @@ -44,7 +44,7 @@ namespace 全自动水压检测仪 { DatabaseInitializer.Initialize(); DatabaseInitializer.ForceResetDefaultUsers(); - MessageBox.Show("默认用户已重置!\n\n管理员: admin / admin123\n普通用户: cgx / 123", + MessageBox.Show("默认用户已重置!\n\n管理员: admin / admin123\n普通用户: csi / 123456", "重置成功", MessageBoxButtons.OK, MessageBoxIcon.Information); } return; @@ -101,7 +101,7 @@ namespace 全自动水压检测仪 // 检查默认用户 var adminUser = userRepo.GetUserByUsername("admin"); - var cgxUser = userRepo.GetUserByUsername("cgx"); + var csiUser = userRepo.GetUserByUsername("csi"); bool needsReset = false; @@ -144,11 +144,11 @@ namespace 全自动水压检测仪 } // 检查 cgx 用户 - if (cgxUser != null) + if (csiUser != null) { - string storedPassword = cgxUser.PasswordHash ?? ""; + string storedPassword = csiUser.PasswordHash ?? ""; - System.Diagnostics.Debug.WriteLine($"\n检查 cgx 用户:"); + System.Diagnostics.Debug.WriteLine($"\n检查 csi 用户:"); System.Diagnostics.Debug.WriteLine($" 当前密码值: '{storedPassword}'"); System.Diagnostics.Debug.WriteLine($" 密码长度: {storedPassword.Length}"); @@ -174,7 +174,7 @@ namespace 全自动水压检测仪 } else { - System.Diagnostics.Debug.WriteLine($"\ncgx 用户不存在"); + System.Diagnostics.Debug.WriteLine($"\ncsi 用户不存在"); needsReset = true; } @@ -184,7 +184,7 @@ namespace 全自动水压检测仪 DatabaseInitializer.ForceResetDefaultUsers(); System.Diagnostics.Debug.WriteLine("密码数据已修复!"); System.Diagnostics.Debug.WriteLine(" admin 密码: admin123"); - System.Diagnostics.Debug.WriteLine(" cgx 密码: 123"); + System.Diagnostics.Debug.WriteLine(" csi 密码: 123456"); } else { From 3e2f90dfbe78c0447c235b0e2b4114fbc78901ba Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 13:39:10 +0800 Subject: [PATCH 2/9] --- .../NormalTemperatureMode.Designer.cs | 73 ++++--- 全自动水压检测仪/NormalTemperatureMode.cs | 18 ++ 全自动水压检测仪/Program.cs | 35 +-- 全自动水压检测仪/ScanImport.Designer.cs | 201 ++++++++++-------- 全自动水压检测仪/ScanImport.cs | 8 + 5 files changed, 205 insertions(+), 130 deletions(-) diff --git a/全自动水压检测仪/NormalTemperatureMode.Designer.cs b/全自动水压检测仪/NormalTemperatureMode.Designer.cs index 3b7131f..d7ddef9 100644 --- a/全自动水压检测仪/NormalTemperatureMode.Designer.cs +++ b/全自动水压检测仪/NormalTemperatureMode.Designer.cs @@ -33,10 +33,13 @@ namespace 全自动水压检测仪 this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel(); this.uiTableLayoutPanel2 = new Sunny.UI.UITableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); + this.uiButton9 = new Sunny.UI.UIButton(); this.uiButton4 = new Sunny.UI.UIButton(); this.uiPanel29 = new Sunny.UI.UIPanel(); this.uiTableLayoutPanel15 = new Sunny.UI.UITableLayoutPanel(); this.uiPanel30 = new Sunny.UI.UIPanel(); + this.uiLabel25 = new Sunny.UI.UILabel(); + this.uiLabel11 = new Sunny.UI.UILabel(); this.uiSwitch1 = new Sunny.UI.UISwitch(); this.uiPanel7 = new Sunny.UI.UIPanel(); this.uiTableLayoutPanel4 = new Sunny.UI.UITableLayoutPanel(); @@ -160,8 +163,6 @@ namespace 全自动水压检测仪 this.uiPanel2 = new Sunny.UI.UIPanel(); this.uiLabel1 = new Sunny.UI.UILabel(); this.uiLight1 = new Sunny.UI.UILight(); - this.uiLabel11 = new Sunny.UI.UILabel(); - this.uiLabel25 = new Sunny.UI.UILabel(); this.uiTableLayoutPanel1.SuspendLayout(); this.uiTableLayoutPanel2.SuspendLayout(); this.panel1.SuspendLayout(); @@ -255,6 +256,7 @@ namespace 全自动水压检测仪 // // panel1 // + this.panel1.Controls.Add(this.uiButton9); this.panel1.Controls.Add(this.uiButton4); this.panel1.Controls.Add(this.uiPanel29); this.panel1.Controls.Add(this.uiPanel7); @@ -265,6 +267,22 @@ namespace 全自动水压检测仪 this.panel1.Size = new System.Drawing.Size(188, 598); this.panel1.TabIndex = 0; // + // uiButton9 + // + this.uiButton9.Cursor = System.Windows.Forms.Cursors.Hand; + this.uiButton9.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(130)))), ((int)(((byte)(240))))); + this.uiButton9.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255))))); + this.uiButton9.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220))))); + this.uiButton9.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiButton9.Location = new System.Drawing.Point(107, 535); + this.uiButton9.MinimumSize = new System.Drawing.Size(1, 1); + this.uiButton9.Name = "uiButton9"; + this.uiButton9.Size = new System.Drawing.Size(75, 55); + this.uiButton9.TabIndex = 4; + this.uiButton9.Text = "退出"; + this.uiButton9.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiButton9.Click += new System.EventHandler(this.uiButton9_Click); + // // uiButton4 // this.uiButton4.Cursor = System.Windows.Forms.Cursors.Hand; @@ -272,10 +290,10 @@ namespace 全自动水压检测仪 this.uiButton4.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255))))); this.uiButton4.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220))))); this.uiButton4.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiButton4.Location = new System.Drawing.Point(46, 534); + this.uiButton4.Location = new System.Drawing.Point(11, 535); this.uiButton4.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton4.Name = "uiButton4"; - this.uiButton4.Size = new System.Drawing.Size(100, 55); + this.uiButton4.Size = new System.Drawing.Size(88, 55); this.uiButton4.TabIndex = 3; this.uiButton4.Text = "水箱加热"; this.uiButton4.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); @@ -329,8 +347,30 @@ namespace 全自动水压检测仪 this.uiPanel30.RectColor = System.Drawing.Color.White; this.uiPanel30.Size = new System.Drawing.Size(154, 47); this.uiPanel30.TabIndex = 0; + this.uiPanel30.Text = null; this.uiPanel30.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; // + // uiLabel25 + // + this.uiLabel25.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiLabel25.ForeColor = System.Drawing.Color.Red; + this.uiLabel25.Location = new System.Drawing.Point(2, 0); + this.uiLabel25.Name = "uiLabel25"; + this.uiLabel25.Size = new System.Drawing.Size(50, 47); + this.uiLabel25.TabIndex = 1; + this.uiLabel25.Text = "请切换模式"; + this.uiLabel25.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // uiLabel11 + // + this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + this.uiLabel11.Location = new System.Drawing.Point(69, -1); + this.uiLabel11.Name = "uiLabel11"; + this.uiLabel11.Size = new System.Drawing.Size(86, 47); + this.uiLabel11.TabIndex = 0; + this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // uiSwitch1 // this.uiSwitch1.ActiveColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(80)))), ((int)(((byte)(80))))); @@ -1692,7 +1732,7 @@ namespace 全自动水压检测仪 // this.uiButton8.Cursor = System.Windows.Forms.Cursors.Hand; this.uiButton8.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiButton8.Location = new System.Drawing.Point(426, 126); + this.uiButton8.Location = new System.Drawing.Point(426, 122); this.uiButton8.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton8.Name = "uiButton8"; this.uiButton8.Size = new System.Drawing.Size(58, 33); @@ -2138,7 +2178,6 @@ namespace 全自动水压检测仪 this.uiLabel3.Name = "uiLabel3"; this.uiLabel3.Size = new System.Drawing.Size(108, 30); this.uiLabel3.TabIndex = 1; - this.uiLabel3.Text = "0"; this.uiLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // uiLabel2 @@ -2199,27 +2238,6 @@ namespace 全自动水压检测仪 this.uiLight1.TabIndex = 1; this.uiLight1.Text = "uiLight1"; // - // uiLabel11 - // - this.uiLabel11.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiLabel11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel11.Location = new System.Drawing.Point(69, -1); - this.uiLabel11.Name = "uiLabel11"; - this.uiLabel11.Size = new System.Drawing.Size(86, 47); - this.uiLabel11.TabIndex = 0; - this.uiLabel11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // uiLabel25 - // - this.uiLabel25.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiLabel25.ForeColor = System.Drawing.Color.Red; - this.uiLabel25.Location = new System.Drawing.Point(2, 0); - this.uiLabel25.Name = "uiLabel25"; - this.uiLabel25.Size = new System.Drawing.Size(50, 47); - this.uiLabel25.TabIndex = 1; - this.uiLabel25.Text = "请切换模式"; - this.uiLabel25.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // // NormalTemperatureMode // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -2425,6 +2443,7 @@ namespace 全自动水压检测仪 private Sunny.UI.UIButton uiButton8; private Sunny.UI.UILabel uiLabel11; private Sunny.UI.UILabel uiLabel25; + private Sunny.UI.UIButton uiButton9; } } diff --git a/全自动水压检测仪/NormalTemperatureMode.cs b/全自动水压检测仪/NormalTemperatureMode.cs index 333b51c..795730c 100644 --- a/全自动水压检测仪/NormalTemperatureMode.cs +++ b/全自动水压检测仪/NormalTemperatureMode.cs @@ -1203,5 +1203,23 @@ namespace 全自动水压检测仪 return registers; } + + public event EventHandler ReturnToLoginRequested; + //返回登录 + private void uiButton9_Click(object sender, EventArgs e) + { + // 停止所有操作 + _readTimer?.Stop(); + _readTimerTwo?.Stop(); + + // 释放资源 + ModbusResourceManager.Instance?.Dispose(); + + // 直接重新启动应用程序 + Application.Restart(); + + // 关闭当前窗口 + Environment.Exit(0); + } } } \ No newline at end of file diff --git a/全自动水压检测仪/Program.cs b/全自动水压检测仪/Program.cs index 063cbc2..69b7b2d 100644 --- a/全自动水压检测仪/Program.cs +++ b/全自动水压检测仪/Program.cs @@ -64,31 +64,34 @@ namespace 全自动水压检测仪 } catch (Exception ex) { - MessageBox.Show($"数据库初始化失败:{ex.Message}\n\n请检查:\n1. MySQL服务是否启动\n2. 数据库连接配置是否正确\n3. 数据库 fullautowaterpressure 是否存在\n\n应用程序将退出。", + MessageBox.Show($"数据库初始化失败:{ex.Message}\n\n请检查:\n1. MySQL服务是否启动\n2. 数据库连接配置是否正确\n3. 数据库 fullautowaterpressure 是否存在\n\n应用程序将退出。", "初始化错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - // 显示登录窗体 - using (var loginForm = new LoginForm()) - { - if (loginForm.ShowDialog() == DialogResult.OK) + // 显示登录窗体 + using (var loginForm = new LoginForm()) { - // 登录成功,根据用户权限显示对应窗体 - if (LoginData.IsAdmin()) + if (loginForm.ShowDialog() == DialogResult.OK) { - // 管理员登录,显示 ScanImport 页面 - Application.Run(new ScanImport()); - } - else - { - // 普通用户登录,显示 NormalTemperatureMode 页面 - Application.Run(new NormalTemperatureMode()); + // 登录成功,根据用户权限显示对应窗体 + if (LoginData.IsAdmin()) + { + // 管理员登录,显示 ScanImport 页面 + Application.Run(new ScanImport()); + } + else + { + + // 普通用户登录,显示 NormalTemperatureMode 页面 + Application.Run(new NormalTemperatureMode()); + + } } + // 登录失败或取消,直接退出 } - // 登录失败或取消,直接退出 } - } + /// /// 检查并修复损坏的密码数据 diff --git a/全自动水压检测仪/ScanImport.Designer.cs b/全自动水压检测仪/ScanImport.Designer.cs index ad4bb72..bf2b9a3 100644 --- a/全自动水压检测仪/ScanImport.Designer.cs +++ b/全自动水压检测仪/ScanImport.Designer.cs @@ -35,6 +35,15 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); this.save = new Sunny.UI.UIButton(); this.uiDataGridView1 = new Sunny.UI.UIDataGridView(); + this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.SerialNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uiTextBox2 = new Sunny.UI.UITextBox(); this.uiLabel48 = new Sunny.UI.UILabel(); this.uiTextBox9 = new Sunny.UI.UITextBox(); @@ -50,17 +59,9 @@ this.uiButton2 = new Sunny.UI.UIButton(); this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel(); this.uiPanel3 = new Sunny.UI.UIPanel(); + this.uiButton3 = new Sunny.UI.UIButton(); this.uiPanel2 = new Sunny.UI.UIPanel(); this.uiPanel1 = new Sunny.UI.UIPanel(); - this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.SerialNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).BeginInit(); this.uiTableLayoutPanel1.SuspendLayout(); this.uiPanel3.SuspendLayout(); @@ -132,6 +133,7 @@ this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); this.uiDataGridView1.Location = new System.Drawing.Point(0, 0); this.uiDataGridView1.Name = "uiDataGridView1"; + this.uiDataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 10.5F); @@ -156,6 +158,86 @@ this.uiDataGridView1.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.uiDataGridView1_RowsAdded); this.uiDataGridView1.RowsRemoved += new System.Windows.Forms.DataGridViewRowsRemovedEventHandler(this.uiDataGridView1_RowsRemoved); // + // Column1 + // + this.Column1.DataPropertyName = "Id"; + this.Column1.HeaderText = "编号"; + this.Column1.MinimumWidth = 6; + this.Column1.Name = "Column1"; + this.Column1.ReadOnly = true; + this.Column1.Width = 75; + // + // SerialNumber + // + this.SerialNumber.HeaderText = "序号"; + this.SerialNumber.MinimumWidth = 8; + this.SerialNumber.Name = "SerialNumber"; + this.SerialNumber.ReadOnly = true; + this.SerialNumber.Width = 75; + // + // Column2 + // + this.Column2.DataPropertyName = "barcode"; + this.Column2.HeaderText = "条码"; + this.Column2.MinimumWidth = 6; + this.Column2.Name = "Column2"; + this.Column2.ReadOnly = true; + this.Column2.Width = 200; + // + // Column3 + // + this.Column3.DataPropertyName = "diffpressure"; + this.Column3.HeaderText = "压力(PSI)"; + this.Column3.MinimumWidth = 6; + this.Column3.Name = "Column3"; + this.Column3.ReadOnly = true; + this.Column3.Width = 150; + // + // Column4 + // + this.Column4.DataPropertyName = "temperature"; + this.Column4.HeaderText = "出口温度(℃)"; + this.Column4.MinimumWidth = 6; + this.Column4.Name = "Column4"; + this.Column4.ReadOnly = true; + this.Column4.Width = 110; + // + // Column7 + // + this.Column7.DataPropertyName = "temperature"; + this.Column7.HeaderText = "温度(℃)"; + this.Column7.MinimumWidth = 6; + this.Column7.Name = "Column7"; + this.Column7.ReadOnly = true; + this.Column7.Width = 150; + // + // Column5 + // + this.Column5.DataPropertyName = "dwelltime"; + this.Column5.HeaderText = "保压时间(h)"; + this.Column5.MinimumWidth = 6; + this.Column5.Name = "Column5"; + this.Column5.ReadOnly = true; + this.Column5.Width = 110; + // + // Column8 + // + this.Column8.DataPropertyName = "TemperatureMode"; + this.Column8.HeaderText = "温度模式"; + this.Column8.MinimumWidth = 8; + this.Column8.Name = "Column8"; + this.Column8.ReadOnly = true; + this.Column8.Width = 110; + // + // Column6 + // + this.Column6.DataPropertyName = "CreateTime"; + this.Column6.HeaderText = "录入时间"; + this.Column6.MinimumWidth = 6; + this.Column6.Name = "Column6"; + this.Column6.ReadOnly = true; + this.Column6.Width = 150; + // // uiTextBox2 // this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam; @@ -375,6 +457,7 @@ // // uiPanel3 // + this.uiPanel3.Controls.Add(this.uiButton3); this.uiPanel3.Controls.Add(this.save); this.uiPanel3.Controls.Add(this.uiButton2); this.uiPanel3.Controls.Add(this.uiButton1); @@ -389,6 +472,27 @@ this.uiPanel3.Text = null; this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; // + // uiButton3 + // + this.uiButton3.Cursor = System.Windows.Forms.Cursors.Hand; + this.uiButton3.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); + this.uiButton3.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(130)))), ((int)(((byte)(210)))), ((int)(((byte)(60))))); + this.uiButton3.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(200)))), ((int)(((byte)(50))))); + this.uiButton3.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(30))))); + this.uiButton3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiButton3.Location = new System.Drawing.Point(859, 43); + this.uiButton3.MinimumSize = new System.Drawing.Size(1, 1); + this.uiButton3.Name = "uiButton3"; + this.uiButton3.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(110)))), ((int)(((byte)(190)))), ((int)(((byte)(40))))); + this.uiButton3.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(120)))), ((int)(((byte)(200)))), ((int)(((byte)(50))))); + this.uiButton3.RectPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(30))))); + this.uiButton3.Size = new System.Drawing.Size(130, 50); + this.uiButton3.Style = Sunny.UI.UIStyle.Custom; + this.uiButton3.TabIndex = 39; + this.uiButton3.Text = "退出"; + this.uiButton3.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiButton3.Click += new System.EventHandler(this.uiButton3_Click); + // // uiPanel2 // this.uiPanel2.Controls.Add(this.uiLabel48); @@ -427,84 +531,6 @@ this.uiPanel1.Text = null; this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; // - // Column1 - // - this.Column1.DataPropertyName = "Id"; - this.Column1.HeaderText = "编号"; - this.Column1.MinimumWidth = 6; - this.Column1.Name = "Column1"; - this.Column1.ReadOnly = true; - this.Column1.Width = 75; - // - // SerialNumber - // - this.SerialNumber.HeaderText = "序号"; - this.SerialNumber.MinimumWidth = 8; - this.SerialNumber.Name = "SerialNumber"; - this.SerialNumber.ReadOnly = true; - this.SerialNumber.Width = 75; - // - // Column2 - // - this.Column2.DataPropertyName = "barcode"; - this.Column2.HeaderText = "条码"; - this.Column2.MinimumWidth = 6; - this.Column2.Name = "Column2"; - this.Column2.ReadOnly = true; - this.Column2.Width = 200; - // - // Column3 - // - this.Column3.DataPropertyName = "diffpressure"; - this.Column3.HeaderText = "压力(PSI)"; - this.Column3.MinimumWidth = 6; - this.Column3.Name = "Column3"; - this.Column3.ReadOnly = true; - // - // Column4 - // - this.Column4.DataPropertyName = "temperature"; - this.Column4.HeaderText = "出口温度(℃)"; - this.Column4.MinimumWidth = 6; - this.Column4.Name = "Column4"; - this.Column4.ReadOnly = true; - this.Column4.Width = 110; - // - // Column7 - // - this.Column7.DataPropertyName = "temperature"; - this.Column7.HeaderText = "温度(℃)"; - this.Column7.MinimumWidth = 6; - this.Column7.Name = "Column7"; - this.Column7.ReadOnly = true; - // - // Column5 - // - this.Column5.DataPropertyName = "dwelltime"; - this.Column5.HeaderText = "保压时间(h)"; - this.Column5.MinimumWidth = 6; - this.Column5.Name = "Column5"; - this.Column5.ReadOnly = true; - this.Column5.Width = 110; - // - // Column8 - // - this.Column8.DataPropertyName = "TemperatureMode"; - this.Column8.HeaderText = "温度模式"; - this.Column8.MinimumWidth = 8; - this.Column8.Name = "Column8"; - this.Column8.ReadOnly = true; - this.Column8.Width = 110; - // - // Column6 - // - this.Column6.DataPropertyName = "CreateTime"; - this.Column6.HeaderText = "录入时间"; - this.Column6.MinimumWidth = 6; - this.Column6.Name = "Column6"; - this.Column6.ReadOnly = true; - this.Column6.Width = 150; - // // ScanImport // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -554,5 +580,6 @@ private System.Windows.Forms.DataGridViewTextBoxColumn Column5; private System.Windows.Forms.DataGridViewTextBoxColumn Column8; private System.Windows.Forms.DataGridViewTextBoxColumn Column6; + private Sunny.UI.UIButton uiButton3; } } \ No newline at end of file diff --git a/全自动水压检测仪/ScanImport.cs b/全自动水压检测仪/ScanImport.cs index 622506f..ee15d73 100644 --- a/全自动水压检测仪/ScanImport.cs +++ b/全自动水压检测仪/ScanImport.cs @@ -277,5 +277,13 @@ namespace 全自动水压检测仪 // 当移除行时更新序号 SetRowNumbers(); } + + private void uiButton3_Click(object sender, EventArgs e) + { + Application.Restart(); + + // 关闭当前窗口 + Environment.Exit(0); + } } } From 720d2408178ca7985567ed9b24696f32fd43a6c2 Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 17:27:59 +0800 Subject: [PATCH 3/9] --- 全自动水压检测仪/App.config | 4 + 全自动水压检测仪/ChangPassword.Designer.cs | 83 ++++++++++++ 全自动水压检测仪/ChangPassword.cs | 53 ++++++++ 全自动水压检测仪/ChangPassword.resx | 120 ++++++++++++++++++ 全自动水压检测仪/PasswordExpirationService.cs | 37 ++++++ 全自动水压检测仪/Program.cs | 95 +++++++++++++- 全自动水压检测仪/全自动水压检测仪.csproj | 10 ++ 7 files changed, 399 insertions(+), 3 deletions(-) create mode 100644 全自动水压检测仪/ChangPassword.Designer.cs create mode 100644 全自动水压检测仪/ChangPassword.cs create mode 100644 全自动水压检测仪/ChangPassword.resx create mode 100644 全自动水压检测仪/PasswordExpirationService.cs diff --git a/全自动水压检测仪/App.config b/全自动水压检测仪/App.config index afe1db2..9a2255a 100644 --- a/全自动水压检测仪/App.config +++ b/全自动水压检测仪/App.config @@ -15,4 +15,8 @@ + + + + \ No newline at end of file diff --git a/全自动水压检测仪/ChangPassword.Designer.cs b/全自动水压检测仪/ChangPassword.Designer.cs new file mode 100644 index 0000000..b81e65b --- /dev/null +++ b/全自动水压检测仪/ChangPassword.Designer.cs @@ -0,0 +1,83 @@ +namespace 呼吸过滤器气雾直径测试仪 +{ + partial class ChangPassword + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(57, 59); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 8; + this.button1.Text = "确认"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(37, 15); + this.label1.TabIndex = 7; + this.label1.Text = "密码"; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(57, 12); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(186, 25); + this.textBox1.TabIndex = 6; + // + // ChangPassword + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(303, 97); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Controls.Add(this.textBox1); + this.Name = "ChangPassword"; + this.Text = "ChangPassword"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBox1; + } +} \ No newline at end of file diff --git a/全自动水压检测仪/ChangPassword.cs b/全自动水压检测仪/ChangPassword.cs new file mode 100644 index 0000000..7f2b6d4 --- /dev/null +++ b/全自动水压检测仪/ChangPassword.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace 呼吸过滤器气雾直径测试仪 +{ + public partial class ChangPassword : Form + { + public ChangPassword() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + if (textBox1.Text == "07283622") + { + Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); + // 更新或添加一个键值对到 AppSettings 配置节 + config.AppSettings.Settings["MaxExpirationPeriodInDays"].Value = "40"; + // 保存更改到配置文件 + config.Save(ConfigurationSaveMode.Modified); + + // 重新加载配置文件 + ConfigurationManager.RefreshSection("appSettings"); + + MessageBox.Show("配置值已成功保存!", "保存成功"); + } + + if (textBox1.Text == "45983625") + { + Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); + // 更新或添加一个键值对到 AppSettings 配置节 + config.AppSettings.Settings["MaxExpirationPeriodInDays"].Value = "36500"; + // 保存更改到配置文件 + config.Save(ConfigurationSaveMode.Modified); + + // 重新加载配置文件 + ConfigurationManager.RefreshSection("appSettings"); + + MessageBox.Show("配置值已成功保存!", "保存成功"); + } + + } + } +} diff --git a/全自动水压检测仪/ChangPassword.resx b/全自动水压检测仪/ChangPassword.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/全自动水压检测仪/ChangPassword.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/全自动水压检测仪/PasswordExpirationService.cs b/全自动水压检测仪/PasswordExpirationService.cs new file mode 100644 index 0000000..4f8e27c --- /dev/null +++ b/全自动水压检测仪/PasswordExpirationService.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace 呼吸过滤器气雾直径测试仪 +{ + internal class PasswordExpirationService + { + private readonly TimeSpan _maxExpirationPeriod; + private readonly TimeSpan _reminderPeriod; + + public PasswordExpirationService() + { + // 读取配置文件中的密码时效策略 + var config = ConfigurationManager.AppSettings; + _maxExpirationPeriod = TimeSpan.FromDays(int.Parse(config["MaxExpirationPeriodInDays"])); + _reminderPeriod = TimeSpan.FromDays(int.Parse(config["ReminderPeriodInDays"])); + } + + public bool IsPasswordExpired(DateTime passwordLastModified) + { + // 计算密码当前的有效期 + TimeSpan passwordExpirationPeriod = passwordLastModified + _maxExpirationPeriod - DateTime.Now; + return passwordExpirationPeriod < TimeSpan.Zero; + } + + public bool IsPasswordExpiringSoon(DateTime passwordLastModified) + { + // 判断密码是否接近过期提醒期 + TimeSpan passwordExpirationPeriod = passwordLastModified + _maxExpirationPeriod - DateTime.Now; + return passwordExpirationPeriod < _reminderPeriod; + } + } +} diff --git a/全自动水压检测仪/Program.cs b/全自动水压检测仪/Program.cs index 040e9f0..5fd2393 100644 --- a/全自动水压检测仪/Program.cs +++ b/全自动水压检测仪/Program.cs @@ -1,10 +1,12 @@ -using System; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using 全自动水压检测仪; using 全自动水压检测仪.DATA; +using 呼吸过滤器气雾直径测试仪; namespace 全自动水压检测仪 { @@ -21,7 +23,92 @@ namespace 全自动水压检测仪 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - try + PasswordExpirationService expirationService = new PasswordExpirationService(); + bool isExpired = expirationService.IsPasswordExpired(DateTime.Parse("2025-12-21")); + bool isExpiringSoon = expirationService.IsPasswordExpiringSoon(DateTime.Parse("2025-12-21")); + if (isExpired) + { + MessageBox.Show("授权已过期,请联系经销商处理"); + Application.Run(new ChangPassword()); + } + if (isExpiringSoon && !isExpired) + { + MessageBox.Show("授权即将过期,请联系经销商处理"); + try + { + // 测试密码加密功能 + System.Diagnostics.Debug.WriteLine("\n========================================"); + System.Diagnostics.Debug.WriteLine("程序启动 - 密码加密测试"); + System.Diagnostics.Debug.WriteLine("========================================"); + PasswordHelper.TestPasswordEncryption(); + + // 检查是否有重置参数 + bool forceReset = args.Length > 0 && args[0].ToLower() == "--reset-users"; + + if (forceReset) + { + var result = MessageBox.Show( + "确定要重置默认用户吗?\n\n这将删除并重新创建:\n• admin / admin123 (管理员)\n• csi / 123456 (普通用户)\n\n其他用户不受影响。", + "重置默认用户", + MessageBoxButtons.YesNo, + MessageBoxIcon.Question); + + if (result == DialogResult.Yes) + { + DatabaseInitializer.Initialize(); + DatabaseInitializer.ForceResetDefaultUsers(); + MessageBox.Show("默认用户已重置!\n\n管理员: admin / admin123\n普通用户: csi / 123456", + "重置成功", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + return; + } + + // 初始化数据库表和默认管理员账户 + System.Diagnostics.Debug.WriteLine("\n========================================"); + System.Diagnostics.Debug.WriteLine("初始化数据库"); + System.Diagnostics.Debug.WriteLine("========================================"); + DatabaseInitializer.Initialize(); + + // 检查并修复损坏的密码数据 + System.Diagnostics.Debug.WriteLine("\n========================================"); + System.Diagnostics.Debug.WriteLine("检查密码数据完整性"); + System.Diagnostics.Debug.WriteLine("========================================"); + CheckAndFixPasswordData(); + } + catch (Exception ex) + { + MessageBox.Show($"数据库初始化失败:{ex.Message}\n\n请检查:\n1. MySQL服务是否启动\n2. 数据库连接配置是否正确\n3. 数据库 fullautowaterpressure 是否存在\n\n应用程序将退出。", + "初始化错误", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + // 显示登录窗体 + using (var loginForm = new LoginForm()) + { + if (loginForm.ShowDialog() == DialogResult.OK) + { + // 登录成功,根据用户权限显示对应窗体 + if (LoginData.IsAdmin()) + { + // 管理员登录,显示 ScanImport 页面 + Application.Run(new ScanImport()); + } + else + { + + // 普通用户登录,显示 NormalTemperatureMode 页面 + Application.Run(new NormalTemperatureMode()); + + } + } + // 登录失败或取消,直接退出 + } + } + if (!isExpired && !isExpiringSoon) + { + + + try { // 测试密码加密功能 System.Diagnostics.Debug.WriteLine("\n========================================"); @@ -90,8 +177,10 @@ namespace 全自动水压检测仪 } // 登录失败或取消,直接退出 } + } - + } + /// /// 检查并修复损坏的密码数据 diff --git a/全自动水压检测仪/全自动水压检测仪.csproj b/全自动水压检测仪/全自动水压检测仪.csproj index 2277732..631f2e0 100644 --- a/全自动水压检测仪/全自动水压检测仪.csproj +++ b/全自动水压检测仪/全自动水压检测仪.csproj @@ -121,6 +121,12 @@ + + Form + + + ChangPassword.cs + Form @@ -169,6 +175,7 @@ UserManagerForm.cs + Form @@ -213,6 +220,9 @@ Report.cs + + ChangPassword.cs + Coeffiicientsetting.cs From c0cc299002b606386482f380e3c30a56278fe1b9 Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 17:29:05 +0800 Subject: [PATCH 4/9] --- 全自动水压检测仪/Report.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/全自动水压检测仪/Report.cs b/全自动水压检测仪/Report.cs index 6581d35..de21267 100644 --- a/全自动水压检测仪/Report.cs +++ b/全自动水压检测仪/Report.cs @@ -286,7 +286,7 @@ namespace 全自动水压检测仪 switch (type) { case 1: - return "低温"; + return "常温"; case 0: return "高温"; default: @@ -307,12 +307,12 @@ namespace 全自动水压检测仪 switch (typeValue) { case "1": - e.Value = "低温"; + e.Value = "常温"; break; case "0": e.Value = "高温"; break; - case "低温": + case "常温": case "高温": // 已经是转换后的值,保持不变 break; From a3d77d2d2c9683e9d54c81e547121d334d0241a0 Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 17:43:53 +0800 Subject: [PATCH 5/9] --- .../NormalTemperatureMode.Designer.cs | 8 +- 全自动水压检测仪/Program.cs | 4 +- 全自动水压检测仪/ScanImport.Designer.cs | 100 +++++++++--------- 3 files changed, 56 insertions(+), 56 deletions(-) diff --git a/全自动水压检测仪/NormalTemperatureMode.Designer.cs b/全自动水压检测仪/NormalTemperatureMode.Designer.cs index d7ddef9..d2361b9 100644 --- a/全自动水压检测仪/NormalTemperatureMode.Designer.cs +++ b/全自动水压检测仪/NormalTemperatureMode.Designer.cs @@ -1142,7 +1142,7 @@ namespace 全自动水压检测仪 this.uiLabel42.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245))))); this.uiLabel42.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); this.uiLabel42.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); - this.uiLabel42.Location = new System.Drawing.Point(111, 3); + this.uiLabel42.Location = new System.Drawing.Point(123, 3); this.uiLabel42.Name = "uiLabel42"; this.uiLabel42.Size = new System.Drawing.Size(63, 30); this.uiLabel42.TabIndex = 2; @@ -1157,7 +1157,7 @@ namespace 全自动水压检测仪 this.uiLabel43.Name = "uiLabel43"; this.uiLabel43.Size = new System.Drawing.Size(121, 30); this.uiLabel43.TabIndex = 0; - this.uiLabel43.Text = "箱体温度(°C):"; + this.uiLabel43.Text = "高温箱体温度(°C):"; this.uiLabel43.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiPanel20 @@ -1181,7 +1181,7 @@ namespace 全自动水压检测仪 this.uiLabel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245))))); this.uiLabel9.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); this.uiLabel9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); - this.uiLabel9.Location = new System.Drawing.Point(111, 3); + this.uiLabel9.Location = new System.Drawing.Point(123, 3); this.uiLabel9.Name = "uiLabel9"; this.uiLabel9.Size = new System.Drawing.Size(71, 30); this.uiLabel9.TabIndex = 2; @@ -1220,7 +1220,7 @@ namespace 全自动水压检测仪 this.uiLabel38.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(245)))), ((int)(((byte)(245))))); this.uiLabel38.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold); this.uiLabel38.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60))))); - this.uiLabel38.Location = new System.Drawing.Point(111, 3); + this.uiLabel38.Location = new System.Drawing.Point(123, 3); this.uiLabel38.Name = "uiLabel38"; this.uiLabel38.Size = new System.Drawing.Size(63, 30); this.uiLabel38.TabIndex = 2; diff --git a/全自动水压检测仪/Program.cs b/全自动水压检测仪/Program.cs index 5fd2393..a0cf520 100644 --- a/全自动水压检测仪/Program.cs +++ b/全自动水压检测仪/Program.cs @@ -24,8 +24,8 @@ namespace 全自动水压检测仪 Application.SetCompatibleTextRenderingDefault(false); PasswordExpirationService expirationService = new PasswordExpirationService(); - bool isExpired = expirationService.IsPasswordExpired(DateTime.Parse("2025-12-21")); - bool isExpiringSoon = expirationService.IsPasswordExpiringSoon(DateTime.Parse("2025-12-21")); + bool isExpired = expirationService.IsPasswordExpired(DateTime.Parse("2025-12-29")); + bool isExpiringSoon = expirationService.IsPasswordExpiringSoon(DateTime.Parse("2025-12-29")); if (isExpired) { MessageBox.Show("授权已过期,请联系经销商处理"); diff --git a/全自动水压检测仪/ScanImport.Designer.cs b/全自动水压检测仪/ScanImport.Designer.cs index bf2b9a3..6812a1a 100644 --- a/全自动水压检测仪/ScanImport.Designer.cs +++ b/全自动水压检测仪/ScanImport.Designer.cs @@ -28,11 +28,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); this.save = new Sunny.UI.UIButton(); this.uiDataGridView1 = new Sunny.UI.UIDataGridView(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -92,21 +92,21 @@ // this.uiDataGridView1.AllowUserToAddRows = false; this.uiDataGridView1.AllowUserToDeleteRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); - dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle31.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); + dataGridViewCellStyle31.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle31.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle31; this.uiDataGridView1.BackgroundColor = System.Drawing.Color.White; this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); - dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle32.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); + dataGridViewCellStyle32.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle32.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32; this.uiDataGridView1.ColumnHeadersHeight = 35; this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -119,14 +119,14 @@ this.Column5, this.Column8, this.Column6}); - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle33.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle33.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle33.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle33.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); + dataGridViewCellStyle33.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle33; this.uiDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; this.uiDataGridView1.EnableHeadersVisualStyles = false; this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 10.5F); @@ -134,19 +134,19 @@ this.uiDataGridView1.Location = new System.Drawing.Point(0, 0); this.uiDataGridView1.Name = "uiDataGridView1"; this.uiDataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); - dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.White; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle34.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); + dataGridViewCellStyle34.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle34.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle34.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); + dataGridViewCellStyle34.SelectionForeColor = System.Drawing.Color.White; + dataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle34; this.uiDataGridView1.RowHeadersWidth = 40; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle5.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle35.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle35.Font = new System.Drawing.Font("微软雅黑", 10.5F); + this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle35; this.uiDataGridView1.RowTemplate.Height = 35; this.uiDataGridView1.SelectedIndex = -1; this.uiDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -261,16 +261,16 @@ this.uiLabel48.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); this.uiLabel48.Location = new System.Drawing.Point(631, 27); this.uiLabel48.Name = "uiLabel48"; - this.uiLabel48.Size = new System.Drawing.Size(103, 30); + this.uiLabel48.Size = new System.Drawing.Size(129, 30); this.uiLabel48.TabIndex = 29; - this.uiLabel48.Text = "出口温度(℃):"; + this.uiLabel48.Text = "出口温度设置(℃):"; this.uiLabel48.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiTextBox9 // this.uiTextBox9.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox9.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox9.Location = new System.Drawing.Point(736, 28); + this.uiTextBox9.Location = new System.Drawing.Point(774, 28); this.uiTextBox9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox9.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox9.Name = "uiTextBox9"; @@ -287,7 +287,7 @@ // this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox5.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox5.Location = new System.Drawing.Point(514, 68); + this.uiTextBox5.Location = new System.Drawing.Point(526, 68); this.uiTextBox5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox5.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox5.Name = "uiTextBox5"; @@ -306,9 +306,9 @@ this.uiLabel41.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); this.uiLabel41.Location = new System.Drawing.Point(404, 73); this.uiLabel41.Name = "uiLabel41"; - this.uiLabel41.Size = new System.Drawing.Size(110, 30); + this.uiLabel41.Size = new System.Drawing.Size(121, 30); this.uiLabel41.TabIndex = 17; - this.uiLabel41.Text = "保压时间(h):"; + this.uiLabel41.Text = "保压时间设置(h):"; this.uiLabel41.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiLabel4 @@ -317,16 +317,16 @@ this.uiLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); this.uiLabel4.Location = new System.Drawing.Point(404, 27); this.uiLabel4.Name = "uiLabel4"; - this.uiLabel4.Size = new System.Drawing.Size(105, 30); + this.uiLabel4.Size = new System.Drawing.Size(121, 30); this.uiLabel4.TabIndex = 18; - this.uiLabel4.Text = "压力(PSI):"; + this.uiLabel4.Text = "压力设置(PSI):"; this.uiLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiTextBox4 // this.uiTextBox4.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox4.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox4.Location = new System.Drawing.Point(514, 27); + this.uiTextBox4.Location = new System.Drawing.Point(526, 27); this.uiTextBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox4.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox4.Name = "uiTextBox4"; @@ -366,16 +366,16 @@ this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); this.uiLabel1.Location = new System.Drawing.Point(631, 73); this.uiLabel1.Name = "uiLabel1"; - this.uiLabel1.Size = new System.Drawing.Size(83, 30); + this.uiLabel1.Size = new System.Drawing.Size(148, 30); this.uiLabel1.TabIndex = 34; - this.uiLabel1.Text = "温度(℃):"; + this.uiLabel1.Text = "高温箱温度设置(℃):"; this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiTextBox1 // this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox1.Location = new System.Drawing.Point(736, 68); + this.uiTextBox1.Location = new System.Drawing.Point(774, 68); this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox1.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox1.Name = "uiTextBox1"; From d7b3457c52c8415a56d97c0b4ad2c939230f01cb Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 19:58:46 +0800 Subject: [PATCH 6/9] --- .../NormalTemperatureMode.Designer.cs | 24 +-- 全自动水压检测仪/NormalTemperatureMode.cs | 199 ++++++++++++++++++ 全自动水压检测仪/Program.cs | 4 +- 3 files changed, 213 insertions(+), 14 deletions(-) diff --git a/全自动水压检测仪/NormalTemperatureMode.Designer.cs b/全自动水压检测仪/NormalTemperatureMode.Designer.cs index d2361b9..e066a18 100644 --- a/全自动水压检测仪/NormalTemperatureMode.Designer.cs +++ b/全自动水压检测仪/NormalTemperatureMode.Designer.cs @@ -1748,7 +1748,7 @@ namespace 全自动水压检测仪 this.uiButton5.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255))))); this.uiButton5.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220))))); this.uiButton5.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiButton5.Location = new System.Drawing.Point(358, 50); + this.uiButton5.Location = new System.Drawing.Point(387, 50); this.uiButton5.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton5.Name = "uiButton5"; this.uiButton5.Size = new System.Drawing.Size(100, 60); @@ -1761,7 +1761,7 @@ namespace 全自动水压检测仪 // this.uiLabel48.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiLabel48.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel48.Location = new System.Drawing.Point(246, 9); + this.uiLabel48.Location = new System.Drawing.Point(271, 9); this.uiLabel48.Name = "uiLabel48"; this.uiLabel48.Size = new System.Drawing.Size(122, 30); this.uiLabel48.TabIndex = 14; @@ -1772,7 +1772,7 @@ namespace 全自动水压检测仪 // this.uiTextBox9.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox9.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox9.Location = new System.Drawing.Point(368, 9); + this.uiTextBox9.Location = new System.Drawing.Point(397, 9); this.uiTextBox9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox9.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox9.Name = "uiTextBox9"; @@ -1803,9 +1803,9 @@ namespace 全自动水压检测仪 this.uiLabel37.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); this.uiLabel37.Location = new System.Drawing.Point(7, 89); this.uiLabel37.Name = "uiLabel37"; - this.uiLabel37.Size = new System.Drawing.Size(108, 30); + this.uiLabel37.Size = new System.Drawing.Size(139, 30); this.uiLabel37.TabIndex = 12; - this.uiLabel37.Text = "温度设置(℃):"; + this.uiLabel37.Text = "高温箱温度设置(℃):"; this.uiLabel37.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiTextBox2 @@ -1840,7 +1840,7 @@ namespace 全自动水压检测仪 // this.uiTextBox4.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox4.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox4.Location = new System.Drawing.Point(126, 89); + this.uiTextBox4.Location = new System.Drawing.Point(154, 89); this.uiTextBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox4.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox4.Name = "uiTextBox4"; @@ -1963,7 +1963,7 @@ namespace 全自动水压检测仪 // this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox5.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox5.Location = new System.Drawing.Point(126, 47); + this.uiTextBox5.Location = new System.Drawing.Point(154, 47); this.uiTextBox5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox5.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox5.Name = "uiTextBox5"; @@ -1983,9 +1983,9 @@ namespace 全自动水压检测仪 this.uiLabel41.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); this.uiLabel41.Location = new System.Drawing.Point(7, 47); this.uiLabel41.Name = "uiLabel41"; - this.uiLabel41.Size = new System.Drawing.Size(110, 30); + this.uiLabel41.Size = new System.Drawing.Size(139, 30); this.uiLabel41.TabIndex = 1; - this.uiLabel41.Text = "保压时间(h):"; + this.uiLabel41.Text = "保压时间设置(h):"; this.uiLabel41.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiLabel4 @@ -1996,7 +1996,7 @@ namespace 全自动水压检测仪 this.uiLabel4.Name = "uiLabel4"; this.uiLabel4.Size = new System.Drawing.Size(119, 30); this.uiLabel4.TabIndex = 1; - this.uiLabel4.Text = "压力设定(PSI):"; + this.uiLabel4.Text = "压力设置(PSI):"; this.uiLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiButton13 @@ -2006,7 +2006,7 @@ namespace 全自动水压检测仪 this.uiButton13.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(150)))), ((int)(((byte)(255))))); this.uiButton13.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(120)))), ((int)(((byte)(220))))); this.uiButton13.Font = new System.Drawing.Font("微软雅黑", 14F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiButton13.Location = new System.Drawing.Point(246, 50); + this.uiButton13.Location = new System.Drawing.Point(275, 50); this.uiButton13.MinimumSize = new System.Drawing.Size(1, 1); this.uiButton13.Name = "uiButton13"; this.uiButton13.Size = new System.Drawing.Size(100, 60); @@ -2019,7 +2019,7 @@ namespace 全自动水压检测仪 // this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox1.Location = new System.Drawing.Point(126, 7); + this.uiTextBox1.Location = new System.Drawing.Point(154, 7); this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox1.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox1.Name = "uiTextBox1"; diff --git a/全自动水压检测仪/NormalTemperatureMode.cs b/全自动水压检测仪/NormalTemperatureMode.cs index 795730c..cc3b3f8 100644 --- a/全自动水压检测仪/NormalTemperatureMode.cs +++ b/全自动水压检测仪/NormalTemperatureMode.cs @@ -49,6 +49,43 @@ namespace 全自动水压检测仪 private ConductivityRepository _repository; + #region 报警监控相关字段和属性 + // 报警寄存器地址定义(根据图片内容) + private const ushort PRESSURE_PROTECTION_ADDR = 200; // M200 压力保护大于 + private const ushort TEMPERATURE_PROTECTION_ADDR = 205; // M205 温度保护大于 + private const ushort HIGH_TEMP_LEVEL_LIMIT_ADDR = 230; // M230 高温液位极限大于 + private const ushort NORMAL_TEMP_LEVEL_LIMIT_ADDR = 235; // M235 常温液位极限大于 + private const ushort HIGH_TEMP_LEVEL_MAX_ADDR = 210; // M210 高温液位上限大于 + private const ushort NORMAL_TEMP_LEVEL_MAX_ADDR = 215; // M215 常温液位上限大于 + + // 报警状态记录 + private Dictionary _alarmStatus = new Dictionary +{ + { PRESSURE_PROTECTION_ADDR, false }, + { TEMPERATURE_PROTECTION_ADDR, false }, + { HIGH_TEMP_LEVEL_LIMIT_ADDR, false }, + { NORMAL_TEMP_LEVEL_LIMIT_ADDR, false }, + { HIGH_TEMP_LEVEL_MAX_ADDR, false }, + { NORMAL_TEMP_LEVEL_MAX_ADDR, false } +}; + + // 报警描述映射 + private Dictionary _alarmDescriptions = new Dictionary +{ + { PRESSURE_PROTECTION_ADDR, "压力保护报警" }, + { TEMPERATURE_PROTECTION_ADDR, "温度保护报警" }, + { HIGH_TEMP_LEVEL_LIMIT_ADDR, "高温液位极限报警" }, + { NORMAL_TEMP_LEVEL_LIMIT_ADDR, "常温液位极限报警" }, + { HIGH_TEMP_LEVEL_MAX_ADDR, "高温液位上限报警" }, + { NORMAL_TEMP_LEVEL_MAX_ADDR, "常温液位上限报警" } +}; + + // 报警定时器 + private System.Windows.Forms.Timer _alarmMonitorTimer; + private bool _isCheckingAlarm = false; + #endregion + + public NormalTemperatureMode() { InitializeComponent(); @@ -56,10 +93,144 @@ namespace 全自动水压检测仪 // 只创建定时器,不在构造器中启动,避免在 Load 前访问未初始化的资源 _readTimer = InitTimer(); // 保存引用 _readTimerTwo = InitTimerTwo(); // 保存第二个定时器引用 + + // 初始化报警监控定时器 + _alarmMonitorTimer = InitAlarmMonitorTimer(); + _repository = new ConductivityRepository(); CurrentReport = new List(); } + private System.Windows.Forms.Timer InitAlarmMonitorTimer() + { + var timer = new System.Windows.Forms.Timer() + { + Interval = 2000 // 每2秒检查一次报警 + }; + timer.Tick += async (s, e) => + { + if (!_isCheckingAlarm && _modbusMaster != null) + { + try + { + await CheckAlarmStatusAsync(); + } + catch (Exception ex) + { + Debug.WriteLine($"报警监控异常: {ex.Message}"); + } + } + }; + return timer; + } + + + private async Task CheckAlarmStatusAsync() + { + if (_isCheckingAlarm || _modbusMaster == null) return; + + _isCheckingAlarm = true; + + try + { + // 批量读取所有报警点的状态 + var alarmAddresses = new List + { + PRESSURE_PROTECTION_ADDR, + TEMPERATURE_PROTECTION_ADDR, + HIGH_TEMP_LEVEL_LIMIT_ADDR, + NORMAL_TEMP_LEVEL_LIMIT_ADDR, + HIGH_TEMP_LEVEL_MAX_ADDR, + NORMAL_TEMP_LEVEL_MAX_ADDR + }; + + // 由于这些是线圈状态,使用ReadCoils + foreach (var address in alarmAddresses) + { + try + { + bool[] alarmStatus = await Task.Run(() => + { + // 注意:ReadCoils的参数是起始地址和数量 + return _modbusMaster.ReadCoils(1, address, 1); + }); + + if (alarmStatus != null && alarmStatus.Length > 0) + { + bool isAlarmActive = alarmStatus[0]; + bool previousStatus = _alarmStatus[address]; + + // 检查状态变化:从不报警变为报警 + if (!previousStatus && isAlarmActive) + { + _alarmStatus[address] = true; + ShowAlarmMessage(address, true); + } + // 检查状态变化:从报警变为不报警 + else if (previousStatus && !isAlarmActive) + { + _alarmStatus[address] = false; + ShowAlarmMessage(address, false); + } + } + } + catch (Exception ex) + { + Debug.WriteLine($"读取地址{address}报警状态失败: {ex.Message}"); + } + + // 短暂延迟避免频繁访问 + await Task.Delay(100); + } + } + catch (Exception ex) + { + Debug.WriteLine($"报警检查失败: {ex.Message}"); + } + finally + { + _isCheckingAlarm = false; + } + } + + private void ShowAlarmMessage(ushort address, bool isAlarmActive) + { + if (!_alarmDescriptions.ContainsKey(address)) + return; + + string alarmName = _alarmDescriptions[address]; + string message = isAlarmActive + ? $"{alarmName}已触发!请立即检查设备状态。" + : $"{alarmName}已解除。"; + + string title = isAlarmActive ? "⚠️ 报警触发" : "✅ 报警解除"; + + SafeInvoke(() => + { + try + { + // 使用MessageBox显示报警 + if (isAlarmActive) + { + // 报警触发使用警告图标 + MessageBox.Show(message, title, + MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + else + { + // 报警解除使用信息图标 + MessageBox.Show(message, title, + MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + } + catch (Exception ex) + { + Debug.WriteLine($"显示报警消息失败: {ex.Message}"); + } + }); + } + private void SafeInvoke(Action action) { if (action == null) return; @@ -864,6 +1035,7 @@ namespace 全自动水压检测仪 _isSwitchingWindow = true; _readTimer?.Stop(); _readTimerTwo?.Stop(); + _alarmMonitorTimer?.Stop(); // 检查资源是否可用 if (_tcpClient == null || !_tcpClient.Connected || _modbusMaster == null) @@ -893,6 +1065,7 @@ namespace 全自动水压检测仪 _isSwitchingWindow = false; _readTimer?.Start(); _readTimerTwo?.Start(); + _alarmMonitorTimer?.Start(); this.Show(); this.Activate(); }); @@ -922,6 +1095,10 @@ namespace 全自动水压检测仪 _readTimerTwo?.Stop(); _readTimerTwo?.Dispose(); + // 停止报警监控定时器 + _alarmMonitorTimer?.Stop(); + _alarmMonitorTimer?.Dispose(); + // 仅用户主动关闭时退出应用 if (e.CloseReason == CloseReason.UserClosing) { @@ -1051,9 +1228,26 @@ namespace 全自动水压检测仪 private void uiButton6_Click(object sender, EventArgs e) { ma?.BtnClickFunctionForNew(Function.ButtonType.复归型, 10025); + + // 同时清除本地记录的报警状态 + ClearAllAlarms(); } #endregion + private void ClearAllAlarms() + { + // 重置所有报警状态 + foreach (var address in _alarmStatus.Keys.ToList()) + { + _alarmStatus[address] = false; + } + + SafeInvoke(() => + { + MessageBox.Show("所有报警状态已重置", "提示"); + }); + } + private void NormalTemperatureMode_Shown(object sender, EventArgs e) { if (_modbusMaster != null) @@ -1061,6 +1255,11 @@ namespace 全自动水压检测仪 _readTimer.Start(); _readTimerTwo.Start(); + + if (_alarmMonitorTimer != null) + { + _alarmMonitorTimer.Start(); + } } } diff --git a/全自动水压检测仪/Program.cs b/全自动水压检测仪/Program.cs index a0cf520..fc6974b 100644 --- a/全自动水压检测仪/Program.cs +++ b/全自动水压检测仪/Program.cs @@ -24,8 +24,8 @@ namespace 全自动水压检测仪 Application.SetCompatibleTextRenderingDefault(false); PasswordExpirationService expirationService = new PasswordExpirationService(); - bool isExpired = expirationService.IsPasswordExpired(DateTime.Parse("2025-12-29")); - bool isExpiringSoon = expirationService.IsPasswordExpiringSoon(DateTime.Parse("2025-12-29")); + bool isExpired = expirationService.IsPasswordExpired(DateTime.Parse("2026-1-29")); + bool isExpiringSoon = expirationService.IsPasswordExpiringSoon(DateTime.Parse("2026-1-29")); if (isExpired) { MessageBox.Show("授权已过期,请联系经销商处理"); From 9b45ab4c484702b4fbc54acb7373c556818656ea Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 20:10:25 +0800 Subject: [PATCH 7/9] --- 全自动水压检测仪/NormalTemperatureMode.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/全自动水压检测仪/NormalTemperatureMode.cs b/全自动水压检测仪/NormalTemperatureMode.cs index cc3b3f8..e5a6a32 100644 --- a/全自动水压检测仪/NormalTemperatureMode.cs +++ b/全自动水压检测仪/NormalTemperatureMode.cs @@ -1410,6 +1410,7 @@ namespace 全自动水压检测仪 // 停止所有操作 _readTimer?.Stop(); _readTimerTwo?.Stop(); + _alarmMonitorTimer?.Stop(); // 释放资源 ModbusResourceManager.Instance?.Dispose(); From 397ee0c648e73dc2bb481cf47cba37395d4a3cec Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 20:56:11 +0800 Subject: [PATCH 8/9] --- 全自动水压检测仪/NormalTemperatureMode.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/全自动水压检测仪/NormalTemperatureMode.cs b/全自动水压检测仪/NormalTemperatureMode.cs index e5a6a32..f3d4c88 100644 --- a/全自动水压检测仪/NormalTemperatureMode.cs +++ b/全自动水压检测仪/NormalTemperatureMode.cs @@ -51,12 +51,12 @@ namespace 全自动水压检测仪 #region 报警监控相关字段和属性 // 报警寄存器地址定义(根据图片内容) - private const ushort PRESSURE_PROTECTION_ADDR = 200; // M200 压力保护大于 - private const ushort TEMPERATURE_PROTECTION_ADDR = 205; // M205 温度保护大于 - private const ushort HIGH_TEMP_LEVEL_LIMIT_ADDR = 230; // M230 高温液位极限大于 - private const ushort NORMAL_TEMP_LEVEL_LIMIT_ADDR = 235; // M235 常温液位极限大于 - private const ushort HIGH_TEMP_LEVEL_MAX_ADDR = 210; // M210 高温液位上限大于 - private const ushort NORMAL_TEMP_LEVEL_MAX_ADDR = 215; // M215 常温液位上限大于 + private const ushort PRESSURE_PROTECTION_ADDR = 10200; // M200 压力保护大于 + private const ushort TEMPERATURE_PROTECTION_ADDR = 10205; // M205 温度保护大于 + private const ushort HIGH_TEMP_LEVEL_LIMIT_ADDR = 10230; // M230 高温液位极限大于 + private const ushort NORMAL_TEMP_LEVEL_LIMIT_ADDR = 10235; // M235 常温液位极限大于 + private const ushort HIGH_TEMP_LEVEL_MAX_ADDR = 10210; // M210 高温液位上限大于 + private const ushort NORMAL_TEMP_LEVEL_MAX_ADDR = 10215; // M215 常温液位上限大于 // 报警状态记录 private Dictionary _alarmStatus = new Dictionary From 22fda7f69fccef034b3b769cde3e2c747b72ee50 Mon Sep 17 00:00:00 2001 From: wxt Date: Tue, 27 Jan 2026 20:58:16 +0800 Subject: [PATCH 9/9] --- .../NormalTemperatureMode.Designer.cs | 4 +- 全自动水压检测仪/ScanImport.Designer.cs | 78 +++++++++---------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/全自动水压检测仪/NormalTemperatureMode.Designer.cs b/全自动水压检测仪/NormalTemperatureMode.Designer.cs index e066a18..3c42d10 100644 --- a/全自动水压检测仪/NormalTemperatureMode.Designer.cs +++ b/全自动水压检测仪/NormalTemperatureMode.Designer.cs @@ -1157,7 +1157,7 @@ namespace 全自动水压检测仪 this.uiLabel43.Name = "uiLabel43"; this.uiLabel43.Size = new System.Drawing.Size(121, 30); this.uiLabel43.TabIndex = 0; - this.uiLabel43.Text = "高温箱体温度(°C):"; + this.uiLabel43.Text = "高温箱温度(°C):"; this.uiLabel43.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiPanel20 @@ -1765,7 +1765,7 @@ namespace 全自动水压检测仪 this.uiLabel48.Name = "uiLabel48"; this.uiLabel48.Size = new System.Drawing.Size(122, 30); this.uiLabel48.TabIndex = 14; - this.uiLabel48.Text = "出口温度设置(℃):"; + this.uiLabel48.Text = "出口温度判定(℃):"; this.uiLabel48.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiTextBox9 diff --git a/全自动水压检测仪/ScanImport.Designer.cs b/全自动水压检测仪/ScanImport.Designer.cs index 6812a1a..45bfdc5 100644 --- a/全自动水压检测仪/ScanImport.Designer.cs +++ b/全自动水压检测仪/ScanImport.Designer.cs @@ -28,11 +28,11 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); this.save = new Sunny.UI.UIButton(); this.uiDataGridView1 = new Sunny.UI.UIDataGridView(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -92,21 +92,21 @@ // this.uiDataGridView1.AllowUserToAddRows = false; this.uiDataGridView1.AllowUserToDeleteRows = false; - dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle31.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); - dataGridViewCellStyle31.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle31.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle31; + dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle36.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); + dataGridViewCellStyle36.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle36.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle36; this.uiDataGridView1.BackgroundColor = System.Drawing.Color.White; this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle32.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); - dataGridViewCellStyle32.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle32.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32; + dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle37.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); + dataGridViewCellStyle37.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle37.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle37.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle37.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle37.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle37; this.uiDataGridView1.ColumnHeadersHeight = 35; this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -119,14 +119,14 @@ this.Column5, this.Column8, this.Column6}); - dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle33.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle33.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle33.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle33.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); - dataGridViewCellStyle33.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle33.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle33; + dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle38.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle38.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle38.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle38.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255))))); + dataGridViewCellStyle38.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle38; this.uiDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; this.uiDataGridView1.EnableHeadersVisualStyles = false; this.uiDataGridView1.Font = new System.Drawing.Font("微软雅黑", 10.5F); @@ -134,19 +134,19 @@ this.uiDataGridView1.Location = new System.Drawing.Point(0, 0); this.uiDataGridView1.Name = "uiDataGridView1"; this.uiDataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle34.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); - dataGridViewCellStyle34.Font = new System.Drawing.Font("微软雅黑", 10.5F); - dataGridViewCellStyle34.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - dataGridViewCellStyle34.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); - dataGridViewCellStyle34.SelectionForeColor = System.Drawing.Color.White; - dataGridViewCellStyle34.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle34; + dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle39.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(249)))), ((int)(((byte)(255))))); + dataGridViewCellStyle39.Font = new System.Drawing.Font("微软雅黑", 10.5F); + dataGridViewCellStyle39.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); + dataGridViewCellStyle39.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); + dataGridViewCellStyle39.SelectionForeColor = System.Drawing.Color.White; + dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle39; this.uiDataGridView1.RowHeadersWidth = 40; - dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle35.BackColor = System.Drawing.Color.White; - dataGridViewCellStyle35.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle35; + dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle40.BackColor = System.Drawing.Color.White; + dataGridViewCellStyle40.Font = new System.Drawing.Font("微软雅黑", 10.5F); + this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle40; this.uiDataGridView1.RowTemplate.Height = 35; this.uiDataGridView1.SelectedIndex = -1; this.uiDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -263,7 +263,7 @@ this.uiLabel48.Name = "uiLabel48"; this.uiLabel48.Size = new System.Drawing.Size(129, 30); this.uiLabel48.TabIndex = 29; - this.uiLabel48.Text = "出口温度设置(℃):"; + this.uiLabel48.Text = "出口温度判定(℃):"; this.uiLabel48.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiTextBox9