From 32be8c2081a374221ab35d14b7cc62db8710c1db Mon Sep 17 00:00:00 2001 From: "GukSang.Jin" Date: Tue, 3 Feb 2026 14:35:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NormalTemperatureMode.Designer.cs | 23 +++ 全自动水压检测仪/NormalTemperatureMode.cs | 8 + .../StatusSettingsForm.Designer.cs | 166 +++++++++++++----- 全自动水压检测仪/StatusSettingsForm.cs | 7 +- 4 files changed, 157 insertions(+), 47 deletions(-) diff --git a/全自动水压检测仪/NormalTemperatureMode.Designer.cs b/全自动水压检测仪/NormalTemperatureMode.Designer.cs index b2a877f..4745e71 100644 --- a/全自动水压检测仪/NormalTemperatureMode.Designer.cs +++ b/全自动水压检测仪/NormalTemperatureMode.Designer.cs @@ -155,6 +155,7 @@ namespace 全自动水压检测仪 this.uiLabel6 = new Sunny.UI.UILabel(); this.uiLight2 = new Sunny.UI.UILight(); this.uiButton14 = new Sunny.UI.UIButton(); + this.uiButton_Settings = new Sunny.UI.UIButton(); // 新增:状态设置按钮 this.uiPanel4 = new Sunny.UI.UIPanel(); this.uiLabel5 = new Sunny.UI.UILabel(); this.uiPanel3 = new Sunny.UI.UIPanel(); @@ -2038,6 +2039,7 @@ namespace 全自动水压检测仪 this.uiPanel1.BackColor = System.Drawing.Color.White; // 隐藏温度模式和阀门状态显示 - 已移至状态设置弹窗 // this.uiPanel1.Controls.Add(this.uiPanel17); + this.uiPanel1.Controls.Add(this.uiButton_Settings); // 新增:状态设置按钮 this.uiPanel1.Controls.Add(this.uiButton14); this.uiPanel1.Controls.Add(this.uiPanel4); this.uiPanel1.Controls.Add(this.uiPanel3); @@ -2123,6 +2125,26 @@ namespace 全自动水压检测仪 this.uiButton14.MouseDown += new System.Windows.Forms.MouseEventHandler(this.uiButton14_MouseDown); this.uiButton14.MouseUp += new System.Windows.Forms.MouseEventHandler(this.uiButton14_MouseUp); // + // + // uiButton_Settings + // + this.uiButton_Settings.Cursor = System.Windows.Forms.Cursors.Hand; + this.uiButton_Settings.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); + this.uiButton_Settings.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(255))))); + this.uiButton_Settings.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(140)))), ((int)(((byte)(235))))); + this.uiButton_Settings.Font = new System.Drawing.Font("微软雅黑", 11F, System.Drawing.FontStyle.Bold); + this.uiButton_Settings.ForeColor = System.Drawing.Color.White; + this.uiButton_Settings.Location = new System.Drawing.Point(15, 8); + this.uiButton_Settings.MinimumSize = new System.Drawing.Size(1, 1); + this.uiButton_Settings.Name = "uiButton_Settings"; + this.uiButton_Settings.Radius = 20; + this.uiButton_Settings.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255))))); + this.uiButton_Settings.Size = new System.Drawing.Size(100, 38); + this.uiButton_Settings.TabIndex = 8; + this.uiButton_Settings.Text = "⚙ 设置"; + this.uiButton_Settings.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiButton_Settings.Click += new System.EventHandler(this.uiButton_Settings_Click); + // // uiPanel4 // this.uiPanel4.BackColor = System.Drawing.Color.White; @@ -2369,6 +2391,7 @@ namespace 全自动水压检测仪 private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel15; private Sunny.UI.UIPanel uiPanel30; private Sunny.UI.UIButton uiButton14; + private Sunny.UI.UIButton uiButton_Settings; // 新增:状态设置按钮 private Sunny.UI.UIPanel uiPanel12; private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel8; private Sunny.UI.UIPanel uiPanel13; diff --git a/全自动水压检测仪/NormalTemperatureMode.cs b/全自动水压检测仪/NormalTemperatureMode.cs index d195e3d..200fa50 100644 --- a/全自动水压检测仪/NormalTemperatureMode.cs +++ b/全自动水压检测仪/NormalTemperatureMode.cs @@ -1457,6 +1457,14 @@ namespace 全自动水压检测仪 } } + /// + /// 设置按钮点击事件 - 打开状态设置窗体 + /// + private void uiButton_Settings_Click(object sender, EventArgs e) + { + OpenStatusSettingsForm(); + } + public event EventHandler ReturnToLoginRequested; //返回登录 private void uiButton9_Click(object sender, EventArgs e) diff --git a/全自动水压检测仪/StatusSettingsForm.Designer.cs b/全自动水压检测仪/StatusSettingsForm.Designer.cs index cfbad42..dd584a3 100644 --- a/全自动水压检测仪/StatusSettingsForm.Designer.cs +++ b/全自动水压检测仪/StatusSettingsForm.Designer.cs @@ -52,45 +52,111 @@ namespace 全自动水压检测仪 this.uiLabel11_Status = new Sunny.UI.UILabel(); this.uiButton_Close = new Sunny.UI.UIButton(); + this.mainPanel.SuspendLayout(); + this.tempModePanel.SuspendLayout(); + this.valveStatusPanel.SuspendLayout(); this.SuspendLayout(); // mainPanel this.mainPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.mainPanel.Location = new System.Drawing.Point(0, 35); this.mainPanel.Name = "mainPanel"; - this.mainPanel.Size = new System.Drawing.Size(850, 515); + this.mainPanel.Size = new System.Drawing.Size(900, 565); this.mainPanel.TabIndex = 0; - this.mainPanel.FillColor = System.Drawing.Color.White; + this.mainPanel.FillColor = System.Drawing.Color.FromArgb(243, 249, 255); + this.mainPanel.RectColor = System.Drawing.Color.FromArgb(243, 249, 255); // tempModePanel - 温度模式区域 - this.tempModePanel.Location = new System.Drawing.Point(20, 20); - this.tempModePanel.Size = new System.Drawing.Size(810, 120); - this.tempModePanel.FillColor = System.Drawing.Color.FromArgb(245, 245, 245); - this.tempModePanel.Radius = 8; + this.tempModePanel.Location = new System.Drawing.Point(30, 20); + this.tempModePanel.Size = new System.Drawing.Size(840, 140); + this.tempModePanel.FillColor = System.Drawing.Color.White; + this.tempModePanel.RectColor = System.Drawing.Color.FromArgb(220, 220, 220); + this.tempModePanel.Radius = 10; + this.tempModePanel.Name = "tempModePanel"; + this.tempModePanel.TabIndex = 0; + + // 温度模式标题 + var tempModeTitle = new Sunny.UI.UILabel(); + tempModeTitle.Location = new System.Drawing.Point(20, 15); + tempModeTitle.Size = new System.Drawing.Size(200, 30); + tempModeTitle.Text = "温度模式状态"; + tempModeTitle.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold); + tempModeTitle.ForeColor = System.Drawing.Color.FromArgb(48, 48, 48); + this.tempModePanel.Controls.Add(tempModeTitle); + + // 常温模式指示 + var normalTempLabel = new Sunny.UI.UILabel(); + normalTempLabel.Location = new System.Drawing.Point(80, 65); + normalTempLabel.Size = new System.Drawing.Size(120, 30); + normalTempLabel.Text = "常温模式"; + normalTempLabel.Font = new System.Drawing.Font("微软雅黑", 12F); + normalTempLabel.ForeColor = System.Drawing.Color.FromArgb(48, 48, 48); + normalTempLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.tempModePanel.Controls.Add(normalTempLabel); + + this.uiLight1_Status.Location = new System.Drawing.Point(40, 67); + this.uiLight1_Status.Size = new System.Drawing.Size(30, 30); + this.uiLight1_Status.OnColor = System.Drawing.Color.FromArgb(80, 160, 255); + this.uiLight1_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200); + this.uiLight1_Status.Radius = 15; + this.uiLight1_Status.Name = "uiLight1_Status"; + this.tempModePanel.Controls.Add(this.uiLight1_Status); + + // 高温模式指示 + var highTempLabel = new Sunny.UI.UILabel(); + highTempLabel.Location = new System.Drawing.Point(330, 65); + highTempLabel.Size = new System.Drawing.Size(120, 30); + highTempLabel.Text = "高温模式"; + highTempLabel.Font = new System.Drawing.Font("微软雅黑", 12F); + highTempLabel.ForeColor = System.Drawing.Color.FromArgb(48, 48, 48); + highTempLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.tempModePanel.Controls.Add(highTempLabel); + + this.uiLight2_Status.Location = new System.Drawing.Point(290, 67); + this.uiLight2_Status.Size = new System.Drawing.Size(30, 30); + this.uiLight2_Status.OnColor = System.Drawing.Color.FromArgb(255, 80, 80); + this.uiLight2_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200); + this.uiLight2_Status.Radius = 15; + this.uiLight2_Status.Name = "uiLight2_Status"; + this.tempModePanel.Controls.Add(this.uiLight2_Status); + + // 当前模式显示 + var currentModeLabel = new Sunny.UI.UILabel(); + currentModeLabel.Location = new System.Drawing.Point(520, 65); + currentModeLabel.Size = new System.Drawing.Size(120, 30); + currentModeLabel.Text = "当前模式:"; + currentModeLabel.Font = new System.Drawing.Font("微软雅黑", 11F); + currentModeLabel.ForeColor = System.Drawing.Color.FromArgb(100, 100, 100); + currentModeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.tempModePanel.Controls.Add(currentModeLabel); + + this.uiLabel11_Status.Location = new System.Drawing.Point(640, 65); + this.uiLabel11_Status.Size = new System.Drawing.Size(150, 30); + this.uiLabel11_Status.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); + this.uiLabel11_Status.ForeColor = System.Drawing.Color.FromArgb(80, 160, 255); + this.uiLabel11_Status.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.tempModePanel.Controls.Add(this.uiLabel11_Status); // valveStatusPanel - 阀门状态区域 - this.valveStatusPanel.Location = new System.Drawing.Point(20, 160); - this.valveStatusPanel.Size = new System.Drawing.Size(810, 280); - this.valveStatusPanel.FillColor = System.Drawing.Color.FromArgb(245, 245, 245); - this.valveStatusPanel.Radius = 8; + this.valveStatusPanel.Location = new System.Drawing.Point(30, 180); + this.valveStatusPanel.Size = new System.Drawing.Size(840, 310); + this.valveStatusPanel.FillColor = System.Drawing.Color.White; + this.valveStatusPanel.RectColor = System.Drawing.Color.FromArgb(220, 220, 220); + this.valveStatusPanel.Radius = 10; + this.valveStatusPanel.Name = "valveStatusPanel"; + this.valveStatusPanel.TabIndex = 1; - // 温度模式指示灯和标签 - this.uiLight1_Status.Location = new System.Drawing.Point(30, 50); - this.uiLight1_Status.Size = new System.Drawing.Size(30, 30); - this.uiLight1_Status.OnColor = System.Drawing.Color.Blue; - this.uiLight1_Status.OffColor = System.Drawing.Color.LightGray; + // 阀门状态标题 + var valveStatusTitle = new Sunny.UI.UILabel(); + valveStatusTitle.Location = new System.Drawing.Point(20, 15); + valveStatusTitle.Size = new System.Drawing.Size(200, 30); + valveStatusTitle.Text = "阀门状态监控"; + valveStatusTitle.Font = new System.Drawing.Font("微软雅黑", 14F, System.Drawing.FontStyle.Bold); + valveStatusTitle.ForeColor = System.Drawing.Color.FromArgb(48, 48, 48); + this.valveStatusPanel.Controls.Add(valveStatusTitle); - this.uiLight2_Status.Location = new System.Drawing.Point(30, 90); - this.uiLight2_Status.Size = new System.Drawing.Size(30, 30); - this.uiLight2_Status.OnColor = System.Drawing.Color.Red; - this.uiLight2_Status.OffColor = System.Drawing.Color.LightGray; - - this.uiLabel11_Status.Location = new System.Drawing.Point(80, 50); - this.uiLabel11_Status.Size = new System.Drawing.Size(200, 30); - this.uiLabel11_Status.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); - - // 阀门状态指示灯 - 使用循环布局 - int startX = 30, startY = 30, spacing = 150, row = 0, col = 0; + // 阀门状态指示灯 - 优化布局 + int startX = 40, startY = 65, spacingX = 160, spacingY = 55; var valveLights = new[] { (this.uiLight3_Status, "高压出阀"), (this.uiLight4_Status, "高压进阀"), @@ -104,19 +170,23 @@ namespace 全自动水压检测仪 (this.uiLight12_Status, "高温回水阀") }; + int row = 0, col = 0; foreach (var (light, label) in valveLights) { - light.Location = new System.Drawing.Point(startX + col * spacing, startY + row * 50); - light.Size = new System.Drawing.Size(25, 25); - light.OnColor = System.Drawing.Color.Green; - light.OffColor = System.Drawing.Color.LightGray; + light.Location = new System.Drawing.Point(startX + col * spacingX, startY + row * spacingY); + light.Size = new System.Drawing.Size(28, 28); + light.OnColor = System.Drawing.Color.FromArgb(0, 190, 0); + light.OffColor = System.Drawing.Color.FromArgb(200, 200, 200); + light.Radius = 14; this.valveStatusPanel.Controls.Add(light); var lbl = new Sunny.UI.UILabel(); - lbl.Location = new System.Drawing.Point(startX + col * spacing + 35, startY + row * 50); - lbl.Size = new System.Drawing.Size(110, 25); + lbl.Location = new System.Drawing.Point(startX + col * spacingX + 38, startY + row * spacingY); + lbl.Size = new System.Drawing.Size(115, 28); lbl.Text = label; - lbl.Font = new System.Drawing.Font("微软雅黑", 9F); + lbl.Font = new System.Drawing.Font("微软雅黑", 10F); + lbl.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60); + lbl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.valveStatusPanel.Controls.Add(lbl); col++; @@ -124,28 +194,34 @@ namespace 全自动水压检测仪 } // 关闭按钮 - this.uiButton_Close.Location = new System.Drawing.Point(350, 460); - this.uiButton_Close.Size = new System.Drawing.Size(150, 40); + this.uiButton_Close.Location = new System.Drawing.Point(375, 510); + this.uiButton_Close.Size = new System.Drawing.Size(150, 42); this.uiButton_Close.Text = "关闭"; - this.uiButton_Close.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiButton_Close.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); + this.uiButton_Close.FillColor = System.Drawing.Color.FromArgb(80, 160, 255); + this.uiButton_Close.FillHoverColor = System.Drawing.Color.FromArgb(100, 180, 255); + this.uiButton_Close.FillPressColor = System.Drawing.Color.FromArgb(60, 140, 235); + this.uiButton_Close.RectColor = System.Drawing.Color.FromArgb(80, 160, 255); + this.uiButton_Close.Radius = 20; + this.uiButton_Close.Cursor = System.Windows.Forms.Cursors.Hand; this.uiButton_Close.Click += new System.EventHandler(this.uiButton_Close_Click); - // 添加控件到面板 - this.tempModePanel.Controls.AddRange(new System.Windows.Forms.Control[] { - this.uiLight1_Status, this.uiLight2_Status, this.uiLabel11_Status - }); - - this.mainPanel.Controls.AddRange(new System.Windows.Forms.Control[] { - this.tempModePanel, this.valveStatusPanel, this.uiButton_Close - }); + // 添加控件到主面板 + this.mainPanel.Controls.Add(this.tempModePanel); + this.mainPanel.Controls.Add(this.valveStatusPanel); + this.mainPanel.Controls.Add(this.uiButton_Close); this.Controls.Add(this.mainPanel); // 窗体设置 - this.ClientSize = new System.Drawing.Size(850, 550); + this.ClientSize = new System.Drawing.Size(900, 600); this.Name = "StatusSettingsForm"; this.Text = "状态监控设置"; + this.Padding = new System.Windows.Forms.Padding(0, 35, 0, 0); + this.mainPanel.ResumeLayout(false); + this.tempModePanel.ResumeLayout(false); + this.valveStatusPanel.ResumeLayout(false); this.ResumeLayout(false); } } diff --git a/全自动水压检测仪/StatusSettingsForm.cs b/全自动水压检测仪/StatusSettingsForm.cs index f1586a2..e02edad 100644 --- a/全自动水压检测仪/StatusSettingsForm.cs +++ b/全自动水压检测仪/StatusSettingsForm.cs @@ -21,10 +21,13 @@ namespace 全自动水压检测仪 // 设置窗体属性 this.Text = "状态监控设置"; - this.Width = 850; - this.Height = 550; + this.Width = 900; + this.Height = 600; this.StartPosition = FormStartPosition.CenterParent; this.ShowInTaskbar = false; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.FormBorderStyle = FormBorderStyle.FixedDialog; // 初始化更新定时器 _updateTimer = new System.Windows.Forms.Timer();