diff --git a/C-Windows-1/Form1.Designer.cs b/C-Windows-1/Form1.Designer.cs index d674cf1..5a707ee 100644 --- a/C-Windows-1/Form1.Designer.cs +++ b/C-Windows-1/Form1.Designer.cs @@ -880,6 +880,7 @@ this.progressBar1.Name = "progressBar1"; this.progressBar1.Size = new System.Drawing.Size(100, 23); this.progressBar1.TabIndex = 146; + this.progressBar1.Visible = false; // // button2 // @@ -1637,7 +1638,7 @@ this.Controls.Add(this.ReceiveText); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Form1"; - this.Text = "20240816"; + this.Text = "20240819"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); ((System.ComponentModel.ISupportInitialize)(this.DataGridView1)).EndInit(); diff --git a/C-Windows-1/Form1.cs b/C-Windows-1/Form1.cs index cc8d9aa..6b58ae2 100644 --- a/C-Windows-1/Form1.cs +++ b/C-Windows-1/Form1.cs @@ -1206,7 +1206,19 @@ namespace C_Windows_1 byte[] data = Encoding.ASCII.GetBytes("hello,udp server"); System.Net.IPAddress ip; string localip=GetLocalIPAddress(); - localip = localip.Substring(0, 10) + "255"; + + // 查找第三个 '.' 符号的位置 + int firstDot = localip.IndexOf('.'); + int secondDot = localip.IndexOf('.', firstDot + 1); + int thirdDot = localip.IndexOf('.', secondDot + 1); + + // 截取到第三个 '.' 符号 + localip = thirdDot != -1 + ? localip.Substring(0, thirdDot + 1) + : localip; + + localip = localip/*.Substring(0, 10)*/ + "255"; + //Code.Text = localip; ip = System.Net.IPAddress.Parse(localip); // 获本机IP频段广播到 .255 IPEndPoint endPoint = new IPEndPoint(ip, Port); @@ -3133,8 +3145,8 @@ namespace C_Windows_1 station2 = Convert.ToUInt16(stationIP); station = station2.ToString("X2"); Modbusread(360, 4, ReadData); - labelruanjian.Text = "软件版本号:" + ReadData[360].ToString("X4") + ReadData[361].ToString("X4"); - labelyinjian.Text = "硬件版本号:" + ReadData[362].ToString("X4") + ReadData[363].ToString("X4"); + labelruanjian.Text = "软件版本号:" + ReadData[361].ToString("X4") + ReadData[360].ToString("X4"); + labelyinjian.Text = "硬件版本号:" + ReadData[363].ToString("X4") + ReadData[362].ToString("X4"); } diff --git a/C-Windows-1/TestPara.Designer.cs b/C-Windows-1/TestPara.Designer.cs index 65d5c90..af44001 100644 --- a/C-Windows-1/TestPara.Designer.cs +++ b/C-Windows-1/TestPara.Designer.cs @@ -878,7 +878,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(712, 425); + this.ClientSize = new System.Drawing.Size(644, 425); this.Controls.Add(this.label15); this.Controls.Add(this.label54); this.Controls.Add(this.TestTime2); diff --git a/C-Windows-1/TestPara.cs b/C-Windows-1/TestPara.cs index d3cac4e..b56443b 100644 --- a/C-Windows-1/TestPara.cs +++ b/C-Windows-1/TestPara.cs @@ -91,13 +91,13 @@ namespace C_Windows_1 { try { - if (FullTime.Text == "" || BBalanTime.Text == "" || SBalanTime.Text == "" || TestTime1.Text == "" || ExhaustTime.Text == "" || BypassTime.Text == "" || DelayTime1.Text == "" || DelayTime2.Text == "" || BLeakLPre.Text == "" || BLeakTPre.Text == "" || LUnit.Text == "" || PUnit.Text == "") + if (FullTime.Text == "" || TestTime1.Text == "" || ExhaustTime.Text == "" || DelayTime1.Text == "" || DelayTime2.Text == "" || BLeakLPre.Text == "" || BLeakTPre.Text == "" || LUnit.Text == "" || PUnit.Text == "") { MessageBox.Show("输入参数格式不对"); } else { - if (FullTime.Text == "" || BBalanTime.Text == "" || SBalanTime.Text == "" || TestTime1.Text == "" || ExhaustTime.Text == "" || BypassTime.Text == "" || DelayTime1.Text == "" || DelayTime2.Text == "" || BLeakLPre.Text == "" || BLeakTPre.Text == "" || LUnit.Text == "" || PUnit.Text == "") + if (FullTime.Text == "" || TestTime1.Text == "" || ExhaustTime.Text == "" || DelayTime1.Text == "" || DelayTime2.Text == "" || BLeakLPre.Text == "" || BLeakTPre.Text == "" || LUnit.Text == "" || PUnit.Text == "") { MessageBox.Show("输入参数格式不对"); } diff --git a/C-Windows-1/bin/Debug/LL28-Control.exe b/C-Windows-1/bin/Debug/LL28-Control.exe index a32f96c..e9153ac 100644 Binary files a/C-Windows-1/bin/Debug/LL28-Control.exe and b/C-Windows-1/bin/Debug/LL28-Control.exe differ diff --git a/C-Windows-1/bin/LL-28上位机.zip b/C-Windows-1/bin/LL-28上位机.zip new file mode 100644 index 0000000..dd6664c Binary files /dev/null and b/C-Windows-1/bin/LL-28上位机.zip differ diff --git a/C-Windows-1/bin/28修改站号IP.rar b/C-Windows-1/bin/新框架ll28上位机.rar similarity index 96% rename from C-Windows-1/bin/28修改站号IP.rar rename to C-Windows-1/bin/新框架ll28上位机.rar index 2de08b4..438f950 100644 Binary files a/C-Windows-1/bin/28修改站号IP.rar and b/C-Windows-1/bin/新框架ll28上位机.rar differ diff --git a/C-Windows-1/obj/Debug/LL28-Control.exe b/C-Windows-1/obj/Debug/LL28-Control.exe index a32f96c..e9153ac 100644 Binary files a/C-Windows-1/obj/Debug/LL28-Control.exe and b/C-Windows-1/obj/Debug/LL28-Control.exe differ