예제 #1
0
        public void Load(string filename, DFACC dfacc)
        {
            sw.Start();
            _filename = filename;
            int file_id, sd_id;

            try
            {
                _fileOpenState = false;
                file_id        = HDF4API.Hopen(filename, DFACC.DFACC_READ, 0);
                HDF4API.Vstart(file_id);
                //_gr_id = HDF4API.GRstart(file_id);
            }
            catch
            {
                string strErrInfo = "HDF4打开文件异常";
                throw new Exception(strErrInfo);
            }
            _fileOpenState = true;
            sd_id          = HDF4Helper.SDstart(filename, HDF4Helper.AccessCodes.DFACC_READ);
            if (sd_id == -1)
            {
                //打开失败
            }
            _file_id = file_id;
            _sd_id   = sd_id;
            sw.Stop();
            em = sw.ElapsedMilliseconds;
            Console.WriteLine("打开" + em + "毫秒");
            // load the file hierarchy
            getRootGroup();
        }
예제 #2
0
 public static extern int Hopen(string filename, DFACC access, int n_dds);