Cleaned up ANSTO code to merge with sinqdev.sics
This is our new RELEASE-4_0 branch which was taken from ansto/93d9a7c Conflicts: .gitignore SICSmain.c asynnet.c confvirtualmot.c counter.c devexec.c drive.c event.h exebuf.c exeman.c histmem.c interface.h motor.c motorlist.c motorsec.c multicounter.c napi.c napi.h napi4.c network.c nwatch.c nxscript.c nxxml.c nxxml.h ofac.c reflist.c scan.c sicshipadaba.c sicsobj.c site_ansto/docs/Copyright.txt site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl statusfile.c tasdrive.c tasub.c tasub.h tasublib.c tasublib.h
This commit is contained in:
25
hmdata.c
25
hmdata.c
@@ -58,7 +58,10 @@ void clearHMData(pHMdata self)
|
||||
if (self->tofMode) {
|
||||
size *= getNoOfTimebins(self);
|
||||
}
|
||||
memset(self->localBuffer, 0, size * sizeof(HistInt));
|
||||
if(self->localBuffer != NULL){
|
||||
memset(self->localBuffer, 0, size * sizeof(HistInt));
|
||||
}
|
||||
self->nextUpdate = time(NULL) + self->updateIntervall;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
@@ -145,18 +148,10 @@ int configureHMdata(pHMdata self, pStringDict pOpt, SConnection * pCon)
|
||||
self->localBuffer = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
note: remove update request in histmem.c
|
||||
*/
|
||||
if (self->updateIntervall > 0) {
|
||||
/*
|
||||
we do buffer
|
||||
*/
|
||||
status = resizeBuffer(self);
|
||||
if (!status) {
|
||||
SCWrite(pCon, "ERROR: failed to resize buffer", eError);
|
||||
return 0;
|
||||
}
|
||||
status = resizeBuffer(self);
|
||||
if (!status) {
|
||||
SCWrite(pCon, "ERROR: failed to resize buffer", eError);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -313,7 +308,7 @@ static int updateHMbuffer(pHistMem hist, int bank, SConnection * pCon)
|
||||
}
|
||||
if (status == OKOK) {
|
||||
return 1;
|
||||
} else {
|
||||
} else {
|
||||
return HWFault;
|
||||
}
|
||||
}
|
||||
@@ -541,7 +536,7 @@ static pNXDS hmDataToNXDataset(pHMdata self)
|
||||
if (isInTOFMode(self)) {
|
||||
result->rank++;
|
||||
}
|
||||
result->dim = malloc(self->rank * sizeof(int));
|
||||
result->dim = malloc(self->rank * sizeof(int64_t));
|
||||
if (result->dim == NULL) {
|
||||
free(result);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user