示例#1
0
 /// <summary>
 /// 基准站坐标ECEF转经纬度
 /// </summary>
 /// <param name="IN01"></param>
 /// <returns></returns>
 public static double[] Ecef2Pos01(Model.INF_B562_0101 IN01)
 {
     double[] r   = { IN01.ecefX * 0.01, IN01.ecefY * 0.01, IN01.ecefZ * 0.01 };
     double[] pos = new double[3];
     CoordinateConverter.ecef2pos(r, pos);
     return(pos);
 }
示例#2
0
 /// <summary>
 /// 数组协议解析基准站信息
 /// </summary>
 /// <param name="Data"></param>
 /// <param name="IN01"></param>
 /// <param name="IN11"></param>
 public static void ParseBaseStation(byte[] Data, Model.INF_B562_0101 IN01, Model.INF_B562_0111 IN11)
 {
     for (int i = 0; i < Data.Length - 6; i++)
     {
         if ((Data[i] == 0xB5) && (Data[i + 1] == 0x62) && (Data[i + 2] == 0x01))
         {
             if (Data[i + 3] == 0x01)
             {
                 ushort len = BitConverter.ToUInt16(Data, i + 4);
                 if (Data.Length - i - 8 >= len)
                 {
                     byte[] buffer = Data.Skip(i + 2).Take(len + 6).ToArray();
                     if (Protocol_UBX.Checksum(buffer))
                     {
                         byte[] payload = buffer.Skip(4).Take(len).ToArray();
                         IN01 = Protocol_UBX.BaseStation(payload);
                     }
                 }
             }
             else if (Data[i + 3] == 0x11)
             {
                 ushort len = BitConverter.ToUInt16(Data, i + 4);
                 if (Data.Length - i - 8 >= len)
                 {
                     byte[] buffer = Data.Skip(i + 2).Take(len + 6).ToArray();
                     if (Protocol_UBX.Checksum(buffer))
                     {
                         byte[] payload = buffer.Skip(4).Take(len).ToArray();
                         IN11 = Protocol_UBX.UserBaseStation(payload);
                     }
                 }
             }
         }
     }
 }