- Fixed bug with ECB not stopping when no beam
- Fixed synchronisation issues - Fixed hsitogram memory writing from nxscript - Started module for writing SICS interfaces in Tcl - Fixed a bug in scan, which allowed to corrupt files - Fixed memory problems in napi5
This commit is contained in:
37
nxscript.c
37
nxscript.c
@@ -286,7 +286,6 @@ static void putHistogramMemory(SConnection *pCon, SicsInterp *pSics,
|
||||
}
|
||||
timeBin = GetHistTimeBin(mem,&timeLength);
|
||||
if(timeLength > 2){
|
||||
length *= timeLength;
|
||||
sprintf(dummy,"%d",timeLength);
|
||||
status = NXDupdate(self->dictHandle,"timedim",dummy);
|
||||
if(status == 0) {
|
||||
@@ -315,30 +314,36 @@ static void putHistogramMemory(SConnection *pCon, SicsInterp *pSics,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
now get some memory
|
||||
*/
|
||||
iData = (HistInt *)malloc(length*sizeof(HistInt));
|
||||
if(!iData){
|
||||
SCWrite(pCon,"ERROR: out of memory for reading histogram memory",
|
||||
eError);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
read HM
|
||||
*/
|
||||
if(subset){
|
||||
status = GetHistogramDirect(mem,pCon,0,start,length,iData,
|
||||
iData = (HistInt *)malloc(length*sizeof(HistInt));
|
||||
if(!iData){
|
||||
SCWrite(pCon,"ERROR: out of memory for reading histogram memory",
|
||||
eError);
|
||||
return;
|
||||
}
|
||||
memset(iData,0,length*sizeof(HistInt));
|
||||
status = GetHistogramDirect(mem,pCon,0,start,start+length,iData,
|
||||
length*sizeof(HistInt));
|
||||
}else{
|
||||
/*
|
||||
status = GetHistogram(mem,pCon,0,start,length,iData,
|
||||
length*sizeof(HistInt));
|
||||
*/
|
||||
iData = GetHistogramPointer(mem,pCon);
|
||||
if(iData == NULL){
|
||||
status = 0;
|
||||
} else {
|
||||
status = 1;
|
||||
}
|
||||
}
|
||||
if(!status){
|
||||
SCWrite(pCon,"ERROR: failed to read histogram memory",eError);
|
||||
free(iData);
|
||||
if(subset){
|
||||
free(iData);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -351,7 +356,9 @@ static void putHistogramMemory(SConnection *pCon, SicsInterp *pSics,
|
||||
SCWrite(pCon,buffer,eError);
|
||||
}
|
||||
|
||||
free(iData);
|
||||
if(subset){
|
||||
free(iData);
|
||||
}
|
||||
SCSendOK(pCon);
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user