1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 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<T> : DeviceData
- {
- public T Data { get; private set; }
- protected abstract T Convert<TSource>(TSource source);
- }
- }
|