添加配置连接窗口已经相关S7与ModbusTCP连接功能

This commit is contained in:
20492
2026-06-12 08:38:43 +08:00
parent 5d14afcb66
commit 1ff51cbc45
13 changed files with 1785 additions and 105 deletions

View File

@@ -0,0 +1,35 @@
using Prism.Events;
using S7.Net;
using System.IO.Ports;
namespace MainModule.Events
{
public enum ProtocolType
{
S7,
ModbusTCP,
ModbusRTU,
TCP,
HTTP
}
public class ConnectionConfigEvent : PubSubEvent<ConnectionConfigEvent.ConnectionConfigData>
{
public class ConnectionConfigData
{
public ProtocolType Protocol { get; set; }
public string IpAddress { get; set; } = string.Empty;
public int Port { get; set; }
public string SerialPort { get; set; } = string.Empty;
public int BaudRate { get; set; }
public Parity Parity { get; set; }
public int DataBits { get; set; }
public StopBits StopBits { get; set; }
public CpuType CpuType { get; set; }
public short Rack { get; set; }
public short Slot { get; set; }
public int SendTimeout { get; set; }
public int ReceiveTimeout { get; set; }
}
}
}