using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Gidrolock_Modbus_Scanner { public class Device { public string name; public string description; public List entries; public CheckEntry checkEntry; public Device(string name, string description, CheckEntry checkEntry, List entries) { this.name = name; this.description = description; this.checkEntry = checkEntry; this.entries = entries; } } public struct Entry { public string name; public RegisterType registerType; public ushort address; public ushort length; public string dataType; public List labels; public Dictionary valueParse; public bool readOnce; public bool isModbusID; public Entry(string name, RegisterType registerType, ushort address, ushort length = 1, string dataType = "uint16", List labels = null, Dictionary valueParse = null, bool readOnce = false, bool isModbusID = false) { this.name = name; this.registerType = registerType; this.address = address; this.length = length; this.dataType = dataType; this.labels = labels; this.valueParse = valueParse; this.readOnce = readOnce; this.isModbusID = isModbusID; } } public struct CheckEntry { public RegisterType registerType; public ushort address; public ushort length; public string dataType; public string expectedValue; public CheckEntry(RegisterType registerType, ushort address, ushort length, string dataType, string expectedValue) { this.registerType = registerType; this.address = address; this.length = length; this.dataType = dataType; this.expectedValue = expectedValue; } } public enum RegisterType { Coil = 1, Discrete = 2, Holding = 3, Input = 4} }