AmericasCup.Data.AverageWind.Read C# (CSharp) Метод

Read() публичный статический Метод

public static Read ( byte buf, int c, AverageWind w ) : int
buf byte
c int
w AverageWind
Результат int
        public static int Read(byte[] buf, int c, AverageWind w)
        {
            w.MessageVersionNumber = buf[c++];
            w.Time = new DateTime(1970, 1, 1).AddMilliseconds(BitConverter.ToUInt64(
                new byte[] { buf[c++], buf[c++], buf[c++], buf[c++], buf[c++], buf[c++], 0, 0 }, 0));

            w.RawPeriod = TimeSpan.FromSeconds(BitConverter.ToUInt16(buf, c) / 10.0f); // 1/10ths of seconds to TimeSpan
            c += 2;
            w.RawSpeed = BitConverter.ToUInt16(buf, c) / 1000.0f; // mm/s -> m/s
            c += 2;

            w.Period2 = TimeSpan.FromSeconds(BitConverter.ToUInt16(buf, c) / 10.0f); // 1/10ths of seconds to TimeSpan
            c += 2;
            w.Speed2 = BitConverter.ToUInt16(buf, c) / 1000.0f; // mm/s -> m/s
            c += 2;

            w.Period3 = TimeSpan.FromSeconds(BitConverter.ToUInt16(buf, c) / 10.0f); // 1/10ths of seconds to TimeSpan
            c += 2;
            w.Speed3 = BitConverter.ToUInt16(buf, c) / 1000.0f; // mm/s -> m/s
            c += 2;

            w.Period4 = TimeSpan.FromSeconds(BitConverter.ToUInt16(buf, c) / 10.0f); // 1/10ths of seconds to TimeSpan
            c += 2;
            w.Speed4 = BitConverter.ToUInt16(buf, c) / 1000.0f; // mm/s -> m/s
            c += 2;

            return c;
        }

Same methods

AverageWind::Read ( byte buf ) : AverageWind
AverageWind