- A few fixes to the hsitogram memory codes
- Many fixes for the triple axis code
This commit is contained in:
40
sinqhmdriv.c
40
sinqhmdriv.c
@@ -139,6 +139,7 @@
|
||||
int iInit = 0, i, iRet;
|
||||
int xOff, xFac, yOff, yFac;
|
||||
int iPort, iLength;
|
||||
int extraDetectors, noDet;
|
||||
|
||||
assert(self);
|
||||
assert(self->pPriv);
|
||||
@@ -208,6 +209,20 @@
|
||||
}
|
||||
pInternal->iBinWidth = (int)fVal;
|
||||
|
||||
/*
|
||||
extra detectors
|
||||
*/
|
||||
iRet = StringDictGet(pOpt,"extradetector",pValue,79);
|
||||
if(iRet)
|
||||
{
|
||||
extraDetectors = atoi(pValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
extraDetectors = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* check BinWidth */
|
||||
if( (pInternal->iBinWidth != 1) && (pInternal->iBinWidth != 2)
|
||||
@@ -338,28 +353,20 @@ pCon);
|
||||
iMode = SQHM__HM_DIG;
|
||||
break;
|
||||
case eHTOF:
|
||||
case eSANSTOF:
|
||||
iMode = SQHM__TOF;
|
||||
/* recalculate some parameters */
|
||||
iLength = 1;
|
||||
noDet = 1;
|
||||
for(i = 0; i < self->data->rank; i++)
|
||||
{
|
||||
iLength *= self->data->iDim[i];
|
||||
noDet *= self->data->iDim[i];
|
||||
}
|
||||
iLength *= self->data->nTimeChan;
|
||||
SINQHMDefineBank(pInternal->pMaster,0,0,self->data->iDim[0],
|
||||
noDet += extraDetectors;
|
||||
iLength = noDet*self->data->nTimeChan;
|
||||
SINQHMDefineBank(pInternal->pMaster,0,0,noDet,
|
||||
self->data->timeBinning,
|
||||
self->data->nTimeChan);
|
||||
break;
|
||||
case eSANSTOF:
|
||||
iMode = SQHM__TOF;
|
||||
iLength = self->data->iDim[0]*self->data->iDim[1];
|
||||
iLength *= self->data->nTimeChan;
|
||||
SINQHMDefineBank(pInternal->pMaster,0,0,
|
||||
(self->data->iDim[0]*self->data->iDim[1])
|
||||
+ 3,
|
||||
self->data->timeBinning,
|
||||
self->data->nTimeChan);
|
||||
break;
|
||||
case eHStrobo:
|
||||
iMode = SQHM__HM_PSD | SQHM__STROBO;
|
||||
break;
|
||||
@@ -396,7 +403,8 @@ pCon);
|
||||
status = SINQHMConfigure(pInternal->pMaster,
|
||||
iMode,
|
||||
self->data->rank,
|
||||
getHMDataLength(self->data),
|
||||
getHMDataLength(self->data) +
|
||||
extraDetectors*self->data->nTimeChan ,
|
||||
pInternal->iBinWidth,
|
||||
0,0);
|
||||
}
|
||||
@@ -507,7 +515,7 @@ pCon);
|
||||
status = SINQHMZero(pInternal->pMaster,-1,-1,-1);
|
||||
}else{
|
||||
status = SINQHMZero(pInternal->pMaster,-1,0,
|
||||
self->data->rank*getHMDataLength(self->data));
|
||||
getHMDataLength(self->data));
|
||||
}
|
||||
/*
|
||||
status = SINQHMZero(pInternal->pMaster,-1,-1,-1);
|
||||
|
||||
Reference in New Issue
Block a user