diff --git a/Diaoyong/ConnectionTest.cs b/Diaoyong/ConnectionTest.cs index f12963e..6d62fca 100644 --- a/Diaoyong/ConnectionTest.cs +++ b/Diaoyong/ConnectionTest.cs @@ -40,8 +40,9 @@ namespace Diaoyong udpcSend.Send(sendbytes, sendbytes.Length, remoteIpep); udpcSend.Close(); } - catch + catch (Exception ex) { + System.Diagnostics.Debug.WriteLine(ex.Message); } } @@ -130,9 +131,10 @@ namespace Diaoyong } } } - catch + catch (Exception ex) { - //SOCKETEventArrive("receive:Nullerror"); + System.Diagnostics.Debug.WriteLine(ex.Message); + } tryLoop++;//1 loop = 100ms if(tryLoop == 50) diff --git a/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferences.cache index ed53d5c..bc7e37c 100644 Binary files a/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 4e1dea5..6feff10 100644 Binary files a/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Diaoyong/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Diaoyong/obj/Debug/Diaoyong.csproj.AssemblyReference.cache b/Diaoyong/obj/Debug/Diaoyong.csproj.AssemblyReference.cache index a17f7fd..2cf4336 100644 Binary files a/Diaoyong/obj/Debug/Diaoyong.csproj.AssemblyReference.cache and b/Diaoyong/obj/Debug/Diaoyong.csproj.AssemblyReference.cache differ diff --git a/Diaoyong/obj/Debug/Diaoyong.csproj.CoreCompileInputs.cache b/Diaoyong/obj/Debug/Diaoyong.csproj.CoreCompileInputs.cache index c46a307..77e5cd5 100644 --- a/Diaoyong/obj/Debug/Diaoyong.csproj.CoreCompileInputs.cache +++ b/Diaoyong/obj/Debug/Diaoyong.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -04bf2dc5143223b57ebea0cf2883e39dde73273d +12c1d82ba3f096dfcfda848bfe12ce5b52201374 diff --git a/Diaoyong/obj/Debug/Diaoyong.csproj.FileListAbsolute.txt b/Diaoyong/obj/Debug/Diaoyong.csproj.FileListAbsolute.txt index 660b547..0b85830 100644 --- a/Diaoyong/obj/Debug/Diaoyong.csproj.FileListAbsolute.txt +++ b/Diaoyong/obj/Debug/Diaoyong.csproj.FileListAbsolute.txt @@ -62,3 +62,29 @@ D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班 D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班设置问题\Diaoyong\obj\Debug\Diaoyong.csproj.CopyComplete D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班设置问题\Diaoyong\obj\Debug\Diaoyong.exe D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班设置问题\Diaoyong\obj\Debug\Diaoyong.pdb +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Publish\Diaoyong.exe.config +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Publish\Diaoyong.exe +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Publish\Diaoyong.pdb +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.csproj.AssemblyReference.cache +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.csproj.SuggestedBindingRedirects.cache +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.ConnectionTest.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.Form1.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.Properties.Resources.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.csproj.GenerateResource.cache +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.csproj.CoreCompileInputs.cache +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.csproj.CopyComplete +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.exe +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Diaoyong\obj\Debug\Diaoyong.pdb +C:\Users\Administrator\Desktop\UDP\Publish\Diaoyong.exe.config +C:\Users\Administrator\Desktop\UDP\Publish\Diaoyong.exe +C:\Users\Administrator\Desktop\UDP\Publish\Diaoyong.pdb +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.csproj.AssemblyReference.cache +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.csproj.SuggestedBindingRedirects.cache +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.ConnectionTest.resources +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.Form1.resources +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.Properties.Resources.resources +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.csproj.GenerateResource.cache +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.csproj.CoreCompileInputs.cache +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.csproj.CopyComplete +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.exe +C:\Users\Administrator\Desktop\UDP\Diaoyong\obj\Debug\Diaoyong.pdb diff --git a/Diaoyong/obj/Debug/Diaoyong.csproj.GenerateResource.cache b/Diaoyong/obj/Debug/Diaoyong.csproj.GenerateResource.cache index 9b3ea75..b1c9e20 100644 Binary files a/Diaoyong/obj/Debug/Diaoyong.csproj.GenerateResource.cache and b/Diaoyong/obj/Debug/Diaoyong.csproj.GenerateResource.cache differ diff --git a/Diaoyong/obj/Debug/Diaoyong.exe b/Diaoyong/obj/Debug/Diaoyong.exe index 0e5cdd0..84d53fa 100644 Binary files a/Diaoyong/obj/Debug/Diaoyong.exe and b/Diaoyong/obj/Debug/Diaoyong.exe differ diff --git a/Diaoyong/obj/Debug/Diaoyong.pdb b/Diaoyong/obj/Debug/Diaoyong.pdb index b077d0c..06d309e 100644 Binary files a/Diaoyong/obj/Debug/Diaoyong.pdb and b/Diaoyong/obj/Debug/Diaoyong.pdb differ diff --git a/IPconf.txt b/IPconf.txt index 3b60a14..cc26491 100644 --- a/IPconf.txt +++ b/IPconf.txt @@ -1,2 +1,2 @@ -MonitorIP=192.168.10.119 +MonitorIP=192.168.1.169 MonitorPort=3000 \ No newline at end of file diff --git a/WindowsFormsApp2/Client.cs b/WindowsFormsApp2/Client.cs index 27b8164..c613ae8 100644 --- a/WindowsFormsApp2/Client.cs +++ b/WindowsFormsApp2/Client.cs @@ -46,27 +46,28 @@ namespace WindowsFormsApp2 public void DisConnection() { + m_Done = true; try { if (u != null) { - m_Done = true; - if (recvThread != null) - { - this.recvThread.Abort(); - } - if (recvThreadImage != null) - { - this.recvThreadImage.Abort(); - } + //if (recvThread != null) + //{ + // this.recvThread.Abort(); + //} + //if (recvThreadImage != null) + //{ + // this.recvThreadImage.Abort(); + //} u.Close(); u = null; } if (uimage != null) - uimage.Close(); + uimage.Close(); } - catch (Exception) + catch (Exception ex) { + System.Diagnostics.Debug.WriteLine(ex.Message); } } @@ -184,19 +185,18 @@ namespace WindowsFormsApp2 public void bindCamId(int id) { _bindCamId = id; + m_Done = false; try { e = new IPEndPoint(new IPAddress(localIP), dataPort + _bindCamId); u = new UdpClient(e); - - recvThread = new Thread(new ThreadStart(Received)); recvThread.Priority = ThreadPriority.Normal; recvThread.Start(); } - catch + catch(Exception ex) { - + System.Diagnostics.Debug.WriteLine(ex); } try { @@ -206,9 +206,9 @@ namespace WindowsFormsApp2 recvThreadImage.Priority = ThreadPriority.Normal; recvThreadImage.Start(); } - catch + catch (Exception ex) { - + System.Diagnostics.Debug.WriteLine(ex); } } @@ -292,8 +292,9 @@ namespace WindowsFormsApp2 t(receiveString); } - catch + catch(Exception ex) { + System.Diagnostics.Debug.WriteLine(ex); //SOCKETEventArrive("receive:Nullerror"); } } @@ -316,8 +317,9 @@ namespace WindowsFormsApp2 bmp = new Bitmap(w, h, w * 3, PixelFormat.Format24bppRgb, pData); } } - catch (Exception) + catch (Exception ex) { + System.Diagnostics.Debug.WriteLine(ex.Message); } } @@ -352,9 +354,10 @@ namespace WindowsFormsApp2 Marshal.FreeHGlobal(pData); //free tha memory } } - catch + catch (Exception ex) { - //SOCKETEventArrive("receive:Nullerror"); + System.Diagnostics.Debug.WriteLine(ex.Message); + } } Thread.Sleep(10); //防止系统资源耗尽 diff --git a/WindowsFormsApp2/DialogLogin.cs b/WindowsFormsApp2/DialogLogin.cs index 086a9df..7aed6fa 100644 --- a/WindowsFormsApp2/DialogLogin.cs +++ b/WindowsFormsApp2/DialogLogin.cs @@ -33,8 +33,10 @@ namespace WindowsFormsApp2 udpcSend.Send(sendbytes, sendbytes.Length, remoteIpep); udpcSend.Close(); } - catch + catch (Exception ex) { + System.Diagnostics.Debug.WriteLine(ex.Message); + } } diff --git a/WindowsFormsApp2/FullScreen.cs b/WindowsFormsApp2/FullScreen.cs index cf59133..0151657 100644 --- a/WindowsFormsApp2/FullScreen.cs +++ b/WindowsFormsApp2/FullScreen.cs @@ -28,15 +28,30 @@ namespace WindowsFormsApp2 } } + public void ReleaseUdp() + { + this.singleCam1.closeSocket(); + } + public void bindCam(int d) { singleCam1.setCamId(d); + FormClosed += FullScreen_FormClosed; camid = d; } + private void FullScreen_FormClosed(object sender, FormClosedEventArgs e) + { + OnFullScreenClose(camid); + } + private void rotate_Click(object sender, EventArgs e) { UserControl1.SendMsg(Convert.ToString(camid)); } + + public Action OnFullScreenClose; + + } } diff --git a/WindowsFormsApp2/UserControl1.cs b/WindowsFormsApp2/UserControl1.cs index 04b9b04..5c277e2 100644 --- a/WindowsFormsApp2/UserControl1.cs +++ b/WindowsFormsApp2/UserControl1.cs @@ -50,8 +50,10 @@ namespace WindowsFormsApp2 udpcSend.Send(sendbytes, sendbytes.Length, remoteIpep); udpcSend.Close(); } - catch + catch(Exception ex) { + System.Diagnostics.Debug.WriteLine(ex.Message); + } } diff --git a/WindowsFormsApp2/displayResult.cs b/WindowsFormsApp2/displayResult.cs index c6e5ec2..0d9ba4d 100644 --- a/WindowsFormsApp2/displayResult.cs +++ b/WindowsFormsApp2/displayResult.cs @@ -6,7 +6,7 @@ namespace WindowsFormsApp2 { public partial class displayResult : UserControl { - + public displayResult() { InitializeComponent(); @@ -22,7 +22,33 @@ namespace WindowsFormsApp2 void callback(int id) { + switch (id) + { + case 0: singleCam1.closeSocket(); break; + case 1: singleCam2.closeSocket(); break; + case 2: singleCam3.closeSocket(); break; + case 3: singleCam4.closeSocket(); break; + case 4: singleCam5.closeSocket(); break; + case 5: singleCam6.closeSocket(); break; + case 6: singleCam7.closeSocket(); break; + case 7: singleCam8.closeSocket(); break; + } FullScreen dial = new FullScreen(); + dial.OnFullScreenClose = (camid) => + { + dial.ReleaseUdp(); + switch (camid) + { + case 0: singleCam1.setCamId(0); break; + case 1: singleCam2.setCamId(1); break; + case 2: singleCam3.setCamId(2); break; + case 3: singleCam4.setCamId(3); break; + case 4: singleCam5.setCamId(4); break; + case 5: singleCam6.setCamId(5); break; + case 6: singleCam7.setCamId(6); break; + case 7: singleCam8.setCamId(7); break; + } + }; if (id > -1) { dial.bindCam(id); @@ -30,6 +56,11 @@ namespace WindowsFormsApp2 } } + void onclose(int camid) + { + + } + public void init() { @@ -55,7 +86,5 @@ namespace WindowsFormsApp2 singleCam8.closeSocket(); userControl11.closeSocket(); } - - } } diff --git a/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 7c8d2c3..db93246 100644 Binary files a/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 579a4a6..10dea20 100644 Binary files a/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/WindowsFormsApp2/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.FileListAbsolute.txt b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.FileListAbsolute.txt index 1bd3d60..45c8cb9 100644 --- a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.FileListAbsolute.txt +++ b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.FileListAbsolute.txt @@ -101,3 +101,45 @@ D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班 D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班设置问题\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CoreCompileInputs.cache D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班设置问题\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.dll D:\烟厂资料\烟厂程序\程序测试\远程端\230519-解决配方、换班设置问题\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.pdb +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Publish\WindowsFormsApp2.dll.config +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Publish\WindowsFormsApp2.dll +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\Publish\WindowsFormsApp2.pdb +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.AssemblyReference.cache +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Alarm_Record.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Camera_glue.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Change_shift.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.displayResult.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Form1.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogSetup.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.FullScreen.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Output_statistic.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Properties.Resources.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam2.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.UserControl1.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogLogin.resources +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.GenerateResource.cache +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CoreCompileInputs.cache +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.dll +D:\烟厂资料\程序测试\远程端\230529-最新Cigarette-UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.pdb +C:\Users\Administrator\Desktop\UDP\Publish\WindowsFormsApp2.dll.config +C:\Users\Administrator\Desktop\UDP\Publish\WindowsFormsApp2.dll +C:\Users\Administrator\Desktop\UDP\Publish\WindowsFormsApp2.pdb +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.AssemblyReference.cache +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Alarm_Record.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Camera_glue.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Change_shift.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.displayResult.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Form1.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogSetup.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.FullScreen.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Output_statistic.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.Properties.Resources.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.singleCam2.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.UserControl1.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.DialogLogin.resources +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.GenerateResource.cache +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.csproj.CoreCompileInputs.cache +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.dll +C:\Users\Administrator\Desktop\UDP\WindowsFormsApp2\obj\Debug\WindowsFormsApp2.pdb diff --git a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.GenerateResource.cache b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.GenerateResource.cache index 84501dd..a9634a1 100644 Binary files a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.GenerateResource.cache and b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.csproj.GenerateResource.cache differ diff --git a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.dll b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.dll index 8121614..ee3cc8c 100644 Binary files a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.dll and b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.dll differ diff --git a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.pdb b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.pdb index 696a6a7..9d0bfde 100644 Binary files a/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.pdb and b/WindowsFormsApp2/obj/Debug/WindowsFormsApp2.pdb differ diff --git a/WindowsFormsApp2/singleCam.Designer.cs b/WindowsFormsApp2/singleCam.Designer.cs index efa79b8..e1021ca 100644 --- a/WindowsFormsApp2/singleCam.Designer.cs +++ b/WindowsFormsApp2/singleCam.Designer.cs @@ -61,10 +61,10 @@ // this.panel1.Controls.Add(this.groupBox1); this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(0, 897); - this.panel1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.panel1.Location = new System.Drawing.Point(0, 718); + this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1576, 50); + this.panel1.Size = new System.Drawing.Size(1182, 40); this.panel1.TabIndex = 0; // // groupBox1 @@ -81,10 +81,10 @@ this.groupBox1.Font = new System.Drawing.Font("宋体", 10F); this.groupBox1.ForeColor = System.Drawing.Color.White; this.groupBox1.Location = new System.Drawing.Point(0, 0); - this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 2, 4, 2); - this.groupBox1.Size = new System.Drawing.Size(1576, 50); + this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.groupBox1.Size = new System.Drawing.Size(1182, 40); this.groupBox1.TabIndex = 9; this.groupBox1.TabStop = false; this.groupBox1.Text = "1#分析结果"; @@ -95,11 +95,11 @@ this.textBox7.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox7.Font = new System.Drawing.Font("宋体", 11F); this.textBox7.ForeColor = System.Drawing.Color.White; - this.textBox7.Location = new System.Drawing.Point(429, 24); - this.textBox7.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.textBox7.Location = new System.Drawing.Point(322, 19); + this.textBox7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox7.Name = "textBox7"; this.textBox7.ReadOnly = true; - this.textBox7.Size = new System.Drawing.Size(69, 21); + this.textBox7.Size = new System.Drawing.Size(52, 17); this.textBox7.TabIndex = 18; // // label7 @@ -107,10 +107,9 @@ this.label7.AutoSize = true; this.label7.Font = new System.Drawing.Font("宋体", 10F); this.label7.ForeColor = System.Drawing.Color.White; - this.label7.Location = new System.Drawing.Point(345, 24); - this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label7.Location = new System.Drawing.Point(259, 19); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(93, 17); + this.label7.Size = new System.Drawing.Size(77, 14); this.label7.TabIndex = 16; this.label7.Text = "识别时间:"; // @@ -118,10 +117,9 @@ // this.label8.BackColor = System.Drawing.Color.Lime; this.label8.Font = new System.Drawing.Font("宋体", 15F); - this.label8.Location = new System.Drawing.Point(525, 20); - this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label8.Location = new System.Drawing.Point(394, 16); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(60, 24); + this.label8.Size = new System.Drawing.Size(45, 19); this.label8.TabIndex = 15; this.label8.Text = " OK "; this.label8.Visible = false; @@ -132,11 +130,11 @@ this.textBox6.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox6.Font = new System.Drawing.Font("宋体", 11F); this.textBox6.ForeColor = System.Drawing.Color.White; - this.textBox6.Location = new System.Drawing.Point(260, 22); - this.textBox6.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.textBox6.Location = new System.Drawing.Point(195, 18); + this.textBox6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox6.Name = "textBox6"; this.textBox6.ReadOnly = true; - this.textBox6.Size = new System.Drawing.Size(69, 21); + this.textBox6.Size = new System.Drawing.Size(52, 17); this.textBox6.TabIndex = 12; // // label6 @@ -144,10 +142,9 @@ this.label6.AutoSize = true; this.label6.Font = new System.Drawing.Font("宋体", 10F); this.label6.ForeColor = System.Drawing.Color.White; - this.label6.Location = new System.Drawing.Point(175, 22); - this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label6.Location = new System.Drawing.Point(131, 18); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(93, 17); + this.label6.Size = new System.Drawing.Size(77, 14); this.label6.TabIndex = 11; this.label6.Text = "胶点个数:"; // @@ -157,11 +154,11 @@ this.textBox5.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox5.Font = new System.Drawing.Font("宋体", 11F); this.textBox5.ForeColor = System.Drawing.Color.White; - this.textBox5.Location = new System.Drawing.Point(91, 23); - this.textBox5.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.textBox5.Location = new System.Drawing.Point(68, 18); + this.textBox5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox5.Name = "textBox5"; this.textBox5.ReadOnly = true; - this.textBox5.Size = new System.Drawing.Size(69, 21); + this.textBox5.Size = new System.Drawing.Size(52, 17); this.textBox5.TabIndex = 10; // // label5 @@ -169,10 +166,9 @@ this.label5.AutoSize = true; this.label5.Font = new System.Drawing.Font("宋体", 10F); this.label5.ForeColor = System.Drawing.Color.White; - this.label5.Location = new System.Drawing.Point(5, 24); - this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label5.Location = new System.Drawing.Point(4, 19); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(85, 17); + this.label5.Size = new System.Drawing.Size(70, 14); this.label5.TabIndex = 9; this.label5.Text = "采集速度:"; // @@ -182,9 +178,9 @@ this.panel2.Controls.Add(this.panel3); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(1576, 897); + this.panel2.Size = new System.Drawing.Size(1182, 718); this.panel2.TabIndex = 2; // // pictureBox1 @@ -192,11 +188,11 @@ this.pictureBox1.AccessibleRole = System.Windows.Forms.AccessibleRole.Window; this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBox1.Location = new System.Drawing.Point(0, 0); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); - this.pictureBox1.MaximumSize = new System.Drawing.Size(1400, 900); - this.pictureBox1.MinimumSize = new System.Drawing.Size(400, 150); + this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); + this.pictureBox1.MaximumSize = new System.Drawing.Size(1050, 720); + this.pictureBox1.MinimumSize = new System.Drawing.Size(300, 120); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(1376, 897); + this.pictureBox1.Size = new System.Drawing.Size(1032, 718); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 1; this.pictureBox1.TabStop = false; @@ -216,10 +212,10 @@ this.panel3.Dock = System.Windows.Forms.DockStyle.Right; this.panel3.Font = new System.Drawing.Font("宋体", 11F); this.panel3.ForeColor = System.Drawing.Color.White; - this.panel3.Location = new System.Drawing.Point(1376, 0); - this.panel3.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.panel3.Location = new System.Drawing.Point(1032, 0); + this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(200, 897); + this.panel3.Size = new System.Drawing.Size(150, 718); this.panel3.TabIndex = 0; // // textBox4 @@ -227,11 +223,11 @@ this.textBox4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.textBox4.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox4.ForeColor = System.Drawing.Color.White; - this.textBox4.Location = new System.Drawing.Point(120, 120); - this.textBox4.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.textBox4.Location = new System.Drawing.Point(90, 96); + this.textBox4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox4.Name = "textBox4"; this.textBox4.ReadOnly = true; - this.textBox4.Size = new System.Drawing.Size(60, 21); + this.textBox4.Size = new System.Drawing.Size(45, 17); this.textBox4.TabIndex = 7; this.textBox4.Text = "0"; // @@ -240,11 +236,11 @@ this.textBox3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.textBox3.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox3.ForeColor = System.Drawing.Color.White; - this.textBox3.Location = new System.Drawing.Point(120, 85); - this.textBox3.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.textBox3.Location = new System.Drawing.Point(90, 68); + this.textBox3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox3.Name = "textBox3"; this.textBox3.ReadOnly = true; - this.textBox3.Size = new System.Drawing.Size(60, 21); + this.textBox3.Size = new System.Drawing.Size(45, 17); this.textBox3.TabIndex = 6; this.textBox3.Text = "0"; // @@ -253,11 +249,11 @@ this.textBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox2.ForeColor = System.Drawing.Color.White; - this.textBox2.Location = new System.Drawing.Point(120, 50); - this.textBox2.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.textBox2.Location = new System.Drawing.Point(90, 40); + this.textBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox2.Name = "textBox2"; this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(60, 21); + this.textBox2.Size = new System.Drawing.Size(45, 17); this.textBox2.TabIndex = 5; this.textBox2.Text = "0"; // @@ -266,11 +262,11 @@ this.textBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(32)))), ((int)(((byte)(32)))), ((int)(((byte)(32))))); this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.textBox1.ForeColor = System.Drawing.Color.White; - this.textBox1.Location = new System.Drawing.Point(120, 15); - this.textBox1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.textBox1.Location = new System.Drawing.Point(90, 12); + this.textBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.textBox1.Name = "textBox1"; this.textBox1.ReadOnly = true; - this.textBox1.Size = new System.Drawing.Size(60, 21); + this.textBox1.Size = new System.Drawing.Size(45, 17); this.textBox1.TabIndex = 4; this.textBox1.Text = "0"; // @@ -278,10 +274,9 @@ // this.label4.AutoSize = true; this.label4.ForeColor = System.Drawing.Color.White; - this.label4.Location = new System.Drawing.Point(11, 120); - this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label4.Location = new System.Drawing.Point(8, 96); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(86, 19); + this.label4.Size = new System.Drawing.Size(68, 15); this.label4.TabIndex = 3; this.label4.Text = "1#剔除数"; // @@ -289,10 +284,9 @@ // this.label3.AutoSize = true; this.label3.ForeColor = System.Drawing.Color.White; - this.label3.Location = new System.Drawing.Point(11, 85); - this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Location = new System.Drawing.Point(8, 68); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(68, 19); + this.label3.Size = new System.Drawing.Size(54, 15); this.label3.TabIndex = 2; this.label3.Text = "1#NG数"; // @@ -300,10 +294,9 @@ // this.label2.AutoSize = true; this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Location = new System.Drawing.Point(11, 50); - this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Location = new System.Drawing.Point(8, 40); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(68, 19); + this.label2.Size = new System.Drawing.Size(54, 15); this.label2.TabIndex = 1; this.label2.Text = "1#OK数"; // @@ -311,23 +304,22 @@ // this.label1.AutoSize = true; this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(8, 15); - this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Location = new System.Drawing.Point(6, 12); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(86, 19); + this.label1.Size = new System.Drawing.Size(68, 15); this.label1.TabIndex = 0; this.label1.Text = "1#检测数"; // // singleCam // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.Controls.Add(this.panel2); this.Controls.Add(this.panel1); - this.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2); + this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.Name = "singleCam"; - this.Size = new System.Drawing.Size(1576, 947); + this.Size = new System.Drawing.Size(1182, 758); this.panel1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); diff --git a/WindowsFormsApp2/singleCam.cs b/WindowsFormsApp2/singleCam.cs index 6e57e0d..6f8d3f7 100644 --- a/WindowsFormsApp2/singleCam.cs +++ b/WindowsFormsApp2/singleCam.cs @@ -59,6 +59,7 @@ namespace WindowsFormsApp2 return; } } + private void _update(string data) { string info_frame = "1"; @@ -218,6 +219,7 @@ namespace WindowsFormsApp2 } } public Action callback = null; + private int thisId = -1; private void pictureBox1_DoubleClick(object sender, EventArgs e)