This commit is contained in:
GukSang.Jin
2026-02-04 10:35:45 +08:00
parent 6f2a810e00
commit 9a448139f8
3 changed files with 294 additions and 34 deletions

View File

@@ -157,41 +157,178 @@ namespace 全自动水压检测仪
// 阀门状态指示灯 - 优化布局
int startX = 40, startY = 65, spacingX = 160, spacingY = 55;
var valveLights = new[] {
(this.uiLight3_Status, "高压出阀"),
(this.uiLight4_Status, "高压进阀"),
(this.uiLight5_Status, "常温抽水阀"),
(this.uiLight6_Status, "常温水箱加水阀"),
(this.uiLight7_Status, "高温抽水阀"),
(this.uiLight8_Status, "空气抽气阀"),
(this.uiLight9_Status, "加热状态"),
(this.uiLight10_Status, "常温回水阀"),
(this.uiLight11_Status, "高温水箱加水阀"),
(this.uiLight12_Status, "高温回水阀")
};
int row = 0, col = 0;
foreach (var (light, label) in valveLights)
{
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 * spacingX + 38, startY + row * spacingY);
lbl.Size = new System.Drawing.Size(115, 28);
lbl.Text = label;
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++;
if (col >= 5) { col = 0; row++; }
}
// 第一行
// 高压出阀
this.uiLight3_Status.Location = new System.Drawing.Point(startX, startY);
this.uiLight3_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight3_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight3_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight3_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight3_Status);
var lbl3 = new Sunny.UI.UILabel();
lbl3.Location = new System.Drawing.Point(startX + 38, startY);
lbl3.Size = new System.Drawing.Size(115, 28);
lbl3.Text = "高压出阀";
lbl3.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl3.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl3);
// 高压进阀
this.uiLight4_Status.Location = new System.Drawing.Point(startX + spacingX, startY);
this.uiLight4_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight4_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight4_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight4_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight4_Status);
var lbl4 = new Sunny.UI.UILabel();
lbl4.Location = new System.Drawing.Point(startX + spacingX + 38, startY);
lbl4.Size = new System.Drawing.Size(115, 28);
lbl4.Text = "高压进阀";
lbl4.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl4.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl4);
// 常温抽水阀
this.uiLight5_Status.Location = new System.Drawing.Point(startX + spacingX * 2, startY);
this.uiLight5_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight5_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight5_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight5_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight5_Status);
var lbl5 = new Sunny.UI.UILabel();
lbl5.Location = new System.Drawing.Point(startX + spacingX * 2 + 38, startY);
lbl5.Size = new System.Drawing.Size(115, 28);
lbl5.Text = "常温抽水阀";
lbl5.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl5.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl5);
// 常温水箱加水阀
this.uiLight6_Status.Location = new System.Drawing.Point(startX + spacingX * 3, startY);
this.uiLight6_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight6_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight6_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight6_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight6_Status);
var lbl6 = new Sunny.UI.UILabel();
lbl6.Location = new System.Drawing.Point(startX + spacingX * 3 + 38, startY);
lbl6.Size = new System.Drawing.Size(115, 28);
lbl6.Text = "常温水箱加水阀";
lbl6.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl6.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl6);
// 高温抽水阀
this.uiLight7_Status.Location = new System.Drawing.Point(startX + spacingX * 4, startY);
this.uiLight7_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight7_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight7_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight7_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight7_Status);
var lbl7 = new Sunny.UI.UILabel();
lbl7.Location = new System.Drawing.Point(startX + spacingX * 4 + 38, startY);
lbl7.Size = new System.Drawing.Size(115, 28);
lbl7.Text = "高温抽水阀";
lbl7.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl7.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl7);
// 第二行
// 空气抽气阀
this.uiLight8_Status.Location = new System.Drawing.Point(startX, startY + spacingY);
this.uiLight8_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight8_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight8_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight8_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight8_Status);
var lbl8 = new Sunny.UI.UILabel();
lbl8.Location = new System.Drawing.Point(startX + 38, startY + spacingY);
lbl8.Size = new System.Drawing.Size(115, 28);
lbl8.Text = "空气抽气阀";
lbl8.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl8.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl8);
// 加热状态
this.uiLight9_Status.Location = new System.Drawing.Point(startX + spacingX, startY + spacingY);
this.uiLight9_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight9_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight9_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight9_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight9_Status);
var lbl9 = new Sunny.UI.UILabel();
lbl9.Location = new System.Drawing.Point(startX + spacingX + 38, startY + spacingY);
lbl9.Size = new System.Drawing.Size(115, 28);
lbl9.Text = "加热状态";
lbl9.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl9.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl9);
// 常温回水阀
this.uiLight10_Status.Location = new System.Drawing.Point(startX + spacingX * 2, startY + spacingY);
this.uiLight10_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight10_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight10_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight10_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight10_Status);
var lbl10 = new Sunny.UI.UILabel();
lbl10.Location = new System.Drawing.Point(startX + spacingX * 2 + 38, startY + spacingY);
lbl10.Size = new System.Drawing.Size(115, 28);
lbl10.Text = "常温回水阀";
lbl10.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl10.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl10);
// 高温水箱加水阀
this.uiLight11_Status.Location = new System.Drawing.Point(startX + spacingX * 3, startY + spacingY);
this.uiLight11_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight11_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight11_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight11_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight11_Status);
var lbl11 = new Sunny.UI.UILabel();
lbl11.Location = new System.Drawing.Point(startX + spacingX * 3 + 38, startY + spacingY);
lbl11.Size = new System.Drawing.Size(115, 28);
lbl11.Text = "高温水箱加水阀";
lbl11.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl11.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl11.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl11);
// 高温回水阀
this.uiLight12_Status.Location = new System.Drawing.Point(startX + spacingX * 4, startY + spacingY);
this.uiLight12_Status.Size = new System.Drawing.Size(28, 28);
this.uiLight12_Status.OnColor = System.Drawing.Color.FromArgb(0, 190, 0);
this.uiLight12_Status.OffColor = System.Drawing.Color.FromArgb(200, 200, 200);
this.uiLight12_Status.Radius = 14;
this.valveStatusPanel.Controls.Add(this.uiLight12_Status);
var lbl12 = new Sunny.UI.UILabel();
lbl12.Location = new System.Drawing.Point(startX + spacingX * 4 + 38, startY + spacingY);
lbl12.Size = new System.Drawing.Size(115, 28);
lbl12.Text = "高温回水阀";
lbl12.Font = new System.Drawing.Font("微软雅黑", 10F);
lbl12.ForeColor = System.Drawing.Color.FromArgb(60, 60, 60);
lbl12.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.valveStatusPanel.Controls.Add(lbl12);
// 关闭按钮
this.uiButton_Close.Location = new System.Drawing.Point(375, 510);

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -247,6 +247,9 @@
<EmbeddedResource Include="ScanImport.resx">
<DependentUpon>ScanImport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="StatusSettingsForm.resx">
<DependentUpon>StatusSettingsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NormalTemperatureMode.resx">
<DependentUpon>NormalTemperatureMode.cs</DependentUpon>
</EmbeddedResource>