添加项目文件。

This commit is contained in:
xyy
2026-02-07 10:07:45 +08:00
parent 26de2ec21a
commit 8cbdb7abad
32 changed files with 8530 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

View File

@@ -0,0 +1,803 @@
namespace
{
partial class CoefficientForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel1 = new Sunny.UI.UIPanel();
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiGroupBox1 = new Sunny.UI.UIGroupBox();
this.uiTableLayoutPanel2 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel6 = new Sunny.UI.UIPanel();
this.uiLabel6 = new Sunny.UI.UILabel();
this.uiLabel4 = new Sunny.UI.UILabel();
this.uiPanel4 = new Sunny.UI.UIPanel();
this.uiTextBox2 = new Sunny.UI.UITextBox();
this.uiLabel2 = new Sunny.UI.UILabel();
this.uiPanel5 = new Sunny.UI.UIPanel();
this.uiTextBox3 = new Sunny.UI.UITextBox();
this.uiLabel3 = new Sunny.UI.UILabel();
this.uiPanel3 = new Sunny.UI.UIPanel();
this.uiTextBox1 = new Sunny.UI.UITextBox();
this.uiLabel1 = new Sunny.UI.UILabel();
this.uiGroupBox3 = new Sunny.UI.UIGroupBox();
this.uiTableLayoutPanel4 = new Sunny.UI.UITableLayoutPanel();
this.uiTableLayoutPanel6 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel8 = new Sunny.UI.UIPanel();
this.uiTextBox5 = new Sunny.UI.UITextBox();
this.uiLabel5 = new Sunny.UI.UILabel();
this.uiPanel14 = new Sunny.UI.UIPanel();
this.uiTextBox11 = new Sunny.UI.UITextBox();
this.uiLabel11 = new Sunny.UI.UILabel();
this.uiPanel15 = new Sunny.UI.UIPanel();
this.uiTextBox12 = new Sunny.UI.UITextBox();
this.uiLabel12 = new Sunny.UI.UILabel();
this.uiTableLayoutPanel5 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel13 = new Sunny.UI.UIPanel();
this.uiTextBox10 = new Sunny.UI.UITextBox();
this.uiLabel10 = new Sunny.UI.UILabel();
this.uiPanel12 = new Sunny.UI.UIPanel();
this.uiTextBox9 = new Sunny.UI.UITextBox();
this.uiLabel9 = new Sunny.UI.UILabel();
this.uiPanel10 = new Sunny.UI.UIPanel();
this.uiTextBox7 = new Sunny.UI.UITextBox();
this.uiLabel7 = new Sunny.UI.UILabel();
this.uiPanel7 = new Sunny.UI.UIPanel();
this.uiButton1 = new Sunny.UI.UIButton();
this.uiTableLayoutPanel1.SuspendLayout();
this.uiPanel2.SuspendLayout();
this.uiGroupBox1.SuspendLayout();
this.uiTableLayoutPanel2.SuspendLayout();
this.uiPanel6.SuspendLayout();
this.uiPanel4.SuspendLayout();
this.uiPanel5.SuspendLayout();
this.uiPanel3.SuspendLayout();
this.uiGroupBox3.SuspendLayout();
this.uiTableLayoutPanel4.SuspendLayout();
this.uiTableLayoutPanel6.SuspendLayout();
this.uiPanel8.SuspendLayout();
this.uiPanel14.SuspendLayout();
this.uiPanel15.SuspendLayout();
this.uiTableLayoutPanel5.SuspendLayout();
this.uiPanel13.SuspendLayout();
this.uiPanel12.SuspendLayout();
this.uiPanel10.SuspendLayout();
this.uiPanel7.SuspendLayout();
this.SuspendLayout();
//
// uiTableLayoutPanel1
//
this.uiTableLayoutPanel1.BackColor = System.Drawing.Color.White;
this.uiTableLayoutPanel1.ColumnCount = 1;
this.uiTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel1, 0, 0);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel2, 0, 1);
this.uiTableLayoutPanel1.Controls.Add(this.uiGroupBox3, 0, 2);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel7, 0, 3);
this.uiTableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel1.Location = new System.Drawing.Point(0, 35);
this.uiTableLayoutPanel1.Margin = new System.Windows.Forms.Padding(1);
this.uiTableLayoutPanel1.Name = "uiTableLayoutPanel1";
this.uiTableLayoutPanel1.Padding = new System.Windows.Forms.Padding(1);
this.uiTableLayoutPanel1.RowCount = 4;
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 42F));
this.uiTableLayoutPanel1.Size = new System.Drawing.Size(1900, 965);
this.uiTableLayoutPanel1.TabIndex = 1;
this.uiTableLayoutPanel1.TagString = null;
//
// uiPanel1
//
this.uiPanel1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel1.ForeColor = System.Drawing.Color.White;
this.uiPanel1.Location = new System.Drawing.Point(5, 6);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.Size = new System.Drawing.Size(1890, 30);
this.uiPanel1.TabIndex = 0;
this.uiPanel1.Text = "系数设置";
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiPanel2
//
this.uiPanel2.Controls.Add(this.uiGroupBox1);
this.uiPanel2.FillColor = System.Drawing.Color.White;
this.uiPanel2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel2.Location = new System.Drawing.Point(5, 83);
this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel2.Name = "uiPanel2";
this.uiPanel2.Padding = new System.Windows.Forms.Padding(3);
this.uiPanel2.RectColor = System.Drawing.Color.White;
this.uiPanel2.Size = new System.Drawing.Size(1890, 133);
this.uiPanel2.TabIndex = 1;
this.uiPanel2.Text = null;
this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiGroupBox1
//
this.uiGroupBox1.Controls.Add(this.uiTableLayoutPanel2);
this.uiGroupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiGroupBox1.FillColor = System.Drawing.Color.White;
this.uiGroupBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiGroupBox1.Location = new System.Drawing.Point(3, 3);
this.uiGroupBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiGroupBox1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiGroupBox1.Name = "uiGroupBox1";
this.uiGroupBox1.Padding = new System.Windows.Forms.Padding(2, 32, 2, 2);
this.uiGroupBox1.RectColor = System.Drawing.Color.Black;
this.uiGroupBox1.Size = new System.Drawing.Size(1884, 127);
this.uiGroupBox1.TabIndex = 0;
this.uiGroupBox1.Text = "1#";
this.uiGroupBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTableLayoutPanel2
//
this.uiTableLayoutPanel2.ColumnCount = 2;
this.uiTableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.uiTableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.uiTableLayoutPanel2.Controls.Add(this.uiPanel6, 1, 1);
this.uiTableLayoutPanel2.Controls.Add(this.uiPanel4, 1, 0);
this.uiTableLayoutPanel2.Controls.Add(this.uiPanel5, 0, 1);
this.uiTableLayoutPanel2.Controls.Add(this.uiPanel3, 0, 0);
this.uiTableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel2.Location = new System.Drawing.Point(2, 32);
this.uiTableLayoutPanel2.Name = "uiTableLayoutPanel2";
this.uiTableLayoutPanel2.RowCount = 2;
this.uiTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.uiTableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.uiTableLayoutPanel2.Size = new System.Drawing.Size(1880, 93);
this.uiTableLayoutPanel2.TabIndex = 0;
this.uiTableLayoutPanel2.TagString = null;
//
// uiPanel6
//
this.uiPanel6.Controls.Add(this.uiLabel6);
this.uiPanel6.Controls.Add(this.uiLabel4);
this.uiPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel6.FillColor = System.Drawing.Color.White;
this.uiPanel6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel6.Location = new System.Drawing.Point(944, 51);
this.uiPanel6.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel6.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel6.Name = "uiPanel6";
this.uiPanel6.RectColor = System.Drawing.Color.White;
this.uiPanel6.Size = new System.Drawing.Size(932, 37);
this.uiPanel6.TabIndex = 4;
this.uiPanel6.Text = null;
this.uiPanel6.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel6
//
this.uiLabel6.BackColor = System.Drawing.Color.DarkGray;
this.uiLabel6.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel6.Location = new System.Drawing.Point(277, 1);
this.uiLabel6.Name = "uiLabel6";
this.uiLabel6.Size = new System.Drawing.Size(120, 35);
this.uiLabel6.TabIndex = 1;
this.uiLabel6.Text = "0.00";
this.uiLabel6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel4
//
this.uiLabel4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel4.Location = new System.Drawing.Point(77, 8);
this.uiLabel4.Name = "uiLabel4";
this.uiLabel4.Size = new System.Drawing.Size(170, 35);
this.uiLabel4.TabIndex = 0;
this.uiLabel4.Text = "腔体温度(℃):";
//
// uiPanel4
//
this.uiPanel4.Controls.Add(this.uiTextBox2);
this.uiPanel4.Controls.Add(this.uiLabel2);
this.uiPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel4.FillColor = System.Drawing.Color.White;
this.uiPanel4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel4.Location = new System.Drawing.Point(944, 5);
this.uiPanel4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel4.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel4.Name = "uiPanel4";
this.uiPanel4.RectColor = System.Drawing.Color.White;
this.uiPanel4.Size = new System.Drawing.Size(932, 36);
this.uiPanel4.TabIndex = 3;
this.uiPanel4.Text = null;
this.uiPanel4.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox2
//
this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox2.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox2.Location = new System.Drawing.Point(277, 0);
this.uiTextBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox2.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox2.Name = "uiTextBox2";
this.uiTextBox2.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox2.ShowText = false;
this.uiTextBox2.Size = new System.Drawing.Size(120, 35);
this.uiTextBox2.TabIndex = 1;
this.uiTextBox2.Text = "0.000";
this.uiTextBox2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox2.Watermark = "";
this.uiTextBox2.Click += new System.EventHandler(this.uiTextBox2_Click);
//
// uiLabel2
//
this.uiLabel2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel2.Location = new System.Drawing.Point(77, 8);
this.uiLabel2.Name = "uiLabel2";
this.uiLabel2.Size = new System.Drawing.Size(126, 35);
this.uiLabel2.TabIndex = 0;
this.uiLabel2.Text = "设置温度:";
//
// uiPanel5
//
this.uiPanel5.Controls.Add(this.uiTextBox3);
this.uiPanel5.Controls.Add(this.uiLabel3);
this.uiPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel5.FillColor = System.Drawing.Color.White;
this.uiPanel5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel5.Location = new System.Drawing.Point(4, 51);
this.uiPanel5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel5.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel5.Name = "uiPanel5";
this.uiPanel5.RectColor = System.Drawing.Color.White;
this.uiPanel5.Size = new System.Drawing.Size(932, 37);
this.uiPanel5.TabIndex = 2;
this.uiPanel5.Text = null;
this.uiPanel5.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox3
//
this.uiTextBox3.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox3.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox3.Location = new System.Drawing.Point(284, 0);
this.uiTextBox3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox3.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox3.Name = "uiTextBox3";
this.uiTextBox3.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox3.ShowText = false;
this.uiTextBox3.Size = new System.Drawing.Size(120, 35);
this.uiTextBox3.TabIndex = 1;
this.uiTextBox3.Text = "0.000";
this.uiTextBox3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox3.Watermark = "";
this.uiTextBox3.Click += new System.EventHandler(this.uiTextBox3_Click);
//
// uiLabel3
//
this.uiLabel3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel3.Location = new System.Drawing.Point(90, 8);
this.uiLabel3.Name = "uiLabel3";
this.uiLabel3.Size = new System.Drawing.Size(150, 35);
this.uiLabel3.TabIndex = 0;
this.uiLabel3.Text = "设置低压:";
//
// uiPanel3
//
this.uiPanel3.Controls.Add(this.uiTextBox1);
this.uiPanel3.Controls.Add(this.uiLabel1);
this.uiPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel3.FillColor = System.Drawing.Color.White;
this.uiPanel3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel3.Location = new System.Drawing.Point(4, 5);
this.uiPanel3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel3.Name = "uiPanel3";
this.uiPanel3.RectColor = System.Drawing.Color.White;
this.uiPanel3.Size = new System.Drawing.Size(932, 36);
this.uiPanel3.TabIndex = 0;
this.uiPanel3.Text = null;
this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox1
//
this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox1.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox1.Location = new System.Drawing.Point(284, 0);
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";
this.uiTextBox1.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox1.ShowText = false;
this.uiTextBox1.Size = new System.Drawing.Size(120, 35);
this.uiTextBox1.TabIndex = 1;
this.uiTextBox1.Text = "0.000";
this.uiTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox1.Watermark = "";
this.uiTextBox1.Click += new System.EventHandler(this.uiTextBox1_Click);
//
// uiLabel1
//
this.uiLabel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel1.Location = new System.Drawing.Point(90, 8);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(146, 35);
this.uiLabel1.TabIndex = 0;
this.uiLabel1.Text = "设置高压:";
//
// uiGroupBox3
//
this.uiGroupBox3.Controls.Add(this.uiTableLayoutPanel4);
this.uiGroupBox3.FillColor = System.Drawing.Color.White;
this.uiGroupBox3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiGroupBox3.Location = new System.Drawing.Point(5, 275);
this.uiGroupBox3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiGroupBox3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiGroupBox3.Name = "uiGroupBox3";
this.uiGroupBox3.Padding = new System.Windows.Forms.Padding(2, 32, 2, 2);
this.uiGroupBox3.RectColor = System.Drawing.Color.Black;
this.uiGroupBox3.Size = new System.Drawing.Size(1890, 216);
this.uiGroupBox3.TabIndex = 3;
this.uiGroupBox3.Text = "系数";
this.uiGroupBox3.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTableLayoutPanel4
//
this.uiTableLayoutPanel4.ColumnCount = 2;
this.uiTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.uiTableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.uiTableLayoutPanel4.Controls.Add(this.uiTableLayoutPanel6, 1, 0);
this.uiTableLayoutPanel4.Controls.Add(this.uiTableLayoutPanel5, 0, 0);
this.uiTableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel4.Location = new System.Drawing.Point(2, 32);
this.uiTableLayoutPanel4.Name = "uiTableLayoutPanel4";
this.uiTableLayoutPanel4.RowCount = 1;
this.uiTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.uiTableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.uiTableLayoutPanel4.Size = new System.Drawing.Size(1886, 182);
this.uiTableLayoutPanel4.TabIndex = 0;
this.uiTableLayoutPanel4.TagString = null;
//
// uiTableLayoutPanel6
//
this.uiTableLayoutPanel6.ColumnCount = 1;
this.uiTableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.uiTableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.uiTableLayoutPanel6.Controls.Add(this.uiPanel8, 0, 2);
this.uiTableLayoutPanel6.Controls.Add(this.uiPanel14, 0, 1);
this.uiTableLayoutPanel6.Controls.Add(this.uiPanel15, 0, 0);
this.uiTableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel6.Location = new System.Drawing.Point(946, 3);
this.uiTableLayoutPanel6.Name = "uiTableLayoutPanel6";
this.uiTableLayoutPanel6.RowCount = 3;
this.uiTableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.uiTableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.uiTableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 34F));
this.uiTableLayoutPanel6.Size = new System.Drawing.Size(937, 176);
this.uiTableLayoutPanel6.TabIndex = 5;
this.uiTableLayoutPanel6.TagString = null;
//
// uiPanel8
//
this.uiPanel8.Controls.Add(this.uiTextBox5);
this.uiPanel8.Controls.Add(this.uiLabel5);
this.uiPanel8.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel8.FillColor = System.Drawing.Color.White;
this.uiPanel8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel8.Location = new System.Drawing.Point(4, 121);
this.uiPanel8.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel8.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel8.Name = "uiPanel8";
this.uiPanel8.RectColor = System.Drawing.Color.White;
this.uiPanel8.Size = new System.Drawing.Size(929, 50);
this.uiPanel8.TabIndex = 6;
this.uiPanel8.Text = null;
this.uiPanel8.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox5
//
this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox5.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox5.Location = new System.Drawing.Point(277, 0);
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";
this.uiTextBox5.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox5.ShowText = false;
this.uiTextBox5.Size = new System.Drawing.Size(120, 35);
this.uiTextBox5.TabIndex = 1;
this.uiTextBox5.Text = "0.00";
this.uiTextBox5.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox5.Watermark = "";
this.uiTextBox5.Click += new System.EventHandler(this.uiTextBox5_Click);
//
// uiLabel5
//
this.uiLabel5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel5.Location = new System.Drawing.Point(77, 7);
this.uiLabel5.Name = "uiLabel5";
this.uiLabel5.Size = new System.Drawing.Size(188, 35);
this.uiLabel5.TabIndex = 0;
this.uiLabel5.Text = "mol GT系数:";
//
// uiPanel14
//
this.uiPanel14.Controls.Add(this.uiTextBox11);
this.uiPanel14.Controls.Add(this.uiLabel11);
this.uiPanel14.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel14.FillColor = System.Drawing.Color.White;
this.uiPanel14.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel14.Location = new System.Drawing.Point(4, 63);
this.uiPanel14.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel14.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel14.Name = "uiPanel14";
this.uiPanel14.RectColor = System.Drawing.Color.White;
this.uiPanel14.Size = new System.Drawing.Size(929, 48);
this.uiPanel14.TabIndex = 5;
this.uiPanel14.Text = null;
this.uiPanel14.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox11
//
this.uiTextBox11.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox11.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox11.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox11.Location = new System.Drawing.Point(277, 0);
this.uiTextBox11.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox11.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox11.Name = "uiTextBox11";
this.uiTextBox11.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox11.ShowText = false;
this.uiTextBox11.Size = new System.Drawing.Size(120, 35);
this.uiTextBox11.TabIndex = 1;
this.uiTextBox11.Text = "0.00";
this.uiTextBox11.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox11.Watermark = "";
this.uiTextBox11.Click += new System.EventHandler(this.uiTextBox11_Click);
//
// 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(77, 7);
this.uiLabel11.Name = "uiLabel11";
this.uiLabel11.Size = new System.Drawing.Size(188, 35);
this.uiLabel11.TabIndex = 0;
this.uiLabel11.Text = "mol GTR系数:";
//
// uiPanel15
//
this.uiPanel15.Controls.Add(this.uiTextBox12);
this.uiPanel15.Controls.Add(this.uiLabel12);
this.uiPanel15.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel15.FillColor = System.Drawing.Color.White;
this.uiPanel15.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel15.Location = new System.Drawing.Point(4, 5);
this.uiPanel15.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel15.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel15.Name = "uiPanel15";
this.uiPanel15.RectColor = System.Drawing.Color.White;
this.uiPanel15.Size = new System.Drawing.Size(929, 48);
this.uiPanel15.TabIndex = 4;
this.uiPanel15.Text = null;
this.uiPanel15.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox12
//
this.uiTextBox12.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox12.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox12.Location = new System.Drawing.Point(277, 0);
this.uiTextBox12.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox12.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox12.Name = "uiTextBox12";
this.uiTextBox12.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox12.ShowText = false;
this.uiTextBox12.Size = new System.Drawing.Size(120, 35);
this.uiTextBox12.TabIndex = 1;
this.uiTextBox12.Text = "00";
this.uiTextBox12.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox12.Watermark = "";
this.uiTextBox12.Click += new System.EventHandler(this.uiTextBox12_Click);
//
// uiLabel12
//
this.uiLabel12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel12.Location = new System.Drawing.Point(77, 8);
this.uiLabel12.Name = "uiLabel12";
this.uiLabel12.Size = new System.Drawing.Size(188, 35);
this.uiLabel12.TabIndex = 0;
this.uiLabel12.Text = "1#平稳系数:";
//
// uiTableLayoutPanel5
//
this.uiTableLayoutPanel5.ColumnCount = 1;
this.uiTableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.uiTableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.uiTableLayoutPanel5.Controls.Add(this.uiPanel13, 0, 2);
this.uiTableLayoutPanel5.Controls.Add(this.uiPanel12, 0, 1);
this.uiTableLayoutPanel5.Controls.Add(this.uiPanel10, 0, 0);
this.uiTableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel5.Location = new System.Drawing.Point(3, 3);
this.uiTableLayoutPanel5.Name = "uiTableLayoutPanel5";
this.uiTableLayoutPanel5.RowCount = 3;
this.uiTableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.uiTableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33F));
this.uiTableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 34F));
this.uiTableLayoutPanel5.Size = new System.Drawing.Size(937, 176);
this.uiTableLayoutPanel5.TabIndex = 4;
this.uiTableLayoutPanel5.TagString = null;
//
// uiPanel13
//
this.uiPanel13.Controls.Add(this.uiTextBox10);
this.uiPanel13.Controls.Add(this.uiLabel10);
this.uiPanel13.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel13.FillColor = System.Drawing.Color.White;
this.uiPanel13.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel13.Location = new System.Drawing.Point(4, 121);
this.uiPanel13.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel13.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel13.Name = "uiPanel13";
this.uiPanel13.RectColor = System.Drawing.Color.White;
this.uiPanel13.Size = new System.Drawing.Size(929, 50);
this.uiPanel13.TabIndex = 6;
this.uiPanel13.Text = null;
this.uiPanel13.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox10
//
this.uiTextBox10.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox10.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox10.Location = new System.Drawing.Point(284, 0);
this.uiTextBox10.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox10.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox10.Name = "uiTextBox10";
this.uiTextBox10.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox10.ShowText = false;
this.uiTextBox10.Size = new System.Drawing.Size(120, 35);
this.uiTextBox10.TabIndex = 1;
this.uiTextBox10.Text = "0.00";
this.uiTextBox10.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox10.Watermark = "";
this.uiTextBox10.Click += new System.EventHandler(this.uiTextBox10_Click);
//
// uiLabel10
//
this.uiLabel10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel10.Location = new System.Drawing.Point(90, 7);
this.uiLabel10.Name = "uiLabel10";
this.uiLabel10.Size = new System.Drawing.Size(179, 35);
this.uiLabel10.TabIndex = 0;
this.uiLabel10.Text = "CM3 GT系数:";
//
// uiPanel12
//
this.uiPanel12.Controls.Add(this.uiTextBox9);
this.uiPanel12.Controls.Add(this.uiLabel9);
this.uiPanel12.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel12.FillColor = System.Drawing.Color.White;
this.uiPanel12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel12.Location = new System.Drawing.Point(4, 63);
this.uiPanel12.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel12.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel12.Name = "uiPanel12";
this.uiPanel12.RectColor = System.Drawing.Color.White;
this.uiPanel12.Size = new System.Drawing.Size(929, 48);
this.uiPanel12.TabIndex = 5;
this.uiPanel12.Text = null;
this.uiPanel12.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox9
//
this.uiTextBox9.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox9.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox9.Location = new System.Drawing.Point(284, 0);
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";
this.uiTextBox9.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox9.ShowText = false;
this.uiTextBox9.Size = new System.Drawing.Size(120, 35);
this.uiTextBox9.TabIndex = 1;
this.uiTextBox9.Text = "0.00";
this.uiTextBox9.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox9.Watermark = "";
this.uiTextBox9.Click += new System.EventHandler(this.uiTextBox9_Click);
//
// uiLabel9
//
this.uiLabel9.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel9.Location = new System.Drawing.Point(90, 7);
this.uiLabel9.Name = "uiLabel9";
this.uiLabel9.Size = new System.Drawing.Size(179, 35);
this.uiLabel9.TabIndex = 0;
this.uiLabel9.Text = "CM3 GTR系数:";
//
// uiPanel10
//
this.uiPanel10.Controls.Add(this.uiTextBox7);
this.uiPanel10.Controls.Add(this.uiLabel7);
this.uiPanel10.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel10.FillColor = System.Drawing.Color.White;
this.uiPanel10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel10.Location = new System.Drawing.Point(4, 5);
this.uiPanel10.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel10.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel10.Name = "uiPanel10";
this.uiPanel10.RectColor = System.Drawing.Color.White;
this.uiPanel10.Size = new System.Drawing.Size(929, 48);
this.uiPanel10.TabIndex = 4;
this.uiPanel10.Text = null;
this.uiPanel10.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiTextBox7
//
this.uiTextBox7.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox7.FillColor = System.Drawing.Color.Yellow;
this.uiTextBox7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox7.Location = new System.Drawing.Point(284, 0);
this.uiTextBox7.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox7.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox7.Name = "uiTextBox7";
this.uiTextBox7.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox7.ShowText = false;
this.uiTextBox7.Size = new System.Drawing.Size(120, 35);
this.uiTextBox7.TabIndex = 1;
this.uiTextBox7.Text = "0.0000";
this.uiTextBox7.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
this.uiTextBox7.Watermark = "";
this.uiTextBox7.Click += new System.EventHandler(this.uiTextBox7_Click);
//
// uiLabel7
//
this.uiLabel7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel7.Location = new System.Drawing.Point(90, 8);
this.uiLabel7.Name = "uiLabel7";
this.uiLabel7.Size = new System.Drawing.Size(209, 35);
this.uiLabel7.TabIndex = 0;
this.uiLabel7.Text = "设置自身压降值(kPa/s):";
//
// uiPanel7
//
this.uiPanel7.Controls.Add(this.uiButton1);
this.uiPanel7.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel7.FillColor = System.Drawing.Color.White;
this.uiPanel7.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel7.Location = new System.Drawing.Point(5, 563);
this.uiPanel7.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel7.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel7.Name = "uiPanel7";
this.uiPanel7.RectColor = System.Drawing.Color.White;
this.uiPanel7.Size = new System.Drawing.Size(1890, 396);
this.uiPanel7.TabIndex = 4;
this.uiPanel7.Text = null;
this.uiPanel7.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiButton1
//
this.uiButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton1.Font = new System.Drawing.Font("宋体", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Location = new System.Drawing.Point(790, 204);
this.uiButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton1.Name = "uiButton1";
this.uiButton1.Size = new System.Drawing.Size(152, 72);
this.uiButton1.TabIndex = 0;
this.uiButton1.Text = "返回";
this.uiButton1.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
//
// CoefficientForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1900, 1000);
this.Controls.Add(this.uiTableLayoutPanel1);
this.Name = "CoefficientForm";
this.Text = "薄膜气体透过率测试仪";
this.ZoomScaleRect = new System.Drawing.Rectangle(22, 22, 800, 450);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CoefficientForm_FormClosing);
this.Load += new System.EventHandler(this.CoefficientForm_Load);
this.uiTableLayoutPanel1.ResumeLayout(false);
this.uiPanel2.ResumeLayout(false);
this.uiGroupBox1.ResumeLayout(false);
this.uiTableLayoutPanel2.ResumeLayout(false);
this.uiPanel6.ResumeLayout(false);
this.uiPanel4.ResumeLayout(false);
this.uiPanel5.ResumeLayout(false);
this.uiPanel3.ResumeLayout(false);
this.uiGroupBox3.ResumeLayout(false);
this.uiTableLayoutPanel4.ResumeLayout(false);
this.uiTableLayoutPanel6.ResumeLayout(false);
this.uiPanel8.ResumeLayout(false);
this.uiPanel14.ResumeLayout(false);
this.uiPanel15.ResumeLayout(false);
this.uiTableLayoutPanel5.ResumeLayout(false);
this.uiPanel13.ResumeLayout(false);
this.uiPanel12.ResumeLayout(false);
this.uiPanel10.ResumeLayout(false);
this.uiPanel7.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel1;
private Sunny.UI.UIPanel uiPanel1;
private Sunny.UI.UIPanel uiPanel2;
private Sunny.UI.UIGroupBox uiGroupBox1;
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel2;
private Sunny.UI.UIPanel uiPanel6;
private Sunny.UI.UILabel uiLabel4;
private Sunny.UI.UIPanel uiPanel4;
private Sunny.UI.UITextBox uiTextBox2;
private Sunny.UI.UILabel uiLabel2;
private Sunny.UI.UIPanel uiPanel5;
private Sunny.UI.UITextBox uiTextBox3;
private Sunny.UI.UILabel uiLabel3;
private Sunny.UI.UIPanel uiPanel3;
private Sunny.UI.UITextBox uiTextBox1;
private Sunny.UI.UILabel uiLabel1;
private Sunny.UI.UIGroupBox uiGroupBox3;
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel4;
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel6;
private Sunny.UI.UIPanel uiPanel8;
private Sunny.UI.UITextBox uiTextBox5;
private Sunny.UI.UILabel uiLabel5;
private Sunny.UI.UIPanel uiPanel14;
private Sunny.UI.UITextBox uiTextBox11;
private Sunny.UI.UILabel uiLabel11;
private Sunny.UI.UIPanel uiPanel15;
private Sunny.UI.UITextBox uiTextBox12;
private Sunny.UI.UILabel uiLabel12;
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel5;
private Sunny.UI.UIPanel uiPanel13;
private Sunny.UI.UITextBox uiTextBox10;
private Sunny.UI.UILabel uiLabel10;
private Sunny.UI.UIPanel uiPanel12;
private Sunny.UI.UITextBox uiTextBox9;
private Sunny.UI.UILabel uiLabel9;
private Sunny.UI.UIPanel uiPanel10;
private Sunny.UI.UITextBox uiTextBox7;
private Sunny.UI.UILabel uiLabel7;
private Sunny.UI.UIPanel uiPanel7;
private Sunny.UI.UIButton uiButton1;
private Sunny.UI.UILabel uiLabel6;
}
}

