예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="linePoint"></param>
        /// <returns></returns>
        static public byte[] Parse(TemperatureLinePoint linePoint)
        {
            ArgumentChecker.CheckNotNull(linePoint);
            byte[] bs = new byte[2];
            bs[0] = um(linePoint.OutSideTemperature);
            bs[1] = um(linePoint.TwoGiveTemperature);

            return(bs);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="line"></param>
        /// <returns></returns>
        static public byte[] Parse(TemperatureLine line)
        {
            ArgumentChecker.CheckNotNull(line);
            byte[] bs = new byte[_size * 2];
            for (int i = 0; i < _size; i++)
            {
                byte[] linePointDatas = TemperatureLinePoint.Parse(line[i]);
                int    idx            = i * 2;

                bs[idx]     = linePointDatas[0];
                bs[idx + 1] = linePointDatas[1];
            }
            return(bs);
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="datas"></param>
        /// <param name="beginPos"></param>
        /// <returns></returns>
        static public TemperatureLine Parse(byte[] datas, int beginPos)
        {
            ArgumentChecker.CheckNotNull(datas);
            if (datas.Length < (_size * 2) + beginPos)
            {
                throw new ArgumentException("datas.length");
            }

            TemperatureLine tl = new TemperatureLine();

            for (int i = 0; i < _size; i++)
            {
                int    idx             = i * 2 + beginPos;
                byte[] pointDatas      = new byte[] { datas[idx], datas[idx + 1] };
                TemperatureLinePoint p = TemperatureLinePoint.Parse(pointDatas);
                tl[i] = p;
            }

            return(tl);
        }