- TDC histogram memory driver sort of working
- New class for scripting datafiles - SANS-II almost complete initialization file
This commit is contained in:
31
tdchm.c
31
tdchm.c
@@ -73,7 +73,7 @@ static int downloadConfiguration(pTdc self){
|
||||
case HMY:
|
||||
function = 130;
|
||||
break;
|
||||
caseHMXY:
|
||||
case HMXY:
|
||||
function = 128;
|
||||
break;
|
||||
default:
|
||||
@@ -154,12 +154,6 @@ static int TDCConfigure(pHistDriver self, SConnection *pCon,
|
||||
|
||||
tdc->fillByte = 0;
|
||||
|
||||
status = downloadConfiguration(tdc);
|
||||
if(!status){
|
||||
tdc->errorCode = status;
|
||||
return 0;
|
||||
}
|
||||
|
||||
status = StringDictGet(pOpt,"ecb",pValue,79);
|
||||
assert(status);
|
||||
tdc->tdc = FindCommandData(pSics,pValue,"ECB");
|
||||
@@ -168,6 +162,13 @@ static int TDCConfigure(pHistDriver self, SConnection *pCon,
|
||||
return 0;
|
||||
}
|
||||
|
||||
status = downloadConfiguration(tdc);
|
||||
if(!status){
|
||||
tdc->errorCode = status;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
self->iReconfig = 0;
|
||||
|
||||
return 1;
|
||||
@@ -265,13 +266,21 @@ static int TDCCountStatus(pHistDriver self, SConnection *pCon){
|
||||
assert(tdc);
|
||||
|
||||
if(tdc->counter != NULL){
|
||||
return tdc->counter->pDriv->GetStatus(tdc->counter->pDriv,&fControl);
|
||||
status = tdc->counter->pDriv->GetStatus(tdc->counter->pDriv,&fControl);
|
||||
}
|
||||
/*
|
||||
The TDC does not seem to have a means to figure if it is counting or not
|
||||
or to do some sort of progress report.
|
||||
or to do some sort of progress report. So it has to have an associated
|
||||
counter in order to stop it at the end.
|
||||
*/
|
||||
return HWIdle;
|
||||
if(status != HWBusy){
|
||||
status = disableTdc(tdc);
|
||||
if(status != 1){
|
||||
tdc->errorCode = COMMERROR;
|
||||
return HWFault;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
/*=====================================================================*/
|
||||
static int TDCGetError(pHistDriver self, int *iCode, char *perror,
|
||||
@@ -472,7 +481,7 @@ static int TDCGetHistogram(pHistDriver self, SConnection *pCon,
|
||||
tdc = (pTdc)self->pPriv;
|
||||
assert(tdc);
|
||||
|
||||
if(length >= MAXTDCCHANNELS){
|
||||
if(length > MAXTDCCHANNELS){
|
||||
tdc->errorCode = MAXEXCEEDED;
|
||||
return HWFault;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user