View File

@@ -0,0 +1,444 @@
using Modbus.Device;
using Sunny.UI;
using Sunny.UI.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using .Data;
namespace
{
public partial class CoefficientForm : UIForm
{
#region
private TcpClient _tcpClient => ModbusResourceManager.Instance.TcpClient;
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
private System.Windows.Forms.Timer _readTimer;
#endregion
private TestScreen _testScreen;
Function ma;
DataChange c = new DataChange();
public CoefficientForm()
{
InitializeComponent();
InitTimer();
}
private System.Windows.Forms.Timer InitTimer()
{
var timer = new System.Windows.Forms.Timer()
{
Interval = 1000
};
timer.Tick += async (s, e) =>
{
if (_modbusMaster != null)
{
try
{
await ReadAddr262DataAsync();
}
catch { }
}
};
//timer.Start();
return timer;
}
private async System.Threading.Tasks.Task ReadAddr262DataAsync()
{
try
{
// 添加空值检查
if (_modbusMaster == null || _tcpClient == null || !_tcpClient.Connected)
{
return;
}
// 创建任务列表
var tasks = new List<Task>
{
ReadAndUpdateFloatAsync(1218, 2, uiLabel6,"F2",""),
ReadLeakTestParametersAsync()
//ReadStatusAsync()
};
await Task.WhenAll(tasks);
}
catch (Exception ex)
{
ShowError($"读取数据失败:{ex.Message}");
}
}
private async Task ReadAndUpdateFloatAsync(int address, int length, Label control, string format, string unit)
{
// 空值校验避免传入空控件导致后续Invoke报错
if (control == null)
{
System.Diagnostics.Debug.WriteLine($"读取地址{address}失败目标Label控件为空");
return;
}
try
{
ushort[] registers = await Task.Run(async () =>
{
// 双重空值校验避免_modbusMaster为空导致调用异常
if (_modbusMaster == null) return null;
return await _modbusMaster.ReadHoldingRegistersAsync(1, (ushort)address, (ushort)length);
});
// ===================== 数据有效性校验 & 解析 =====================
// 场景1读取到2个及以上寄存器 → 解析为浮点型数据占2个16位寄存器
if (registers != null && registers.Length >= 2)
{
// c.UshortToFloat自定义工具方法将2个16位无符号寄存器转换为32位浮点型
// 参数顺序registers[1]高位寄存器、registers[0](低位寄存器)→ 需匹配设备数据存储格式
float value = c.UshortToFloat(registers[1], registers[0]);
// ===================== WinForm UI控件更新 =====================
// Control.Invoke判断是否跨线程若跨线程则切换到UI线程更新控件
// WinForm中UI控件只能由创建它的主线程修改否则会抛出跨线程异常
if (control.InvokeRequired)
{
control.Invoke(new Action(() =>
{
control.Text = $"{value.ToString(format)}{unit}";
}));
}
else
{
// 若当前已是UI线程直接更新
control.Text = $"{value.ToString(format)}{unit}";
}
}
// 场景2读取到1个寄存器 → 解析为整型数据占1个16位寄存器
else if (registers != null && registers.Length >= 1)
{
// 直接取第一个寄存器的值作为整型数据
int value = registers[0];
// 同样通过Control.Invoke保证UI线程安全更新
if (control.InvokeRequired)
{
control.Invoke(new Action(() =>
{
control.Text = $"{value.ToString(format)}{unit}";
}));
}
else
{
control.Text = $"{value.ToString(format)}{unit}";
}
}
// 场景3registers为null或长度为0 → 无有效数据,不执行更新(静默处理)
else if (registers == null || registers.Length == 0)
{
System.Diagnostics.Debug.WriteLine($"读取地址{address}失败:未获取到有效寄存器数据");
}
}
catch (Exception ex)
{
//System.Diagnostics.Debug.WriteLine($"读取地址{address}失败:{ex.Message}\n异常堆栈{ex.StackTrace}");
ShowError($"读取地址{address}失败:{ex.Message}\n异常堆栈{ex.StackTrace}");
}
}
private void ShowError(string msg) => MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
private class RegisterConfig
{
public ushort Address { get; set; } // Modbus寄存器地址ushort类型匹配方法参数
public UITextBox TextBox { get; set; } // 适配SunnyUI的UITextBox控件
public string Format { get; set; } // 数值格式化字符串
public bool IsInteger { get; set; } // 是否为整数类型(新增)
}
private async Task ReadLeakTestParametersAsync()
{
// 前置校验:连接状态检查
if (_tcpClient == null || !_tcpClient.Connected || _modbusMaster == null)
{
return;
}
try
{
// 配置所有寄存器映射关系(统一管理,便于维护)
var registerConfigs = new List<RegisterConfig>
{
CreateRegisterConfig(1018, uiTextBox1, "F3",false), // 高压
CreateRegisterConfig(1118, uiTextBox3, "F3",false), // 低压
CreateRegisterConfig(1222, uiTextBox2, "F3",false), // 温度
CreateRegisterConfig(234, uiTextBox7, "F4",false), // 压降值
CreateRegisterConfig(230, uiTextBox12, "0",true), // 1#平稳系数
CreateRegisterConfig(242, uiTextBox9, "F2",false), // CM3 GTR系数
CreateRegisterConfig(246, uiTextBox10, "F2",false), // CM3 GT系数
CreateRegisterConfig(252, uiTextBox11, "F2",false), // mol GTR系数
CreateRegisterConfig(256, uiTextBox5, "F2",false) // mol GT系数
};
// 批量处理所有寄存器读取和UI更新
foreach (var config in registerConfigs)
{
await ReadRegisterAndUpdateUIAsync(config);
}
}
catch (Exception ex)
{
this.Invoke(new Action(() =>
{
UIMessageBox.ShowError($"读取系数失败:{ex.Message}");
}));
}
}
/// <summary>
/// 辅助方法创建寄存器配置对象适配C# 7.3语法)
/// </summary>
/// <param name="address">寄存器地址</param>
/// <param name="textBox">绑定的SunnyUI文本框</param>
/// <param name="format">数值格式化字符串</param>
private RegisterConfig CreateRegisterConfig(int address, UITextBox textBox, string format, bool isInteger)
{
var config = new RegisterConfig();
config.Address = (ushort)address; // 显式转换为ushort解决类型不匹配
config.TextBox = textBox;
config.Format = format;
config.IsInteger = isInteger; // 赋值整数类型标识
return config;
}
/// <summary>
/// 通用方法读取寄存器并更新SunnyUI文本框核心逻辑复用
/// </summary>
/// <param name="config">寄存器配置</param>
private async Task ReadRegisterAndUpdateUIAsync(RegisterConfig config)
{
// 异步读取Modbus寄存器避免阻塞UI线程
ushort[] registers = await Task.Run(() =>
_modbusMaster?.ReadHoldingRegisters(1, config.Address, 2));
// 数据有效性校验 + 区分整数/浮点处理
if (registers != null && registers.Length >= 2)
{
this.Invoke(new Action(() =>
{
if (config.IsInteger)
{
// 整数处理合并两个ushort为32位整数根据Modbus字节序调整
// 注意字节序需匹配设备端此处为registers[1]高位 + registers[0]低位)
int intValue = (registers[1] << 16) | registers[0];
config.TextBox.Text = intValue.ToString(config.Format);
}
else
{
// 浮点处理:保持原有逻辑
float floatValue = c.UshortToFloat(registers[1], registers[0]);
config.TextBox.Text = floatValue.ToString(config.Format);
}
}));
}
}
private void ShowErrorMsg(string msg)
{
// 判断当前线程是否是UI线程避免跨线程访问控件异常
if (this.InvokeRequired)
{
// 跨线程时通过Invoke切换到UI线程执行
this.Invoke(new Action<string>(ShowErrorMsg), msg);
return;
}
// UI线程直接显示错误提示框
MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
//返回
private void uiButton1_Click(object sender, EventArgs e)
{
SwitchWindow(ref _testScreen, () => new TestScreen());
}
private void CoefficientForm_Load(object sender, EventArgs e)
{
string plcIp = "192.168.1.10";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (!initSuccess)
{
MessageBox.Show("连接Modbus服务器失败", "错误");
this.Close();
return;
}
// 检查连接状态
if (_tcpClient == null || !_tcpClient.Connected)
{
MessageBox.Show("Modbus连接异常", "错误");
this.Close();
return;
}
ma = new Function(_modbusMaster);
_readTimer = InitTimer();
// 等_modbusMaster初始化完成后手动启动
if (_modbusMaster != null)
{
_readTimer.Start();
}
}
private void SwitchWindow<T>(ref T windowInstance, Func<T> createFunc) where T : UIForm
{
//1.停止当前窗口的定时器(不释放资源)
_readTimer?.Stop();
// 2. 检查资源是否可用(添加重连机制)
if (_tcpClient == null || !_tcpClient.Connected || _modbusMaster == null)
{
//尝试重新连接
bool reconnectSuccess = TryReconnect();
if (!reconnectSuccess)
{
MessageBox.Show("TCP连接已断开请重新连接", "提示");
return;
}
}
// 3. 复用窗口实例:不存在则创建,存在则激活
if (windowInstance == null)
{
windowInstance = createFunc();
// 添加窗口关闭事件处理
windowInstance.Closed += (s, args) =>
{
// 窗口关闭时重新启动定时器并显示当前窗口
//_readtimer?.Start();
//this.Show();
this.Activate();
};
}
else
{
// 激活已存在的窗口(前置显示)
windowInstance.Activate();
return;
}
// 4. 切换窗口:隐藏当前窗口,显示目标窗口(非模态)
this.Hide();
windowInstance.Show(); // 使用 Show() 而不是 ShowDialog()
}
private bool TryReconnect()
{
try
{
string plcIp = "192.168.1.10";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (initSuccess)
{
ma = new Function(_modbusMaster);
return true;
}
}
catch (Exception ex)
{
ShowError($"重新连接失败:{ex.Message}");
}
return false;
}
private void uiTextBox1_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox1.Text.Trim(), 1018, Function.DataType., 3);//高压
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox3_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox3.Text.Trim(), 1118, Function.DataType., 3);//低压
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox2_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox2.Text.Trim(), 1222, Function.DataType., 3);//温度
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox7_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox7.Text.Trim(), 234, Function.DataType., 4);//自身压降值
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox12_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox12.Text.Trim(), 230, Function.DataType.);//1#平稳系数
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox9_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox9.Text.Trim(), 242, Function.DataType.);//CM3 GTR系数
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox10_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox10.Text.Trim(), 246, Function.DataType.);//CM3 GT系数
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox11_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox11.Text.Trim(), 252, Function.DataType.);//mol GTR系数
System.Threading.Tasks.Task.Delay(50);
}
private void uiTextBox5_Click(object sender, EventArgs e)
{
ma?.WriteToPLCForNew(uiTextBox5.Text.Trim(), 256, Function.DataType.);//mol GT系数
System.Threading.Tasks.Task.Delay(50);
}
private void CoefficientForm_FormClosing(object sender, FormClosingEventArgs e)
{
_readTimer?.Stop();
_readTimer?.Dispose();
// 仅用户主动关闭时退出应用
if (e.CloseReason == CloseReason.UserClosing)
{
ModbusResourceManager.Instance?.Dispose();
Application.Exit();
}
}
}
}

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

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace .Data
{
public class BoolSignal
{
private bool _previousValue;
public event Action OnRisingEdge;
// bool value = true;
public bool Value { get; set; }
public void CheckRisingEdge()
{
if (Value && !_previousValue)
{
OnRisingEdge?.Invoke();
}
_previousValue = Value;
}
}
}

