- 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:
cvs
2003-05-05 07:49:26 +00:00
parent 4ca2fcff60
commit 4ebf207325
25 changed files with 271 additions and 102 deletions

13
frame.c
View File

@@ -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);