- Fixed missalignment in TAS scan messages
- Fixed a counting/driving race in devexec - Fixed some problems with sanscheck SKIPPED: psi/tasscan.c psi/utils/check/amorcheck psi/utils/check/dmccheck psi/utils/check/focuscheck psi/utils/check/hrptcheck psi/utils/check/sanscheck psi/utils/check/sicssyntaxlib.tcl psi/utils/check/topsicheck psi/utils/check/tricscheck
This commit is contained in:
@ -431,11 +431,15 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case HWBusy:
|
case HWBusy:
|
||||||
if(pCountInt)
|
if(pCountInt != NULL && pDrivInt != NULL)
|
||||||
|
{
|
||||||
|
SetStatus(eCountDrive);
|
||||||
|
}
|
||||||
|
else if(pCountInt != NULL && pDrivInt == NULL)
|
||||||
{
|
{
|
||||||
SetStatus(eCounting);
|
SetStatus(eCounting);
|
||||||
}
|
}
|
||||||
else if(pDrivInt)
|
else if(pDrivInt != NULL && pCountInt == NULL)
|
||||||
{
|
{
|
||||||
SetStatus(eDriving);
|
SetStatus(eDriving);
|
||||||
}
|
}
|
||||||
|
48
hkl.c
48
hkl.c
@ -603,12 +603,23 @@ static int calculateBisecting(MATRIX z1, pHKL self, SConnection *pCon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
giving up!
|
giving up! But calculate one more time in order to show Jurg where
|
||||||
|
he should be.
|
||||||
*/
|
*/
|
||||||
for(i = 0; i < 4; i++)
|
z1mToBisecting(self->fLambda,z1,&stt,&om,&chi,&phi);
|
||||||
{
|
if(iRetry == 1){
|
||||||
fSet[i] = .0;
|
rotatePsi(om,chi,phi,psi,&ompsi,&chipsi,&phipsi);
|
||||||
|
fSet[0] = (float)stt;
|
||||||
|
fSet[1] = (float)ompsi;
|
||||||
|
fSet[2] = (float)chipsi;
|
||||||
|
fSet[3]= (float)phipsi;
|
||||||
|
} else {
|
||||||
|
fSet[0] = (float)stt;
|
||||||
|
fSet[1] = (float)om;
|
||||||
|
fSet[2] = (float)chi;
|
||||||
|
fSet[3]= (float)phi;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
@ -1203,6 +1214,7 @@ ente:
|
|||||||
char pBueffel[512];
|
char pBueffel[512];
|
||||||
float fUB[9], fPsi, fVal;
|
float fUB[9], fPsi, fVal;
|
||||||
float fHKL[3], fSet[4];
|
float fHKL[3], fSet[4];
|
||||||
|
double dVal;
|
||||||
pHKL self = NULL;
|
pHKL self = NULL;
|
||||||
CommandList *pCom = NULL;
|
CommandList *pCom = NULL;
|
||||||
pDummy pDum = NULL;
|
pDummy pDum = NULL;
|
||||||
@ -1269,6 +1281,34 @@ ente:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(strcmp(argv[1],"fromangles") == 0)
|
||||||
|
{
|
||||||
|
if(argc < 6)
|
||||||
|
{
|
||||||
|
SCWrite(pCon,
|
||||||
|
"ERROR: need stt, om, chi,phi to calculate HKL from angles",
|
||||||
|
eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for(i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
iRet = Tcl_GetDouble(InterpGetTcl(pSics),argv[i+2],&dVal);
|
||||||
|
if(iRet != TCL_OK)
|
||||||
|
{
|
||||||
|
snprintf(pBueffel,511,"ERROR: failed to convert %s to number",
|
||||||
|
argv[i+2]);
|
||||||
|
SCWrite(pCon,pBueffel,eError);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
fSet[i] = (float)dVal;
|
||||||
|
}
|
||||||
|
angle2HKL(self,(double)fSet[0],(double)fSet[1],
|
||||||
|
(double)fSet[2],(double)fSet[3],fHKL);
|
||||||
|
sprintf(pBueffel,"HKL from angles: %8.4f %8.4f %8.4f ",
|
||||||
|
fHKL[0], fHKL[1],fHKL[2]);
|
||||||
|
SCWrite(pCon,pBueffel,eValue);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
/*------------- lambda */
|
/*------------- lambda */
|
||||||
else if(strcmp(argv[1],"lambda") == 0)
|
else if(strcmp(argv[1],"lambda") == 0)
|
||||||
{
|
{
|
||||||
|
243
napi5.c
243
napi5.c
@ -53,6 +53,11 @@
|
|||||||
char iAccess[2];
|
char iAccess[2];
|
||||||
} NexusFile5, *pNexusFile5;
|
} NexusFile5, *pNexusFile5;
|
||||||
|
|
||||||
|
/*
|
||||||
|
forward declaration of NX5closegroup in order to get rid of a nasty
|
||||||
|
warning
|
||||||
|
*/
|
||||||
|
NXstatus CALLING_STYLE NX5closegroup (NXhandle fid);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -116,14 +121,12 @@
|
|||||||
unsigned int vers_major, vers_minor, vers_release, am1 ;
|
unsigned int vers_major, vers_minor, vers_release, am1 ;
|
||||||
hid_t fapl;
|
hid_t fapl;
|
||||||
int mdc_nelmts;
|
int mdc_nelmts;
|
||||||
unsigned long rdcc_nelmts;
|
int rdcc_nelmts;
|
||||||
size_t rdcc_nbytes;
|
size_t rdcc_nbytes;
|
||||||
double rdcc_w0;
|
double rdcc_w0;
|
||||||
|
|
||||||
/* turn off the automatic HDF error handling */
|
/* turn off the automatic HDF error handling */
|
||||||
|
|
||||||
H5Eset_auto(NULL,NULL);
|
H5Eset_auto(NULL,NULL);
|
||||||
|
|
||||||
#ifdef USE_FTIME
|
#ifdef USE_FTIME
|
||||||
struct timeb timeb_struct;
|
struct timeb timeb_struct;
|
||||||
#endif
|
#endif
|
||||||
@ -193,6 +196,12 @@
|
|||||||
iRet=H5Pget_cache(fapl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0);
|
iRet=H5Pget_cache(fapl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0);
|
||||||
rdcc_nbytes=(size_t)cacheSize;
|
rdcc_nbytes=(size_t)cacheSize;
|
||||||
iRet = H5Pset_cache(fapl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0);
|
iRet = H5Pset_cache(fapl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0);
|
||||||
|
/*
|
||||||
|
setting the close degree is absolutely necessary in HDF5
|
||||||
|
versions > 1.6. If you use a lessere version and the compiler
|
||||||
|
complains, comment it out but keep this in mind.
|
||||||
|
*/
|
||||||
|
H5Pset_fclose_degree(fapl,H5F_CLOSE_STRONG);
|
||||||
am1 = H5F_ACC_TRUNC;
|
am1 = H5F_ACC_TRUNC;
|
||||||
pNew->iFID = H5Fcreate (filename, am1, H5P_DEFAULT, fapl);
|
pNew->iFID = H5Fcreate (filename, am1, H5P_DEFAULT, fapl);
|
||||||
} else {
|
} else {
|
||||||
@ -332,6 +341,7 @@
|
|||||||
int iRet;
|
int iRet;
|
||||||
|
|
||||||
pFile=NXI5assert(*fid);
|
pFile=NXI5assert(*fid);
|
||||||
|
|
||||||
iRet=0;
|
iRet=0;
|
||||||
iRet = H5Fclose(pFile->iFID);
|
iRet = H5Fclose(pFile->iFID);
|
||||||
if (iRet < 0) {
|
if (iRet < 0) {
|
||||||
@ -347,6 +357,7 @@
|
|||||||
}
|
}
|
||||||
free (pFile);
|
free (pFile);
|
||||||
*fid = NULL;
|
*fid = NULL;
|
||||||
|
H5garbage_collect();
|
||||||
return NX_OK;
|
return NX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1139,6 +1150,67 @@
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* Operator function. */
|
||||||
|
|
||||||
|
herr_t group_info1(hid_t loc_id, const char *name, void *opdata)
|
||||||
|
{
|
||||||
|
NexusFile5 self;
|
||||||
|
H5G_stat_t statbuf;
|
||||||
|
self.iNX = *((int*)opdata);
|
||||||
|
H5Gget_objinfo(loc_id, name, 0, &statbuf);
|
||||||
|
|
||||||
|
switch (statbuf.type)
|
||||||
|
{
|
||||||
|
case H5G_GROUP:
|
||||||
|
self.iNX++;
|
||||||
|
*((int*)opdata)=self.iNX;
|
||||||
|
break;
|
||||||
|
case H5G_DATASET:
|
||||||
|
self.iNX++;
|
||||||
|
*((int*)opdata)=self.iNX;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
NXstatus CALLING_STYLE NX5getgroupinfo (NXhandle fid, int *iN, NXname pName, NXname pClass)
|
||||||
|
{
|
||||||
|
pNexusFile5 pFile;
|
||||||
|
hid_t atype,attr_id;
|
||||||
|
char data[64];
|
||||||
|
int iRet;
|
||||||
|
|
||||||
|
pFile = NXI5assert (fid);
|
||||||
|
/* check if there is a group open */
|
||||||
|
if (pFile->iCurrentG == 0) {
|
||||||
|
strcpy (pName, "root");
|
||||||
|
strcpy (pClass, "NXroot");
|
||||||
|
pFile->iNX=0;
|
||||||
|
iRet=H5Giterate(pFile->iFID,"/",0,group_info1,&pFile->iNX);
|
||||||
|
*iN=pFile->iNX;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
strcpy (pName,pFile->name_ref);
|
||||||
|
attr_id = H5Aopen_name(pFile->iCurrentG,"NX_class");
|
||||||
|
if (attr_id<0) {
|
||||||
|
strcpy(pClass,"non");
|
||||||
|
} else {
|
||||||
|
atype=H5Tcopy(H5T_C_S1);
|
||||||
|
H5Tset_size(atype,64);
|
||||||
|
H5Aread(attr_id, atype, data);
|
||||||
|
strcpy(pClass,data);
|
||||||
|
pFile->iNX=0;
|
||||||
|
iRet=H5Giterate(pFile->iFID,pFile->name_ref,0,group_info1, &pFile->iNX);
|
||||||
|
*iN=pFile->iNX;
|
||||||
|
H5Aclose(attr_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -1151,6 +1223,7 @@
|
|||||||
char data[128];
|
char data[128];
|
||||||
char ph_name[1024];
|
char ph_name[1024];
|
||||||
info_type op_data;
|
info_type op_data;
|
||||||
|
int iRet_iNX=-1;
|
||||||
|
|
||||||
pFile = NXI5assert (fid);
|
pFile = NXI5assert (fid);
|
||||||
op_data.iname = NULL;
|
op_data.iname = NULL;
|
||||||
@ -1161,6 +1234,18 @@
|
|||||||
}
|
}
|
||||||
iRet=H5Giterate(pFile->iFID,pFile->name_ref,&idx,nxgroup_info,&op_data);
|
iRet=H5Giterate(pFile->iFID,pFile->name_ref,&idx,nxgroup_info,&op_data);
|
||||||
strcpy(nxclass,"");
|
strcpy(nxclass,"");
|
||||||
|
|
||||||
|
if (pFile->iCurrentG == 0) {
|
||||||
|
pFile->iNX=0;
|
||||||
|
iRet_iNX = H5Giterate(pFile->iFID,"/",0,group_info1,&pFile->iNX);
|
||||||
|
} else {
|
||||||
|
pFile->iNX=0;
|
||||||
|
iRet_iNX = H5Giterate(pFile->iFID,pFile->name_ref,0,group_info1, &pFile->iNX);
|
||||||
|
}
|
||||||
|
if (idx == pFile->iNX) {
|
||||||
|
iRet_iNX = 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (iRet > 0)
|
if (iRet > 0)
|
||||||
{
|
{
|
||||||
pFile->iStack5[pFile->iStackPtr].iCurrentIDX++;
|
pFile->iStack5[pFile->iStackPtr].iCurrentIDX++;
|
||||||
@ -1247,21 +1332,20 @@
|
|||||||
}
|
}
|
||||||
return NX_OK;
|
return NX_OK;
|
||||||
}
|
}
|
||||||
else if (iRet==0)
|
else
|
||||||
{
|
{
|
||||||
|
if (iRet_iNX == 2) {
|
||||||
if (op_data.iname != NULL) {
|
if (op_data.iname != NULL) {
|
||||||
free(op_data.iname);
|
free(op_data.iname);
|
||||||
}
|
}
|
||||||
pFile->iStack5[pFile->iStackPtr].iCurrentIDX = 0;
|
pFile->iStack5[pFile->iStackPtr].iCurrentIDX = 0;
|
||||||
return NX_EOD;
|
return NX_EOD;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (op_data.iname != NULL) {
|
if (op_data.iname != NULL) {
|
||||||
free(op_data.iname);
|
free(op_data.iname);
|
||||||
}
|
}
|
||||||
NXIReportError (NXpData,
|
NXIReportError (NXpData,
|
||||||
"ERROR: Iteration was not successful");
|
"ERROR: Iteration (directory) was not successful");
|
||||||
return NX_ERROR;
|
return NX_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1567,17 +1651,43 @@
|
|||||||
int iPType,rank;
|
int iPType,rank;
|
||||||
char *iname = NULL;
|
char *iname = NULL;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
|
int intern_idx=-1;
|
||||||
|
|
||||||
pFile = NXI5assert (fileid);
|
pFile = NXI5assert (fileid);
|
||||||
idx=pFile->iAtt5.iCurrentIDX;
|
idx=pFile->iAtt5.iCurrentIDX;
|
||||||
|
iRet=0;
|
||||||
if ((pFile->iCurrentD == 0) && (pFile->iCurrentG==0))
|
if ((pFile->iCurrentD == 0) && (pFile->iCurrentG==0))
|
||||||
{
|
{
|
||||||
/* global attribute */
|
/* global attribute */
|
||||||
pFile->iVID=H5Gopen(pFile->iFID,"/");
|
pFile->iVID=H5Gopen(pFile->iFID,"/");
|
||||||
|
intern_idx=H5Aget_num_attrs(pFile->iVID);
|
||||||
|
if (intern_idx > idx) {
|
||||||
iRet=H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
|
iRet=H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iRet=0;
|
||||||
|
}
|
||||||
|
intern_idx=-1;
|
||||||
|
if (iRet < 0) {
|
||||||
|
NXIReportError (NXpData, "ERROR iterating through ROOT Attr. list!");
|
||||||
|
return NX_ERROR;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
intern_idx=H5Aget_num_attrs(pFile->iCurrentD);
|
||||||
|
if (intern_idx > idx) {
|
||||||
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
|
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iRet=0;
|
||||||
|
}
|
||||||
|
intern_idx=-1;
|
||||||
|
if (iRet < 0) {
|
||||||
|
NXIReportError (NXpData, "ERROR iterating through Attr. list!");
|
||||||
|
return NX_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (iRet>0)
|
if (iRet>0)
|
||||||
{
|
{
|
||||||
pFile->iAtt5.iCurrentIDX++;
|
pFile->iAtt5.iCurrentIDX++;
|
||||||
@ -1650,31 +1760,28 @@
|
|||||||
H5Tclose(atype);
|
H5Tclose(atype);
|
||||||
H5Sclose(aspace);
|
H5Sclose(aspace);
|
||||||
H5Aclose(pFile->iCurrentA);
|
H5Aclose(pFile->iCurrentA);
|
||||||
if ((pFile->iCurrentD == 0) && (pFile->iCurrentG==0))
|
|
||||||
{
|
|
||||||
/* close group for global attribute */
|
|
||||||
H5Gclose(pFile->iVID);
|
|
||||||
}
|
|
||||||
return NX_OK;
|
return NX_OK;
|
||||||
}
|
}
|
||||||
else if (iRet==0)
|
|
||||||
{
|
|
||||||
if (iname != NULL) {
|
|
||||||
free(iname);
|
|
||||||
}
|
|
||||||
if (idx == 0)
|
|
||||||
{
|
|
||||||
pFile->iAtt5.iCurrentIDX = 0;
|
|
||||||
return NX_EOD;
|
|
||||||
}
|
|
||||||
pFile->iAtt5.iCurrentIDX = 0;
|
|
||||||
return NX_EOD;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if ((pFile->iCurrentD == 0) && (pFile->iCurrentG==0))
|
||||||
|
{
|
||||||
|
/* global attribute */
|
||||||
|
intern_idx=H5Aget_num_attrs(pFile->iVID);
|
||||||
|
} else {
|
||||||
|
if (pFile->iCurrentD>0){
|
||||||
|
intern_idx=H5Aget_num_attrs(pFile->iCurrentD);
|
||||||
|
} else {
|
||||||
|
intern_idx=H5Aget_num_attrs(pFile->iCurrentG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((intern_idx == 0)||(intern_idx == idx)) {
|
||||||
|
pFile->iAtt5.iCurrentIDX = 0;
|
||||||
if (iname != NULL) {
|
if (iname != NULL) {
|
||||||
free(iname);
|
free(iname);
|
||||||
}
|
}
|
||||||
|
return NX_EOD;
|
||||||
|
}
|
||||||
NXIReportError (NXpData,
|
NXIReportError (NXpData,
|
||||||
"ERROR: Iteration was not successful");
|
"ERROR: Iteration was not successful");
|
||||||
return NX_ERROR;
|
return NX_ERROR;
|
||||||
@ -1792,33 +1899,42 @@
|
|||||||
pNexusFile5 pFile;
|
pNexusFile5 pFile;
|
||||||
char *iname = NULL;
|
char *iname = NULL;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
int iRet;
|
herr_t iRet;
|
||||||
|
|
||||||
pFile = NXI5assert (fid);
|
pFile = NXI5assert (fid);
|
||||||
idx=0;
|
idx=0;
|
||||||
|
*iN = idx;
|
||||||
if (pFile->iCurrentD == 0 && pFile->iCurrentG == 0) {
|
if (pFile->iCurrentD == 0 && pFile->iCurrentG == 0) {
|
||||||
/*
|
/*
|
||||||
global attribute
|
global attribute
|
||||||
*/
|
*/
|
||||||
pFile->iVID=H5Gopen(pFile->iFID,"/");
|
pFile->iVID=H5Gopen(pFile->iFID,"/");
|
||||||
iRet = H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
|
iRet = H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
|
||||||
iRet = 1;
|
if (iRet < 0) {
|
||||||
while (iRet != 0) {
|
NXIReportError (NXpData, "iterating ERROR!");
|
||||||
iRet = H5Aiterate(pFile->iVID,&idx,attr_info,&iname);
|
return NX_ERROR;
|
||||||
}
|
}
|
||||||
|
idx=H5Aget_num_attrs(pFile->iVID);
|
||||||
|
|
||||||
if (idx > 0) {
|
if (idx > 0) {
|
||||||
*iN = idx;
|
*iN = idx;
|
||||||
} else {
|
} else {
|
||||||
*iN = 1;
|
*iN = 1;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if (iname != NULL) {
|
if (iname != NULL) {
|
||||||
free(iname);
|
free(iname);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return NX_OK;
|
return NX_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (pFile->iCurrentD>0) {
|
||||||
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
|
iRet=H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
|
||||||
|
} else {
|
||||||
|
iRet=H5Aiterate(pFile->iCurrentG,&idx,attr_info,&iname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (iRet<0) {
|
if (iRet<0) {
|
||||||
NXIReportError (NXpData, "Attribute number cannot be fixed!");
|
NXIReportError (NXpData, "Attribute number cannot be fixed!");
|
||||||
@ -1828,83 +1944,16 @@
|
|||||||
*iN=idx;
|
*iN=idx;
|
||||||
return NX_OK;
|
return NX_OK;
|
||||||
}
|
}
|
||||||
iRet = 1;
|
idx=H5Aget_num_attrs(pFile->iCurrentD);
|
||||||
while (iRet != 0) {
|
|
||||||
iRet = H5Aiterate(pFile->iCurrentD,&idx,attr_info,&iname);
|
|
||||||
}
|
|
||||||
if (idx > 0) {
|
if (idx > 0) {
|
||||||
*iN = idx;
|
*iN = idx;
|
||||||
} else {
|
} else {
|
||||||
*iN = 1;
|
*iN = 1;
|
||||||
}
|
}
|
||||||
if (iname != NULL) {
|
|
||||||
free(iname);
|
|
||||||
}
|
|
||||||
return NX_OK;
|
return NX_OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
/* Operator function. */
|
|
||||||
|
|
||||||
herr_t group_info1(hid_t loc_id, const char *name, void *opdata)
|
|
||||||
{
|
|
||||||
NexusFile5 self;
|
|
||||||
H5G_stat_t statbuf;
|
|
||||||
self.iNX = *((int*)opdata);
|
|
||||||
H5Gget_objinfo(loc_id, name, 0, &statbuf);
|
|
||||||
|
|
||||||
switch (statbuf.type)
|
|
||||||
{
|
|
||||||
case H5G_GROUP:
|
|
||||||
self.iNX++;
|
|
||||||
*((int*)opdata)=self.iNX;
|
|
||||||
break;
|
|
||||||
case H5G_DATASET:
|
|
||||||
self.iNX++;
|
|
||||||
*((int*)opdata)=self.iNX;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
NXstatus CALLING_STYLE NX5getgroupinfo (NXhandle fid, int *iN, NXname pName, NXname pClass)
|
|
||||||
{
|
|
||||||
pNexusFile5 pFile;
|
|
||||||
hid_t atype,attr_id;
|
|
||||||
char data[64];
|
|
||||||
int iRet;
|
|
||||||
|
|
||||||
pFile = NXI5assert (fid);
|
|
||||||
/* check if there is a group open */
|
|
||||||
if (pFile->iCurrentG == 0) {
|
|
||||||
strcpy (pName, "root");
|
|
||||||
strcpy (pClass, "NXroot");
|
|
||||||
pFile->iNX=0;
|
|
||||||
iRet=H5Giterate(pFile->iFID,"/",0,group_info1,&pFile->iNX);
|
|
||||||
*iN=pFile->iNX;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
strcpy (pName,pFile->name_ref);
|
|
||||||
attr_id = H5Aopen_name(pFile->iCurrentG,"NX_class");
|
|
||||||
if (attr_id<0) {
|
|
||||||
strcpy(pClass,"non");
|
|
||||||
} else {
|
|
||||||
atype=H5Tcopy(H5T_C_S1);
|
|
||||||
H5Tset_size(atype,64);
|
|
||||||
H5Aread(attr_id, atype, data);
|
|
||||||
strcpy(pClass,data);
|
|
||||||
pFile->iNX=0;
|
|
||||||
iRet=H5Giterate(pFile->iFID,pFile->name_ref,0,group_info1, &pFile->iNX);
|
|
||||||
*iN=pFile->iNX;
|
|
||||||
H5Aclose(attr_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
2
status.c
2
status.c
@ -64,6 +64,7 @@
|
|||||||
"Halted",
|
"Halted",
|
||||||
"Dead",
|
"Dead",
|
||||||
"Waiting for User Input",
|
"Waiting for User Input",
|
||||||
|
"Counting/Driving",
|
||||||
NULL };
|
NULL };
|
||||||
|
|
||||||
static char *iText[] = {
|
static char *iText[] = {
|
||||||
@ -80,6 +81,7 @@
|
|||||||
"halt",
|
"halt",
|
||||||
"dead",
|
"dead",
|
||||||
"input",
|
"input",
|
||||||
|
"count/drive",
|
||||||
NULL };
|
NULL };
|
||||||
|
|
||||||
static pICallBack pCall = NULL;
|
static pICallBack pCall = NULL;
|
||||||
|
Reference in New Issue
Block a user