/** get the root group and all the alone objects */ private void getRootGroup() { sw.Restart(); //LoadVgroups(_file_id);//暂时取消加载整个树结构,目前这个加载比较慢,暂时也用不着。 sw.Stop(); em = sw.ElapsedMilliseconds; Console.WriteLine("LoadVgroups" + em + "毫秒"); sw.Restart(); int num_ds = 0; int num_global = 0; status = HDF4Helper.SDfileinfo(_sd_id, out num_ds, out num_global); _num_datasets = num_ds; _num_global_attrs = num_global; for (int i = 0; i < num_ds; i++) { H4SDS ds = H4SDS.Load(_sd_id, i); _datasets.Add(ds); } for (int i = 0; i < num_global; i++) { HDFAttribute global_attr = HDFAttribute.Load(_sd_id, i); _global_attrs.Add(global_attr); } sw.Stop(); em = sw.ElapsedMilliseconds; Console.WriteLine("SDfileinfo" + em + "毫秒"); sw.Restart(); //Finding All Vdatas that are Not Members of a Vgroup: VSlone //初始化Vdata(读取表格数据,表格列名称参数) int[] ref_array = new int[1024]; HDF4API.VSlone(_file_id, ref_array, 1024); //初始化Vdata(读取表格数据,表格列名称参数) istat; int vdata_ref; int istat = HDF4API.Vstart(_file_id); vdata_ref = -1; List <H4Vdata> vdatas = new List <H4Vdata>(); while ((vdata_ref = HDF4API.VSgetid(_file_id, vdata_ref)) != HDFConstants.FAIL) { H4Vdata vdata = LoadVdata(_file_id, vdata_ref); vdatas.Add(vdata); } _vdatas = vdatas; sw.Stop(); em = sw.ElapsedMilliseconds; Console.WriteLine("VSlone" + em + "毫秒"); }