- 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

View File

@@ -583,7 +583,7 @@
static int SendSingleTOF(pAmorStat self, SConnection *pCon)
{
HistInt *lData = NULL;
int i, i2, i3, iDim[MAXDIM], iIdx, iSum, status, length;
int i, i2, i3, iDim[MAXDIM], iIdx, iSum, status, length, nTime;
pSINQHM pHist;
SinqHMDriv *pTata;
int iMax = -999999;
@@ -593,11 +593,14 @@
/* get size of our problem */
GetHistDim(self->pHM,iDim,&i3);
assert(i3 == 3);
/* allocate some data */
timebin = GetHistTimeBin(self->pHM, &i3);
length = 1 + 2*i3;
timebin = GetHistTimeBin(self->pHM, &nTime);
if(nTime < 2) {
return 1;
}
length = 1 + 2*nTime;
iData = (HistInt *)malloc(length*sizeof(HistInt));
if(iData == NULL){
SCWrite(pCon,"ERROR: failed to allocate memory in SendSingleTOF",
@@ -607,14 +610,14 @@
memset(iData,0,length*sizeof(int));
/* first number is the length of each single histogram */
iData[0] = htonl(i3);
iData[0] = htonl(nTime);
if(isSINQHMDriv(self->pHM->pDriv))
{
iStart = iDim[0]*iDim[1]*iDim[2];
iStart = iDim[0]*iDim[1]*nTime;
GetHistogramDirect(self->pHM,pCon,0,iStart,
iStart + 2*iDim[2],&iData[1],2*iDim[2]*sizeof(HistInt));
iStart + 2*nTime,&iData[1],2*nTime*sizeof(HistInt));
for(i = 1; i < length; i++)
{
iData[i] = htonl(iData[i]);
@@ -635,10 +638,10 @@
send, with a little trick to do two histograms.
*/
SCWriteUUencoded(pCon,"SING1",iData,
(iDim[2]+1)*sizeof(int));
iData[iDim[2]] = htonl(iDim[2]);
SCWriteUUencoded(pCon,"SING2",&iData[iDim[2]],
(iDim[2]+1)*sizeof(int));
(nTime+1)*sizeof(int));
iData[nTime] = htonl(nTime);
SCWriteUUencoded(pCon,"SING2",&iData[nTime],
(nTime+1)*sizeof(int));
free(iData);
return 1;
}
@@ -651,13 +654,17 @@
{
int iDim[MAXDIM], i, i2, i3, *iSum = NULL, iLang, *iPtr;
HistInt *lData = NULL;
int iLimit, status;
int iLimit, status, nTime;
char pBueffel[132];
pSINQHM pHist;
SinqHMDriv *pTata;
const float *fTime;
/* get histogram dimensions */
GetHistDim(self->pHM,iDim,&i3);
fTime = GetHistTimeBin(self->pHM,&nTime);
iDim[i3] = nTime;
i3++;
assert(i3 == 3);
/* check limits */