View File

@@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace
{
public class DataChange
{
/// <summary>
/// ushort转为float类型
/// </summary>
/// <param name="P1"></param>
/// <param name="P2"></param>
/// <returns>float型数据</returns>
public float UshortToFloat(ushort P1, ushort P2)
{
int intSign, intSignRest, intExponent, intExponentRest;
float faResult, faDigit;
intSign = P1 / 32768;
intSignRest = P1 % 32768;
intExponent = intSignRest / 128;
intExponentRest = intSignRest % 128;
faDigit = (float)(intExponentRest * 65536 + P2) / 8388608;
faResult = (float)Math.Pow(-1, intSign) * (float)Math.Pow(2, intExponent - 127) * (faDigit + 1);
return faResult;
}
/// <summary>
/// ushort转为int类型
/// </summary>
/// <param name="u1"></param>
/// <param name="u2"></param>
/// <returns>返回int型数据</returns>
public int UshortToInt1(ushort u1, ushort u2)
{
ushort[] maidong = new ushort[2] { u1, u2 };
byte[] bytes = new byte[maidong.Length * 2];
Buffer.BlockCopy(maidong, 0, bytes, 0, bytes.Length);
int result = BitConverter.ToInt32(bytes, 0);
// 将字节数组转换为32位无符号整数
return result;
}
/// <summary>
/// Float转为Ushort数组发送
/// </summary>
/// <param name="value"></param>
/// <returns>返回ushort数组</returns>
public ushort[] SplitFloatToUShortArray(float value)
{
byte[] floatBytes = BitConverter.GetBytes(value);
ushort[] ushortArray = new ushort[floatBytes.Length / 2];
for (int i = 0, j = 0; i < floatBytes.Length; i += 2, j++)
{
ushortArray[j] = BitConverter.ToUInt16(floatBytes, i);
}
return ushortArray;
}
/// <summary>
/// Int转为ushort数组发送
/// </summary>
/// <param name="res"></param>
/// <returns>返回ushort数组</returns>
public ushort[] intToushorts(int res)
{
ushort ust1 = (ushort)(res >> 16);
ushort ust2 = (ushort)res;
return new ushort[] { ust2, ust1 };
}
}
}

View File

