Beispiel #1
0
        static public Rtcm2Header1 Parse(string binString)
        {
            if (binString.Length != 30)
            {
                throw new Exception("应该是30位。");
            }
            Rtcm2Header1 RtcmFrame = new Rtcm2Header1();

            RtcmFrame.CharString = binString;
            var header = binString.Substring(0, 8);

            if (header != Rtcm2Header1.Preamble_2)
            {
                throw new Exception("header应该是 " + Rtcm2Header1.Preamble_2 + "。实际是:" + header);
            }
            RtcmFrame.Head     = (byte)Convert.ToInt32(header, 2);                    //转回十进制
            RtcmFrame.Id       = (byte)Convert.ToInt32(binString.Substring(8, 6), 2); //转回十进制
            RtcmFrame.SiteId   = Convert.ToInt32(binString.Substring(14, 10), 2);     //转回十进制
            RtcmFrame.CheckBit = Convert.ToInt32(binString.Substring(24, 6), 2);      //转回十进制
            return(RtcmFrame);
        }
Beispiel #2
0
 public Rtcm2Header(Rtcm2Header1 RtcmByte1, Rtcm2Header2 RtcmByte2)
 {
     this.RtcmByte1 = RtcmByte1;
     this.RtcmByte2 = RtcmByte2;
 }