Exemplo n.º 1
0
 public D1BDHeader(object commonInfoFor1BD, object qualityCheckInfoFor1BD,
                   object scaleInfoFor1BD, object radiantionConvertArgsInfoFor1BD,
                   object geographEnvelopeInfoFor1BD,
                   object simluateRemoteMeasureMeasureInfoFor1BD,
                   object nomalHeaderInfo, bool isBigEndian)
 {
     _commonInfoFor1BD                = (CommonInfoFor1BD)commonInfoFor1BD;
     _qualityCheckInfoFor1BD          = (QualityCheckInfoFor1BD)qualityCheckInfoFor1BD;
     _sacleInfoFor1BD                 = (ScaleInfoFor1BD)scaleInfoFor1BD;
     _radiantionConvertArgsInfoFor1BD = (RadiantionConvertArgsInfoFor1BD)radiantionConvertArgsInfoFor1BD;
     _geographLocationInfoFor1BD      = (GeographLocationInfoFor1BD)geographEnvelopeInfoFor1BD;
     _simluateRemoteMeasureInfoFor1BD = (SimluateRemoteMeasureInfoFor1BD)simluateRemoteMeasureMeasureInfoFor1BD;
     _nomalHeaderInfo                 = (NomalHeaderInfo)nomalHeaderInfo;
     _isBigEndian = isBigEndian;
 }
Exemplo n.º 2
0
        public override object Create(Stream fileStream, BinaryReader binaryReader, int offset, int endOffset)
        {
            QualityCheckInfoFor1BD qInfo = new QualityCheckInfoFor1BD();

            fileStream.Seek(116, SeekOrigin.Begin);
            if (_isBigEndian)
            {
                UInt32 yqState_Int = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                string yqState_Str = Convert.ToString(yqState_Int, 2).PadLeft(32, '0');
                qInfo.PatchControl      = yqState_Str[1] == '0' ? false : true;
                qInfo.EarthShadow       = yqState_Str[2] == '0' ? false : true;
                qInfo.RemotesensingLock = yqState_Str[3] == '0' ? false : true;
                qInfo.ScanMotor         = yqState_Str[4] == '0' ? false : true;
                qInfo.CoolerHot         = yqState_Str[5] == '0' ? false : true;
                qInfo.VStandard         = yqState_Str[6] == '0' ? false : true;
                qInfo.Used3AOr3B        = yqState_Str[7] == '0' ? false : true;
                qInfo.EnableChannel5    = yqState_Str[8] == '0' ? false : true;
                qInfo.EnableChannel4    = yqState_Str[9] == '0' ? false : true;
                qInfo.EnableChannel3B   = yqState_Str[10] == '0' ? false : true;
                qInfo.EnableChannel3A   = yqState_Str[11] == '0' ? false : true;
                qInfo.EnableChannel2    = yqState_Str[12] == '0' ? false : true;
                qInfo.EnableChannel1    = yqState_Str[13] == '0' ? false : true;
                qInfo.UsedElectron      = yqState_Str[14] == '0' ? false : true;
                qInfo.UsedMotor         = yqState_Str[15] == '0' ? false : true;
                fileStream.Seek(2, SeekOrigin.Current);
                qInfo.StateChangeCount       = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.SecondYQState          = ToLocalEndian_Core.ToUInt32FromBig(binaryReader.ReadBytes(4));
                qInfo.RecordCount            = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.MarkRecordCount        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.LostRecordCount        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.DataKXCount            = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorFrameCount        = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorTIPCount          = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorAssistCount       = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrder         = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrderCode     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.UpdateSOCC             = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocation     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocationCode = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                int    statePACS_Int = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
                string statePACS_Str = Convert.ToString(statePACS_Int, 2).PadLeft(16, '0');
                qInfo.DataMode      = statePACS_Str[0] == '0' ? false : true;
                qInfo.TapeDirection = statePACS_Str[1] == '0' ? false : true;
                qInfo.PseudoNoise   = statePACS_Str[2] == '0' ? false : true;
                qInfo.PACSource     = ToLocalEndian_Core.ToUInt16FromBig(binaryReader.ReadBytes(2));
            }
            else
            {
                UInt32 yqState_Int = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                string yqState_Str = Convert.ToString(yqState_Int, 2).PadLeft(32, '0');
                qInfo.PatchControl      = yqState_Str[1] == '0' ? false : true;
                qInfo.EarthShadow       = yqState_Str[2] == '0' ? false : true;
                qInfo.RemotesensingLock = yqState_Str[3] == '0' ? false : true;
                qInfo.ScanMotor         = yqState_Str[4] == '0' ? false : true;
                qInfo.CoolerHot         = yqState_Str[5] == '0' ? false : true;
                qInfo.VStandard         = yqState_Str[6] == '0' ? false : true;
                qInfo.Used3AOr3B        = yqState_Str[7] == '0' ? false : true;
                qInfo.EnableChannel5    = yqState_Str[8] == '0' ? false : true;
                qInfo.EnableChannel4    = yqState_Str[9] == '0' ? false : true;
                qInfo.EnableChannel3B   = yqState_Str[10] == '0' ? false : true;
                qInfo.EnableChannel3A   = yqState_Str[11] == '0' ? false : true;
                qInfo.EnableChannel2    = yqState_Str[12] == '0' ? false : true;
                qInfo.EnableChannel1    = yqState_Str[13] == '0' ? false : true;
                qInfo.UsedElectron      = yqState_Str[14] == '0' ? false : true;
                qInfo.UsedMotor         = yqState_Str[15] == '0' ? false : true;
                fileStream.Seek(2, SeekOrigin.Current);
                qInfo.StateChangeCount       = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.SecondYQState          = ToLocalEndian_Core.ToUInt32FromLittle(binaryReader.ReadBytes(4));
                qInfo.RecordCount            = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.MarkRecordCount        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.LostRecordCount        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.DataKXCount            = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorFrameCount        = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorTIPCount          = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorAssistCount       = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrder         = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorTimeOrderCode     = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.UpdateSOCC             = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocation     = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                qInfo.ErrorEarthLocationCode = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                int    statePACS_Int = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
                string statePACS_Str = Convert.ToString(statePACS_Int, 2).PadLeft(16, '0');
                qInfo.DataMode      = statePACS_Str[0] == '0' ? false : true;
                qInfo.TapeDirection = statePACS_Str[1] == '0' ? false : true;
                qInfo.PseudoNoise   = statePACS_Str[2] == '0' ? false : true;
                qInfo.PACSource     = ToLocalEndian_Core.ToUInt16FromLittle(binaryReader.ReadBytes(2));
            }
            base.Create(fileStream, binaryReader, offset, endOffset);
            return(qInfo);
        }