@@ -0,0 +1,235 @@
using Modbus.Device;
using Modbus;
using Sunny.UI;
using System;
using System.Threading;
using System.Windows;
using System.Windows.Forms;
namespace
{
public class Function
{
ModbusMaster master;
IModbusMaster modbusMaster;
DataChange dc = new DataChange();
public enum ButtonType
{
,
,
,
}
public enum DataType
{
,
}
public Function(ModbusMaster master_in)
{
this.master = master_in;
}
public Function(IModbusMaster modbusMaster)
{
this.modbusMaster = modbusMaster;
}
public void BtnClickFunction(ButtonType buttonType, ushort address)
{
try
{
switch (buttonType)
{
case ButtonType.:
master.WriteSingleCoil(1, address, true);
Thread.Sleep(100);
master.WriteSingleCoil(1, address, false);
Thread.Sleep(100);
break;
case ButtonType.:
if (master.ReadCoils(1, address, 1)[0])
{
master.WriteSingleCoil(1, address, false); Thread.Sleep(100);
}
else
{ master.WriteSingleCoil(1, address, true); Thread.Sleep(100); }
break;
case ButtonType.:
master.WriteSingleCoil(1, address, true);
Thread.Sleep(100);
break;
case ButtonType.:
master.WriteSingleCoil(1, address, false);
Thread.Sleep(100);
break;
default:
break;
}
}
catch (Exception ex)
{
}
}
public void BtnClickFunctionForNew(ButtonType buttonType, ushort address)
{
try
{
switch (buttonType)
{
case ButtonType.:
modbusMaster.WriteSingleCoil(1, address, true);
Thread.Sleep(100);
modbusMaster.WriteSingleCoil(1, address, false);
Thread.Sleep(100);
break;
case ButtonType.:
if (modbusMaster.ReadCoils(1, address, 1)[0])
{
modbusMaster.WriteSingleCoil(1, address, false); Thread.Sleep(100);
}
else
{ modbusMaster.WriteSingleCoil(1, address, true); Thread.Sleep(100); }
break;
case ButtonType.:
modbusMaster.WriteSingleCoil(1, address, true);
Thread.Sleep(100);
break;
case ButtonType.:
modbusMaster.WriteSingleCoil(1, address, false);
Thread.Sleep(100);
break;
default:
break;
}
}
catch (Exception ex)
{
}
}
public void WriteToPLC(string inPutValue, ushort address, DataType dataType)
{
try
{
switch (dataType)
{
case DataType.:
double value = inPutValue.ToDouble();
if (UIInputDialog.ShowInputDoubleDialog(ref value, UIStyle.Inherited, desc: "请输入值", showMask: false))
{
master.WriteMultipleRegisters(1, address, dc.SplitFloatToUShortArray((float)value));
}
break;
case DataType.:
int value_int = inPutValue.ToInt();
if (UIInputDialog.ShowInputIntegerDialog(ref value_int, UIStyle.Inherited, desc: "请输入数据:"))
{
master.WriteMultipleRegisters(1, address, dc.intToushorts(value_int));
}
break;
default:
break;
}
}
catch (Exception ex)
{
MessageBox.Show("操作失败!" + "\n" + "\n" + ex.Message, "错误");
}
}
public void WriteToPLCForNew(string inPutValue, ushort address, DataType dataType, bool isok=false,float max=0,float min=0)
{
try
{
//KeyboardHelper.ShowSoftKeyboard();
switch (dataType)
{
case DataType.:
double value = inPutValue.ToDouble();
if (UIInputDialog.ShowInputDoubleDialog(ref value, UIStyle.Inherited, desc: "请输入值", showMask: false))
{
if ( isok&&value > max || value < min)
{
MessageBox.Show("数据不正确");
return;
}
modbusMaster.WriteMultipleRegisters(1, address, dc.SplitFloatToUShortArray((float)value));
}
break;
case DataType.:
int value_int = inPutValue.ToInt();
if (UIInputDialog.ShowInputIntegerDialog(ref value_int, UIStyle.Inherited, desc: "请输入数据:"))
{
modbusMaster.WriteMultipleRegisters(1, address, dc.intToushorts(value_int));
//if (isok)
//{ modbusMaster.WriteSingleCoil(1, 25, true); }
}
break;
default:
break;
}
//KeyboardHelper.HideSoftKeyboard();
}
catch (Exception ex)
{
MessageBox.Show("操作失败!" + "\n" + "\n" + ex.Message, "错误");
}
}
public void WriteToPLCForNew(string inPutValue, ushort address, DataType dataType, int d)
{
try
{
//KeyboardHelper.ShowSoftKeyboard();
switch (dataType)
{
case DataType.:
double value = inPutValue.ToDouble();
if (UIInputDialog.ShowInputDoubleDialog(ref value, UIStyle.Inherited, d, desc: "请输入值", showMask: false))
{
modbusMaster.WriteMultipleRegisters(1, address, dc.SplitFloatToUShortArray((float)value));
}
break;
case DataType.:
int value_int = inPutValue.ToInt();
if (UIInputDialog.ShowInputIntegerDialog(ref value_int, UIStyle.Inherited, desc: "请输入数据:"))
{
modbusMaster.WriteMultipleRegisters(1, address, dc.intToushorts(value_int));
//if (isok)
//{ modbusMaster.WriteSingleCoil(1, 25, true); }
}
break;
default:
break;
}
//KeyboardHelper.HideSoftKeyboard();
}
catch (Exception ex)
{
MessageBox.Show("操作失败!" + "\n" + "\n" + ex.Message, "错误");
}
}
}
}

View File

@@ -0,0 +1,21 @@
namespace
{
public class LoginData
{
static string _userName = "";
public string UserName
{
get { return _userName; }
set { _userName = value; }
}
//登陆权限
static int _userPower = 0;//0为普通用户1为管理员
public int UserPower
{
get { return _userPower; }
set { _userPower = value; }
}
}
}

View File

@@ -0,0 +1,69 @@
using System;
using Modbus.Device;
using System.Net.Sockets;
namespace .Data
{
// 单例模式:全局唯一资源管理器
public class ModbusResourceManager
{
// 私有构造函数禁止外部new
private ModbusResourceManager() { }
// 唯一实例
private static readonly Lazy<ModbusResourceManager> _instance = new Lazy<ModbusResourceManager>(() => new ModbusResourceManager());
public static ModbusResourceManager Instance => _instance.Value;
// 共享资源
public TcpClient TcpClient { get; private set; }
public IModbusMaster ModbusMaster { get; private set; }
// 初始化资源在程序启动时调用如MainWindow加载时
public bool Init(string ip, int port)
{
try
{
// 先释放旧资源
ReleaseResource();
// 创建新连接
TcpClient = new TcpClient();
TcpClient.Connect(ip, port);
ModbusMaster = ModbusIpMaster.CreateIp(TcpClient);
return true;
}
catch (Exception ex)
{
Console.WriteLine($"资源初始化失败:{ex.Message}");
ReleaseResource();
return false;
}
}
public void Dispose()
{
try
{
ModbusMaster?.Dispose();
TcpClient?.Close();
}
catch
{
// 忽略清理时的异常
}
}
// 释放资源(统一释放,避免重复关闭)
public void ReleaseResource()
{
ModbusMaster?.Dispose();
ModbusMaster = null;
//if (TcpClient?.Connected ?? false)
//{
// TcpClient.Close();
//}
TcpClient?.Dispose();
TcpClient = null;
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace .Data
{
internal class PLC_Data
{
}
}

View File

@@ -0,0 +1,71 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Security.Principal;
using System.Windows;
public class KeyboardHelper
{
public static void ShowSoftKeyboard()
{
if (!IsRunAsAdmin())
{
RestartAsAdmin();
return;
}
// 替换原有的 Process.Start 代码
string oskPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "osk.exe");
if (File.Exists(oskPath))
{
Process.Start(new ProcessStartInfo
{
FileName = oskPath,
UseShellExecute = true
});
}
else
{
//MessageBox.Show("未找到屏幕键盘程序osk.exe可能系统文件缺失或非Windows系统。", "错误");
}
}
public static void HideSoftKeyboard()
{
try
{
Process.Start("cmd.exe", "/C taskkill /IM osk.exe /F");
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
private static bool IsRunAsAdmin()
{
WindowsIdentity identity = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}
private static void RestartAsAdmin()
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.WorkingDirectory = Environment.CurrentDirectory;
startInfo.FileName = Process.GetCurrentProcess().MainModule.FileName;
startInfo.Verb = "runas";
try
{
Process.Start(startInfo);
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Environment.Exit(0);
}
}

View File

@@ -0,0 +1,396 @@
namespace
{
partial class MiopahReport
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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 dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = 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 dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
this.uiDataGridView1 = new Sunny.UI.UIDataGridView();
this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel3 = new Sunny.UI.UIPanel();
this.uiButton3 = new Sunny.UI.UIButton();
this.uiButton2 = new Sunny.UI.UIButton();
this.uiButton1 = new Sunny.UI.UIButton();
this.uiPanel1 = new Sunny.UI.UIPanel();
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiLabel2 = new Sunny.UI.UILabel();
this.uiLabel1 = new Sunny.UI.UILabel();
this.Column1 = 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.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).BeginInit();
this.uiTableLayoutPanel1.SuspendLayout();
this.uiPanel3.SuspendLayout();
this.uiPanel1.SuspendLayout();
this.uiPanel2.SuspendLayout();
this.SuspendLayout();
//
// uiDataGridView1
//
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
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("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
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;
this.uiDataGridView1.ColumnHeadersHeight = 32;
this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column2,
this.Column3,
this.Column4,
this.Column5,
this.Column6,
this.Column7,
this.Column8});
dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle11;
this.uiDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiDataGridView1.EnableHeadersVisualStyles = false;
this.uiDataGridView1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiDataGridView1.Location = new System.Drawing.Point(320, 20);
this.uiDataGridView1.Name = "uiDataGridView1";
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle12.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.Color.White;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle12;
this.uiDataGridView1.RowHeadersWidth = 62;
dataGridViewCellStyle13.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle13.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle13;
this.uiDataGridView1.RowTemplate.Height = 30;
this.uiDataGridView1.SelectedIndex = -1;
this.uiDataGridView1.Size = new System.Drawing.Size(1252, 673);
this.uiDataGridView1.StripeOddColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.uiDataGridView1.TabIndex = 0;
//
// uiTableLayoutPanel1
//
this.uiTableLayoutPanel1.ColumnCount = 1;
this.uiTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel3, 0, 2);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel1, 0, 1);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel2, 0, 0);
this.uiTableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel1.Location = new System.Drawing.Point(0, 35);
this.uiTableLayoutPanel1.Name = "uiTableLayoutPanel1";
this.uiTableLayoutPanel1.RowCount = 3;
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.uiTableLayoutPanel1.Size = new System.Drawing.Size(1900, 965);
this.uiTableLayoutPanel1.TabIndex = 1;
this.uiTableLayoutPanel1.TagString = null;
//
// uiPanel3
//
this.uiPanel3.Controls.Add(this.uiButton3);
this.uiPanel3.Controls.Add(this.uiButton2);
this.uiPanel3.Controls.Add(this.uiButton1);
this.uiPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel3.FillColor = System.Drawing.Color.White;
this.uiPanel3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel3.Location = new System.Drawing.Point(4, 872);
this.uiPanel3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel3.Name = "uiPanel3";
this.uiPanel3.Padding = new System.Windows.Forms.Padding(5);
this.uiPanel3.Size = new System.Drawing.Size(1892, 88);
this.uiPanel3.TabIndex = 2;
this.uiPanel3.Text = null;
this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiButton3
//
this.uiButton3.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton3.Location = new System.Drawing.Point(1084, 13);
this.uiButton3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton3.Name = "uiButton3";
this.uiButton3.Size = new System.Drawing.Size(113, 60);
this.uiButton3.TabIndex = 2;
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);
//
// uiButton2
//
this.uiButton2.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton2.Location = new System.Drawing.Point(904, 13);
this.uiButton2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton2.Name = "uiButton2";
this.uiButton2.Size = new System.Drawing.Size(113, 60);
this.uiButton2.TabIndex = 1;
this.uiButton2.Text = "导出";
this.uiButton2.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton2.Click += new System.EventHandler(this.uiButton2_Click);
//
// uiButton1
//
this.uiButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Location = new System.Drawing.Point(726, 13);
this.uiButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton1.Name = "uiButton1";
this.uiButton1.Size = new System.Drawing.Size(113, 60);
this.uiButton1.TabIndex = 0;
this.uiButton1.Text = "打印";
this.uiButton1.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.uiDataGridView1);
this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel1.FillColor = System.Drawing.Color.White;
this.uiPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel1.Location = new System.Drawing.Point(4, 149);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.Padding = new System.Windows.Forms.Padding(320, 20, 320, 20);
this.uiPanel1.RectColor = System.Drawing.Color.White;
this.uiPanel1.Size = new System.Drawing.Size(1892, 713);
this.uiPanel1.TabIndex = 0;
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiPanel2
//
this.uiPanel2.Controls.Add(this.uiLabel2);
this.uiPanel2.Controls.Add(this.uiLabel1);
this.uiPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel2.FillColor = System.Drawing.Color.White;
this.uiPanel2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel2.Location = new System.Drawing.Point(4, 5);
this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel2.Name = "uiPanel2";
this.uiPanel2.Padding = new System.Windows.Forms.Padding(5);
this.uiPanel2.RectColor = System.Drawing.Color.White;
this.uiPanel2.Size = new System.Drawing.Size(1892, 134);
this.uiPanel2.TabIndex = 1;
this.uiPanel2.Text = null;
this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel2
//
this.uiLabel2.Dock = System.Windows.Forms.DockStyle.Right;
this.uiLabel2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel2.Location = new System.Drawing.Point(1620, 5);
this.uiLabel2.Name = "uiLabel2";
this.uiLabel2.Size = new System.Drawing.Size(267, 124);
this.uiLabel2.TabIndex = 1;
this.uiLabel2.Text = "时间日期";
this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel1
//
this.uiLabel1.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel1.Location = new System.Drawing.Point(713, 34);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(434, 75);
this.uiLabel1.TabIndex = 0;
this.uiLabel1.Text = "秒帕记录";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Column1
//
this.Column1.DataPropertyName = "Num1";
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.Black;
this.Column1.DefaultCellStyle = dataGridViewCellStyle3;
this.Column1.HeaderText = "编号";
this.Column1.MinimumWidth = 8;
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 150;
//
// Column2
//
this.Column2.DataPropertyName = "Createtime1";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Black;
this.Column2.DefaultCellStyle = dataGridViewCellStyle4;
this.Column2.HeaderText = "时间日期";
this.Column2.MinimumWidth = 8;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.Width = 250;
//
// Column3
//
this.Column3.DataPropertyName = "Volume1";
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black;
this.Column3.DefaultCellStyle = dataGridViewCellStyle5;
this.Column3.HeaderText = "低压室体积(L)";
this.Column3.MinimumWidth = 8;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.Width = 180;
//
// Column4
//
this.Column4.DataPropertyName = "Area1";
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle6.ForeColor = System.Drawing.Color.Black;
this.Column4.DefaultCellStyle = dataGridViewCellStyle6;
this.Column4.HeaderText = "试样面积(m²)";
this.Column4.MinimumWidth = 8;
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 180;
//
// Column5
//
this.Column5.DataPropertyName = "Temperature1";
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.ForeColor = System.Drawing.Color.Black;
this.Column5.DefaultCellStyle = dataGridViewCellStyle7;
this.Column5.HeaderText = "试验温度(K)";
this.Column5.MinimumWidth = 8;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.Width = 180;
//
// Column6
//
this.Column6.DataPropertyName = "Thickness1";
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.ForeColor = System.Drawing.Color.Black;
this.Column6.DefaultCellStyle = dataGridViewCellStyle8;
this.Column6.HeaderText = "试样厚度(m)";
this.Column6.MinimumWidth = 8;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.Width = 180;
//
// Column7
//
this.Column7.DataPropertyName = "MolGTR";
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle9.ForeColor = System.Drawing.Color.Black;
this.Column7.DefaultCellStyle = dataGridViewCellStyle9;
this.Column7.HeaderText = "气体透过率GTR";
this.Column7.MinimumWidth = 8;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.Width = 200;
//
// Column8
//
this.Column8.DataPropertyName = "MolP";
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle10.ForeColor = System.Drawing.Color.Black;
this.Column8.DefaultCellStyle = dataGridViewCellStyle10;
this.Column8.HeaderText = "气体透过系数P";
this.Column8.MinimumWidth = 8;
this.Column8.Name = "Column8";
this.Column8.ReadOnly = true;
this.Column8.Width = 200;
//
// MiopahReport
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1900, 1000);
this.Controls.Add(this.uiTableLayoutPanel1);
this.Name = "MiopahReport";
this.Text = "薄膜气体透过率测试仪";
this.ZoomScaleRect = new System.Drawing.Rectangle(22, 22, 800, 450);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MiopahReport_FormClosing);
this.Load += new System.EventHandler(this.MiopahReport_Load);
((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).EndInit();
this.uiTableLayoutPanel1.ResumeLayout(false);
this.uiPanel3.ResumeLayout(false);
this.uiPanel1.ResumeLayout(false);
this.uiPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Sunny.UI.UIDataGridView uiDataGridView1;
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel1;
private Sunny.UI.UIPanel uiPanel1;
private Sunny.UI.UIPanel uiPanel2;
private Sunny.UI.UILabel uiLabel1;
private Sunny.UI.UIPanel uiPanel3;
private Sunny.UI.UILabel uiLabel2;
private Sunny.UI.UIButton uiButton3;
private Sunny.UI.UIButton uiButton2;
private Sunny.UI.UIButton uiButton1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
}
}

