| | |
| | | |
| | | namespace WIDESEAWCS_QuartzJob.DeviceBase |
| | | { |
| | | /// <summary> |
| | | /// 西门子 |
| | | /// </summary> |
| | | public class DeviceCommand : IDataTransfer |
| | | { |
| | | #region <Const> |
| | | #endregion <Const> |
| | | |
| | | #region <Private Member> |
| | | /// <summary> |
| | | /// 数据长度 |
| | | /// </summary> |
| | | public ushort ReadCount { get; } |
| | | |
| | | private IByteTransform byteTransform = new ReverseBytesTransform(); |
| | |
| | | #endregion <Public Menber> |
| | | |
| | | #region <Constructor function> |
| | | /// <summary> |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <exception cref="NotSupportedException"></exception> |
| | | public DeviceCommand() |
| | | { |
| | | ushort readCount = 0; |
| | |
| | | #endregion <Private Method> |
| | | |
| | | #region <Public Method> |
| | | /// <summary> |
| | | /// 数据装换 |
| | | /// </summary> |
| | | /// <param name="Content"></param> |
| | | /// <exception cref="NotSupportedException"></exception> |
| | | public void ParseSource(byte[] Content) |
| | | { |
| | | PropertyInfo[] propertyInfos = GetType().GetProperties().Where(x => x.CanWrite).ToArray(); |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 数据转换 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | /// <exception cref="NotSupportedException"></exception> |
| | | public byte[] ToSource() |
| | | { |
| | | int propertyValueHasNull = -1; |