using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace WCS.Core { public enum PLCType { [Description("西门子")] Siemens = 1, [Description("三菱")] Mitsubishi = 2, [Description("欧姆龙")] Omron = 3, } public struct PLCInfo { public string IP; public int Port; public int Slot; public int Rack; public PLCType Type; } public struct DBInfo { public PLCInfo PLCInfo; public ushort No; } public struct ProtocolInfo { public DBInfo DBInfo; public int Position { get; set; } } public abstract class DeviceData { public string Code { get; set; } = ""; public DateTime Frame { get; set; } public string Message { get; set; } = ""; } public abstract class DeviceData : DeviceData { public T Data { get; private set; } protected abstract T Convert(TSource source); } }