View File

@@ -0,0 +1,394 @@
using Modbus.Device;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using .Data;
using static .TestScreen;
namespace
{
public partial class MiopahReport : UIForm
{
#region
private TcpClient _tcpClient => ModbusResourceManager.Instance.TcpClient;
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
#endregion
private TestScreen _testScreen;
Timer Timer;
Function ma;
private List<MiopahReportRecord> reports;
public MiopahReport(List<MiopahReportRecord> reports)
{
InitializeComponent();
this.reports = reports;
Timer = new Timer();
Timer.Tick += Timer_Tick;
Timer.Interval = 500;
Timer.Start();
}
private void MiopahReport_Load(object sender, EventArgs e)
{
string plcIp = "192.168.1.10";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (!initSuccess)
{
MessageBox.Show("连接Modbus服务器失败", "错误");
this.Close();
return;
}
// 检查连接状态
if (_tcpClient == null || !_tcpClient.Connected)
{
MessageBox.Show("Modbus连接异常", "错误");
this.Close();
return;
}
ma = new Function(_modbusMaster);
uiDataGridView1.DataSource = reports;
uiDataGridView1.AllowUserToAddRows = false;
AdjustDataGridViewStyle();
}
private void Timer_Tick(object sender, EventArgs e)
{
uiLabel2.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
private void SwitchWindow<T>(ref T windowInstance, Func<T> createFunc) where T : UIForm
{
//1.停止当前窗口的定时器(不释放资源)
Timer?.Stop();
// 2. 检查资源是否可用(添加重连机制)
if (_tcpClient == null || !_tcpClient.Connected || _modbusMaster == null)
{
//尝试重新连接
bool reconnectSuccess = TryReconnect();
if (!reconnectSuccess)
{
MessageBox.Show("TCP连接已断开请重新连接", "提示");
return;
}
}
// 3. 复用窗口实例:不存在则创建,存在则激活
if (windowInstance == null)
{
windowInstance = createFunc();
// 添加窗口关闭事件处理
windowInstance.Closed += (s, args) =>
{
// 窗口关闭时重新启动定时器并显示当前窗口
//_readtimer?.Start();
//this.Show();
this.Activate();
};
}
else
{
// 激活已存在的窗口(前置显示)
windowInstance.Activate();
return;
}
// 4. 切换窗口:隐藏当前窗口,显示目标窗口(非模态)
this.Hide();
windowInstance.Show(); // 使用 Show() 而不是 ShowDialog()
}
private bool TryReconnect()
{
try
{
string plcIp = "192.168.1.10";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (initSuccess)
{
ma = new Function(_modbusMaster);
return true;
}
}
catch (Exception ex)
{
ShowError($"重新连接失败:{ex.Message}");
}
return false;
}
private void ShowError(string msg) => MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
private void AdjustDataGridViewStyle()
{
foreach (DataGridViewColumn column in uiDataGridView1.Columns)
{
// 自动调整列宽(适配内容)
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
// 列宽最小值(防止过窄)
if (column.Width < 120) column.Width = 120;
// 单元格内容居中
column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
}
}
private void ExportToExcel(string filePath)
{
try
{
string extension = Path.GetExtension(filePath).ToLower();
// 根据文件后缀分支处理
switch (extension)
{
case ".xlsx":
ExportToXlsx(filePath); // Excel格式支持样式
break;
case ".csv":
ExportToCsv(filePath); // CSV格式基础导出
break;
case ".pdf":
ShowMessage("提示", "PDF导出暂未实现已自动切换为Excel格式", UIMessageBoxIcon.Info);
ExportToXlsx(Path.ChangeExtension(filePath, ".xlsx"));
filePath = Path.ChangeExtension(filePath, ".xlsx");
break;
default:
throw new NotSupportedException("不支持的文件格式!");
}
ShowMessage("导出成功", $"报表已成功导出到:{filePath}", UIMessageBoxIcon.Success);
}
catch (Exception ex)
{
ShowMessage("导出错误", $"导出失败:{ex.Message}", UIMessageBoxIcon.Error);
}
}
/// <summary>
/// 导出为Excel.xlsx支持列宽调整+居中样式
/// </summary>
private void ExportToXlsx(string filePath)
{
// 授权EPPlus使用非商业用途
//ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial;
using (var package = new ExcelPackage())
{
var worksheet = package.Workbook.Worksheets.Add("秒帕记录报告");
// 找到化验编号输入文本框
//var labNumberInput = this.Controls.OfType<TextBox>()
// .FirstOrDefault(tb => tb.Location.X == uiDataGridView1.Width - 130 && tb.ReadOnly == false);
//string labNumberValue = labNumberInput?.Text?.Trim() ?? "未填写";
// 1. 写入化验编号第1行
//worksheet.Cells["A1"].Value = "化验编号";
//worksheet.Cells["B1"].Value = labNumberValue;
// 合并单元格(美化)
//worksheet.Cells["A1:B1"].Style.Font.Bold = true;
//worksheet.Cells["A1:B1"].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
// 2. 写入表头第3行空出第2行分隔
int headerRow = 1;
for (int i = 0; i < uiDataGridView1.Columns.Count; i++)
{
worksheet.Cells[headerRow, i + 1].Value = uiDataGridView1.Columns[i].HeaderText;
// 表头样式:加粗+居中
worksheet.Cells[headerRow, i + 1].Style.Font.Bold = true;
worksheet.Cells[headerRow, i + 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
worksheet.Cells[headerRow, i + 1].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
}
// 3. 写入数据行
int dataRow = headerRow + 1;
foreach (DataGridViewRow row in uiDataGridView1.Rows)
{
if (!row.IsNewRow)
{
for (int i = 0; i < row.Cells.Count; i++)
{
string cellValue = row.Cells[i].Value?.ToString() ?? "";
cellValue = cellValue.Replace("\n", " ").Replace("\r", " ").Trim();
worksheet.Cells[dataRow, i + 1].Value = cellValue;
// 数据居中
worksheet.Cells[dataRow, i + 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
worksheet.Cells[dataRow, i + 1].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
// 日期列特殊处理(确保格式完整)
if (uiDataGridView1.Columns[i].HeaderText.Contains("时间") ||
uiDataGridView1.Columns[i].HeaderText.Contains("日期"))
{
worksheet.Cells[dataRow, i + 1].Style.Numberformat.Format = "yyyy-MM-dd HH:mm:ss";
}
}
dataRow++;
}
}
// 4. 自动调整列宽(关键:解决日期显示不完整)
for (int i = 1; i <= uiDataGridView1.Columns.Count; i++)
{
// 自动适配内容宽度最小值15Excel列宽单位
worksheet.Column(i).AutoFit();
if (worksheet.Column(i).Width < 15)
{
worksheet.Column(i).Width = 15;
}
// 日期列强制加宽(避免仍截断)
if (worksheet.Cells[headerRow, i].Value?.ToString().Contains("时间") == true ||
worksheet.Cells[headerRow, i].Value?.ToString().Contains("日期") == true)
{
worksheet.Column(i).Width = 25;
}
}
// 5. 保存文件
package.SaveAs(new FileInfo(filePath));
}
}
private void ExportToCsv(string filePath)
{
var labNumberInput = this.Controls.OfType<TextBox>()
.FirstOrDefault(tb => tb.Location.X == uiDataGridView1.Width - 130 && tb.ReadOnly == false);
string labNumberValue = labNumberInput?.Text?.Trim() ?? "未填写";
using (var writer = new StreamWriter(filePath, false, System.Text.Encoding.UTF8))
{
writer.Write('\uFEFF');
writer.WriteLine(); // 空行分隔
// 写入表头
var headerCells = new List<string>();
foreach (DataGridViewColumn column in uiDataGridView1.Columns)
{
headerCells.Add(EscapeCsv(column.HeaderText));
}
writer.WriteLine(string.Join(",", headerCells));
// 写入数据
foreach (DataGridViewRow row in uiDataGridView1.Rows)
{
if (!row.IsNewRow)
{
var cells = new List<string>();
foreach (DataGridViewCell cell in row.Cells)
{
string cellValue = cell.Value?.ToString() ?? "";
cellValue = cellValue.Replace("\n", " ").Replace("\r", " ").Trim();
cells.Add(EscapeCsv(cellValue));
}
writer.WriteLine(string.Join(",", cells));
}
}
}
// 提示CSV样式调整方法
ShowMessage("提示", "CSV文件导出成功打开后可手动设置\n1. 选中列 → 右键 → 列宽建议日期列设为20\n2. 选中单元格 → 开始 → 居中对齐", UIMessageBoxIcon.Info);
}
private string EscapeCsv(string value)
{
if (string.IsNullOrEmpty(value))
return "";
if (value.Contains(",") || value.Contains("\"") || value.Contains("\n") || value.Contains("\r"))
{
value = value.Replace("\"", "\"\"");
return $"\"{value}\"";
}
return value;
}
private void ShowMessage(string title, string message, UIMessageBoxIcon icon)
{
switch (icon)
{
case UIMessageBoxIcon.Success:
UIMessageTip.ShowOk(message);
break;
case UIMessageBoxIcon.Error:
UIMessageTip.ShowError(message);
break;
case UIMessageBoxIcon.Info:
UIMessageTip.ShowWarning(message); // 此处可根据实际控件调整为Info样式
break;
default:
UIMessageBox.Show(message, title);
break;
}
}
//导出
private void uiButton2_Click(object sender, EventArgs e)
{
try
{
using (SaveFileDialog saveDialog = new SaveFileDialog())
{
saveDialog.Filter = "Excel文件|*.xlsx|CSV文件|*.csv|PDF文件|*.pdf";
saveDialog.Title = "导出报表";
saveDialog.FileName = $"秒帕记录报告_{DateTime.Now:yyyyMMdd_HHmmss}";
if (saveDialog.ShowDialog() == DialogResult.OK)
{
string filePath = saveDialog.FileName;
ExportToExcel(filePath);
}
}
}
catch (Exception ex)
{
ShowMessage("导出错误", $"导出失败:{ex.Message}", UIMessageBoxIcon.Error);
}
}
//打印
private void uiButton1_Click(object sender, EventArgs e)
{
ma?.BtnClickFunctionForNew(Function.ButtonType., 15);
}
//返回
private void uiButton3_Click(object sender, EventArgs e)
{
SwitchWindow(ref _testScreen, () => new TestScreen());
}
private void MiopahReport_FormClosing(object sender, FormClosingEventArgs e)
{
Timer?.Stop();
Timer?.Dispose();
// 仅用户主动关闭时退出应用
if (e.CloseReason == CloseReason.UserClosing)
{
ModbusResourceManager.Instance?.Dispose();
Application.Exit();
}
}
}
public enum UIMessageBoxIcon
{
Success,
Error,
Info,
Warning
}
}

View File

@@ -0,0 +1,144 @@
<?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>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new TestScreen());
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("薄膜气体透过率测试仪")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("薄膜气体透过率测试仪")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("50c29430-7b46-41e3-8f17-ba9b6e909620")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace .Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("薄膜气体透过率测试仪.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace .Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,123 @@
<?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>
<metadata name="uiTableLayoutPanel17.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@@ -0,0 +1,394 @@
namespace
{
partial class TianpaReport
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel3 = new Sunny.UI.UIPanel();
this.uiButton3 = new Sunny.UI.UIButton();
this.uiButton2 = new Sunny.UI.UIButton();
this.uiButton1 = new Sunny.UI.UIButton();
this.uiPanel1 = new Sunny.UI.UIPanel();
this.uiDataGridView1 = new Sunny.UI.UIDataGridView();
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiLabel2 = new Sunny.UI.UILabel();
this.uiLabel1 = new Sunny.UI.UILabel();
this.Column1 = 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.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.uiTableLayoutPanel1.SuspendLayout();
this.uiPanel3.SuspendLayout();
this.uiPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).BeginInit();
this.uiPanel2.SuspendLayout();
this.SuspendLayout();
//
// uiTableLayoutPanel1
//
this.uiTableLayoutPanel1.ColumnCount = 1;
this.uiTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel3, 0, 2);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel1, 0, 1);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel2, 0, 0);
this.uiTableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel1.Location = new System.Drawing.Point(0, 35);
this.uiTableLayoutPanel1.Name = "uiTableLayoutPanel1";
this.uiTableLayoutPanel1.RowCount = 3;
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.uiTableLayoutPanel1.Size = new System.Drawing.Size(1900, 965);
this.uiTableLayoutPanel1.TabIndex = 2;
this.uiTableLayoutPanel1.TagString = null;
//
// uiPanel3
//
this.uiPanel3.Controls.Add(this.uiButton3);
this.uiPanel3.Controls.Add(this.uiButton2);
this.uiPanel3.Controls.Add(this.uiButton1);
this.uiPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel3.FillColor = System.Drawing.Color.White;
this.uiPanel3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel3.Location = new System.Drawing.Point(4, 872);
this.uiPanel3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel3.Name = "uiPanel3";
this.uiPanel3.Padding = new System.Windows.Forms.Padding(5);
this.uiPanel3.Size = new System.Drawing.Size(1892, 88);
this.uiPanel3.TabIndex = 2;
this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiButton3
//
this.uiButton3.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton3.Location = new System.Drawing.Point(1084, 13);
this.uiButton3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton3.Name = "uiButton3";
this.uiButton3.Size = new System.Drawing.Size(113, 60);
this.uiButton3.TabIndex = 2;
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);
//
// uiButton2
//
this.uiButton2.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton2.Location = new System.Drawing.Point(904, 13);
this.uiButton2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton2.Name = "uiButton2";
this.uiButton2.Size = new System.Drawing.Size(113, 60);
this.uiButton2.TabIndex = 1;
this.uiButton2.Text = "导出";
this.uiButton2.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton2.Click += new System.EventHandler(this.uiButton2_Click);
//
// uiButton1
//
this.uiButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Location = new System.Drawing.Point(726, 13);
this.uiButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton1.Name = "uiButton1";
this.uiButton1.Size = new System.Drawing.Size(113, 60);
this.uiButton1.TabIndex = 0;
this.uiButton1.Text = "打印";
this.uiButton1.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.uiDataGridView1);
this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel1.FillColor = System.Drawing.Color.White;
this.uiPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel1.Location = new System.Drawing.Point(4, 149);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.Padding = new System.Windows.Forms.Padding(320, 20, 320, 20);
this.uiPanel1.RectColor = System.Drawing.Color.White;
this.uiPanel1.Size = new System.Drawing.Size(1892, 713);
this.uiPanel1.TabIndex = 0;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiDataGridView1
//
dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.uiDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle14;
this.uiDataGridView1.BackgroundColor = System.Drawing.Color.White;
this.uiDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle15.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle15.ForeColor = System.Drawing.Color.White;
dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15;
this.uiDataGridView1.ColumnHeadersHeight = 32;
this.uiDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column1,
this.Column2,
this.Column3,
this.Column4,
this.Column5,
this.Column6,
this.Column7,
this.Column8});
dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle24.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle24.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.uiDataGridView1.DefaultCellStyle = dataGridViewCellStyle24;
this.uiDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiDataGridView1.EnableHeadersVisualStyles = false;
this.uiDataGridView1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView1.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
this.uiDataGridView1.Location = new System.Drawing.Point(320, 20);
this.uiDataGridView1.Name = "uiDataGridView1";
dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle25.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
dataGridViewCellStyle25.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle25.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
dataGridViewCellStyle25.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
dataGridViewCellStyle25.SelectionForeColor = System.Drawing.Color.White;
dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.uiDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle25;
this.uiDataGridView1.RowHeadersWidth = 62;
dataGridViewCellStyle26.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle26.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle26;
this.uiDataGridView1.RowTemplate.Height = 30;
this.uiDataGridView1.SelectedIndex = -1;
this.uiDataGridView1.Size = new System.Drawing.Size(1252, 673);
this.uiDataGridView1.StripeOddColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.uiDataGridView1.TabIndex = 0;
//
// uiPanel2
//
this.uiPanel2.Controls.Add(this.uiLabel2);
this.uiPanel2.Controls.Add(this.uiLabel1);
this.uiPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel2.FillColor = System.Drawing.Color.White;
this.uiPanel2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel2.Location = new System.Drawing.Point(4, 5);
this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel2.Name = "uiPanel2";
this.uiPanel2.Padding = new System.Windows.Forms.Padding(5);
this.uiPanel2.RectColor = System.Drawing.Color.White;
this.uiPanel2.Size = new System.Drawing.Size(1892, 134);
this.uiPanel2.TabIndex = 1;
this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel2
//
this.uiLabel2.BackColor = System.Drawing.Color.White;
this.uiLabel2.Dock = System.Windows.Forms.DockStyle.Right;
this.uiLabel2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel2.Location = new System.Drawing.Point(1620, 5);
this.uiLabel2.Name = "uiLabel2";
this.uiLabel2.Size = new System.Drawing.Size(267, 124);
this.uiLabel2.TabIndex = 1;
this.uiLabel2.Text = "时间日期";
this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel1
//
this.uiLabel1.BackColor = System.Drawing.Color.White;
this.uiLabel1.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel1.Location = new System.Drawing.Point(713, 36);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(434, 75);
this.uiLabel1.TabIndex = 0;
this.uiLabel1.Text = "天帕记录";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Column1
//
this.Column1.DataPropertyName = "Num2";
dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle16.ForeColor = System.Drawing.Color.Black;
this.Column1.DefaultCellStyle = dataGridViewCellStyle16;
this.Column1.HeaderText = "编号";
this.Column1.MinimumWidth = 8;
this.Column1.Name = "Column1";
this.Column1.ReadOnly = true;
this.Column1.Width = 150;
//
// Column2
//
this.Column2.DataPropertyName = "Createtime2";
dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle17.ForeColor = System.Drawing.Color.Black;
this.Column2.DefaultCellStyle = dataGridViewCellStyle17;
this.Column2.HeaderText = "时间日期";
this.Column2.MinimumWidth = 8;
this.Column2.Name = "Column2";
this.Column2.ReadOnly = true;
this.Column2.Width = 250;
//
// Column3
//
this.Column3.DataPropertyName = "Volume2";
dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle18.ForeColor = System.Drawing.Color.Black;
this.Column3.DefaultCellStyle = dataGridViewCellStyle18;
this.Column3.HeaderText = "低压室体积(cm³)";
this.Column3.MinimumWidth = 8;
this.Column3.Name = "Column3";
this.Column3.ReadOnly = true;
this.Column3.Width = 200;
//
// Column4
//
this.Column4.DataPropertyName = "Area2";
dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle19.ForeColor = System.Drawing.Color.Black;
this.Column4.DefaultCellStyle = dataGridViewCellStyle19;
this.Column4.HeaderText = "试样面积(m²)";
this.Column4.MinimumWidth = 8;
this.Column4.Name = "Column4";
this.Column4.ReadOnly = true;
this.Column4.Width = 180;
//
// Column5
//
this.Column5.DataPropertyName = "Temperature2";
dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle20.ForeColor = System.Drawing.Color.Black;
this.Column5.DefaultCellStyle = dataGridViewCellStyle20;
this.Column5.HeaderText = "试验温度(K)";
this.Column5.MinimumWidth = 8;
this.Column5.Name = "Column5";
this.Column5.ReadOnly = true;
this.Column5.Width = 180;
//
// Column6
//
this.Column6.DataPropertyName = "Thickness2";
dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle21.ForeColor = System.Drawing.Color.Black;
this.Column6.DefaultCellStyle = dataGridViewCellStyle21;
this.Column6.HeaderText = "试样厚度(m)";
this.Column6.MinimumWidth = 8;
this.Column6.Name = "Column6";
this.Column6.ReadOnly = true;
this.Column6.Width = 180;
//
// Column7
//
this.Column7.DataPropertyName = "CM3GTR";
dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle22.ForeColor = System.Drawing.Color.Black;
this.Column7.DefaultCellStyle = dataGridViewCellStyle22;
this.Column7.HeaderText = "气体透过率GTR";
this.Column7.MinimumWidth = 8;
this.Column7.Name = "Column7";
this.Column7.ReadOnly = true;
this.Column7.Width = 180;
//
// Column8
//
this.Column8.DataPropertyName = "CM3P";
dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle23.ForeColor = System.Drawing.Color.Black;
this.Column8.DefaultCellStyle = dataGridViewCellStyle23;
this.Column8.HeaderText = "气体透过系数P";
this.Column8.MinimumWidth = 8;
this.Column8.Name = "Column8";
this.Column8.ReadOnly = true;
this.Column8.Width = 180;
//
// TianpaReport
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1900, 1000);
this.Controls.Add(this.uiTableLayoutPanel1);
this.Name = "TianpaReport";
this.Text = "薄膜气体透过率测试仪";
this.ZoomScaleRect = new System.Drawing.Rectangle(22, 22, 800, 450);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TianpaReport_FormClosing);
this.Load += new System.EventHandler(this.TianpaReport_Load);
this.uiTableLayoutPanel1.ResumeLayout(false);
this.uiPanel3.ResumeLayout(false);
this.uiPanel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).EndInit();
this.uiPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel1;
private Sunny.UI.UIPanel uiPanel3;
private Sunny.UI.UIButton uiButton3;
private Sunny.UI.UIButton uiButton2;
private Sunny.UI.UIButton uiButton1;
private Sunny.UI.UIPanel uiPanel1;
private Sunny.UI.UIDataGridView uiDataGridView1;
private Sunny.UI.UIPanel uiPanel2;
private Sunny.UI.UILabel uiLabel2;
private Sunny.UI.UILabel uiLabel1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
private System.Windows.Forms.DataGridViewTextBoxColumn Column8;
}
}

