Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="st"></param>
 public GRWriteTimeTempLine(GRStation st, TimeTempLine ttl)
 {
     Station = st;
     if (ttl == null)
     {
         throw new ArgumentNullException("ttl");
     }
     _ttl = ttl;
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bs"></param>
        /// <param name="beginIdx"></param>
        /// <returns></returns>
        static public TimeTempLine Parse(byte[] bs, int beginIdx)
        {
            TimeTempLine ttl = new TimeTempLine();

            for (int i = 0; i < POINTSIZE; i++)
            {
                ttl.list[i] = new TimeTempPoint((byte)(i * 2), bs[i + beginIdx]);
            }

            return(ttl);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public override CommResultState ProcessReceived(byte[] data)
        {
            CommResultState r = GRCommandMaker.CheckReceivedData(Station.Address,
                                                                 GRDef.DEVICE_TYPE, GRDef.FC_READ_SETTINGS, data);

            if (r == CommResultState.Correct)
            {
                byte[] innerDatas = GRCommandMaker.GetReceivedInnerData(data);

                byte mc = innerDatas[0];
                if (mc == GRDef.MC_TEMPERATURE_LINE)
                {
                    _tl = TemperatureLine.Parse(innerDatas, 1);
                    this._timetempline = TimeTempLine.Parse(innerDatas, 1 + 16);
                }
                else
                {
                    return(CommResultState.DataError);
                }
            }
            return(r);
        }