public static Message1008 Parse(string binStr) { StringSequence sequence = new StringSequence(); sequence.EnQuence(binStr); Message1008 msg = new Message1008(); msg.MessageNumber = BitConvertUtil.GetUInt(sequence.DeQueue(12)); //uint12 msg.ReferenceStationID = BitConvertUtil.GetUInt(sequence.DeQueue(12)); //uint12 msg.DescriptorCounterN = BitConvertUtil.GetUInt(sequence.DeQueue(8)); //uint8 int len = (int)msg.DescriptorCounterN; var str = BitConvertUtil.GetCharString(sequence, len);//char8(N) msg.AntennaDescriptor = str; msg.AntennaSetupID = BitConvertUtil.GetUInt(sequence.DeQueue(8)); //uint8 msg.SerialNumberCounterM = BitConvertUtil.GetUInt(sequence.DeQueue(8)); //uint8 msg.AntennaSerialNumber = BitConvertUtil.GetCharString(sequence, (int)msg.SerialNumberCounterM); //char8(M) msg.Length = 48 + (int)msg.DescriptorCounterN * 8 + (int)msg.SerialNumberCounterM * 8; return(msg); }
public static Message1022 Parse(string binStr) { StringSequence sequence = new StringSequence(); sequence.EnQuence(binStr); Message1022 msg = new Message1022(); msg.MessageNumber = BitConvertUtil.GetUInt(sequence.DeQueue(12)); msg.SourceNameCounter = BitConvertUtil.GetUInt(sequence.DeQueue(5)); msg.SourceName = BitConvertUtil.GetCharString(sequence, (int)msg.SourceNameCounter); msg.TargetNameCounter = BitConvertUtil.GetUInt(sequence.DeQueue(5)); msg.TargetName = BitConvertUtil.GetCharString(sequence, (int)msg.TargetNameCounter); msg.SystemIdentificationNumber = BitConvertUtil.GetUInt(sequence.DeQueue(8)); msg.UtilizedTransformationMessageIndicator = BitConvertUtil.GetUInt(sequence.DeQueue(10)); msg.PlateNumber = BitConvertUtil.GetUInt(sequence.DeQueue(5)); msg.ComputationIndicator = BitConvertUtil.GetUInt(sequence.DeQueue(4)); msg.HeightIndicator = BitConvertUtil.GetUInt(sequence.DeQueue(2)); msg.LatitudeOfOrigin = BitConvertUtil.GetInt(sequence.DeQueue(19)); msg.LongitudeOfOrigin = BitConvertUtil.GetInt(sequence.DeQueue(20)); msg.deltaLatitudeOfOrigin = BitConvertUtil.GetUInt(sequence.DeQueue(14)); msg.deltaLongitudeOfOrigin = BitConvertUtil.GetUInt(sequence.DeQueue(14)); msg.dX = BitConvertUtil.GetInt(sequence.DeQueue(23)); msg.dY = BitConvertUtil.GetInt(sequence.DeQueue(23)); msg.dZ = BitConvertUtil.GetInt(sequence.DeQueue(23)); msg.R1 = BitConvertUtil.GetInt(sequence.DeQueue(32)); msg.R2 = BitConvertUtil.GetInt(sequence.DeQueue(32)); msg.R3 = BitConvertUtil.GetInt(sequence.DeQueue(32)); msg.dS = BitConvertUtil.GetInt(sequence.DeQueue(25)); msg.XP = BitConvertUtil.GetInt(sequence.DeQueue(35)); msg.YP = BitConvertUtil.GetInt(sequence.DeQueue(35)); msg.ZP = BitConvertUtil.GetInt(sequence.DeQueue(35)); msg.addaS = BitConvertUtil.GetUInt(sequence.DeQueue(24)); msg.addbS = BitConvertUtil.GetUInt(sequence.DeQueue(25)); msg.addaT = BitConvertUtil.GetUInt(sequence.DeQueue(24)); msg.addbT = BitConvertUtil.GetUInt(sequence.DeQueue(25)); msg.HorizontalHelmertMolodenskiQualityIndicator = BitConvertUtil.GetUInt(sequence.DeQueue(3)); msg.VerticalHelmertMolodenskiQualityIndicator = BitConvertUtil.GetUInt(sequence.DeQueue(3)); msg.Length = 517 + (int)msg.SourceNameCounter * 8 + (int)msg.TargetNameCounter * 8; return(msg); }