View File

@@ -0,0 +1,391 @@
using Modbus.Device;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using .Data;
using static .TestScreen;
namespace
{
public partial class TianpaReport : UIForm
{
#region
private TcpClient _tcpClient => ModbusResourceManager.Instance.TcpClient;
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
#endregion
private TestScreen _testScreen;
Timer Timer;
Function ma;
private List<TianpaReportRecord> reports;
public TianpaReport(List<TianpaReportRecord> reports)
{
InitializeComponent();
this.reports = reports;
Timer = new Timer();
Timer.Tick += Timer_Tick;
Timer.Interval = 500;
Timer.Start();
}
private void Timer_Tick(object sender, EventArgs e)
{
uiLabel2.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
private void SwitchWindow<T>(ref T windowInstance, Func<T> createFunc) where T : UIForm
{
//1.停止当前窗口的定时器(不释放资源)
Timer?.Stop();
// 2. 检查资源是否可用(添加重连机制)
if (_tcpClient == null || !_tcpClient.Connected || _modbusMaster == null)
{
//尝试重新连接
bool reconnectSuccess = TryReconnect();
if (!reconnectSuccess)
{
MessageBox.Show("TCP连接已断开请重新连接", "提示");
return;
}
}
// 3. 复用窗口实例:不存在则创建,存在则激活
if (windowInstance == null)
{
windowInstance = createFunc();
// 添加窗口关闭事件处理
windowInstance.Closed += (s, args) =>
{
// 窗口关闭时重新启动定时器并显示当前窗口
//_readtimer?.Start();
//this.Show();
this.Activate();
};
}
else
{
// 激活已存在的窗口(前置显示)
windowInstance.Activate();
return;
}
// 4. 切换窗口:隐藏当前窗口,显示目标窗口(非模态)
this.Hide();
windowInstance.Show(); // 使用 Show() 而不是 ShowDialog()
}
private bool TryReconnect()
{
try
{
string plcIp = "192.168.1.10";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (initSuccess)
{
ma = new Function(_modbusMaster);
return true;
}
}
catch (Exception ex)
{
ShowError($"重新连接失败:{ex.Message}");
}
return false;
}
private void ShowError(string msg) => MessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
private void AdjustDataGridViewStyle()
{
foreach (DataGridViewColumn column in uiDataGridView1.Columns)
{
// 自动调整列宽(适配内容)
column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
// 列宽最小值(防止过窄)
if (column.Width < 120) column.Width = 150;
// 单元格内容居中
column.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
column.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
}
}
private void ExportToExcel(string filePath)
{
try
{
string extension = Path.GetExtension(filePath).ToLower();
// 根据文件后缀分支处理
switch (extension)
{
case ".xlsx":
ExportToXlsx(filePath); // Excel格式支持样式
break;
case ".csv":
ExportToCsv(filePath); // CSV格式基础导出
break;
case ".pdf":
ShowMessage("提示", "PDF导出暂未实现已自动切换为Excel格式", UIMessageBoxIcon.Info);
ExportToXlsx(Path.ChangeExtension(filePath, ".xlsx"));
filePath = Path.ChangeExtension(filePath, ".xlsx");
break;
default:
throw new NotSupportedException("不支持的文件格式!");
}
ShowMessage("导出成功", $"报表已成功导出到:{filePath}", UIMessageBoxIcon.Success);
}
catch (Exception ex)
{
ShowMessage("导出错误", $"导出失败:{ex.Message}", UIMessageBoxIcon.Error);
}
}
/// <summary>
/// 导出为Excel.xlsx支持列宽调整+居中样式
/// </summary>
private void ExportToXlsx(string filePath)
{
// 授权EPPlus使用非商业用途
//ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial;
using (var package = new ExcelPackage())
{
var worksheet = package.Workbook.Worksheets.Add("秒帕记录报告");
// 找到化验编号输入文本框
//var labNumberInput = this.Controls.OfType<TextBox>()
// .FirstOrDefault(tb => tb.Location.X == uiDataGridView1.Width - 130 && tb.ReadOnly == false);
//string labNumberValue = labNumberInput?.Text?.Trim() ?? "未填写";
// 1. 写入化验编号第1行
//worksheet.Cells["A1"].Value = "化验编号";
//worksheet.Cells["B1"].Value = labNumberValue;
// 合并单元格(美化)
//worksheet.Cells["A1:B1"].Style.Font.Bold = true;
//worksheet.Cells["A1:B1"].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
// 2. 写入表头第3行空出第2行分隔
int headerRow = 1;
for (int i = 0; i < uiDataGridView1.Columns.Count; i++)
{
worksheet.Cells[headerRow, i + 1].Value = uiDataGridView1.Columns[i].HeaderText;
// 表头样式:加粗+居中
worksheet.Cells[headerRow, i + 1].Style.Font.Bold = true;
worksheet.Cells[headerRow, i + 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
worksheet.Cells[headerRow, i + 1].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
}
// 3. 写入数据行
int dataRow = headerRow + 1;
foreach (DataGridViewRow row in uiDataGridView1.Rows)
{
if (!row.IsNewRow)
{
for (int i = 0; i < row.Cells.Count; i++)
{
string cellValue = row.Cells[i].Value?.ToString() ?? "";
cellValue = cellValue.Replace("\n", " ").Replace("\r", " ").Trim();
worksheet.Cells[dataRow, i + 1].Value = cellValue;
// 数据居中
worksheet.Cells[dataRow, i + 1].Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
worksheet.Cells[dataRow, i + 1].Style.VerticalAlignment = ExcelVerticalAlignment.Center;
// 日期列特殊处理(确保格式完整)
if (uiDataGridView1.Columns[i].HeaderText.Contains("时间") ||
uiDataGridView1.Columns[i].HeaderText.Contains("日期"))
{
worksheet.Cells[dataRow, i + 1].Style.Numberformat.Format = "yyyy-MM-dd HH:mm:ss";
}
}
dataRow++;
}
}
// 4. 自动调整列宽(关键:解决日期显示不完整)
for (int i = 1; i <= uiDataGridView1.Columns.Count; i++)
{
// 自动适配内容宽度最小值15Excel列宽单位
worksheet.Column(i).AutoFit();
if (worksheet.Column(i).Width < 15)
{
worksheet.Column(i).Width = 15;
}
// 日期列强制加宽(避免仍截断)
if (worksheet.Cells[headerRow, i].Value?.ToString().Contains("时间") == true ||
worksheet.Cells[headerRow, i].Value?.ToString().Contains("日期") == true)
{
worksheet.Column(i).Width = 25;
}
}
// 5. 保存文件
package.SaveAs(new FileInfo(filePath));
}
}
private void ExportToCsv(string filePath)
{
var labNumberInput = this.Controls.OfType<TextBox>()
.FirstOrDefault(tb => tb.Location.X == uiDataGridView1.Width - 130 && tb.ReadOnly == false);
string labNumberValue = labNumberInput?.Text?.Trim() ?? "未填写";
using (var writer = new StreamWriter(filePath, false, System.Text.Encoding.UTF8))
{
writer.Write('\uFEFF');
writer.WriteLine(); // 空行分隔
// 写入表头
var headerCells = new List<string>();
foreach (DataGridViewColumn column in uiDataGridView1.Columns)
{
headerCells.Add(EscapeCsv(column.HeaderText));
}
writer.WriteLine(string.Join(",", headerCells));
// 写入数据
foreach (DataGridViewRow row in uiDataGridView1.Rows)
{
if (!row.IsNewRow)
{
var cells = new List<string>();
foreach (DataGridViewCell cell in row.Cells)
{
string cellValue = cell.Value?.ToString() ?? "";
cellValue = cellValue.Replace("\n", " ").Replace("\r", " ").Trim();
cells.Add(EscapeCsv(cellValue));
}
writer.WriteLine(string.Join(",", cells));
}
}
}
// 提示CSV样式调整方法
ShowMessage("提示", "CSV文件导出成功打开后可手动设置\n1. 选中列 → 右键 → 列宽建议日期列设为20\n2. 选中单元格 → 开始 → 居中对齐", UIMessageBoxIcon.Info);
}
private string EscapeCsv(string value)
{
if (string.IsNullOrEmpty(value))
return "";
if (value.Contains(",") || value.Contains("\"") || value.Contains("\n") || value.Contains("\r"))
{
value = value.Replace("\"", "\"\"");
return $"\"{value}\"";
}
return value;
}
private void ShowMessage(string title, string message, UIMessageBoxIcon icon)
{
switch (icon)
{
case UIMessageBoxIcon.Success:
UIMessageTip.ShowOk(message);
break;
case UIMessageBoxIcon.Error:
UIMessageTip.ShowError(message);
break;
case UIMessageBoxIcon.Info:
UIMessageTip.ShowWarning(message); // 此处可根据实际控件调整为Info样式
break;
default:
UIMessageBox.Show(message, title);
break;
}
}
private void TianpaReport_Load(object sender, EventArgs e)
{
string plcIp = "192.168.1.10";
bool initSuccess = Data.ModbusResourceManager.Instance.Init(plcIp, 502);
if (!initSuccess)
{
MessageBox.Show("连接Modbus服务器失败", "错误");
this.Close();
return;
}
// 检查连接状态
if (_tcpClient == null || !_tcpClient.Connected)
{
MessageBox.Show("Modbus连接异常", "错误");
this.Close();
return;
}
ma = new Function(_modbusMaster);
uiDataGridView1.DataSource = reports;
uiDataGridView1.AllowUserToAddRows = false;
AdjustDataGridViewStyle();
}
private void TianpaReport_FormClosing(object sender, FormClosingEventArgs e)
{
Timer?.Stop();
Timer?.Dispose();
// 仅用户主动关闭时退出应用
if (e.CloseReason == CloseReason.UserClosing)
{
ModbusResourceManager.Instance?.Dispose();
Application.Exit();
}
}
//打印
private void uiButton1_Click(object sender, EventArgs e)
{
ma?.BtnClickFunctionForNew(Function.ButtonType., 15);
}
//导出
private void uiButton2_Click(object sender, EventArgs e)
{
try
{
using (SaveFileDialog saveDialog = new SaveFileDialog())
{
saveDialog.Filter = "Excel文件|*.xlsx|CSV文件|*.csv|PDF文件|*.pdf";
saveDialog.Title = "导出报表";
saveDialog.FileName = $"天帕记录报告_{DateTime.Now:yyyyMMdd_HHmmss}";
if (saveDialog.ShowDialog() == DialogResult.OK)
{
string filePath = saveDialog.FileName;
ExportToExcel(filePath);
}
}
}
catch (Exception ex)
{
ShowMessage("导出错误", $"导出失败:{ex.Message}", UIMessageBoxIcon.Error);
}
}
//返回
private void uiButton3_Click(object sender, EventArgs e)
{
SwitchWindow(ref _testScreen, () => new TestScreen());
}
}
}

View File

@@ -0,0 +1,144 @@
<?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>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column4.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column5.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column6.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -0,0 +1,204 @@
using Sunny.UI;
using System.Drawing;
using System.Windows.Forms;
namespace
{
partial class TrendChart
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.uiTableLayoutPanel1 = new Sunny.UI.UITableLayoutPanel();
this.uiPanel3 = new Sunny.UI.UIPanel();
this.uiButton1 = new Sunny.UI.UIButton();
this.uiPanel1 = new Sunny.UI.UIPanel();
this.plotView1 = new OxyPlot.WindowsForms.PlotView();
this.uiPanel2 = new Sunny.UI.UIPanel();
this.uiLabel2 = new Sunny.UI.UILabel();
this.uiLabel1 = new Sunny.UI.UILabel();
this.uiTableLayoutPanel1.SuspendLayout();
this.uiPanel3.SuspendLayout();
this.uiPanel1.SuspendLayout();
this.uiPanel2.SuspendLayout();
this.SuspendLayout();
//
// uiTableLayoutPanel1
//
this.uiTableLayoutPanel1.ColumnCount = 1;
this.uiTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel3, 0, 2);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel1, 0, 1);
this.uiTableLayoutPanel1.Controls.Add(this.uiPanel2, 0, 0);
this.uiTableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTableLayoutPanel1.Location = new System.Drawing.Point(0, 35);
this.uiTableLayoutPanel1.Name = "uiTableLayoutPanel1";
this.uiTableLayoutPanel1.RowCount = 3;
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F));
this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.uiTableLayoutPanel1.Size = new System.Drawing.Size(1900, 965);
this.uiTableLayoutPanel1.TabIndex = 3;
this.uiTableLayoutPanel1.TagString = null;
//
// uiPanel3
//
this.uiPanel3.Controls.Add(this.uiButton1);
this.uiPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel3.FillColor = System.Drawing.Color.White;
this.uiPanel3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel3.Location = new System.Drawing.Point(4, 872);
this.uiPanel3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel3.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel3.Name = "uiPanel3";
this.uiPanel3.Padding = new System.Windows.Forms.Padding(5);
this.uiPanel3.RectColor = System.Drawing.Color.White;
this.uiPanel3.Size = new System.Drawing.Size(1892, 88);
this.uiPanel3.TabIndex = 2;
this.uiPanel3.Text = null;
this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiButton1
//
this.uiButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiButton1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(152)))), ((int)(((byte)(219)))));
this.uiButton1.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(128)))), ((int)(((byte)(185)))));
this.uiButton1.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(102)))), ((int)(((byte)(148)))));
this.uiButton1.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Location = new System.Drawing.Point(864, 20);
this.uiButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiButton1.Name = "uiButton1";
this.uiButton1.Radius = 8;
this.uiButton1.RectColor = System.Drawing.Color.Transparent;
this.uiButton1.Size = new System.Drawing.Size(158, 53);
this.uiButton1.Style = Sunny.UI.UIStyle.Custom;
this.uiButton1.TabIndex = 0;
this.uiButton1.Text = "📊 导出图表";
this.uiButton1.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.plotView1);
this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel1.FillColor = System.Drawing.Color.White;
this.uiPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel1.Location = new System.Drawing.Point(4, 149);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.Padding = new System.Windows.Forms.Padding(100, 30, 100, 30);
this.uiPanel1.RectColor = System.Drawing.Color.White;
this.uiPanel1.Size = new System.Drawing.Size(1892, 713);
this.uiPanel1.TabIndex = 0;
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// plotView1
//
this.plotView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.plotView1.Location = new System.Drawing.Point(100, 30);
this.plotView1.Name = "plotView1";
this.plotView1.PanCursor = System.Windows.Forms.Cursors.Hand;
this.plotView1.Size = new System.Drawing.Size(1692, 653);
this.plotView1.TabIndex = 0;
this.plotView1.Text = "plotView1";
this.plotView1.ZoomHorizontalCursor = System.Windows.Forms.Cursors.SizeWE;
this.plotView1.ZoomRectangleCursor = System.Windows.Forms.Cursors.SizeNWSE;
this.plotView1.ZoomVerticalCursor = System.Windows.Forms.Cursors.SizeNS;
//
// uiPanel2
//
this.uiPanel2.Controls.Add(this.uiLabel2);
this.uiPanel2.Controls.Add(this.uiLabel1);
this.uiPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiPanel2.FillColor = System.Drawing.Color.White;
this.uiPanel2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel2.Location = new System.Drawing.Point(4, 5);
this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel2.Name = "uiPanel2";
this.uiPanel2.Padding = new System.Windows.Forms.Padding(5);
this.uiPanel2.RectColor = System.Drawing.Color.White;
this.uiPanel2.Size = new System.Drawing.Size(1892, 134);
this.uiPanel2.TabIndex = 1;
this.uiPanel2.Text = null;
this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel2
//
this.uiLabel2.BackColor = System.Drawing.Color.White;
this.uiLabel2.Dock = System.Windows.Forms.DockStyle.Right;
this.uiLabel2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel2.Location = new System.Drawing.Point(1620, 5);
this.uiLabel2.Name = "uiLabel2";
this.uiLabel2.Size = new System.Drawing.Size(267, 124);
this.uiLabel2.TabIndex = 1;
this.uiLabel2.Text = "时间日期";
this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiLabel1
//
this.uiLabel1.BackColor = System.Drawing.Color.White;
this.uiLabel1.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel1.Location = new System.Drawing.Point(713, 36);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(434, 75);
this.uiLabel1.TabIndex = 0;
this.uiLabel1.Text = "趋势图表";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// TrendChart
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1900, 1000);
this.Controls.Add(this.uiTableLayoutPanel1);
this.Name = "TrendChart";
this.Text = "薄膜气体透过率测试仪";
this.ZoomScaleRect = new System.Drawing.Rectangle(22, 22, 800, 450);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.TrendChart_FormClosing);
this.uiTableLayoutPanel1.ResumeLayout(false);
this.uiPanel3.ResumeLayout(false);
this.uiPanel1.ResumeLayout(false);
this.uiPanel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private Sunny.UI.UITableLayoutPanel uiTableLayoutPanel1;
private Sunny.UI.UIPanel uiPanel3;
private Sunny.UI.UIPanel uiPanel1;
private Sunny.UI.UIPanel uiPanel2;
private Sunny.UI.UILabel uiLabel2;
private Sunny.UI.UILabel uiLabel1;
private OxyPlot.WindowsForms.PlotView plotView1;
private Sunny.UI.UIButton uiButton1;
}
}

