串口下拉框去掉电脑自带的 COM1,只留实训台上的 COM2–COM5;展开时每个串口后面用灰字标出接的设备(ADAM-4017+、ADAM-4150、ZigBee 协调器、LED 屏),选中后的值还是 COM2 这样的串口名,和真机一致。项目 5 任务 3 跳过 COM1 的写法照书保留,任务说明补一句;使用说明、设计方案同步;按位置选串口的测试下标跟着改
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
50946467f6
commit
50dced4d37
9 files changed
+26
-15
No files matched your search
@@ -8,8 +8,8 @@ namespace System.IO.Ports;
|
||||
/// </summary>
|
||||
public class SerialPort : Component
|
||||
{
|
||||
/// <summary>COM1 是电脑自带串口,COM2–COM5 对应实训台上的 4017、4150、ZigBee 协调器和 LED 屏</summary>
|
||||
private static readonly string[] VirtualPorts = { "COM1", "COM2", "COM3", "COM4", "COM5" };
|
||||
/// <summary>COM2–COM5 对应实训台上的 4017、4150、ZigBee 协调器和 LED 屏,不提供电脑自带的 COM1</summary>
|
||||
private static readonly string[] VirtualPorts = { "COM2", "COM3", "COM4", "COM5" };
|
||||
|
||||
public SerialPort() { }
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SerialPort : Component
|
||||
|
||||
public static string[] GetPortNames() => (string[])VirtualPorts.Clone();
|
||||
|
||||
public string PortName { get; set; } = "COM1";
|
||||
public string PortName { get; set; } = "COM2";
|
||||
public int BaudRate { get; set; } = 9600;
|
||||
public int DataBits { get; set; } = 8;
|
||||
public int ReadTimeout { get; set; } = -1;
|
||||
|
||||
Reference in new issue
Block a user