Ejemplo n.º 1
0
 public static void Serialize(BinaryWriter binaryWriter, UserHeaderLabel uhl)
 {
     binaryWriter.Write(uhl.RecognitionSentinel, 3);
     binaryWriter.Write(uhl.FixedByStandard);
     binaryWriter.WriteStringLatitude(uhl.LatitiudeOfOrigin);
     binaryWriter.WriteStringLongitude(uhl.LongitudeOfOrigin);
     binaryWriter.WriteStringInt((int)(uhl.LongitudeInterval * 360.0), 4, '0');
     binaryWriter.WriteStringInt((int)(uhl.LatitudeInterval * 360.0), 4, '0');
     binaryWriter.WriteStringRightJustified(uhl.AbsoluteVerticalAccuracy, 4, '0');
     binaryWriter.WriteStringLeftJustified(uhl.SecurityCode, 3, ' ');
     binaryWriter.WriteStringLeftJustified(uhl.UniqueReference, 12, ' ');
     binaryWriter.WriteStringInt(uhl.NumberOfLongitudeLines, 4, '0');
     binaryWriter.WriteStringInt(uhl.NumberOfLatitudePoints, 4, '0');
     binaryWriter.Write(uhl.MultipleAccuracy);
     binaryWriter.Write(uhl.Reserved, 24);
 }
Ejemplo n.º 2
0
        public static UserHeaderLabel Deserialize(BinaryReader binaryReader)
        {
            UserHeaderLabel uhl = new UserHeaderLabel();

            uhl.RecognitionSentinel      = binaryReader.ReadString(3);
            uhl.FixedByStandard          = binaryReader.ReadChar();
            uhl.LatitiudeOfOrigin        = binaryReader.ReadStringLatitude();
            uhl.LongitudeOfOrigin        = binaryReader.ReadStringLongitude();
            uhl.LongitudeInterval        = binaryReader.ReadStringInt32(4) / 360.0;
            uhl.LatitudeInterval         = binaryReader.ReadStringInt32(4) / 360.0;
            uhl.AbsoluteVerticalAccuracy = binaryReader.ReadString(4);
            uhl.SecurityCode             = binaryReader.ReadString(3);
            uhl.UniqueReference          = binaryReader.ReadString(12);
            uhl.NumberOfLongitudeLines   = binaryReader.ReadStringInt32(4);
            uhl.NumberOfLatitudePoints   = binaryReader.ReadStringInt32(4);
            uhl.MultipleAccuracy         = binaryReader.ReadChar();
            uhl.Reserved = binaryReader.ReadString(24);
            return(uhl);
        }