1
hutongqing
2025-01-02 8c6fd742db249ad4cc819cf041eb98d880a3ef73
WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs
@@ -35,6 +35,9 @@
        #endregion <Const>
        #region <Private Member>
        /// <summary>
        /// 数据长度
        /// </summary>
        public ushort ReadCount { get; }
        private IByteTransform byteTransform = new ReverseBytesTransform();
@@ -45,6 +48,10 @@
        #endregion <Public Menber>
        #region <Constructor function>
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <exception cref="NotSupportedException"></exception>
        public DeviceCommand()
        {
            ushort readCount = 0;
@@ -105,6 +112,11 @@
        #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();
@@ -156,6 +168,12 @@
            }
        }
        /// <summary>
        /// 数据转换
        /// </summary>
        /// <returns></returns>
        /// <exception cref="Exception"></exception>
        /// <exception cref="NotSupportedException"></exception>
        public byte[] ToSource()
        {
            int propertyValueHasNull = -1;