- Many fixes to tas code
- fixes to amor writing and status code - edited ecbcounter to stop at no beam - updated documentation - fixed a bug in project code affecting SANS
This commit is contained in:
13
frame.c
13
frame.c
@@ -26,14 +26,17 @@
|
||||
/*======================================================================*/
|
||||
static int readHMFrame(SConnection *pCon, pHistMem pHM, int nFrame){
|
||||
HistInt *buffer = NULL;
|
||||
int iDim[MAXDIM], rank, length, status, i;
|
||||
int iDim[MAXDIM], rank, length, status, i, noTimeBins;
|
||||
pSINQHM pHist;
|
||||
SinqHMDriv *pTata;
|
||||
const float *timeBin;
|
||||
|
||||
/*
|
||||
find dimensions and allocate data
|
||||
*/
|
||||
GetHistDim(pHM,iDim,&rank);
|
||||
timeBin = GetHistTimeBin(pHM,&noTimeBins);
|
||||
|
||||
if(rank < 2){
|
||||
SCWrite(pCon,"ERROR: no PSD data present, cannot send frame",eError);
|
||||
return 0;
|
||||
@@ -52,7 +55,7 @@ static int readHMFrame(SConnection *pCon, pHistMem pHM, int nFrame){
|
||||
buffer[0] = htonl(iDim[0]);
|
||||
buffer[1] = htonl(iDim[1]);
|
||||
|
||||
if(isSINQHMDriv(pHM->pDriv) && rank == 3) {
|
||||
if(isSINQHMDriv(pHM->pDriv) && noTimeBins > 2) {
|
||||
/*
|
||||
read from HM. The 5 is PROJECT__FRAME in Sinqhm_def.h
|
||||
Again: be friendly: fix out of range frames
|
||||
@@ -60,12 +63,12 @@ static int readHMFrame(SConnection *pCon, pHistMem pHM, int nFrame){
|
||||
if(nFrame < 0){
|
||||
nFrame = 0;
|
||||
}
|
||||
if(nFrame >= iDim[2]){
|
||||
nFrame = iDim[2]-1;
|
||||
if(nFrame >= noTimeBins){
|
||||
nFrame = noTimeBins-1;
|
||||
}
|
||||
pTata = (SinqHMDriv *)pHM->pDriv->pPriv;
|
||||
pHist = (pSINQHM)pTata->pMaster;
|
||||
status = SINQHMProject(pHist, 5, 0, nFrame,
|
||||
status = SINQHMProject(pHist, 0x0005, 0, nFrame,
|
||||
0, iDim[1], buffer+2,length*sizeof(HistInt));
|
||||
if(status != 1){
|
||||
SCWrite(pCon,"ERROR: SINQHM refused to deliver frame",eError);
|
||||
|
||||
Reference in New Issue
Block a user