├── code ├── upper_computer │ ├── .vs │ │ └── WindowsFormsApp1 │ │ │ ├── FileContentIndex │ │ │ ├── read.lock │ │ │ ├── 1f10c0e1-7f80-46bc-95e3-e67b1a148bed.vsidx │ │ │ ├── 1f753520-da5b-4d96-ba6e-0d784198db4e.vsidx │ │ │ └── 5e324989-e685-4582-9b74-1bf11d32ab0e.vsidx │ │ │ └── v17 │ │ │ └── .suo │ ├── WindowsFormsApp1 │ │ ├── obj │ │ │ └── Debug │ │ │ │ ├── WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache │ │ │ │ ├── WindowsFormsApp1.csproj.CoreCompileInputs.cache │ │ │ │ ├── WindowsFormsApp1.exe │ │ │ │ ├── WindowsFormsApp1.pdb │ │ │ │ ├── WindowsFormsApp1.Form1.resources │ │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ │ ├── WindowsFormsApp1.Properties.Resources.resources │ │ │ │ ├── WindowsFormsApp1.csproj.AssemblyReference.cache │ │ │ │ ├── WindowsFormsApp1.csproj.GenerateResource.cache │ │ │ │ ├── .NETFramework,Version=v4.7.2.AssemblyAttributes.cs │ │ │ │ └── WindowsFormsApp1.csproj.FileListAbsolute.txt │ │ ├── bin │ │ │ └── Debug │ │ │ │ ├── WindowsFormsApp1.exe │ │ │ │ ├── WindowsFormsApp1.pdb │ │ │ │ ├── WindowsFormsApp1.exe.config │ │ │ │ └── log.txt │ │ ├── App.config │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Settings.Designer.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── Program.cs │ │ ├── WindowsFormsApp1.csproj │ │ ├── Form1.resx │ │ ├── Form1.cs │ │ └── Form1.Designer.cs │ └── WindowsFormsApp1.sln ├── list_data │ └── WindowsFormsApp1 │ │ ├── .vs │ │ └── WindowsFormsApp1 │ │ │ ├── FileContentIndex │ │ │ ├── read.lock │ │ │ └── 05ac8d8a-2e53-42e9-9e2f-e74eb5c21d32.vsidx │ │ │ └── v17 │ │ │ └── .suo │ │ ├── WindowsFormsApp1 │ │ ├── obj │ │ │ └── Debug │ │ │ │ ├── WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache │ │ │ │ ├── WindowsFormsApp1.csproj.CoreCompileInputs.cache │ │ │ │ ├── WindowsFormsApp1.exe │ │ │ │ ├── WindowsFormsApp1.pdb │ │ │ │ ├── WindowsFormsApp1.Form1.resources │ │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ │ ├── WindowsFormsApp1.csproj.GenerateResource.cache │ │ │ │ ├── WindowsFormsApp1.Properties.Resources.resources │ │ │ │ ├── WindowsFormsApp1.csproj.AssemblyReference.cache │ │ │ │ ├── .NETFramework,Version=v4.8.AssemblyAttributes.cs │ │ │ │ └── WindowsFormsApp1.csproj.FileListAbsolute.txt │ │ ├── bin │ │ │ └── Debug │ │ │ │ ├── WindowsFormsApp1.exe │ │ │ │ ├── WindowsFormsApp1.pdb │ │ │ │ └── WindowsFormsApp1.exe.config │ │ ├── App.config │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Settings.Designer.cs │ │ │ ├── Resources.Designer.cs │ │ │ └── Resources.resx │ │ ├── Program.cs │ │ ├── Form1.Designer.cs │ │ ├── WindowsFormsApp1.csproj │ │ ├── Form1.cs │ │ └── Form1.resx │ │ └── WindowsFormsApp1.sln └── queue_data │ └── WindowsFormsApp1 │ ├── .vs │ └── WindowsFormsApp1 │ │ ├── FileContentIndex │ │ ├── read.lock │ │ ├── 3e8efc5f-ed85-44fa-b8ca-c8f4167221d7.vsidx │ │ └── f5a7224d-6ccc-44f7-8930-72ca5cdd8dfd.vsidx │ │ └── v17 │ │ └── .suo │ ├── WindowsFormsApp1 │ ├── obj │ │ └── Debug │ │ │ ├── WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache │ │ │ ├── WindowsFormsApp1.csproj.CoreCompileInputs.cache │ │ │ ├── WindowsFormsApp1.exe │ │ │ ├── WindowsFormsApp1.pdb │ │ │ ├── WindowsFormsApp1.Form1.resources │ │ │ ├── DesignTimeResolveAssemblyReferences.cache │ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ │ ├── WindowsFormsApp1.Properties.Resources.resources │ │ │ ├── WindowsFormsApp1.csproj.AssemblyReference.cache │ │ │ ├── WindowsFormsApp1.csproj.GenerateResource.cache │ │ │ ├── .NETFramework,Version=v4.8.AssemblyAttributes.cs │ │ │ └── WindowsFormsApp1.csproj.FileListAbsolute.txt │ ├── bin │ │ └── Debug │ │ │ ├── WindowsFormsApp1.exe │ │ │ ├── WindowsFormsApp1.pdb │ │ │ └── WindowsFormsApp1.exe.config │ ├── App.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── AssemblyInfo.cs │ │ ├── Settings.Designer.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ ├── Program.cs │ ├── Form1.Designer.cs │ ├── WindowsFormsApp1.csproj │ ├── Form1.cs │ └── Form1.resx │ └── WindowsFormsApp1.sln ├── ReadMe.md ├── images ├── image-20220528160954085.png ├── image-20220528161032016.png └── image-20220528161051591.png └── 说明.md /code/upper_computer/.vs/WindowsFormsApp1/FileContentIndex/read.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/read.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/read.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | 这个是使用C#来编写的一个上位机代码,主要包括一下几个功能 2 | 3 | 1. 串口通信 4 | 2. 数据以波形的形式显示 5 | 3. 数据以追加的形式保存到txt文件中,或者csv -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/image-20220528160954085.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/images/image-20220528160954085.png -------------------------------------------------------------------------------- /images/image-20220528161032016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/images/image-20220528161032016.png -------------------------------------------------------------------------------- /images/image-20220528161051591.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/images/image-20220528161051591.png -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 9a68a842565c3852bd137f2c0b5ed3f9f3b19ea3 2 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | dd8f235b0d41fb5160fbeac2a663828f245a9e47 2 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | dd8f235b0d41fb5160fbeac2a663828f245a9e47 2 | -------------------------------------------------------------------------------- /code/upper_computer/.vs/WindowsFormsApp1/v17/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/.vs/WindowsFormsApp1/v17/.suo -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/.vs/WindowsFormsApp1/v17/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/.vs/WindowsFormsApp1/v17/.suo -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/.vs/WindowsFormsApp1/v17/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/.vs/WindowsFormsApp1/v17/.suo -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Form1.resources -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code/upper_computer/.vs/WindowsFormsApp1/FileContentIndex/1f10c0e1-7f80-46bc-95e3-e67b1a148bed.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/.vs/WindowsFormsApp1/FileContentIndex/1f10c0e1-7f80-46bc-95e3-e67b1a148bed.vsidx -------------------------------------------------------------------------------- /code/upper_computer/.vs/WindowsFormsApp1/FileContentIndex/1f753520-da5b-4d96-ba6e-0d784198db4e.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/.vs/WindowsFormsApp1/FileContentIndex/1f753520-da5b-4d96-ba6e-0d784198db4e.vsidx -------------------------------------------------------------------------------- /code/upper_computer/.vs/WindowsFormsApp1/FileContentIndex/5e324989-e685-4582-9b74-1bf11d32ab0e.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/upper_computer/.vs/WindowsFormsApp1/FileContentIndex/5e324989-e685-4582-9b74-1bf11d32ab0e.vsidx -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.Properties.Resources.resources -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/05ac8d8a-2e53-42e9-9e2f-e74eb5c21d32.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/list_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/05ac8d8a-2e53-42e9-9e2f-e74eb5c21d32.vsidx -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/3e8efc5f-ed85-44fa-b8ca-c8f4167221d7.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/3e8efc5f-ed85-44fa-b8ca-c8f4167221d7.vsidx -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/f5a7224d-6ccc-44f7-8930-72ca5cdd8dfd.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TZHelloWorld/upper_computer/HEAD/code/queue_data/WindowsFormsApp1/.vs/WindowsFormsApp1/FileContentIndex/f5a7224d-6ccc-44f7-8930-72ca5cdd8dfd.vsidx -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] 5 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] 5 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] 5 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace WindowsFormsApp1 8 | { 9 | internal static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace WindowsFormsApp1 8 | { 9 | internal static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace WindowsFormsApp1 8 | { 9 | internal static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("WindowsFormsApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsFormsApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("2e7f39d8-0bb7-4e79-b707-631b2ed40ba9")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("WindowsFormsApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsFormsApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("deb4d88a-e366-4d89-b9b9-f3b42e9b61eb")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("WindowsFormsApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsFormsApp1")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("8d700bbb-981d-4621-aa6e-97fb9d3b40bb")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32516.85 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{2E7F39D8-0BB7-4E79-B707-631B2ED40BA9}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2E7F39D8-0BB7-4E79-B707-631B2ED40BA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2E7F39D8-0BB7-4E79-B707-631B2ED40BA9}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2E7F39D8-0BB7-4E79-B707-631B2ED40BA9}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2E7F39D8-0BB7-4E79-B707-631B2ED40BA9}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C1E81C7D-D030-4139-816F-C6CA9BB983B3} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32516.85 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{DEB4D88A-E366-4D89-B9B9-F3B42E9B61EB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DEB4D88A-E366-4D89-B9B9-F3B42E9B61EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DEB4D88A-E366-4D89-B9B9-F3B42E9B61EB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DEB4D88A-E366-4D89-B9B9-F3B42E9B61EB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DEB4D88A-E366-4D89-B9B9-F3B42E9B61EB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {BA124609-FAF1-4E73-9158-C7B4A584AA38} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32516.85 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{8D700BBB-981D-4621-AA6E-97FB9D3B40BB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {8D700BBB-981D-4621-AA6E-97FB9D3B40BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {8D700BBB-981D-4621-AA6E-97FB9D3B40BB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {8D700BBB-981D-4621-AA6E-97FB9D3B40BB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {8D700BBB-981D-4621-AA6E-97FB9D3B40BB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {62AA3227-E1FA-4835-94C3-3CDB0A7F456E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config 2 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe 3 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb 4 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.AssemblyReference.cache 5 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache 6 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Form1.resources 7 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Properties.Resources.resources 8 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache 9 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache 10 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe 11 | C:\Users\tz\Desktop\串口相关信息\upper_computer\list_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb 12 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config 2 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe 3 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb 4 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.AssemblyReference.cache 5 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache 6 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Form1.resources 7 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Properties.Resources.resources 8 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache 9 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache 10 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe 11 | C:\Users\tz\Desktop\串口相关信息\upper_computer\queue_data\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb 12 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config 2 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe 3 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb 4 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.AssemblyReference.cache 5 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache 6 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Form1.resources 7 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Properties.Resources.resources 8 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache 9 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache 10 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe 11 | D:\code\C#\1\WindowsFormsApp1\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb 12 | D:\code\C#\1\send\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe.config 13 | D:\code\C#\1\send\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.exe 14 | D:\code\C#\1\send\WindowsFormsApp1\bin\Debug\WindowsFormsApp1.pdb 15 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.AssemblyReference.cache 16 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.SuggestedBindingRedirects.cache 17 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Form1.resources 18 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.Properties.Resources.resources 19 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.GenerateResource.cache 20 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache 21 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe 22 | D:\code\C#\1\send\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb 23 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 重写当前线程的 CurrentUICulture 属性,对 56 | /// 使用此强类型资源类的所有资源查找执行重写。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 重写当前线程的 CurrentUICulture 属性,对 56 | /// 使用此强类型资源类的所有资源查找执行重写。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WindowsFormsApp1.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 重写当前线程的 CurrentUICulture 属性,对 56 | /// 使用此强类型资源类的所有资源查找执行重写。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WindowsFormsApp1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows 窗体设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 33 | System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 34 | System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series(); 35 | this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 36 | this.timer1 = new System.Windows.Forms.Timer(this.components); 37 | this.timer2 = new System.Windows.Forms.Timer(this.components); 38 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); 39 | this.SuspendLayout(); 40 | // 41 | // chart1 42 | // 43 | chartArea4.Name = "ChartArea1"; 44 | this.chart1.ChartAreas.Add(chartArea4); 45 | legend4.Name = "Legend1"; 46 | this.chart1.Legends.Add(legend4); 47 | this.chart1.Location = new System.Drawing.Point(0, 0); 48 | this.chart1.Name = "chart1"; 49 | series4.ChartArea = "ChartArea1"; 50 | series4.Legend = "Legend1"; 51 | series4.Name = "Series1"; 52 | this.chart1.Series.Add(series4); 53 | this.chart1.Size = new System.Drawing.Size(798, 451); 54 | this.chart1.TabIndex = 0; 55 | this.chart1.Text = "chart1"; 56 | // 57 | // timer1 58 | // 59 | this.timer1.Enabled = true; 60 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick); 61 | // 62 | // timer2 63 | // 64 | this.timer2.Enabled = true; 65 | this.timer2.Interval = 200; 66 | this.timer2.Tick += new System.EventHandler(this.timer2_Tick); 67 | // 68 | // Form1 69 | // 70 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 71 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 72 | this.ClientSize = new System.Drawing.Size(804, 456); 73 | this.Controls.Add(this.chart1); 74 | this.Name = "Form1"; 75 | this.Text = "Form1"; 76 | this.Load += new System.EventHandler(this.Form1_Load); 77 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); 78 | this.ResumeLayout(false); 79 | 80 | } 81 | 82 | #endregion 83 | 84 | private System.Windows.Forms.DataVisualization.Charting.Chart chart1; 85 | private System.Windows.Forms.Timer timer1; 86 | private System.Windows.Forms.Timer timer2; 87 | } 88 | } 89 | 90 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WindowsFormsApp1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows 窗体设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea5 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 33 | System.Windows.Forms.DataVisualization.Charting.Legend legend5 = new System.Windows.Forms.DataVisualization.Charting.Legend(); 34 | System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series(); 35 | this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 36 | this.timer1 = new System.Windows.Forms.Timer(this.components); 37 | this.timer2 = new System.Windows.Forms.Timer(this.components); 38 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); 39 | this.SuspendLayout(); 40 | // 41 | // chart1 42 | // 43 | chartArea5.Name = "ChartArea1"; 44 | this.chart1.ChartAreas.Add(chartArea5); 45 | legend5.Name = "Legend1"; 46 | this.chart1.Legends.Add(legend5); 47 | this.chart1.Location = new System.Drawing.Point(0, 0); 48 | this.chart1.Name = "chart1"; 49 | series5.ChartArea = "ChartArea1"; 50 | series5.Legend = "Legend1"; 51 | series5.Name = "Series1"; 52 | this.chart1.Series.Add(series5); 53 | this.chart1.Size = new System.Drawing.Size(798, 447); 54 | this.chart1.TabIndex = 0; 55 | this.chart1.Text = "chart1"; 56 | // 57 | // timer1 58 | // 59 | this.timer1.Enabled = true; 60 | this.timer1.Interval = 50; 61 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick); 62 | // 63 | // timer2 64 | // 65 | this.timer2.Enabled = true; 66 | this.timer2.Interval = 50; 67 | this.timer2.Tick += new System.EventHandler(this.timer2_Tick); 68 | // 69 | // Form1 70 | // 71 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 72 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 73 | this.ClientSize = new System.Drawing.Size(800, 450); 74 | this.Controls.Add(this.chart1); 75 | this.Name = "Form1"; 76 | this.Text = "Form1"; 77 | this.Load += new System.EventHandler(this.Form1_Load); 78 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); 79 | this.ResumeLayout(false); 80 | 81 | } 82 | 83 | #endregion 84 | 85 | private System.Windows.Forms.DataVisualization.Charting.Chart chart1; 86 | private System.Windows.Forms.Timer timer1; 87 | private System.Windows.Forms.Timer timer2; 88 | } 89 | } 90 | 91 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/WindowsFormsApp1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {2E7F39D8-0BB7-4E79-B707-631B2ED40BA9} 8 | WinExe 9 | WindowsFormsApp1 10 | WindowsFormsApp1 11 | v4.7.2 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Form 52 | 53 | 54 | Form1.cs 55 | 56 | 57 | 58 | 59 | Form1.cs 60 | 61 | 62 | ResXFileCodeGenerator 63 | Resources.Designer.cs 64 | Designer 65 | 66 | 67 | True 68 | Resources.resx 69 | 70 | 71 | SettingsSingleFileGenerator 72 | Settings.Designer.cs 73 | 74 | 75 | True 76 | Settings.settings 77 | True 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/WindowsFormsApp1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DEB4D88A-E366-4D89-B9B9-F3B42E9B61EB} 8 | WinExe 9 | WindowsFormsApp1 10 | WindowsFormsApp1 11 | v4.8 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Form 52 | 53 | 54 | Form1.cs 55 | 56 | 57 | 58 | 59 | Form1.cs 60 | 61 | 62 | ResXFileCodeGenerator 63 | Resources.Designer.cs 64 | Designer 65 | 66 | 67 | True 68 | Resources.resx 69 | 70 | 71 | SettingsSingleFileGenerator 72 | Settings.Designer.cs 73 | 74 | 75 | True 76 | Settings.settings 77 | True 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/WindowsFormsApp1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8D700BBB-981D-4621-AA6E-97FB9D3B40BB} 8 | WinExe 9 | WindowsFormsApp1 10 | WindowsFormsApp1 11 | v4.8 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Form 52 | 53 | 54 | Form1.cs 55 | 56 | 57 | 58 | 59 | Form1.cs 60 | 61 | 62 | ResXFileCodeGenerator 63 | Resources.Designer.cs 64 | Designer 65 | 66 | 67 | True 68 | Resources.resx 69 | 70 | 71 | SettingsSingleFileGenerator 72 | Settings.Designer.cs 73 | 74 | 75 | True 76 | Settings.settings 77 | True 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using System.Windows.Forms.DataVisualization.Charting; 11 | 12 | namespace WindowsFormsApp1 13 | { 14 | public partial class Form1 : Form 15 | { 16 | //定义的成员变量,用于保存波形数据 17 | private List data_display1 = new List(); 18 | private List data_display2 = new List(); 19 | private List data_display3 = new List(); 20 | 21 | 22 | public Form1() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | private void Form1_Load(object sender, EventArgs e) 28 | { 29 | InitChart(); 30 | } 31 | 32 | private void InitChart() 33 | { 34 | //定义图表区域 35 | this.chart1.ChartAreas.Clear(); 36 | ChartArea chartArea1 = new ChartArea("C1"); 37 | this.chart1.ChartAreas.Add(chartArea1); 38 | //定义存储和显示点的容器 39 | this.chart1.Series.Clear(); 40 | Series series1 = new Series("S1"); 41 | Series series2 = new Series("S2"); 42 | Series series3 = new Series("S3"); 43 | series1.ChartArea = "C1"; 44 | series2.ChartArea = "C1"; 45 | series3.ChartArea = "C1"; 46 | this.chart1.Series.Add(series1); 47 | this.chart1.Series.Add(series2); 48 | this.chart1.Series.Add(series3); 49 | //设置图表显示样式 50 | this.chart1.ChartAreas[0].AxisX.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标x轴箭头为三角 51 | this.chart1.ChartAreas[0].AxisY.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标y轴箭头为三角 52 | 53 | //设置x轴的最大最小值 54 | //this.chart1.ChartAreas[0].AxisX.Minimum = 0; 55 | //this.chart1.ChartAreas[0].AxisX.Maximum = 100; 56 | this.chart1.ChartAreas[0].AxisX.Interval = 100;//x轴刻度间隔大小 57 | 58 | //设置y轴的最大最小值 59 | this.chart1.ChartAreas[0].AxisY.Minimum = 0; 60 | this.chart1.ChartAreas[0].AxisY.Maximum = 100; 61 | this.chart1.ChartAreas[0].AxisY.Interval = 10;//x轴刻度间隔大小 62 | 63 | //设置xy轴的颜色 64 | this.chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.Silver; 65 | this.chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.Silver; 66 | 67 | //不设置标题 68 | this.chart1.Titles.Clear(); 69 | 70 | //设置图表显示样式 71 | this.chart1.Series[0].Color = Color.Red; 72 | this.chart1.Series[1].Color = Color.Blue; 73 | this.chart1.Series[2].Color = Color.Green; 74 | 75 | //设置线形: 76 | //SeriesChartType.Spline 77 | //SeriesChartType.Line 78 | this.chart1.Series[0].ChartType = SeriesChartType.Line; 79 | this.chart1.Series[1].ChartType = SeriesChartType.Line; 80 | this.chart1.Series[2].ChartType = SeriesChartType.Line; 81 | 82 | //开始清空数据 83 | this.chart1.Series[0].Points.Clear(); 84 | this.chart1.Series[1].Points.Clear(); 85 | this.chart1.Series[2].Points.Clear(); 86 | 87 | } 88 | /// 89 | /// 生成假的数据 90 | /// 91 | /// 92 | /// 93 | private void timer1_Tick(object sender, EventArgs e) 94 | { 95 | //接收数据到list中,假的数据 96 | Random r = new Random(); 97 | data_display1.Add(r.NextDouble() * 10); 98 | data_display2.Add(r.NextDouble() * 20 + 10); 99 | data_display3.Add(r.NextDouble() * 20 + 40); 100 | 101 | } 102 | 103 | private void timer2_Tick(object sender, EventArgs e) 104 | { 105 | //更新显示波形,先删除之前的数据,然后将目前的数据显示出来 106 | this.chart1.Series[0].Points.Clear(); 107 | this.chart1.Series[1].Points.Clear(); 108 | this.chart1.Series[2].Points.Clear(); 109 | for (int i = 0; i < data_display1.Count; i++) 110 | { 111 | this.chart1.Series[0].Points.AddXY((i + 1), data_display1.ElementAt(i)); 112 | this.chart1.Series[1].Points.AddXY((i + 1), data_display2.ElementAt(i)); 113 | this.chart1.Series[2].Points.AddXY((i + 1), data_display3.ElementAt(i)); 114 | } 115 | 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using System.Windows.Forms.DataVisualization.Charting; 11 | 12 | namespace WindowsFormsApp1 13 | { 14 | public partial class Form1 : Form 15 | { 16 | 17 | //定义的成员变量,用于保存波形数据 18 | private static int show_len = 100;//定义每次显示数据的长度 19 | private Queue data_display1 = new Queue(show_len); 20 | private Queue data_display2 = new Queue(show_len); 21 | private Queue data_display3 = new Queue(show_len); 22 | 23 | 24 | public Form1() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | private void Form1_Load(object sender, EventArgs e) 30 | { 31 | InitChart(); 32 | } 33 | 34 | /// 35 | /// 初始化图表 36 | /// 37 | private void InitChart() 38 | { 39 | //定义图表区域 40 | this.chart1.ChartAreas.Clear(); 41 | ChartArea chartArea1 = new ChartArea("C1"); 42 | this.chart1.ChartAreas.Add(chartArea1); 43 | //定义存储和显示点的容器 44 | this.chart1.Series.Clear(); 45 | Series series1 = new Series("S1"); 46 | Series series2 = new Series("S2"); 47 | Series series3 = new Series("S3"); 48 | series1.ChartArea = "C1"; 49 | series2.ChartArea = "C1"; 50 | series3.ChartArea = "C1"; 51 | this.chart1.Series.Add(series1); 52 | this.chart1.Series.Add(series2); 53 | this.chart1.Series.Add(series3); 54 | //设置图表显示样式 55 | this.chart1.ChartAreas[0].AxisX.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标x轴箭头为三角 56 | this.chart1.ChartAreas[0].AxisY.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标y轴箭头为三角 57 | 58 | //设置x轴的最大最小值 59 | //this.chart1.ChartAreas[0].AxisX.Minimum = 0; 60 | //this.chart1.ChartAreas[0].AxisX.Maximum = 100; 61 | this.chart1.ChartAreas[0].AxisX.Interval = 100;//x轴刻度间隔大小 62 | 63 | //设置y轴的最大最小值 64 | this.chart1.ChartAreas[0].AxisY.Minimum = 0; 65 | this.chart1.ChartAreas[0].AxisY.Maximum = 100; 66 | this.chart1.ChartAreas[0].AxisY.Interval = 10;//x轴刻度间隔大小 67 | 68 | //设置xy轴的颜色 69 | this.chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.Silver; 70 | this.chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.Silver; 71 | 72 | //不设置标题 73 | this.chart1.Titles.Clear(); 74 | 75 | //设置图表显示样式 76 | this.chart1.Series[0].Color = Color.Red; 77 | this.chart1.Series[1].Color = Color.Blue; 78 | this.chart1.Series[2].Color = Color.Green; 79 | 80 | //设置线形: 81 | //SeriesChartType.Spline 82 | //SeriesChartType.Line 83 | this.chart1.Series[0].ChartType = SeriesChartType.Spline; 84 | this.chart1.Series[1].ChartType = SeriesChartType.Spline; 85 | this.chart1.Series[2].ChartType = SeriesChartType.Spline; 86 | 87 | //开始清空数据 88 | this.chart1.Series[0].Points.Clear(); 89 | this.chart1.Series[1].Points.Clear(); 90 | this.chart1.Series[2].Points.Clear(); 91 | 92 | } 93 | 94 | private void timer1_Tick(object sender, EventArgs e) 95 | { 96 | //接收数据到queue中,假的数据 97 | Random r = new Random(); 98 | int len = r.Next(0, 5); 99 | 100 | for (int i = 0; i < len; i++) 101 | { 102 | if (data_display1.Count > show_len) 103 | { 104 | data_display1.Dequeue(); 105 | data_display2.Dequeue(); 106 | data_display3.Dequeue(); 107 | } 108 | data_display1.Enqueue(r.NextDouble() * 10); 109 | data_display2.Enqueue(r.NextDouble() * 20 + 10); 110 | data_display3.Enqueue(r.NextDouble() * 20 + 40); 111 | } 112 | 113 | } 114 | 115 | private void timer2_Tick(object sender, EventArgs e) 116 | { 117 | //更新显示波形,先删除之前的数据,然后将目前的数据显示出来 118 | this.chart1.Series[0].Points.Clear(); 119 | this.chart1.Series[1].Points.Clear(); 120 | this.chart1.Series[2].Points.Clear(); 121 | for (int i = 0; i < data_display1.Count; i++) 122 | { 123 | this.chart1.Series[0].Points.AddXY((i + 1), data_display1.ElementAt(i)); 124 | this.chart1.Series[1].Points.AddXY((i + 1), data_display2.ElementAt(i)); 125 | this.chart1.Series[2].Points.AddXY((i + 1), data_display3.ElementAt(i)); 126 | } 127 | 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /code/list_data/WindowsFormsApp1/WindowsFormsApp1/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 107, 17 125 | 126 | -------------------------------------------------------------------------------- /code/queue_data/WindowsFormsApp1/WindowsFormsApp1/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 107, 17 125 | 126 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Form1.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 137, 17 122 | 123 | 124 | 246, 18 125 | 126 | 127 | 17, 17 128 | 129 | 130 | 376, 18 131 | 132 | 133 | 146 134 | 135 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/bin/Debug/log.txt: -------------------------------------------------------------------------------- 1 | 2 | 3.83144217256058 3 | 8.2473653174226 4 | 5.72835179312544 5 | 6.62916568882259 6 | 4.61514131846611 7 | 9.49153303610698 8 | 1.17675915880909 9 | 3.47352618978989 10 | 6.51205093903097 11 | 7.87333340750697 12 | 4.21303461501982 13 | 6.44285982774704 14 | 8.40896055959582 15 | 6.25513377890695 16 | 7.24931007123054 17 | 9.41219346570419 18 | 7.2957500849365 19 | 9.19265970550136 20 | 1.08956932606621 21 | 9.97635885140689 22 | 8.74346921627571 23 | 4.12902245490301 24 | 1.87326847197174 25 | 7.1252695876757 26 | 7.16529791111373 27 | 3.44066676378281 28 | 9.61360502504446 29 | 5.33757638434767 30 | 7.99540539644445 31 | 7.23448600491252 32 | 6.1212755302532 33 | 9.23957311512883 34 | 0.521141942833151 35 | 0.0427904073348224 36 | 8.01818515081805 37 | 7.62137348652881 38 | 3.55741739904388 39 | 6.90497467615873 40 | 9.58558344262912 41 | 0.10970892389757 42 | 1.48249306319398 43 | 8.49150929529756 44 | 3.37940268375883 45 | 6.87330966669755 46 | 2.26619220909951 47 | 9.73567701398194 48 | 6.9132614307633 49 | 4.79661548267892 50 | 4.16310182966436 51 | 8.11747738538192 52 | 9.94953688697402 53 | 7.76594912063607 54 | 3.04989135500504 55 | 4.9468009755699 56 | 6.84371059613475 57 | 5.73050012147543 58 | 0.605812822750682 59 | 6.82924927064648 60 | 7.62740974204029 61 | 8.98761319415067 62 | 9.86552472685721 63 | 9.52431936260514 64 | 7.36941356555066 65 | 2.90180018306794 66 | 9.19480803385135 67 | 1.47594863151943 68 | 1.09171765441621 69 | 9.85774900291942 70 | 2.98862727498106 71 | 1.87541680032174 72 | 1.10191672160379 73 | 3.22136875857663 74 | 8.39654606226671 75 | 3.77232642088659 76 | 9.48371709300378 77 | 6.25764421478736 78 | 5.66923604145145 79 | 7.86551746440377 80 | 9.29391967099808 81 | 5.33972471269766 82 | 1.97205253037254 83 | 3.13735659845982 84 | 7.23663433326251 85 | 0.353852901772527 86 | 9.13354395382737 87 | 8.73565327317251 88 | 8.02033347916805 89 | 1.59802062045691 90 | 9.61348824650677 91 | 3.15037113761081 92 | 9.9172430997329 93 | 9.97982099185689 94 | 2.6497637027175 95 | 6.11970477556796 96 | 1.81415272029776 97 | 8.36162136325688 98 | 5.68603915892823 99 | 9.08903841352511 100 | 0.700942245638437 101 | 2.59785186620329 102 | 1.48464139154397 103 | 2.46815642922565 104 | 9.52947608638996 105 | 3.38155101210883 106 | 0.84995680062564 107 | 2.56575154260069 108 | 5.27846063267368 109 | 9.23175717202563 110 | 5.60202699881141 111 | 7.95906939914407 112 | 8.85772526210999 113 | 2.07815864685837 114 | 3.84286348886921 115 | 6.84585892448475 116 | 1.72009260939438 117 | 8.7427685450496 118 | 7.62955807039028 119 | 2.96426032807876 120 | 5.92159557432011 121 | 6.75030171719859 122 | 9.52646769095513 123 | 1.34606069947875 124 | 8.95787103053083 125 | 1.42337731151999 126 | 9.72786107087874 127 | 1.99414648674156 128 | 0.310166836860667 129 | 4.04515493383871 130 | 2.66110040371357 131 | 2.99077560333106 132 | 2.2161965082475 133 | 4.88768522389591 134 | 0.597996879647484 135 | 3.77447474923659 136 | 3.46036422693188 137 | 2.31371506225025 138 | 1.5041267925427 139 | 5.67138436980144 140 | 1.84216459833186 141 | 5.34999051846098 142 | 4.47346043049985 143 | 7.5682939903663 144 | 0.223964969731851 145 | 8.3862659746717 146 | 7.442794068457 147 | 6.45508351570698 148 | 8.35199313627183 149 | 0.248902756836686 150 | 9.13569228217736 151 | 2.71230040710061 152 | 5.26597835834416 153 | 1.03260190274222 154 | 1.0941007785006 155 | 8.30225381455489 156 | 3.65437952506094 157 | 4.02734011133543 158 | 3.71321066921261 159 | 0.720068868584963 160 | 4.77838546260185 161 | 2.1966191438011 162 | 2.60000019455329 163 | 3.58243621586935 164 | 4.49690981511814 165 | 6.39381943568299 166 | 5.28060896102367 167 | 3.20840430595372 168 | 1.65809784627431 169 | 8.07339101008763 170 | 7.17751858158853 171 | 1.59020467735371 172 | 4.69437330248504 173 | 6.06430810692921 174 | 8.7449168733996 175 | 4.07854011472247 176 | 0.64182649396445 177 | 2.46034048612245 178 | 2.5387361145293 179 | 0.842140857522442 180 | 1.42552563986998 181 | 3.70450820480683 182 | 8.05021733420445 183 | 2.82721608543173 184 | 3.32243526043484 185 | 2.08630857620682 186 | 1.08649279041518 187 | 5.79654972338888 188 | 2.20922478577552 189 | 4.10613440634037 190 | 6.00304402690523 191 | 4.8898335522459 192 | 4.57464401357558 193 | 7.96620517408764 194 | 6.78674317281076 195 | 2.95644438497557 196 | 1.00248063029837 197 | 8.68365279337561 198 | 1.33824475637555 199 | 9.46735193928115 200 | 2.58241247505993 201 | 7.47861227834533 202 | 0.550374798732984 203 | 8.35414146462183 204 | 5.44477982234432 205 | 0.25105108518668 206 | 3.82658019374431 207 | 2.14796070575153 208 | 5.88294880272958 209 | 2.27925255069474 210 | 4.86790385323945 211 | 2.93165985165707 212 | 3.45254828382868 213 | 7.39460011822851 214 | 4.82856947222192 215 | 1.83434865522867 216 | 0.43087557443924 217 | 4.49905814346813 218 | 5.94088372119744 219 | 6.39596776403299 220 | 4.32268409259742 221 | 8.29287738459784 222 | 2.70448446399741 223 | 7.17966690993852 224 | 5.5668518112818 225 | 0.750444149947932 226 | 1.18097174036362 227 | 9.07657653050338 228 | 3.94865218268179 229 | 3.78671960615866 230 | 4.15030537832077 231 | 0.973486151068232 232 | 2.33045255408178 233 | 6.82299506236939 234 | 7.11963901627792 235 | 9.86027567640891 236 | 1.75718529697377 237 | 5.49217339395181 238 | 3.6454922583166 239 | 2.5408844428793 240 | 4.81878799145053 241 | 3.70270744604185 242 | 4.43779406344415 243 | 3.20058836285052 244 | 7.11840282991454 245 | 2.82655645293489 246 | 3.21511455029953 247 | 1.87346409162202 248 | 6.00519235525522 249 | 5.68892380021928 250 | 7.90210197582008 251 | 6.78889150116075 252 | 6.93309151890366 253 | 7.05855147776126 254 | 4.7809023199514 255 | 8.68580112172561 256 | 5.31489189030365 257 | 0.0948269339719913 258 | 0.582710742290463 259 | 3.69669226170363 260 | 3.13110239018272 261 | 2.15010903410153 262 | 6.18502769907239 263 | 4.04701865466638 264 | 4.56682807047238 265 | 2.93380818000706 266 | 7.42919541775677 267 | 3.45067096569141 268 | 9.5347273952955 269 | 4.83071780057192 270 | 5.81099578915676 271 | 6.48694642190214 272 | 2.50406103325266 273 | 6.72762742113677 274 | 4.19279616055675 275 | 9.52322187811286 276 | 5.47339467120981 277 | 5.61441694647745 278 | 7.51132656704231 279 | 8.29502571294784 280 | 6.68113159792551 281 | 6.40293426178532 282 | 0.191935333512693 283 | 5.06293196932549 284 | 9.43920971799605 285 | 2.87254409998308 286 | 4.68890005940986 287 | 5.91534136604301 288 | 0.227219746553907 289 | 1.75933362532376 290 | 7.55126740669425 291 | 3.65624324588861 292 | 5.55315286645347 293 | 4.43994239179415 294 | 7.17723549677862 295 | 2.79505374971547 296 | 6.336852012359 297 | 5.5590358681786 298 | 5.8313292059262 299 | 7.90425030417007 300 | 8.04737130554736 301 | 9.80115992473492 302 | 6.42917167694735 303 | 1.69806954529978 304 | 4.81097204834734 305 | 0.584859070640457 306 | 7.67333939563173 307 | 9.18717323764561 308 | 0.857816688184541 309 | 2.48176869120531 310 | 6.05513976703172 311 | 2.22344869385634 312 | 3.82715032614169 313 | 1.36855821654599 314 | 3.26546783711085 315 | 5.1623774576757 316 | 4.04916698301638 317 | 8.54347520440047 318 | 9.1031610775288 319 | 5.94607660358123 320 | 6.92527557580046 321 | 2.13943653373953 322 | 7.84298622414609 323 | 5.30707594720045 324 | 8.62668537005162 325 | 6.55124366588483 326 | 8.61556818178648 327 | 8.58097540148579 328 | 7.5134748953923 329 | 9.41361101316922 330 | 9.41038451595715 331 | 1.30729413652201 332 | 0.194083661862688 333 | 9.03957910325359 334 | 5.49528056545895 335 | 2.09099328242754 336 | 7.42137947465357 337 | 8.53155602166967 338 | 3.9879029029924 339 | 5.80317984605356 340 | 1.5678314778804 341 | 3.65839157423861 342 | 9.90971491202233 343 | 5.55530119480346 344 | 8.29151528342232 345 | 7.45221081536832 346 | 6.67331565482231 347 | 6.339000340709 348 | 9.5356830021067 349 | 1.88740005338909 350 | 9.21157234311643 351 | 8.23590996127385 352 | 7.91748337350669 353 | 4.92367550959982 354 | 2.18090598107358 355 | 0.132819581838706 356 | 6.29928374490667 357 | 7.95995096581054 358 | 5.15023961903073 359 | 9.01960910717938 360 | 0.91651872774424 361 | 9.80330825308492 362 | 0.405818810875443 363 | 1.80338789327228 364 | 1.70021787364977 365 | 8.78761918227543 366 | 4.83966334948301 367 | 3.59712749421463 368 | 7.16941955367542 369 | 4.38082664012016 370 | 8.4135872723598 371 | 1.31579499752996 372 | 6.93473105641768 373 | 6.27773626068501 374 | 6.79538764375978 375 | 4.35207045374069 376 | 9.90406469437483 377 | 5.16452578602569 378 | 7.06143540659055 379 | 5.94822493193123 380 | 0.901922709728555 381 | 8.19550738120242 382 | 2.81150292270421 383 | 7.84513455249608 384 | 9.28372308112854 385 | 1.23178283741315 386 | 9.74204417306094 387 | 7.66552345252853 388 | 4.26805829362388 389 | 1.309442464872 390 | 0.153858889897288 391 | 3.20635208543686 392 | 8.53565926129728 393 | 2.09314161077754 394 | 1.39802660858167 395 | 4.58762686913257 396 | 7.56532799804831 397 | 3.99005123134239 398 | 9.77982697998165 399 | 7.62390232534329 400 | 0.534661636005464 401 | 5.88696085190725 402 | 8.16162735138164 403 | 0.660177781554022 404 | 3.50399527396261 405 | 4.77375037724793 406 | 6.67065999781278 407 | 7.45435914371831 408 | 0.6499627887504 409 | 7.53989016522648 410 | 9.35126876428317 411 | 9.03176316015039 412 | 0.134967910188701 413 | 0.275930878834767 414 | 4.01602181327344 415 | 5.28848671134956 416 | 2.03187753075356 417 | 8.65773125023475 418 | 7.05229726948417 419 | 8.25782034930672 420 | 5.7668656277316 421 | 2.81557667665909 422 | 4.71248629722394 423 | 3.59927582256462 424 | 1.14606668760351 425 | 3.93200965315663 426 | 5.49618544312948 427 | 9.5278670590035 428 | 6.96828510936736 429 | 7.06358373494054 430 | 2.01620249637226 431 | 8.9604933555054 432 | 0.398002867772245 433 | 0.857402976070253 434 | 8.77980323917223 435 | 9.74419250141093 436 | 1.64217058645662 437 | 0.324129141086773 438 | 8.88841729093735 439 | 1.64110212197579 440 | 0.0239709578566118 441 | 3.3604045972975 442 | 1.8577509288945 443 | 0.527891647316465 444 | 2.42480126788132 445 | 3.20850041378685 446 | 2.51230639522537 447 | 0.24011698096996 448 | 5.10541003435171 449 | 0.894106766625357 450 | 7.00231965491656 451 | 9.27590713802534 452 | 7.7860188008221 453 | 0.520074856709724 454 | 9.75252408522764 455 | 6.6115760042386 456 | 6.67280832616277 457 | 3.38244220399412 458 | 8.56971794672763 459 | 0.466627567292483 460 | 9.35341709263316 461 | 3.00841029407848 462 | 6.63223646890011 463 | 1.25032671319802 464 | 1.39021066547847 465 | 9.66851192511083 466 | 3.14723633376287 467 | 9.77201103687846 468 | 2.70478738132156 469 | 2.81772500500908 470 | 3.87854610284723 471 | 4.71463462557394 472 | 2.26034647424721 473 | 6.61154424613879 474 | 0.642146845647202 475 | 5.49833377147947 476 | 3.50451419293159 477 | 3.02435595683025 478 | 7.24217294586924 479 | 7.39524339204433 480 | 1.88631456433158 481 | 6.06063141304098 482 | 0.211506583826387 483 | 9.29215301260918 484 | 0.268114935731569 485 | 9.0969068692517 486 | 8.17894253794986 487 | 8.96264168385539 488 | 4.37465000170034 489 | 2.94034379671344 490 | 0.859551304420247 491 | 2.75645037310033 492 | 5.97661925292416 493 | 4.59453940139829 494 | 2.82732235865077 495 | 6.88977917977133 496 | 4.02244424169066 497 | 3.54016007089064 498 | 2.38241846318469 499 | 2.45275090097112 500 | 4.96533165917049 501 | 5.43706969145549 502 | 0.764218834584681 503 | 5.48902635718185 504 | 7.93466529712764 505 | 4.32385921679617 506 | 6.22076883736102 507 | 5.1075583627017 508 | 4.87075390055345 509 | 9.33246328464358 510 | 7.00446798326656 511 | 3.25255427195344 512 | 2.36873874085431 513 | 8.90137760383141 514 | 1.63435464335343 515 | 5.40501419706504 516 | 0.468775895642478 517 | 4.12269008072218 518 | 2.36568551620733 519 | 2.50449045212217 520 | 1.25247504154801 521 | 5.36685779940656 522 | 5.72458277257373 523 | 5.59592860080112 524 | 3.14938466211287 525 | 3.74865817080655 526 | 8.76085822878445 527 | 8.56526223875827 528 | 5.04629428267772 529 | 2.13045854220654 530 | 1.79713368499518 531 | 3.9330838080184 532 | 5.82999342858325 533 | 6.61369257448879 534 | 4.6187939795753 535 | 8.67684606866764 536 | 8.51060219505364 537 | 3.00059435097528 538 | 9.29430134095918 539 | 4.24476206965966 540 | 5.1529777167146 541 | 3.31908731410237 542 | 1.19121096152403 543 | 2.62656244105965 544 | 8.18925317292533 545 | 6.28842095205952 546 | 0.0780004868647086 547 | 1.97491010742956 548 | 3.87181972799442 549 | 2.7586092533351 550 | 5.11489787842841 551 | 5.06896555659779 552 | 4.65551887389995 553 | 3.4966982498284 554 | 8.10524101280851 555 | 6.22291716571102 556 | 5.98503368719715 557 | 8.11982678627587 558 | 4.36683405859714 559 | 0.338251181104337 560 | 2.23516080166919 561 | 4.13207042223405 562 | 3.01885994757473 563 | 3.39282011305579 564 | 9.41977636861604 565 | 4.91576956813958 566 | 1.77462048445578 567 | 2.45605182482677 568 | 6.48316785995065 569 | 4.26295592182454 570 | 8.3800774805155 571 | 2.64475629322452 572 | 0.276987101080356 573 | 9.16377662642103 574 | 3.8889240119089 575 | 5.81189585654619 576 | 7.88704718830392 577 | 9.94747577232657 578 | 2.62808453879696 579 | 4.75905982067765 580 | 4.52499415936181 581 | 3.14086019207763 582 | 6.42190377992667 583 | 1.52266056347762 584 | 5.30869330526734 585 | 4.38502791076201 586 | 2.20401534447633 587 | 2.64087226364802 588 | 7.2056029258322 589 | 2.766828282162 590 | 5.24029080068706 591 | 5.61020590160517 592 | 6.09239245117288 593 | 7.98930207173773 594 | 9.88621169230259 595 | 8.77300121764326 596 | 5.25516371953076 597 | 2.12000318435952 598 | 2.56682045877297 599 | 2.01876446233073 600 | 8.19255409678098 601 | 2.23730913001919 602 | 6.1252995282995 603 | 4.13421875058404 604 | 4.50709989969949 605 | 6.0311283711489 606 | 4.91791789648958 607 | 5.75126761838387 608 | 8.51212267228967 609 | 6.24080284323581 610 | 6.81482751705443 611 | 4.13306798978386 612 | 1.54839812850039 613 | 8.71173713761928 614 | 2.51486836118385 615 | 4.58467358471112 616 | 8.3822258088655 617 | 6.62140342715262 618 | 8.42811051217286 619 | 0.27913542943035 620 | 5.0032037985526 621 | 2.17604504999521 622 | 3.38500416995259 623 | 1.06283457533588 624 | 6.24737151723698 625 | 4.90424216021981 626 | 0.994627918579908 627 | 2.95974419590074 628 | 4.62917188863697 629 | 7.94051761643054 630 | 3.96396155653706 -------------------------------------------------------------------------------- /说明.md: -------------------------------------------------------------------------------- 1 | # [上位机](https://baike.baidu.com/item/上位机) 2 | 3 | **上位机**是指可以直接发出操控命令的计算机,一般是PC/host computer/master computer/upper computer,屏幕上显示各种信号变化(液压,[水位](https://baike.baidu.com/item/水位/21295),温度等)。[下位机](https://baike.baidu.com/item/下位机/9624953)是直接控制设备获取设备状况的[计算机](https://baike.baidu.com/item/计算机/140338),一般是PLC/[单片机](https://baike.baidu.com/item/单片机/102396)single chip microcomputer/slave computer/lower computer之类的。上位机发出的命令首先给下位机,下位机再根据此命令解释成相应[时序信号](https://baike.baidu.com/item/时序信号/4419171)直接控制相应设备。下位机(单片机)与 上位机之间要进行数据通信的两种方式都是基于**串口**的 4 | 5 | 6 | 7 | # 串口通信 8 | 9 | > 串行接口(串口)是一种可以将接受来自CPU的并行数据字符转换为连续的串行数据流发送出去,同时可将接受的串行数据流转换为并行的数据字符供给CPU的器件。一般完成这种功能的电路,我们称为串行接口电路。 10 | > 11 | > 串口通信(Serial Communications)的概念非常简单,串口按位(bit)发送和接收字节。尽管比按字节(byte)的并行通信慢,但是串口可以在使用一根线发送数据的同时用另一根线接收数据。串口通信最重要的参数是波特率、数据位、停止位和奇偶校验。对于两个进行通信的端口,这些参数必须匹配。 12 | 13 | 1. 波特率:指的是信号被调制以后在单位时间内的变化,即单位时间内载波参数变化的次数,这是一个衡量符号传输速率的参数。 14 | 15 | > 如每秒钟传送960个字符,而每个字符格式包含10位(1个起始位,1个停止位,8个数据位),这时的波特率为960Bd,比特率为10位*960个/秒=9600bps。 16 | 17 | 2. 数据位:当计算机发送一个信息包,实际的数据往往不会是8位的,标准的值是6、7和8位。标准的ASCII码是0~127(7位),扩展的ASCII码是0~255(8位)。 18 | 19 | 3. 停止位:表示单个数据包的最后几位,也就是用于该数据包结束的标志,常用的值有1,1.5,2位 20 | 21 | 4. 奇偶校验:一种检验方式 22 | 23 | 24 | 25 | ## C#串口通信:SerialPort类 26 | 27 | 参考官方文档:[SerialPort 类 (System.IO.Ports) | Microsoft Docs](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport?redirectedfrom=MSDN#mainBody) 28 | 29 | 常用的字段,方法,与事件: 30 | 31 | 对于SerialPort类,如果要创建实例,其参数最常用设置如下: 32 | 33 | | 名称 | 类型 | 说明 | 34 | | -------- | ------------------------------------------------------------ | ------------------------------------------------------------ | 35 | | PortName | [String](https://docs.microsoft.com/zh-cn/dotnet/api/system.string) | 通信端口,(例如 COM1) | 36 | | BaudRate | [Int32](https://docs.microsoft.com/zh-cn/dotnet/api/system.int32) | 串行波特率 | 37 | | DataBits | [Int32](https://docs.microsoft.com/zh-cn/dotnet/api/system.int32) | 数据位值,每个字节的标准数据位长度 | 38 | | Parity | [Parity](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.parity) | [Parity](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.parity#system-io-ports-serialport-parity) 值之一,表奇偶校验检查协议 | 39 | | StopBits | [StopBits](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.stopbits) | [StopBits](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.stopbits#system-io-ports-serialport-stopbits) 值之一,表每个字节的标准停止位数 | 40 | 41 | 常用方法:() 42 | 43 | | 名称 | 说明 | 44 | | ------------------------------------------------------------ | ------------------------------------------------------------ | 45 | | [Close](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.close) | 关闭端口连接,将 [IsOpen](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.isopen#system-io-ports-serialport-isopen) 属性设置为 `false`,并释放内部 [Stream](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.stream) 对象。 | 46 | | [GetPortNames](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.getportnames) | 获取当前计算机的串行端口名称数组 | 47 | | [Open](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.open) | 打开一个新的串行端口连接 | 48 | | [Read](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.read) | 从SerialPort输入缓冲区中读取 | 49 | | [Write](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.write) | 将数据写入串行端口输出缓冲区 | 50 | 51 | 常用事件: 52 | 53 | | 名称 | 说明 | 54 | | ------------------------------------------------------------ | ------------------------------------------------------------ | 55 | | [DataReceived](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.datareceived) | 指示已通过由 [SerialPort](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport) 对象表示的端口接收了数据。 | 56 | 57 | 58 | 59 | ## 列出所有的串口 60 | 61 | 封装一个串口号检测的方法,并显示到串口号(组件名叫cbxCOMPort)中: 62 | 63 | ```c# 64 | string[] portNamesArray = SerialPort.GetPortNames();//获取所有可用串口名字 65 | cbxCOMPort.Items.Clear(); //清除当前串口号中的所有串口名称 66 | foreach (string port in portNamesArray) 67 | { 68 | cbxCOMPort.Items.Add(port); 69 | } 70 | ``` 71 | 72 | 73 | 74 | ## C#串口通信:读写数据 75 | 76 | ### 写数据:[SerialPort.Write](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.write),[SerialPort.WriteLine](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.writeline) 77 | 78 | | 函数 | 说明 | 79 | | ------------------------------------------------- | ------------------------------------------------------------ | 80 | | void Write(string text); | 将指定的字符串写入串行端口。 | 81 | | void Write(byte[] buffer, int offset, int count); | 使用缓冲区中的数据将指定数量的字节写入串行端口。 | 82 | | void Write(char[] buffer, int offset, int count); | 使用缓冲区中的数据将指定数量的字符写入串行端口。 | 83 | | void WriteLine (string text); | 将指定的字符串和 [NewLine](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.newline#system-io-ports-serialport-newline) 值写入输出缓冲区。 | 84 | 85 | 使用细节: 86 | 87 | 1. Write函数是同步的。在数据发送完之前,Write函数是不会返回的。比如:波特率1200,发送1024个字节大概要耗时9秒。如果这段代码在主线程里,那么这9秒内整个程序将处于假死状态,即主函数无法响应用户的键盘、鼠标输入; 88 | 89 | 2. WriteTimeout属性用于控制Write函数的最长耗时。它的默认值为System.IO.Ports.SerialPort.InfiniteTimeout,也就是-1。其含义为:Write函数不将所有数据写完绝不返回。可以修改此属性: 90 | 91 | ```c# 92 | port.WriteTimeout = 5000//Write 函数最多耗时 5秒 93 | //Write写数据时最多耗时5秒,超过这个时间未发的数据将被舍弃,Write函数抛出异常TimeoutException后立即返回。 94 | ``` 95 | 96 | 97 | 98 | ### 读数据:[SerialPort.Read](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.read),[SerialPort.ReadByte](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.readbyte),[SerialPort.ReadChar](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.readchar),[SerialPort.ReadExisting](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.readexisting),[SerialPort.ReadLine](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.readline),[SerialPort.ReadTo](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.readto) 99 | 100 | | 函数 | 说明 | 101 | | ----------------------------------------------- | ------------------------------------------------------------ | 102 | | int Read(byte[] buffer, int offset, int count); | 从 [SerialPort](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport) 输入缓冲区读取一些字节并将那些字节写入字节数组中指定的偏移量处。 | 103 | | int Read(char[] buffer, int offset, int count); | 从 [SerialPort](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport) 输入缓冲区中读取一些字符,然后将这些字符写入字符数组中指定的偏移量处。 | 104 | | int ReadByte (); | 从 [SerialPort](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport) 输入缓冲区中同步读取一个字节。 | 105 | | int ReadChar (); | 从 [SerialPort](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport) 输入缓冲区中同步读取一个字符。 | 106 | | string ReadExisting(); | 在编码的基础上,读取 [SerialPort](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport) 对象的流和输入缓冲区中所有立即可用的字节。 | 107 | | string ReadLine(); | 一直读取到输入缓冲区中的 [NewLine](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.newline#system-io-ports-serialport-newline) 值。 | 108 | | string ReadTo(string value); | 一直读取到输入缓冲区中的指定 `value` 的字符串。 | 109 | 110 | 使用细节: 111 | 112 | 1. Read函数是同步的,在数据读取完之前,该函数是不会返回的。如果这段代码在主线程里,那么整个程序将处于假死状态; 113 | 114 | 2. eadTimeout属性用于控制Read函数的最长耗时。它的默认值为System.IO.Ports.SerialPort.InfiniteTimeout,也就是-1。其含义为:Read函数未读取到串口数据之前是不会返回的。可以修改此属性: 115 | 116 | ```c# 117 | port.ReadTimeout = 2000;//read函数最多耗时2秒,超过这个时间未读取到数据,Read函数将抛出异常TimeoutException,然后返回。 118 | ``` 119 | 120 | 121 | 122 | ### DataReceived事件: 123 | 124 | 串口输入缓冲区获得新数据后,会以DataReceived事件通知System.IO.Ports.SerialPort对象,可以在此时读取串口数据。 125 | 126 | ```c# 127 | port.ReceivedBytesThreshold = 1;//串口输入缓冲区获得新数据后,将检查缓冲区内已有的字节数,大于等于ReceivedBytesThreshold就会触发DataReceived事件.这里设置为1,显然就是一旦获得新数据后,立即触发DataReceived事件。 128 | 129 | port.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(port_DataReceived);//对于DataReceived事件,用函数port_DataReceived进行处理。 130 | ``` 131 | 132 | ```c# 133 | //回调函数port_DataReceived用于响应DataReceived事件,通常在这个函数里读取串口数据。 134 | //参数sender就是事件的发起者(这里就是port),也就是说:多个串口对象可以共用一个回调函数,通过sender可以区分是哪个串口对象。 135 | //回调函数是被一个多线程调用的,它不在主线程内。所以,不要在这个回调函数里直接访问界面控件。如果一定要用,那么就需要使用Invoke或BeginInvoke来使用 136 | void port_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e) 137 | { 138 | int nRead = port.BytesToRead; 139 | if (nRead > 0) 140 | { 141 | byte[] data = new byte[nRead]; 142 | port.Read(data, 0, nRead); 143 | } 144 | } 145 | ``` 146 | 147 | 148 | 149 | ### 数据发送不同步问题: 150 | 151 | 描述:串行通讯的双方,如果有一方反应较慢,另一方不管不顾的不停发送数据,就可能造成数据丢失。为了防止这种情况发生,需要使用流控制。 152 | 153 | 流控制也叫握手,使用 [Handshake](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.handshake) 中的值获取或设置串行端口数据传输的握手协议。 154 | 155 | 有四种取值: 156 | 157 | | 取值 | 说明 | 158 | | ---------------------------------------------- | ---------- | 159 | | System.IO.Ports.Handshake.None | 无 | 160 | | System.IO.Ports.Handshake.XOnXOff | 软件 | 161 | | System.IO.Ports.Handshake.RequestToSend | 硬件 | 162 | | System.IO.Ports.Handshake.RequestToSendXOnXOff | 硬件和软件 | 163 | 164 | (1) 软件流控制(XON/XOFF) 165 | 166 | [Handshake](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.handshake)如果该属性设置为[RequestToSendXOnXOff](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.handshake#system-io-ports-handshake-requesttosendxonxoff)且[CtsHolding](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.ctsholding)设置为`false`该属性,则不会发送 XOff 字符。 如果 [CtsHolding](https://docs.microsoft.com/zh-cn/dotnet/api/system.io.ports.serialport.ctsholding) 设置为 `true`,则必须在发送 XOff 字符之前发送更多数据。 167 | 168 | 串口设备A给串口设备B发送数据。B忙不过来时(B的串口输入缓冲区快满了)会给A发送字符XOFF(一般为13H),A将暂停发送数据;B的串口输入缓冲区快空时,会给A发送字符XON(一般为11H),A将继续发送数据。 169 | 170 | 软件流控制最大的问题在于:通讯双方不能传输字符XON和XOFF。 171 | 172 | (2)硬件流控制(RTS/CTS)需要一定的硬件知识,不是很懂 173 | 174 | 175 | 176 | ======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= 177 | 178 | 开始设计: 179 | 180 | # 界面设计 181 | 182 | 首先对于使用C#而言,可以通过拖拽的方式进行,最主要的设计: 183 | 184 | 1. (窗体的属性,事件,方法) 185 | 2. 控件的排布, 186 | 3. 事件的监听, 187 | 4. 当监听到某个事件后,需要执行的方法。 188 | 189 | 对于该上位机的设计,界面如下: 190 | 191 | ![image-20220528161051591](images/image-20220528161051591.png) 192 | 193 | 主要是通过拖拽控件,并且设计布局达到上面的效果。 194 | 195 | 196 | 197 | # 波形显示(chart控件的使用) 198 | 199 | 参考:[C#--图表控件(Chart)_北极星小王子的博客-CSDN博客_c# chart](https://blog.csdn.net/weixin_41835916/article/details/83789061) 200 | 201 | [C#之Chart控件系列教程——一(转载)_hellohake的博客-CSDN博客_c# chart控件](https://blog.csdn.net/hellohake/article/details/106613787) 202 | 203 | chart控件的五大核心属性: 204 | 205 | - Annotations 206 | - ChartAreas 207 | - Legends 208 | - Series 209 | - Titles 210 | 211 | 其中最为核心的三个属性是ChartAreas、Series、Legends 212 | 213 | 初始化图像设置封装成函数有: 214 | 215 | ```c# 216 | private void InitChart() 217 | { 218 | //定义图表区域 219 | this.chart1.ChartAreas.Clear(); 220 | ChartArea chartArea1 = new ChartArea("C1"); 221 | this.chart1.ChartAreas.Add(chartArea1); 222 | //定义存储和显示点的容器 223 | this.chart1.Series.Clear(); 224 | Series series1 = new Series("S1"); 225 | Series series2 = new Series("S2"); 226 | Series series3 = new Series("S3"); 227 | series1.ChartArea = "C1"; 228 | series2.ChartArea = "C1"; 229 | series3.ChartArea = "C1"; 230 | this.chart1.Series.Add(series1); 231 | this.chart1.Series.Add(series2); 232 | this.chart1.Series.Add(series3); 233 | //设置图表显示样式 234 | this.chart1.ChartAreas[0].AxisX.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标x轴箭头为三角 235 | this.chart1.ChartAreas[0].AxisY.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标y轴箭头为三角 236 | 237 | //设置x轴的最大最小值 238 | //this.chart1.ChartAreas[0].AxisX.Minimum = 0; 239 | //this.chart1.ChartAreas[0].AxisX.Maximum = 100; 240 | this.chart1.ChartAreas[0].AxisX.Interval = 100;//x轴刻度间隔大小 241 | 242 | //设置y轴的最大最小值 243 | this.chart1.ChartAreas[0].AxisY.Minimum = 0; 244 | this.chart1.ChartAreas[0].AxisY.Maximum = 100; 245 | this.chart1.ChartAreas[0].AxisY.Interval = 10;//x轴刻度间隔大小 246 | 247 | //设置xy轴的颜色 248 | this.chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.Silver; 249 | this.chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.Silver; 250 | 251 | //不设置标题 252 | this.chart1.Titles.Clear(); 253 | 254 | //设置图表显示样式 255 | this.chart1.Series[0].Color = Color.Red; 256 | this.chart1.Series[1].Color = Color.Blue; 257 | this.chart1.Series[2].Color = Color.Green; 258 | 259 | //设置线形: 260 | //SeriesChartType.Spline 261 | //SeriesChartType.Line 262 | this.chart1.Series[0].ChartType = SeriesChartType.Line; 263 | this.chart1.Series[1].ChartType = SeriesChartType.Line; 264 | this.chart1.Series[2].ChartType = SeriesChartType.Line; 265 | 266 | //开始清空数据 267 | this.chart1.Series[0].Points.Clear(); 268 | this.chart1.Series[1].Points.Clear(); 269 | this.chart1.Series[2].Points.Clear(); 270 | 271 | } 272 | ``` 273 | 274 | 275 | 276 | 显示波形 277 | 278 | 需求: 279 | 280 | 1. 通过SerialPort接收到数据,然后处理,分别保存到data_display1,data_display2,data_display3中,分别表示三个波形数据 281 | 2. 将三个波形数据画到chart中。也就是将数据添加到Series中 282 | 3. 实时更新数据 283 | 284 | 285 | 286 | 思路: 287 | 288 | 将传输过来的数据保存到私有变量data_display1,data_display2,data_display3。 289 | 290 | 通过定时器函数,将私有变量的数据打印成波形。 291 | 292 | 293 | 294 | > 这里有个问题,如果定时器函数一直开着会不会导致设备性能变差??? 295 | 296 | 297 | 298 | 定时器介绍: 299 | 300 | 主要属性有: 301 | 302 | 1. Enabled:如果 [Timer](https://docs.microsoft.com/zh-cn/dotnet/api/system.timers.timer?view=netframework-4.8) 应引发 [Elapsed](https://docs.microsoft.com/zh-cn/dotnet/api/system.timers.timer.elapsed?view=netframework-4.8) 事件,则为 `true`;否则,为 `false`。 默认值为 `false`。 303 | 2. Interval:获取或设置引发 [Elapsed](https://docs.microsoft.com/zh-cn/dotnet/api/system.timers.timer.elapsed?view=netframework-4.8) 事件的间隔(以毫秒为单位) 304 | 305 | 绑定事件:点击进去就行。 306 | 307 | > 这里有个疑问,不知道是不是版本问题,在编写代码的时候添加事件是aTimer.Tick += OnTimedEvent; 308 | > 309 | > 但是查官方文档的时候发现是:aTimer.Elapsed += OnTimedEvent; 310 | 311 | 312 | 313 | 波形显示函数介绍: 314 | 315 | | 函数 | 说明 | 316 | | ------------------------------------------------------------ | ------------------------------------------------------------ | 317 | | [AddXY(Double, Double)](https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.forms.datavisualization.charting.datapointcollection.addxy?view=netframework-4.8#system-windows-forms-datavisualization-charting-datapointcollection-addxy(system-double-system-double)) | 向集合的末尾添加一个具有指定的 X 值和 Y 值的 [DataPoint](https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.forms.datavisualization.charting.datapoint?view=netframework-4.8) 对象。 | 318 | | [Clear()](https://docs.microsoft.com/zh-cn/dotnet/api/system.collections.objectmodel.collection-1.clear?view=netframework-4.8#system-collections-objectmodel-collection-1-clear) | 从 [Collection](https://docs.microsoft.com/zh-cn/dotnet/api/system.collections.objectmodel.collection-1?view=netframework-4.8) 中移除所有元素。(继承自 [Collection](https://docs.microsoft.com/zh-cn/dotnet/api/system.collections.objectmodel.collection-1?view=netframework-4.8)) | 319 | 320 | 对于data_display1,data_display2,data_display3数据可以采用两种方式:数组类型(全部显示数据),队列类型(显示最后的定长数据) 321 | 322 | 1. 数组类型,代码 323 | 324 | ```c# 325 | //创建list 326 | private List list = new List(); 327 | 328 | // 使用add()方法添加元素 329 | list.Add(obj); 330 | 331 | //返回list中存在的元素总数 332 | list.Count; 333 | 334 | //获取list中第i个元素 335 | data_display1.ElementAt(i); 336 | data_display1[i] 337 | ``` 338 | 339 | 定时器的案例,创建两个定时器,一个定时器用与生成数据,一个定时器用于显示波形。 340 | 341 | > 通过设置两个定时器可以模拟数据传输不同步的时候是否会发生问题。设置两个定时器的Interval属性,看一下波形产生的效果 342 | 343 | ```c# 344 | //定义的成员变量,用于保存波形数据 345 | private List data_display1 = new List(); 346 | private List data_display2 = new List(); 347 | private List data_display3 = new List(); 348 | ``` 349 | 350 | ```c# 351 | //定时器1: 352 | //接收数据到list中,假的数据 353 | Random r = new Random(); 354 | data_display1.Add(r.NextDouble() * 10); 355 | data_display2.Add(r.NextDouble() * 20 + 10); 356 | data_display3.Add(r.NextDouble() * 20 + 40); 357 | ``` 358 | 359 | ```c# 360 | //定时器2,显示波形数据 361 | //更新显示波形,先删除之前的数据,然后将目前的数据显示出来 362 | this.chart1.Series[0].Points.Clear(); 363 | this.chart1.Series[1].Points.Clear(); 364 | this.chart1.Series[2].Points.Clear(); 365 | for (int i = 0; i < data_display1.Count; i++) 366 | { 367 | this.chart1.Series[0].Points.AddXY((i + 1), data_display1.ElementAt(i)); 368 | this.chart1.Series[1].Points.AddXY((i + 1), data_display2.ElementAt(i)); 369 | this.chart1.Series[2].Points.AddXY((i + 1), data_display3.ElementAt(i)); 370 | } 371 | ``` 372 | 373 | 2. 队列类型,代码 374 | 375 | ```c# 376 | //创建队列queue 377 | private Queue queue = new Queue(show_len); 378 | 379 | //出队操作 380 | queue.Dequeue(); 381 | 382 | //入队操作 383 | queue.Enqueue(obj); 384 | 385 | //获取队列中的数据个数data_display1 386 | queue.Count; 387 | 388 | //队列中第i个数据 389 | queue.ElementAt(i); 390 | 391 | ``` 392 | 393 | 定时器的案例,创建两个定时器,一个定时器用与生成数据,一个定时器用于显示波形。 394 | 395 | ```c# 396 | //定义的成员变量,用于保存波形数据 397 | private static int show_len = 100;//定义每次显示数据的长度 398 | private Queue data_display1 = new Queue(show_len); 399 | private Queue data_display2 = new Queue(show_len); 400 | private Queue data_display3 = new Queue(show_len); 401 | ``` 402 | 403 | ```c# 404 | //定时器1: 405 | //接收数据到queue中,假的数据 406 | Random r = new Random(); 407 | int len = r.Next(0, 5); 408 | 409 | for (int i = 0;ishow_len) { 411 | data_display1.Dequeue(); 412 | data_display2.Dequeue(); 413 | data_display3.Dequeue(); 414 | } 415 | data_display1.Enqueue(r.NextDouble() * 10); 416 | data_display2.Enqueue(r.NextDouble() * 20+10); 417 | data_display3.Enqueue(r.NextDouble() * 20+40); 418 | } 419 | ``` 420 | 421 | ```c# 422 | //更新显示波形,先删除之前的数据,然后将目前的数据显示出来 423 | this.chart1.Series[0].Points.Clear(); 424 | this.chart1.Series[1].Points.Clear(); 425 | this.chart1.Series[2].Points.Clear(); 426 | for (int i = 0; i < data_display1.Count; i++) 427 | { 428 | this.chart1.Series[0].Points.AddXY((i + 1), data_display1.ElementAt(i)); 429 | this.chart1.Series[1].Points.AddXY((i + 1), data_display2.ElementAt(i)); 430 | this.chart1.Series[2].Points.AddXY((i + 1), data_display3.ElementAt(i)); 431 | } 432 | ``` 433 | 434 | 435 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.IO; 7 | using System.IO.Ports; 8 | using System.Linq; 9 | using System.Text; 10 | using System.Threading; 11 | using System.Threading.Tasks; 12 | using System.Windows.Forms; 13 | using System.Windows.Forms.DataVisualization.Charting; 14 | 15 | namespace WindowsFormsApp1 16 | { 17 | public partial class Form1 : Form 18 | { 19 | #region 全局变量 20 | /// 21 | /// 全局变量 22 | /// 23 | private SerialPort sp = null; //声明一个串口类 24 | private bool isOpen = false; //打开串口标志 25 | private bool isSetProperty = false; //属性设置标志 26 | private bool isHex = false; //十六进制显示标志接收 27 | private bool isHexTx = false; //十六进制显示标志发送标志 28 | 29 | /// 30 | /// 波形显示数据定义 31 | /// 32 | /// 33 | //如果是全部显示使用list数组 34 | //private List data_display1 = new List(); 35 | //private List data_display2 = new List(); 36 | //private List data_display3 = new List(); 37 | 38 | //如果显示的数据每次都只显示100个(固定个数的)数据,然后动起来的,使用队列 39 | private static int show_len = 100;//定义每次显示数据的长度 40 | private Queue data_display1 = new Queue(show_len); 41 | private Queue data_display2 = new Queue(show_len); 42 | private Queue data_display3 = new Queue(show_len); 43 | 44 | 45 | #endregion 46 | 47 | 48 | 49 | public Form1() 50 | { 51 | InitializeComponent(); //窗口初始化,net自动生成 52 | } 53 | 54 | #region 打开软件载入数据函数 55 | /// 56 | /// 打开软件载入数据函数 57 | /// 58 | /// 59 | /// 60 | private void Form1_Load(object sender, EventArgs e) 61 | { 62 | this.MaximumSize = this.Size; 63 | this.MinimumSize = this.Size; 64 | this.MaximizeBox = false; 65 | checkCOM(); 66 | 67 | //cbxCOMPort.SelectedIndex = 0; 68 | //列出常用的波特率 69 | cbxBaudBate.Items.Add("1200"); 70 | cbxBaudBate.Items.Add("2400"); 71 | cbxBaudBate.Items.Add("4800"); 72 | cbxBaudBate.Items.Add("9600"); 73 | cbxBaudBate.Items.Add("19200"); 74 | cbxBaudBate.Items.Add("38400"); 75 | cbxBaudBate.Items.Add("43000"); 76 | cbxBaudBate.Items.Add("56000"); 77 | cbxBaudBate.Items.Add("57600"); 78 | cbxBaudBate.Items.Add("115200"); 79 | cbxBaudBate.SelectedIndex = 3;//设置默认选中 80 | //列出停止位 81 | cbxStopBits.Items.Add("0"); 82 | cbxStopBits.Items.Add("1"); 83 | cbxStopBits.Items.Add("1.5"); 84 | cbxStopBits.Items.Add("2"); 85 | cbxStopBits.SelectedIndex = 1;//设置默认选中 86 | //列出数据位 87 | cbxDataBits.Items.Add("8"); 88 | cbxDataBits.Items.Add("7"); 89 | cbxDataBits.Items.Add("6"); 90 | cbxDataBits.Items.Add("5"); 91 | cbxDataBits.SelectedIndex = 0;//设置默认选中 92 | //列出奇偶校验 93 | cbxparity.Items.Add("无"); 94 | cbxparity.Items.Add("奇校验"); 95 | cbxparity.Items.Add("偶校验"); 96 | cbxparity.SelectedIndex = 0;//设置默认选中 97 | 98 | //默认为char显示,标志位,单选框 99 | rbnChar.Checked = true; 100 | 101 | //默认为char发送 102 | tbnChar.Checked = true; 103 | 104 | //初始化图形 105 | InitChart(); 106 | } 107 | #endregion 108 | 109 | 110 | #region 串口检测 111 | /// 112 | /// 串口检测 113 | /// 114 | /// 115 | /// 116 | private void checkCOM() { 117 | bool comExistence = false; //有可用串口标志 118 | cbxCOMPort.Items.Clear(); //清除当前串口号中的所有串口名称 119 | 120 | 121 | string[] sPorts = SerialPort.GetPortNames();//获取所有的能用的串口的名字 122 | //cbxCOMPort.Items.Add("");//显示空字符的串口。 123 | foreach (string port in sPorts) 124 | { 125 | cbxCOMPort.Items.Add(port); 126 | comExistence = true; 127 | } 128 | 129 | 130 | if (comExistence) 131 | { 132 | cbxCOMPort.SelectedIndex = 0; //使ListBox显示第1个添加的索引 133 | } 134 | else 135 | { 136 | MessageBox.Show("没有找到可用的串口!", "错误提示"); 137 | } 138 | } 139 | 140 | private void btnCheckCOM_Click(object sender, EventArgs e) 141 | { 142 | checkCOM(); 143 | } 144 | #endregion 145 | 146 | 147 | #region 私有函数,检测串口是否设置 148 | /// 149 | /// 私有函数,检测串口是否设置 150 | /// 151 | /// 152 | private bool CheckPortSerring() 153 | { 154 | if (cbxCOMPort.Text.Trim() == "") return false; 155 | if (cbxBaudBate.Text.Trim() == "") return false; 156 | if (cbxDataBits.Text.Trim() == "") return false; 157 | if (cbxparity.Text.Trim() == "") return false; 158 | if (cbxStopBits.Text.Trim() == "") return false; 159 | return true; 160 | } 161 | #endregion 162 | 163 | 164 | #region 私有函数,检测发送数据 165 | /// 166 | /// 私有函数,检测发送数据 167 | /// 168 | /// 169 | private bool CheckSendData() 170 | { 171 | if (tbxSendData.Text.Trim() == "") return false; 172 | return true; 173 | } 174 | #endregion 175 | 176 | 177 | #region 私有函数,软件启动设置串口的属性 178 | /// 179 | /// 私有函数,软件启动设置串口的属性 180 | /// 181 | private void SetPortProperty() // 182 | { 183 | sp = new SerialPort(); 184 | 185 | sp.PortName = cbxCOMPort.Text.Trim(); //设置串口名 186 | 187 | sp.BaudRate = Convert.ToInt32(cbxBaudBate.Text.Trim()); //设置串口的波特率 188 | 189 | float f = Convert.ToSingle(cbxStopBits.Text.Trim()); //设置停止位 190 | 191 | if (f == 0) 192 | { 193 | sp.StopBits = StopBits.None; 194 | } 195 | else if (f == 1.5) 196 | { 197 | sp.StopBits = StopBits.OnePointFive; 198 | } 199 | else if (f == 1) 200 | { 201 | sp.StopBits = StopBits.One; 202 | } 203 | else if (f == 2) 204 | { 205 | sp.StopBits = StopBits.Two; 206 | } 207 | else 208 | { 209 | sp.StopBits = StopBits.One; 210 | } 211 | 212 | sp.DataBits = Convert.ToInt16(cbxDataBits.Text.Trim()); //设置数据位 213 | 214 | string s = cbxparity.Text.Trim(); //设置奇偶检验为 215 | if (s.CompareTo("无") == 0) 216 | { 217 | sp.Parity = Parity.None; 218 | } 219 | else if (s.CompareTo("奇校验") == 0) 220 | { 221 | sp.Parity = Parity.Odd; 222 | } 223 | else if (s.CompareTo("偶校验") == 0) 224 | { 225 | sp.Parity = Parity.Even; 226 | } 227 | else 228 | { 229 | sp.Parity = Parity.None; 230 | } 231 | 232 | sp.ReadTimeout = -1; //设置超时读取时间 233 | sp.RtsEnable = true; 234 | 235 | //定义DataReceived 事件,当串口接收到数据后触发事件 236 | sp.DataReceived += new SerialDataReceivedEventHandler(sp_DataReceived); //该方法加载就运行 237 | sp.Encoding = System.Text.Encoding.GetEncoding("UTF-8"); //根据实际情况选择UTF-8还是GB2312(串口显示中文) 238 | if (rbnHex.Checked) //接收字符或者hex选择 239 | { 240 | isHex = true; 241 | } 242 | else 243 | { 244 | isHex = false; 245 | } 246 | 247 | if (tbnHex.Checked) //发送字符或者hex选择 248 | { 249 | isHexTx = true; 250 | } 251 | else 252 | { 253 | isHexTx = false; 254 | } 255 | } 256 | #endregion 257 | 258 | 259 | #region 数据发送函数 260 | /// 261 | /// 数据发送函数 262 | /// 263 | /// 264 | /// 265 | // 266 | private void btnSend_Click(object sender, EventArgs e) 267 | { 268 | if (isOpen) //写串口数据 269 | { 270 | try 271 | { 272 | if (isHexTx == false)//如果发送模式为字符模式 273 | { 274 | //sp.Write(tbxSendData.Text.ToString()); //发送一串字符 275 | //sp.WriteLine(tbxSendData.Text); //发送一串字符 276 | 277 | Encoding gb = System.Text.Encoding.GetEncoding("UTF-8"); //发送字符 278 | Byte[] writeBytes = gb.GetBytes(tbxSendData.Text); 279 | sp.Write(writeBytes, 0, writeBytes.Length); 280 | } 281 | else//如果发送模式为HEX模式 282 | { 283 | string dataTxStr = tbxSendData.Text.ToString(); ; //将textbox1 转化为 字符串 284 | byte[] byte_hexTx = new byte[] { }; 285 | byte_hexTx = strToToHexByte(dataTxStr.ToString()); //字符串转化为16进制数组 286 | sp.Write(byte_hexTx, 0, byte_hexTx.Length); //发送数组 287 | } 288 | 289 | } 290 | catch (Exception) 291 | { 292 | MessageBox.Show("1、软件故障!\r\n" + 293 | "2、发送十六进制高低位需填满!", "错误提示"); 294 | 295 | return; 296 | } 297 | } 298 | else 299 | { 300 | MessageBox.Show("串口未打开!", "提示错误"); 301 | return; 302 | } 303 | 304 | if (!CheckSendData()) //检测要发送的数据 305 | { 306 | MessageBox.Show("请输入要发送的数据!", "错误提示"); 307 | return; 308 | } 309 | } 310 | #endregion 311 | 312 | 313 | #region 打开串口按键 314 | /// 315 | /// 打开串口按键 316 | /// 317 | /// 318 | /// 319 | //打开串口 320 | private void btnOpenCom_Click(object sender, EventArgs e) 321 | { 322 | if (isOpen == false) 323 | { 324 | if (!CheckPortSerring()) //检测串口设置 325 | { 326 | MessageBox.Show("串口未设置", "错误提示"); 327 | return; 328 | } 329 | 330 | if (!isSetProperty) //串口未设置则设置串口 331 | { 332 | SetPortProperty(); 333 | isSetProperty = true; 334 | } 335 | 336 | try //打开串口 337 | { 338 | sp.Open(); 339 | isOpen = true; 340 | btnOpenCom.Text = "关闭串口"; 341 | //串口打开后则相关的串口设置按钮便不可再用 342 | cbxCOMPort.Enabled = false; 343 | cbxBaudBate.Enabled = false; 344 | cbxDataBits.Enabled = false; 345 | cbxparity.Enabled = false; 346 | cbxStopBits.Enabled = false; 347 | rbnChar.Enabled = false; 348 | rbnHex.Enabled = false; 349 | tbnChar.Enabled = false; 350 | tbnHex.Enabled = false; 351 | 352 | } 353 | catch (Exception) 354 | { 355 | //串口打开失败后,相应标志位取消 356 | isSetProperty = false; 357 | isOpen = false; 358 | MessageBox.Show("串口无效或已被占用!", "错误提示"); 359 | } 360 | } 361 | else //关闭串口 362 | { 363 | try 364 | { 365 | sp.Close(); 366 | isOpen = false; 367 | isSetProperty = false; 368 | btnOpenCom.Text = "打开串口"; 369 | cbxCOMPort.Enabled = true; 370 | cbxBaudBate.Enabled = true; 371 | cbxDataBits.Enabled = true; 372 | cbxparity.Enabled = true; 373 | cbxStopBits.Enabled = true; 374 | rbnChar.Enabled = true; 375 | rbnHex.Enabled = true; 376 | tbnChar.Enabled = true; 377 | tbnHex.Enabled = true; 378 | 379 | } 380 | catch (Exception) 381 | { 382 | MessageBox.Show("关闭时发生错误!", "错误提示"); 383 | 384 | } 385 | } 386 | } 387 | #endregion 388 | 389 | 390 | #region 串口接收处理函数 391 | /// 392 | /// 串口接收处理函数 393 | /// 394 | /// 395 | /// 396 | private void sp_DataReceived(object sendr, SerialDataReceivedEventArgs e) 397 | { 398 | try 399 | { 400 | Control.CheckForIllegalCrossThreadCalls = false;//线程间操作无效报错,需要添加这一句 401 | Byte[] ReceivedData = new Byte[sp.BytesToRead]; //创建接收字节数组 402 | String RecvDataText = null; //显示字符存储 403 | 404 | sp.Read(ReceivedData, 0, ReceivedData.Length); //读取所有接收到的数据 405 | 406 | if (isHex == false)//如果接收模式为字符模式 407 | { 408 | String decodedString = Encoding.Default.GetString(ReceivedData); //设置编码格式,显示汉字 409 | tbxRecvData.Text += decodedString + " "; //接收框显示,追加数据 410 | } 411 | else//如果接收模式为HEX数值模式 412 | { 413 | for (int i = 0; i < ReceivedData.Length; i++) 414 | { 415 | RecvDataText += ("0x" + ReceivedData[i].ToString("X2") + " "); //显示前缀0x 416 | //RecvDataText += (ReceivedData[i].ToString("x2") + " "); //不显示前缀0x 417 | } 418 | tbxRecvData.Text += RecvDataText; 419 | } 420 | 421 | //对数据进行保存处理,这里得看具体传过来的数据是什么。否则不好处理啊。 422 | // 1. 为了显示波形,所以存储到list中或者queue中 423 | 424 | 425 | // 2. 将保存的数据持久化到文件中(追加),这里暂时写成txt文件 426 | File.AppendAllText("./log.txt", "数据。。。"+ "\r\n");//追加到txt文件中 427 | 428 | //如果要追加到csv文件中,可以参考:https://www.delftstack.com/zh/howto/csharp/how-to-write-data-into-a-csv-file-in-csharp/ 429 | 430 | 431 | tbxRecvData.Select(tbxRecvData.TextLength, 0); //文本显示最后一行 432 | tbxRecvData.ScrollToCaret(); //滚动到最后一行 433 | 434 | } 435 | catch (Exception) 436 | { 437 | throw; 438 | } 439 | 440 | } 441 | #endregion 442 | 443 | 444 | #region 清除发送数据 445 | /// 446 | /// 清除发送数据 447 | /// 448 | /// 449 | /// 450 | private void btnCleanData_Click(object sender, EventArgs e) 451 | { 452 | tbxSendData.Text = ""; 453 | } 454 | #endregion 455 | 456 | 457 | #region 字符串转16进制数组 458 | /// 459 | /// 字符串转16进制字节数组 460 | /// 461 | /// 462 | /// 463 | private static byte[] strToToHexByte(string hexString) 464 | { 465 | hexString = hexString.Replace(" ", "");//去除空格,将接受到的hexStringde 466 | if ((hexString.Length % 2) != 0) 467 | hexString += " "; 468 | byte[] returnBytes = new byte[hexString.Length / 2]; 469 | for (int i = 0; i < returnBytes.Length; i++) 470 | returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16); 471 | return returnBytes; 472 | } 473 | #endregion 474 | 475 | 476 | #region 清空接收数据 477 | /// 478 | /// 清空接收数据 479 | /// 480 | /// 481 | /// 482 | private void btnCleanRxData_Click(object sender, EventArgs e) 483 | { 484 | tbxRecvData.Text = ""; //清空接收数据 485 | } 486 | #endregion 487 | 488 | 489 | #region 初始化波形显示区域 490 | /// 491 | /// 初始化图表 492 | /// 493 | private void InitChart() 494 | { 495 | //定义图表区域 496 | this.chart1.ChartAreas.Clear(); 497 | ChartArea chartArea1 = new ChartArea("C1"); 498 | this.chart1.ChartAreas.Add(chartArea1); 499 | //定义存储和显示点的容器 500 | this.chart1.Series.Clear(); 501 | Series series1 = new Series("S1"); 502 | Series series2 = new Series("S2"); 503 | Series series3 = new Series("S3"); 504 | series1.ChartArea = "C1"; 505 | series2.ChartArea = "C1"; 506 | series3.ChartArea = "C1"; 507 | this.chart1.Series.Add(series1); 508 | this.chart1.Series.Add(series2); 509 | this.chart1.Series.Add(series3); 510 | //设置图表显示样式 511 | this.chart1.ChartAreas[0].AxisX.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标x轴箭头为三角 512 | this.chart1.ChartAreas[0].AxisY.ArrowStyle = AxisArrowStyle.Triangle;//设置坐标y轴箭头为三角 513 | 514 | //设置x轴的最大最小值 515 | //this.chart1.ChartAreas[0].AxisX.Minimum = 0; 516 | //this.chart1.ChartAreas[0].AxisX.Maximum = 100; 517 | this.chart1.ChartAreas[0].AxisX.Interval = 100;//x轴刻度间隔大小 518 | 519 | //设置y轴的最大最小值 520 | this.chart1.ChartAreas[0].AxisY.Minimum = 0; 521 | this.chart1.ChartAreas[0].AxisY.Maximum = 100; 522 | this.chart1.ChartAreas[0].AxisY.Interval = 10;//x轴刻度间隔大小 523 | 524 | //设置xy轴的颜色 525 | this.chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.Silver; 526 | this.chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.Silver; 527 | 528 | //不设置标题 529 | this.chart1.Titles.Clear(); 530 | 531 | //设置图表显示样式 532 | this.chart1.Series[0].Color = Color.Red; 533 | this.chart1.Series[1].Color = Color.Blue; 534 | this.chart1.Series[2].Color = Color.Green; 535 | 536 | //设置线形: 537 | //SeriesChartType.Spline 538 | //SeriesChartType.Line 539 | this.chart1.Series[0].ChartType = SeriesChartType.Line; 540 | this.chart1.Series[1].ChartType = SeriesChartType.Line; 541 | this.chart1.Series[2].ChartType = SeriesChartType.Line; 542 | 543 | //开始清空数据 544 | this.chart1.Series[0].Points.Clear(); 545 | this.chart1.Series[1].Points.Clear(); 546 | this.chart1.Series[2].Points.Clear(); 547 | 548 | } 549 | 550 | 551 | 552 | #endregion 553 | /// 554 | /// 定时器函数 555 | /// 556 | /// 557 | /// 558 | /// 559 | //更新数据,怎么说呢,传输过来的数据保存到list当中,或者queue中,函数都一样 560 | private void timer_display_Tick(object sender, EventArgs e) 561 | { 562 | 563 | //更新显示波形,先删除之前的数据,然后将目前的数据显示出来 564 | this.chart1.Series[0].Points.Clear(); 565 | this.chart1.Series[1].Points.Clear(); 566 | this.chart1.Series[2].Points.Clear(); 567 | for (int i = 0; i < data_display1.Count; i++) 568 | { 569 | this.chart1.Series[0].Points.AddXY((i + 1), data_display1.ElementAt(i)); 570 | this.chart1.Series[1].Points.AddXY((i + 1), data_display2.ElementAt(i)); 571 | this.chart1.Series[2].Points.AddXY((i + 1), data_display3.ElementAt(i)); 572 | } 573 | 574 | } 575 | /// 576 | /// 生成假的数据 577 | /// 578 | /// 579 | /// 580 | private void timer1_Tick(object sender, EventArgs e) 581 | { 582 | //接收数据到queue中,假的数据 583 | Random r = new Random(); 584 | int len = r.Next(0, 5); 585 | 586 | for (int i = 0; i < len; i++) 587 | { 588 | if (data_display1.Count > show_len) 589 | { 590 | data_display1.Dequeue(); 591 | data_display2.Dequeue(); 592 | data_display3.Dequeue(); 593 | } 594 | data_display1.Enqueue(r.NextDouble() * 10); 595 | data_display2.Enqueue(r.NextDouble() * 20 + 10); 596 | data_display3.Enqueue(r.NextDouble() * 20 + 40); 597 | } 598 | 599 | 600 | 601 | } 602 | } 603 | 604 | 605 | 606 | 607 | } 608 | -------------------------------------------------------------------------------- /code/upper_computer/WindowsFormsApp1/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace WindowsFormsApp1 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// 必需的设计器变量。 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// 清理所有正在使用的资源。 12 | /// 13 | /// 如果应释放托管资源,为 true;否则为 false。 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows 窗体设计器生成的代码 24 | 25 | /// 26 | /// 设计器支持所需的方法 - 不要修改 27 | /// 使用代码编辑器修改此方法的内容。 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); 33 | System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series(); 34 | System.Windows.Forms.DataVisualization.Charting.Series series5 = new System.Windows.Forms.DataVisualization.Charting.Series(); 35 | System.Windows.Forms.DataVisualization.Charting.Series series6 = new System.Windows.Forms.DataVisualization.Charting.Series(); 36 | this.groupBox1 = new System.Windows.Forms.GroupBox(); 37 | this.btnOpenCom = new System.Windows.Forms.Button(); 38 | this.btnCheckCOM = new System.Windows.Forms.Button(); 39 | this.rbnHex = new System.Windows.Forms.RadioButton(); 40 | this.rbnChar = new System.Windows.Forms.RadioButton(); 41 | this.cbxDataBits = new System.Windows.Forms.ComboBox(); 42 | this.label5 = new System.Windows.Forms.Label(); 43 | this.cbxparity = new System.Windows.Forms.ComboBox(); 44 | this.label6 = new System.Windows.Forms.Label(); 45 | this.cbxStopBits = new System.Windows.Forms.ComboBox(); 46 | this.label3 = new System.Windows.Forms.Label(); 47 | this.cbxBaudBate = new System.Windows.Forms.ComboBox(); 48 | this.label2 = new System.Windows.Forms.Label(); 49 | this.cbxCOMPort = new System.Windows.Forms.ComboBox(); 50 | this.label1 = new System.Windows.Forms.Label(); 51 | this.groupBox2 = new System.Windows.Forms.GroupBox(); 52 | this.tbxRecvData = new System.Windows.Forms.TextBox(); 53 | this.groupBox3 = new System.Windows.Forms.GroupBox(); 54 | this.btnCleanRxData = new System.Windows.Forms.Button(); 55 | this.tbnHex = new System.Windows.Forms.RadioButton(); 56 | this.tbnChar = new System.Windows.Forms.RadioButton(); 57 | this.btnSend = new System.Windows.Forms.Button(); 58 | this.tbxSendData = new System.Windows.Forms.TextBox(); 59 | this.btnCleanData = new System.Windows.Forms.Button(); 60 | this.serialPort1 = new System.IO.Ports.SerialPort(this.components); 61 | this.timer_display = new System.Windows.Forms.Timer(this.components); 62 | this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); 63 | this.groupBox5 = new System.Windows.Forms.GroupBox(); 64 | this.文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 65 | this.menuStrip1 = new System.Windows.Forms.MenuStrip(); 66 | this.timer1 = new System.Windows.Forms.Timer(this.components); 67 | this.groupBox1.SuspendLayout(); 68 | this.groupBox2.SuspendLayout(); 69 | this.groupBox3.SuspendLayout(); 70 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); 71 | this.groupBox5.SuspendLayout(); 72 | this.menuStrip1.SuspendLayout(); 73 | this.SuspendLayout(); 74 | // 75 | // groupBox1 76 | // 77 | this.groupBox1.Controls.Add(this.btnOpenCom); 78 | this.groupBox1.Controls.Add(this.btnCheckCOM); 79 | this.groupBox1.Controls.Add(this.rbnHex); 80 | this.groupBox1.Controls.Add(this.rbnChar); 81 | this.groupBox1.Controls.Add(this.cbxDataBits); 82 | this.groupBox1.Controls.Add(this.label5); 83 | this.groupBox1.Controls.Add(this.cbxparity); 84 | this.groupBox1.Controls.Add(this.label6); 85 | this.groupBox1.Controls.Add(this.cbxStopBits); 86 | this.groupBox1.Controls.Add(this.label3); 87 | this.groupBox1.Controls.Add(this.cbxBaudBate); 88 | this.groupBox1.Controls.Add(this.label2); 89 | this.groupBox1.Controls.Add(this.cbxCOMPort); 90 | this.groupBox1.Controls.Add(this.label1); 91 | this.groupBox1.Location = new System.Drawing.Point(11, 28); 92 | this.groupBox1.Name = "groupBox1"; 93 | this.groupBox1.Size = new System.Drawing.Size(377, 109); 94 | this.groupBox1.TabIndex = 0; 95 | this.groupBox1.TabStop = false; 96 | this.groupBox1.Text = "串口配置"; 97 | // 98 | // btnOpenCom 99 | // 100 | this.btnOpenCom.Location = new System.Drawing.Point(286, 54); 101 | this.btnOpenCom.Name = "btnOpenCom"; 102 | this.btnOpenCom.Size = new System.Drawing.Size(75, 23); 103 | this.btnOpenCom.TabIndex = 14; 104 | this.btnOpenCom.Text = "打开串口"; 105 | this.btnOpenCom.UseVisualStyleBackColor = true; 106 | this.btnOpenCom.Click += new System.EventHandler(this.btnOpenCom_Click); 107 | // 108 | // btnCheckCOM 109 | // 110 | this.btnCheckCOM.Location = new System.Drawing.Point(286, 21); 111 | this.btnCheckCOM.Name = "btnCheckCOM"; 112 | this.btnCheckCOM.Size = new System.Drawing.Size(75, 23); 113 | this.btnCheckCOM.TabIndex = 13; 114 | this.btnCheckCOM.Text = "串口检测"; 115 | this.btnCheckCOM.UseVisualStyleBackColor = true; 116 | this.btnCheckCOM.Click += new System.EventHandler(this.btnCheckCOM_Click); 117 | // 118 | // rbnHex 119 | // 120 | this.rbnHex.AutoSize = true; 121 | this.rbnHex.Location = new System.Drawing.Point(221, 81); 122 | this.rbnHex.Name = "rbnHex"; 123 | this.rbnHex.Size = new System.Drawing.Size(65, 16); 124 | this.rbnHex.TabIndex = 12; 125 | this.rbnHex.Text = "HEX接收"; 126 | this.rbnHex.UseVisualStyleBackColor = true; 127 | // 128 | // rbnChar 129 | // 130 | this.rbnChar.AutoSize = true; 131 | this.rbnChar.Checked = true; 132 | this.rbnChar.Location = new System.Drawing.Point(144, 81); 133 | this.rbnChar.Name = "rbnChar"; 134 | this.rbnChar.Size = new System.Drawing.Size(71, 16); 135 | this.rbnChar.TabIndex = 11; 136 | this.rbnChar.TabStop = true; 137 | this.rbnChar.Text = "接收字符"; 138 | this.rbnChar.UseVisualStyleBackColor = true; 139 | // 140 | // cbxDataBits 141 | // 142 | this.cbxDataBits.FormattingEnabled = true; 143 | this.cbxDataBits.Location = new System.Drawing.Point(204, 49); 144 | this.cbxDataBits.Name = "cbxDataBits"; 145 | this.cbxDataBits.Size = new System.Drawing.Size(60, 20); 146 | this.cbxDataBits.TabIndex = 10; 147 | // 148 | // label5 149 | // 150 | this.label5.AutoSize = true; 151 | this.label5.Location = new System.Drawing.Point(142, 54); 152 | this.label5.Name = "label5"; 153 | this.label5.Size = new System.Drawing.Size(53, 12); 154 | this.label5.TabIndex = 9; 155 | this.label5.Text = "数据位:"; 156 | // 157 | // cbxparity 158 | // 159 | this.cbxparity.FormattingEnabled = true; 160 | this.cbxparity.Location = new System.Drawing.Point(204, 18); 161 | this.cbxparity.Name = "cbxparity"; 162 | this.cbxparity.Size = new System.Drawing.Size(60, 20); 163 | this.cbxparity.TabIndex = 8; 164 | // 165 | // label6 166 | // 167 | this.label6.AutoSize = true; 168 | this.label6.Location = new System.Drawing.Point(142, 21); 169 | this.label6.Name = "label6"; 170 | this.label6.Size = new System.Drawing.Size(65, 12); 171 | this.label6.TabIndex = 7; 172 | this.label6.Text = "奇偶校验:"; 173 | // 174 | // cbxStopBits 175 | // 176 | this.cbxStopBits.FormattingEnabled = true; 177 | this.cbxStopBits.Location = new System.Drawing.Point(54, 83); 178 | this.cbxStopBits.Name = "cbxStopBits"; 179 | this.cbxStopBits.Size = new System.Drawing.Size(60, 20); 180 | this.cbxStopBits.TabIndex = 6; 181 | // 182 | // label3 183 | // 184 | this.label3.AutoSize = true; 185 | this.label3.Location = new System.Drawing.Point(7, 86); 186 | this.label3.Name = "label3"; 187 | this.label3.Size = new System.Drawing.Size(53, 12); 188 | this.label3.TabIndex = 5; 189 | this.label3.Text = "停止位:"; 190 | // 191 | // cbxBaudBate 192 | // 193 | this.cbxBaudBate.FormattingEnabled = true; 194 | this.cbxBaudBate.Location = new System.Drawing.Point(54, 51); 195 | this.cbxBaudBate.Name = "cbxBaudBate"; 196 | this.cbxBaudBate.Size = new System.Drawing.Size(60, 20); 197 | this.cbxBaudBate.TabIndex = 4; 198 | // 199 | // label2 200 | // 201 | this.label2.AutoSize = true; 202 | this.label2.Location = new System.Drawing.Point(7, 54); 203 | this.label2.Name = "label2"; 204 | this.label2.Size = new System.Drawing.Size(53, 12); 205 | this.label2.TabIndex = 3; 206 | this.label2.Text = "波特率:"; 207 | // 208 | // cbxCOMPort 209 | // 210 | this.cbxCOMPort.FormattingEnabled = true; 211 | this.cbxCOMPort.Location = new System.Drawing.Point(54, 18); 212 | this.cbxCOMPort.Name = "cbxCOMPort"; 213 | this.cbxCOMPort.Size = new System.Drawing.Size(60, 20); 214 | this.cbxCOMPort.TabIndex = 2; 215 | // 216 | // label1 217 | // 218 | this.label1.AutoSize = true; 219 | this.label1.Location = new System.Drawing.Point(7, 21); 220 | this.label1.Name = "label1"; 221 | this.label1.Size = new System.Drawing.Size(53, 12); 222 | this.label1.TabIndex = 0; 223 | this.label1.Text = "串口号:"; 224 | // 225 | // groupBox2 226 | // 227 | this.groupBox2.Controls.Add(this.tbxRecvData); 228 | this.groupBox2.Location = new System.Drawing.Point(422, 28); 229 | this.groupBox2.Name = "groupBox2"; 230 | this.groupBox2.Size = new System.Drawing.Size(429, 268); 231 | this.groupBox2.TabIndex = 1; 232 | this.groupBox2.TabStop = false; 233 | this.groupBox2.Text = "数据接收"; 234 | // 235 | // tbxRecvData 236 | // 237 | this.tbxRecvData.Location = new System.Drawing.Point(9, 23); 238 | this.tbxRecvData.Multiline = true; 239 | this.tbxRecvData.Name = "tbxRecvData"; 240 | this.tbxRecvData.ReadOnly = true; 241 | this.tbxRecvData.ScrollBars = System.Windows.Forms.ScrollBars.Both; 242 | this.tbxRecvData.Size = new System.Drawing.Size(414, 233); 243 | this.tbxRecvData.TabIndex = 0; 244 | // 245 | // groupBox3 246 | // 247 | this.groupBox3.Controls.Add(this.btnCleanRxData); 248 | this.groupBox3.Controls.Add(this.tbnHex); 249 | this.groupBox3.Controls.Add(this.tbnChar); 250 | this.groupBox3.Controls.Add(this.btnSend); 251 | this.groupBox3.Controls.Add(this.tbxSendData); 252 | this.groupBox3.Controls.Add(this.btnCleanData); 253 | this.groupBox3.Location = new System.Drawing.Point(11, 153); 254 | this.groupBox3.Name = "groupBox3"; 255 | this.groupBox3.Size = new System.Drawing.Size(377, 143); 256 | this.groupBox3.TabIndex = 4; 257 | this.groupBox3.TabStop = false; 258 | this.groupBox3.Text = "数据发送"; 259 | // 260 | // btnCleanRxData 261 | // 262 | this.btnCleanRxData.Location = new System.Drawing.Point(163, 112); 263 | this.btnCleanRxData.Name = "btnCleanRxData"; 264 | this.btnCleanRxData.Size = new System.Drawing.Size(37, 23); 265 | this.btnCleanRxData.TabIndex = 17; 266 | this.btnCleanRxData.Text = "清接"; 267 | this.btnCleanRxData.UseVisualStyleBackColor = true; 268 | this.btnCleanRxData.Click += new System.EventHandler(this.btnCleanRxData_Click); 269 | // 270 | // tbnHex 271 | // 272 | this.tbnHex.AutoSize = true; 273 | this.tbnHex.Location = new System.Drawing.Point(73, 115); 274 | this.tbnHex.Name = "tbnHex"; 275 | this.tbnHex.Size = new System.Drawing.Size(41, 16); 276 | this.tbnHex.TabIndex = 16; 277 | this.tbnHex.Text = "HEX"; 278 | this.tbnHex.UseVisualStyleBackColor = true; 279 | // 280 | // tbnChar 281 | // 282 | this.tbnChar.AutoSize = true; 283 | this.tbnChar.Checked = true; 284 | this.tbnChar.Location = new System.Drawing.Point(13, 115); 285 | this.tbnChar.Name = "tbnChar"; 286 | this.tbnChar.Size = new System.Drawing.Size(47, 16); 287 | this.tbnChar.TabIndex = 15; 288 | this.tbnChar.TabStop = true; 289 | this.tbnChar.Text = "字符"; 290 | this.tbnChar.UseVisualStyleBackColor = true; 291 | // 292 | // btnSend 293 | // 294 | this.btnSend.Location = new System.Drawing.Point(221, 112); 295 | this.btnSend.Name = "btnSend"; 296 | this.btnSend.Size = new System.Drawing.Size(80, 23); 297 | this.btnSend.TabIndex = 6; 298 | this.btnSend.Text = "发送数据"; 299 | this.btnSend.UseVisualStyleBackColor = true; 300 | this.btnSend.Click += new System.EventHandler(this.btnSend_Click); 301 | // 302 | // tbxSendData 303 | // 304 | this.tbxSendData.Location = new System.Drawing.Point(6, 20); 305 | this.tbxSendData.Multiline = true; 306 | this.tbxSendData.Name = "tbxSendData"; 307 | this.tbxSendData.ScrollBars = System.Windows.Forms.ScrollBars.Both; 308 | this.tbxSendData.Size = new System.Drawing.Size(327, 89); 309 | this.tbxSendData.TabIndex = 0; 310 | // 311 | // btnCleanData 312 | // 313 | this.btnCleanData.Location = new System.Drawing.Point(120, 112); 314 | this.btnCleanData.Name = "btnCleanData"; 315 | this.btnCleanData.Size = new System.Drawing.Size(37, 23); 316 | this.btnCleanData.TabIndex = 5; 317 | this.btnCleanData.Text = "清送"; 318 | this.btnCleanData.UseVisualStyleBackColor = true; 319 | this.btnCleanData.Click += new System.EventHandler(this.btnCleanData_Click); 320 | // 321 | // timer_display 322 | // 323 | this.timer_display.Enabled = true; 324 | this.timer_display.Interval = 200; 325 | this.timer_display.Tick += new System.EventHandler(this.timer_display_Tick); 326 | // 327 | // chart1 328 | // 329 | this.chart1.AllowDrop = true; 330 | chartArea2.AxisX.ArrowStyle = System.Windows.Forms.DataVisualization.Charting.AxisArrowStyle.Triangle; 331 | chartArea2.AxisX.IsInterlaced = true; 332 | chartArea2.AxisY.ArrowStyle = System.Windows.Forms.DataVisualization.Charting.AxisArrowStyle.Triangle; 333 | chartArea2.Name = "ChartArea1"; 334 | this.chart1.ChartAreas.Add(chartArea2); 335 | this.chart1.Location = new System.Drawing.Point(6, 16); 336 | this.chart1.Name = "chart1"; 337 | this.chart1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; 338 | series4.ChartArea = "ChartArea1"; 339 | series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; 340 | series4.IsVisibleInLegend = false; 341 | series4.Name = "Series1"; 342 | series5.ChartArea = "ChartArea1"; 343 | series5.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; 344 | series5.IsVisibleInLegend = false; 345 | series5.LegendText = "数据2"; 346 | series5.Name = "Series2"; 347 | series6.ChartArea = "ChartArea1"; 348 | series6.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline; 349 | series6.IsVisibleInLegend = false; 350 | series6.LegendText = "数据3"; 351 | series6.Name = "Series3"; 352 | this.chart1.Series.Add(series4); 353 | this.chart1.Series.Add(series5); 354 | this.chart1.Series.Add(series6); 355 | this.chart1.Size = new System.Drawing.Size(828, 286); 356 | this.chart1.TabIndex = 9; 357 | this.chart1.Text = "chart1"; 358 | // 359 | // groupBox5 360 | // 361 | this.groupBox5.Controls.Add(this.chart1); 362 | this.groupBox5.Location = new System.Drawing.Point(11, 302); 363 | this.groupBox5.Name = "groupBox5"; 364 | this.groupBox5.Size = new System.Drawing.Size(840, 308); 365 | this.groupBox5.TabIndex = 10; 366 | this.groupBox5.TabStop = false; 367 | this.groupBox5.Text = "波形显示"; 368 | // 369 | // 文件ToolStripMenuItem 370 | // 371 | this.文件ToolStripMenuItem.Name = "文件ToolStripMenuItem"; 372 | this.文件ToolStripMenuItem.Size = new System.Drawing.Size(44, 21); 373 | this.文件ToolStripMenuItem.Text = "文件"; 374 | // 375 | // menuStrip1 376 | // 377 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 378 | this.文件ToolStripMenuItem}); 379 | this.menuStrip1.Location = new System.Drawing.Point(0, 0); 380 | this.menuStrip1.Name = "menuStrip1"; 381 | this.menuStrip1.Size = new System.Drawing.Size(859, 25); 382 | this.menuStrip1.TabIndex = 3; 383 | this.menuStrip1.Text = "menuStrip1"; 384 | // 385 | // timer1 386 | // 387 | this.timer1.Enabled = true; 388 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick); 389 | // 390 | // Form1 391 | // 392 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); 393 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 394 | this.BackColor = System.Drawing.SystemColors.Window; 395 | this.ClientSize = new System.Drawing.Size(859, 616); 396 | this.Controls.Add(this.groupBox5); 397 | this.Controls.Add(this.groupBox3); 398 | this.Controls.Add(this.groupBox2); 399 | this.Controls.Add(this.groupBox1); 400 | this.Controls.Add(this.menuStrip1); 401 | this.MainMenuStrip = this.menuStrip1; 402 | this.Name = "Form1"; 403 | this.Text = "send"; 404 | this.Load += new System.EventHandler(this.Form1_Load); 405 | this.groupBox1.ResumeLayout(false); 406 | this.groupBox1.PerformLayout(); 407 | this.groupBox2.ResumeLayout(false); 408 | this.groupBox2.PerformLayout(); 409 | this.groupBox3.ResumeLayout(false); 410 | this.groupBox3.PerformLayout(); 411 | ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); 412 | this.groupBox5.ResumeLayout(false); 413 | this.menuStrip1.ResumeLayout(false); 414 | this.menuStrip1.PerformLayout(); 415 | this.ResumeLayout(false); 416 | this.PerformLayout(); 417 | 418 | } 419 | 420 | #endregion 421 | 422 | private System.Windows.Forms.GroupBox groupBox1; 423 | private System.Windows.Forms.GroupBox groupBox2; 424 | private System.Windows.Forms.ComboBox cbxCOMPort; 425 | private System.Windows.Forms.Label label1; 426 | private System.Windows.Forms.ComboBox cbxDataBits; 427 | private System.Windows.Forms.Label label5; 428 | private System.Windows.Forms.ComboBox cbxparity; 429 | private System.Windows.Forms.Label label6; 430 | private System.Windows.Forms.ComboBox cbxStopBits; 431 | private System.Windows.Forms.Label label3; 432 | private System.Windows.Forms.ComboBox cbxBaudBate; 433 | private System.Windows.Forms.Label label2; 434 | private System.Windows.Forms.RadioButton rbnHex; 435 | private System.Windows.Forms.RadioButton rbnChar; 436 | private System.Windows.Forms.Button btnCheckCOM; 437 | private System.Windows.Forms.Button btnOpenCom; 438 | private System.Windows.Forms.GroupBox groupBox3; 439 | private System.Windows.Forms.Button btnCleanData; 440 | private System.Windows.Forms.Button btnSend; 441 | private System.Windows.Forms.TextBox tbxRecvData; 442 | private System.Windows.Forms.TextBox tbxSendData; 443 | private System.IO.Ports.SerialPort serialPort1; 444 | private System.Windows.Forms.RadioButton tbnChar; 445 | private System.Windows.Forms.RadioButton tbnHex; 446 | private System.Windows.Forms.Button btnCleanRxData; 447 | private System.Windows.Forms.Timer timer_display; 448 | private System.Windows.Forms.DataVisualization.Charting.Chart chart1; 449 | private System.Windows.Forms.GroupBox groupBox5; 450 | private System.Windows.Forms.ToolStripMenuItem 文件ToolStripMenuItem; 451 | private System.Windows.Forms.MenuStrip menuStrip1; 452 | private System.Windows.Forms.Timer timer1; 453 | } 454 | } 455 | 456 | --------------------------------------------------------------------------------