Beispiel #1
0
        public static D1BDHeader Get1BDHeader(string filename)
        {
            FileStream   fs         = null;
            BinaryReader br         = null;
            D1BDHeader   d1bdHeader = null;

            try
            {
                fs         = new FileStream(filename, FileMode.Open, FileAccess.Read);
                br         = new BinaryReader(fs, Encoding.Default);
                d1bdHeader = new SecHlder1BDFileHeader().Create(fs, br, 0, 22016) as D1BDHeader;
            }
            finally
            {
                if (fs != null)
                {
                    fs.Close();
                }
                if (br != null)
                {
                    br.Close();
                }
            }
            return(d1bdHeader);
        }
Beispiel #2
0
 public L1BDataProvider(string fileName)
 {
     this.fileName = fileName;
     _d1bdHeader   = SecHlder1BDFileHeader.Get1BDHeader(fileName);
     using (FileStream fs = new FileStream(fileName, FileMode.Open))
     {
         long len = fs.Length;
         _factOfLine = (int)(len / _sizeOfLine - 1);
     }
 }
Beispiel #3
0
        public override object Create(Stream fileStream, BinaryReader binaryReader, int offset, int endOffset)
        {
            bool isBig = IsBigEndian(fileStream, binaryReader);

            D1BDHeader hInfo = new D1BDHeader(
                new SecHlder1BDFileHeaderCommonInfo_NOAA(isBig).Create(fileStream, binaryReader, cstCommonInfoOffset, cstCommonInfoEndOffset),
                new SecHlder1BDFileHeaderQualityInfo_NOAA(isBig).Create(fileStream, binaryReader, cstQualityInfoOffset, cstQualityInfoEndOffset),
                new SecHlder1BDFileHeaderScaleInfo_NOAA(isBig).Create(fileStream, binaryReader, cstScaleInfoOffset, cstScaleInfoEndOffset),
                new SecHlder1BDFileHeaderRadiantionInfo_NOAA(isBig).Create(fileStream, binaryReader, cstRadiantionInfoOffset, cstRadiantionInfoEndOffset),
                new SecHlder1BDFileHeaderGeographInfo_NOAA(isBig).Create(fileStream, binaryReader, cstGeographInfoOffset, cstGeographInfoEndOffset),
                new SecHlder1BDFileHeaderSimluateInfo_NOAA().Create(fileStream, binaryReader, cstSimulateInfoOffset, cstSimluateInfoEndOffset),
                new NomalInfoSection().Create(fileStream, binaryReader, cstNomalInfoSectionOffset, cstSimluateInfoEndOffset)
                , isBig);

            return(hInfo);
        }