- Added a a general data handling object
- Extended the callback interface to register scipts on callbacks - Fixed a stop bug in the anticollision object - Modified the HM code to do zero through a client connection
This commit is contained in:
52
napi5.c
52
napi5.c
@@ -26,7 +26,6 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "fortify.h"
|
||||
|
||||
typedef struct __NexusFile5 {
|
||||
struct iStack5 {
|
||||
@@ -116,7 +115,8 @@
|
||||
long gmt_offset;
|
||||
unsigned int vers_major, vers_minor, vers_release, am1 ;
|
||||
hid_t fapl;
|
||||
int mdc_nelmts, rdcc_nelmts;
|
||||
int mdc_nelmts;
|
||||
unsigned long rdcc_nelmts;
|
||||
size_t rdcc_nbytes;
|
||||
double rdcc_w0;
|
||||
|
||||
@@ -253,14 +253,20 @@
|
||||
attr1= H5Acreate(pNew->iVID, "file_name", aid1, aid2, H5P_DEFAULT);
|
||||
if (attr1 < 0)
|
||||
{
|
||||
NXIReportError (NXpData, "ERROR: HDF failed to store file_name attribute ");
|
||||
NXIReportError (NXpData,
|
||||
"ERROR: HDF failed to store file_name attribute ");
|
||||
return NX_ERROR;
|
||||
}
|
||||
if (H5Awrite(attr1, aid1, (char*)filename) < 0)
|
||||
{
|
||||
NXIReportError (NXpData, "ERROR: HDF failed to store file_name attribute ");
|
||||
NXIReportError (NXpData,
|
||||
"ERROR: HDF failed to store file_name attribute ");
|
||||
return NX_ERROR;
|
||||
}
|
||||
iRet = H5Tclose(aid1);
|
||||
iRet = H5Sclose(aid2);
|
||||
iRet = H5Aclose(attr1);
|
||||
/* ------- library version ------*/
|
||||
H5get_libversion(&vers_major, &vers_minor, &vers_release);
|
||||
sprintf (version_nr, "%d.%d.%d", vers_major,vers_minor,vers_release);
|
||||
aid2=H5Screate(H5S_SCALAR);
|
||||
@@ -269,24 +275,34 @@
|
||||
attr1= H5Acreate(pNew->iVID, "HDF5_Version", aid1, aid2, H5P_DEFAULT);
|
||||
if (attr1 < 0)
|
||||
{
|
||||
NXIReportError (NXpData, "ERROR: HDF failed to store file_name attribute ");
|
||||
NXIReportError (NXpData,
|
||||
"ERROR: HDF failed to store file_name attribute ");
|
||||
return NX_ERROR;
|
||||
}
|
||||
if (H5Awrite(attr1, aid1, (char*)version_nr) < 0)
|
||||
{
|
||||
NXIReportError (NXpData, "ERROR: HDF failed to store file_name attribute ");
|
||||
NXIReportError (NXpData,
|
||||
"ERROR: HDF failed to store file_name attribute ");
|
||||
return NX_ERROR;
|
||||
}
|
||||
iRet = H5Tclose(aid1);
|
||||
iRet = H5Sclose(aid2);
|
||||
iRet = H5Aclose(attr1);
|
||||
/*----------- file time */
|
||||
aid2=H5Screate(H5S_SCALAR);
|
||||
aid1 = H5Tcopy(H5T_C_S1);
|
||||
H5Tset_size(aid1, strlen(time_buffer));
|
||||
attr1=H5Acreate(pNew->iVID, "file_time", aid1, aid2, H5P_DEFAULT);
|
||||
if (attr1 < 0)
|
||||
{
|
||||
NXIReportError (NXpData, "ERROR: HDF failed to store file_time attribute ");
|
||||
NXIReportError (NXpData,
|
||||
"ERROR: HDF failed to store file_time attribute ");
|
||||
return NX_ERROR;
|
||||
}
|
||||
if (H5Awrite(attr1, aid1, time_buffer) < 0)
|
||||
{
|
||||
NXIReportError (NXpData, "ERROR: HDF failed to store file_time attribute ");
|
||||
NXIReportError (NXpData,
|
||||
"ERROR: HDF failed to store file_time attribute ");
|
||||
return NX_ERROR;
|
||||
}
|
||||
/* Close attribute dataspace */
|
||||
@@ -330,7 +346,6 @@
|
||||
free(pFile->iCurrentLD);
|
||||
}
|
||||
free (pFile);
|
||||
H5garbage_collect();
|
||||
*fid = NULL;
|
||||
return NX_OK;
|
||||
}
|
||||
@@ -662,22 +677,28 @@
|
||||
return NX_ERROR;
|
||||
}
|
||||
H5Pset_deflate(cparms,6);
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1, dataspace, cparms);
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1,
|
||||
dataspace, cparms);
|
||||
} else if (compress_type == NX_COMP_NONE) {
|
||||
if (dimensions[0] == NX_UNLIMITED) {
|
||||
cparms = H5Pcreate(H5P_DATASET_CREATE);
|
||||
iNew = H5Pset_chunk(cparms,rank,chunkdims);
|
||||
if (iNew < 0) {
|
||||
NXIReportError (NXpData, "ERROR: Size of chunks could not be set!");
|
||||
NXIReportError (NXpData,
|
||||
"ERROR: Size of chunks could not be set!");
|
||||
return NX_ERROR;
|
||||
}
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1, dataspace, cparms);
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1,
|
||||
dataspace, cparms);
|
||||
} else {
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1, dataspace, H5P_DEFAULT);
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1,
|
||||
dataspace, H5P_DEFAULT);
|
||||
}
|
||||
} else {
|
||||
NXIReportError (NXpData, "HDF5 doesn't support selected compression method! Dataset was saved without compression");
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1, dataspace, H5P_DEFAULT);
|
||||
NXIReportError (NXpData,
|
||||
"HDF5 doesn't support selected compression method! Dataset was saved without compression");
|
||||
iRet = H5Dcreate (pFile->iCurrentG, (char*)name, datatype1,
|
||||
dataspace, H5P_DEFAULT);
|
||||
}
|
||||
if (iRet < 0) {
|
||||
NXIReportError (NXpData, "ERROR: Creating chunked dataset failed!");
|
||||
@@ -1165,6 +1186,7 @@
|
||||
strcpy(nxclass,data);
|
||||
H5Tclose(atype);
|
||||
H5Gclose(grp);
|
||||
H5Aclose(attr1);
|
||||
} else if (op_data.type==H5G_DATASET)
|
||||
{
|
||||
grp=H5Dopen(pFile->iCurrentG,name);
|
||||
|
||||
Reference in New Issue
Block a user