View File

@@ -0,0 +1,524 @@
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Legends;
using OxyPlot.Series;
using OxyPlot.WindowsForms;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using .Data;
using OxyPlot.Pdf;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
namespace
{
public partial class TrendChart : UIForm
{
private TestScreen _testScreen;
Timer Timer;
public List<lineData> Data { get; set; }
public void AddChart(lineData data)
{
Data.Add(data);
CreateBasicLineChart();
}
public TrendChart(List<lineData> Data)
{
InitializeComponent();
Timer = new Timer();
Timer.Tick += Timer_Tick;
Timer.Interval = 500;
Timer.Start();
this.Data = Data;
if (Data == null || Data.Count() == 0)
{
Data = new List<lineData>();
}
CreateBasicLineChart();
}
private void Timer_Tick(object sender, EventArgs e)
{
uiLabel2.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
private void CreateBasicLineChart()
{
// 创建模型
var plotModel = new PlotModel
{
//Title = "月度销售额统计",
//TitleFontSize = 16,
//TitleFontWeight = FontWeights.Bold
};
// 设置坐标轴
plotModel.Axes.Add(new LinearAxis
{
Position = AxisPosition.Left,
Title = "低压室压力(kPa)",
//MajorStep = 0.05,
// 可选:设置最小范围,确保坐标轴不会太小
MinimumRange = 0.1, // 最小显示范围
// 可选:设置绝对的边界
AbsoluteMinimum = 0, // 确保最小值不会低于0
AbsoluteMaximum = double.MaxValue, // 最大值无上限
// 自动调整的额外设置
MaximumPadding = 0.05, // 顶部留5%的空白
MinimumPadding = 0.05, // 底部留5%的空白
});
plotModel.Axes.Add(new CategoryAxis
{
Position = AxisPosition.Bottom,
Title = "时间",
MajorStep = 30,
ItemsSource = Data.Select(s => s.X)
});
// 创建折线系列
var lineSeries = new LineSeries
{
//Title = "2024年",
Color = OxyColor.FromRgb(255, 0, 0), // 红色
//MarkerType = MarkerType.Circle,
//MarkerSize = 5,
//MarkerFill = OxyColors.Red,
MarkerStroke = OxyColors.White,
MarkerStrokeThickness = 1,
StrokeThickness = 2
};
// 添加数据点
float[] salesData = Data.Select(x => x.Y).ToArray();
for (int i = 0; i < salesData.Length; i++)
{
lineSeries.Points.Add(new DataPoint(i, salesData[i]));
}
// 添加系列到模型
plotModel.Series.Add(lineSeries);
// 设置背景色
plotModel.Background = OxyColors.White;
plotModel.PlotAreaBorderColor = OxyColors.LightGray;
// 应用到PlotView
plotView1.Model = plotModel;
}
private void TrendChart_FormClosing(object sender, FormClosingEventArgs e)
{
Timer?.Stop();
Timer?.Dispose();
}
//导出图表
private void uiButton1_Click(object sender, EventArgs e)
{
try
{
// 创建保存文件对话框
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.Filter = "PDF文件 (*.pdf)|*.pdf|PNG图片 (*.png)|*.png|所有文件 (*.*)|*.*";
saveFileDialog.FilterIndex = 1;
saveFileDialog.RestoreDirectory = true;
saveFileDialog.FileName = $"趋势图表_{DateTime.Now:yyyyMMdd_HHmmss}.pdf";
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
string filePath = saveFileDialog.FileName;
// 根据选择的文件类型调用不同的导出方法
string extension = Path.GetExtension(filePath).ToLower();
if (extension == ".pdf")
{
ExportChartToPdf(filePath);
}
else if (extension == ".png")
{
ExportChartToImage(filePath);
}
else
{
// 如果没有扩展名或扩展名不对默认使用PDF
if (string.IsNullOrEmpty(extension))
{
filePath += ".pdf";
ExportChartToPdf(filePath);
}
else
{
// 尝试导出为PDF
ExportChartToPdf(filePath);
}
}
MessageBox.Show($"图表已成功导出到:\n{filePath}",
"导出成功",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
}
}
catch (Exception ex)
{
MessageBox.Show($"导出图表时发生错误:\n{ex.Message}",
"导出失败",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
private void ExportChartToPdf(string filePath)
{
try
{
// 1. 创建图表图片
Bitmap chartImage = CreateChartImage(800, 600);
// 2. 使用System.Drawing.Printing创建PDF简单方法
// 或者直接保存为高质量图片
string tempImagePath = Path.Combine(Path.GetTempPath(), $"chart_temp_{Guid.NewGuid()}.png");
// 保存为高质量PNG
chartImage.Save(tempImagePath, System.Drawing.Imaging.ImageFormat.Png);
// 3. 由于System.Drawing不直接支持PDF我们使用iTextSharp需要安装NuGet包
// 如果没有安装iTextSharp我们直接保存为图片
ExportImageAsPdf(chartImage, filePath);
// 4. 清理临时文件
if (File.Exists(tempImagePath))
{
File.Delete(tempImagePath);
}
// 5. 释放资源
chartImage.Dispose();
}
catch (Exception ex)
{
// 如果PDF导出失败降级为图片导出
string imagePath = Path.ChangeExtension(filePath, ".png");
ExportChartToImage(imagePath);
throw new Exception($"PDF导出失败已保存为图片格式: {ex.Message}");
}
}
private void ExportChartToImage(string filePath)
{
Bitmap chartImage = null;
try
{
// 创建高质量图表图片
chartImage = CreateChartImage(1600, 1200); // 高分辨率
// 保存图片
System.Drawing.Imaging.ImageFormat format = System.Drawing.Imaging.ImageFormat.Png;
string extension = Path.GetExtension(filePath).ToLower();
if (extension == ".jpg" || extension == ".jpeg")
format = System.Drawing.Imaging.ImageFormat.Jpeg;
else if (extension == ".bmp")
format = System.Drawing.Imaging.ImageFormat.Bmp;
chartImage.Save(filePath, format);
}
finally
{
chartImage?.Dispose();
}
}
private Bitmap CreateChartImage(int width, int height)
{
Bitmap bitmap = new Bitmap(width, height);
using (Graphics graphics = Graphics.FromImage(bitmap))
{
// 设置高质量绘制
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
graphics.CompositingQuality = CompositingQuality.HighQuality;
// 填充白色背景
graphics.Clear(Color.White);
// 设置边距
int marginLeft = 80;
int marginRight = 40;
int marginTop = 60;
int marginBottom = 80;
int chartWidth = width - marginLeft - marginRight;
int chartHeight = height - marginTop - marginBottom;
// 1. 绘制标题
using (Font titleFont = new Font("微软雅黑", 16, FontStyle.Bold))
using (Brush titleBrush = new SolidBrush(Color.Black))
{
string title = "趋势图表";
SizeF titleSize = graphics.MeasureString(title, titleFont);
graphics.DrawString(title, titleFont, titleBrush,
(width - titleSize.Width) / 2, 20);
}
// 2. 绘制坐标轴
Pen axisPen = new Pen(Color.Black, 2);
// Y轴
graphics.DrawLine(axisPen, marginLeft, marginTop, marginLeft, marginTop + chartHeight);
// X轴
graphics.DrawLine(axisPen, marginLeft, marginTop + chartHeight,
marginLeft + chartWidth, marginTop + chartHeight);
// 3. 绘制坐标轴标题
using (Font axisFont = new Font("微软雅黑", 12))
using (Brush axisBrush = new SolidBrush(Color.Black))
{
// Y轴标题
graphics.DrawString("低压室压力(kPa)", axisFont, axisBrush,
marginLeft - 70, marginTop - 40);
// X轴标题
graphics.DrawString("时间", axisFont, axisBrush,
marginLeft + chartWidth / 2 - 20, marginTop + chartHeight + 40);
}
// 4. 计算数据范围
if (Data != null && Data.Count > 0)
{
float minY = Data.Min(d => d.Y);
float maxY = Data.Max(d => d.Y);
// 添加一些余量
float rangeY = maxY - minY;
if (rangeY == 0) rangeY = 1;
minY -= rangeY * 0.1f;
maxY += rangeY * 0.1f;
// 5. 自适应Y轴刻度
int yTicks = 5; // 固定5个刻度清晰易读
// 计算合适的刻度步长
float roughStep = (maxY - minY) / (yTicks - 1);
float magnitude = (float)Math.Pow(10, Math.Floor(Math.Log10(roughStep)));
float stepSize = (float)Math.Ceiling(roughStep / magnitude) * magnitude;
// 调整minY和maxY为步长的整数倍
minY = (float)(Math.Floor(minY / stepSize) * stepSize);
maxY = (float)(Math.Ceiling(maxY / stepSize) * stepSize);
// 重新计算刻度数量
yTicks = (int)Math.Ceiling((maxY - minY) / stepSize);
float yTickStep = chartHeight / yTicks;
float yValueStep = stepSize;
using (Font tickFont = new Font("Arial", 9))
using (Brush tickBrush = new SolidBrush(Color.Black))
{
for (int i = 0; i <= yTicks; i++)
{
float yPos = marginTop + chartHeight - (i * yTickStep);
float yValue = minY + (i * yValueStep);
// 绘制刻度线
graphics.DrawLine(Pens.Gray, marginLeft - 5, yPos, marginLeft, yPos);
// 绘制刻度值(根据值的大小选择合适的小数位数)
string tickLabel;
if (Math.Abs(yValue) < 0.01)
tickLabel = "0";
else if (stepSize < 0.1)
tickLabel = yValue.ToString("F3");
else if (stepSize < 1)
tickLabel = yValue.ToString("F2");
else if (stepSize < 10)
tickLabel = yValue.ToString("F1");
else
tickLabel = yValue.ToString("F0");
SizeF textSize = graphics.MeasureString(tickLabel, tickFont);
graphics.DrawString(tickLabel, tickFont, tickBrush,
marginLeft - textSize.Width - 8, yPos - textSize.Height / 2);
}
}
// 6. 绘制X轴刻度时间
int xTicks = Math.Min(10, Data.Count);
using (Font tickFont = new Font("Arial", 9))
using (Brush tickBrush = new SolidBrush(Color.Black))
{
for (int i = 0; i < xTicks; i++)
{
int dataIndex = i * (Data.Count - 1) / (xTicks - 1);
if (dataIndex >= Data.Count) dataIndex = Data.Count - 1;
float xPos = marginLeft + (i * chartWidth / (float)(xTicks - 1));
// 绘制刻度线
graphics.DrawLine(Pens.Gray, xPos, marginTop + chartHeight,
xPos, marginTop + chartHeight + 5);
// 绘制时间标签
if (dataIndex < Data.Count)
{
string timeLabel = Data[dataIndex].X;
if (timeLabel.Length > 8)
timeLabel = timeLabel.Substring(timeLabel.Length - 8); // 只取时间部分
SizeF textSize = graphics.MeasureString(timeLabel, tickFont);
graphics.DrawString(timeLabel, tickFont, tickBrush,
xPos - textSize.Width / 2, marginTop + chartHeight + 10);
}
}
}
// 7. 绘制数据曲线
if (Data.Count > 1)
{
PointF[] points = new PointF[Data.Count];
for (int i = 0; i < Data.Count; i++)
{
float xRatio = i / (float)(Data.Count - 1);
float yRatio = (Data[i].Y - minY) / (maxY - minY);
float xPos = marginLeft + (xRatio * chartWidth);
float yPos = marginTop + chartHeight - (yRatio * chartHeight);
points[i] = new PointF(xPos, yPos);
}
// 绘制曲线
using (Pen curvePen = new Pen(Color.Red, 2))
{
curvePen.StartCap = System.Drawing.Drawing2D.LineCap.Round;
curvePen.EndCap = System.Drawing.Drawing2D.LineCap.Round;
// 绘制平滑曲线
if (points.Length > 1)
{
graphics.DrawCurve(curvePen, points, 0.5f);
}
// 绘制数据点
foreach (PointF point in points)
{
graphics.FillEllipse(Brushes.Red,
point.X - 3, point.Y - 3, 6, 6);
graphics.DrawEllipse(Pens.White,
point.X - 3, point.Y - 3, 6, 6);
}
}
}
// 8. 绘制图例
using (Font legendFont = new Font("微软雅黑", 10))
{
string legendText = "压力数据";
SizeF legendSize = graphics.MeasureString(legendText, legendFont);
RectangleF legendRect = new RectangleF(
width - marginRight - legendSize.Width - 30,
marginTop,
legendSize.Width + 20,
legendSize.Height + 10);
graphics.FillRectangle(Brushes.White, legendRect);
graphics.DrawRectangle(Pens.Gray,
legendRect.X, legendRect.Y, legendRect.Width, legendRect.Height);
// 绘制图例颜色标记
graphics.FillRectangle(Brushes.Red,
legendRect.X + 5, legendRect.Y + 5, 15, legendRect.Height - 10);
graphics.DrawString(legendText, legendFont, Brushes.Black,
legendRect.X + 25, legendRect.Y + 5);
}
}
else
{
// 没有数据时显示提示
using (Font infoFont = new Font("微软雅黑", 14))
using (Brush infoBrush = new SolidBrush(Color.Gray))
{
string infoText = "暂无数据";
SizeF textSize = graphics.MeasureString(infoText, infoFont);
graphics.DrawString(infoText, infoFont, infoBrush,
(width - textSize.Width) / 2, (height - textSize.Height) / 2);
}
}
// 9. 绘制边框
graphics.DrawRectangle(Pens.LightGray, 0, 0, width - 1, height - 1);
}
return bitmap;
}
private void ExportImageAsPdf(Image image, string filePath)
{
try
{
// 方法1如果有iTextSharp使用它创建PDF
// 这需要安装iTextSharp NuGet包
// 方法2直接保存为图片
string imagePath = Path.ChangeExtension(filePath, ".png");
image.Save(imagePath, System.Drawing.Imaging.ImageFormat.Png);
// 方法3使用Windows自带的PDF打印功能需要用户交互
// 这里我们使用方法2因为最简单可靠
// 如果需要PDF可以提示用户安装iTextSharp
throw new NotImplementedException("PDF导出需要安装iTextSharp库已保存为PNG图片");
}
catch (NotImplementedException)
{
// 保存为图片
string imagePath = Path.ChangeExtension(filePath, ".png");
image.Save(imagePath, System.Drawing.Imaging.ImageFormat.Png);
// 更新文件路径
File.Move(imagePath, filePath.Replace(".pdf", ".png"));
}
}
}
}

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

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle.Cryptography" version="2.4.0" targetFramework="net472" />
<package id="EPPlus" version="4.5.3.3" targetFramework="net472" />
<package id="iTextSharp" version="5.5.13.4" targetFramework="net472" />
<package id="Microsoft.NETFramework.ReferenceAssemblies" version="1.0.2" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.NETFramework.ReferenceAssemblies.net472" version="1.0.2" targetFramework="net472" developmentDependency="true" />
<package id="OxyPlot.Core" version="2.2.0" targetFramework="net472" />
<package id="OxyPlot.Pdf" version="2.2.0" targetFramework="net472" />
<package id="OxyPlot.WindowsForms" version="2.2.0" targetFramework="net472" />
<package id="PDFsharp-MigraDoc-gdi" version="1.50.5147" targetFramework="net472" />
</packages>

View File

@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{50C29430-7B46-41E3-8F17-BA9B6E909620}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>薄膜气体透过率测试仪</RootNamespace>
<AssemblyName>薄膜气体透过率测试仪</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
<HintPath>..\packages\BouncyCastle.Cryptography.2.4.0\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
</Reference>
<Reference Include="EPPlus, Version=4.5.3.3, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
<HintPath>..\packages\EPPlus.4.5.3.3\lib\net40\EPPlus.dll</HintPath>
</Reference>
<Reference Include="itextsharp, Version=5.5.13.4, Culture=neutral, PublicKeyToken=8354ae6d2174ddca, processorArchitecture=MSIL">
<HintPath>..\packages\iTextSharp.5.5.13.4\lib\net461\itextsharp.dll</HintPath>
</Reference>
<Reference Include="MigraDoc.DocumentObjectModel-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.DocumentObjectModel-gdi.dll</HintPath>
</Reference>
<Reference Include="MigraDoc.Rendering-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.Rendering-gdi.dll</HintPath>
</Reference>
<Reference Include="MigraDoc.RtfRendering-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\MigraDoc.RtfRendering-gdi.dll</HintPath>
</Reference>
<Reference Include="NModbus4">
<HintPath>..\packages\NModbus4.2.1.0\lib\net40\NModbus4.dll</HintPath>
</Reference>
<Reference Include="OxyPlot, Version=2.2.0.0, Culture=neutral, PublicKeyToken=638079a8f0bd61e9, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.Core.2.2.0\lib\net462\OxyPlot.dll</HintPath>
</Reference>
<Reference Include="OxyPlot.Pdf, Version=2.2.0.0, Culture=neutral, PublicKeyToken=c167629db8cf8ad9, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.Pdf.2.2.0\lib\net462\OxyPlot.Pdf.dll</HintPath>
</Reference>
<Reference Include="OxyPlot.WindowsForms, Version=2.2.0.0, Culture=neutral, PublicKeyToken=245eacd6b5d2d338, processorArchitecture=MSIL">
<HintPath>..\packages\OxyPlot.WindowsForms.2.2.0\lib\net462\OxyPlot.WindowsForms.dll</HintPath>
</Reference>
<Reference Include="PdfSharp-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\PdfSharp-gdi.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.Charting-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>..\packages\PDFsharp-MigraDoc-gdi.1.50.5147\lib\net20\PdfSharp.Charting-gdi.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="SunnyUI">
<HintPath>..\packages\SunnyUI.3.8.9\lib\net472\SunnyUI.dll</HintPath>
</Reference>
<Reference Include="SunnyUI.Common">
<HintPath>..\packages\SunnyUI.Common.3.8.9\lib\net472\SunnyUI.Common.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Security" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CoefficientForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CoefficientForm.Designer.cs">
<DependentUpon>CoefficientForm.cs</DependentUpon>
</Compile>
<Compile Include="Data\BoolSign.cs" />
<Compile Include="Data\DataChange.cs" />
<Compile Include="Data\Function.cs" />
<Compile Include="Data\keyboard.cs" />
<Compile Include="Data\LoginData.cs" />
<Compile Include="Data\ModbusResourceManager.cs" />
<Compile Include="Data\PLC_Data.cs" />
<Compile Include="MiopahReport.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MiopahReport.Designer.cs">
<DependentUpon>MiopahReport.cs</DependentUpon>
</Compile>
<Compile Include="TestScreen.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TestScreen.Designer.cs">
<DependentUpon>TestScreen.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TianpaReport.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TianpaReport.Designer.cs">
<DependentUpon>TianpaReport.cs</DependentUpon>
</Compile>
<Compile Include="TrendChart.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TrendChart.Designer.cs">
<DependentUpon>TrendChart.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="CoefficientForm.resx">
<DependentUpon>CoefficientForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MiopahReport.resx">
<DependentUpon>MiopahReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="TestScreen.resx">
<DependentUpon>TestScreen.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TianpaReport.resx">
<DependentUpon>TianpaReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TrendChart.resx">
<DependentUpon>TrendChart.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.NETFramework.ReferenceAssemblies.net472.1.0.2\build\Microsoft.NETFramework.ReferenceAssemblies.net472.targets" Condition="Exists('..\packages\Microsoft.NETFramework.ReferenceAssemblies.net472.1.0.2\build\Microsoft.NETFramework.ReferenceAssemblies.net472.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.NETFramework.ReferenceAssemblies.net472.1.0.2\build\Microsoft.NETFramework.ReferenceAssemblies.net472.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.NETFramework.ReferenceAssemblies.net472.1.0.2\build\Microsoft.NETFramework.ReferenceAssemblies.net472.targets'))" />
</Target>
</Project>