- Fixed a few problems with hklscan

- Added transfer of zipped data to conman.c, histogram memory software
  in order to support the TRICS status display.
- Upgraded TRICS data file writing.
- First installment of triple axis spectrometer support: initialization of
  data structures and an implementation of the MAD dr(ive) command.
This commit is contained in:
cvs
2000-11-21 08:16:46 +00:00
parent f9a31d2065
commit e83d3e6946
39 changed files with 5301 additions and 563 deletions

72
scan.c
View File

@ -441,6 +441,7 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
static int ScanDrive(pScanData self, int iPoint);
static int ScanCount(pScanData self, int iPoint);
static int CollectScanData(pScanData self, int iPoint);
static int PrepareScan(pScanData self);
/*--------------------------------------------------------------------------*/
pScanData CreateScanObject(char *pRecover, char *pHeader,pCounter pCount)
{
@ -493,6 +494,7 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
pNew->fPreset = 10.;
strcpy(pNew->pCounterName,pCount->name);
pNew->pCounterData = pCount;
pNew->PrepareScan = PrepareScan;
pNew->WriteHeader = WriteHeader;
pNew->WriteScanPoints = WriteScanPoints;
pNew->ScanDrive = ScanDrive;
@ -540,6 +542,7 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
{
assert(self);
self->PrepareScan = PrepareScan;
self->WriteHeader = WriteHeader;
self->WriteScanPoints = WriteScanPoints;
self->ScanDrive = ScanDrive;
@ -825,6 +828,60 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
return 1;
}
/*--------------------------------------------------------------------------*/
int NonCheckPrepare(pScanData self)
{
pVarEntry pVar = NULL;
void *pDings;
int i, iRet;
float fVal;
char pBueffel[512];
char pMessage[1024];
assert(self);
assert(self->iNP > 0);
assert(self->pCon);
/* allocate storage for scan variables */
for(i = 0; i < self->iScanVar; i++)
{
DynarGet(self->pScanVar,i,&pDings);
pVar = (pVarEntry)pDings;
if(pVar)
{
/* start value */
fVal = pVar->fStart;
/* allocate data space */
if(pVar->fData)
{
free(pVar->fData);
pVar->fData = NULL;
}
pVar->fData = (float *)malloc(self->iNP * sizeof(float));
if(!pVar->fData)
{
SCWrite(self->pCon,"ERROR: out of memory in scan, aborting",eError);
return 0;
}
memset(pVar->fData,0,self->iNP * sizeof(float));
}
else
{
SCWrite(self->pCon,
"WARNING: Internal error, no scan variable, I try to continue",
eWarning);
}
pVar = NULL;
} /* end for */
/* configure counter */
SetCounterMode((pCounter)self->pCounterData,self->iMode);
SetCounterPreset((pCounter)self->pCounterData, self->fPreset);
self->iCounts = 0;
return 1;
}
/*--------------------------------------------------------------------------*/
static int StartToDrive(pScanData self, int iPoint)
{
pVarEntry pVar = NULL;
@ -1129,6 +1186,7 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
/*-------- scan post processing */
self->CollectScanData(self,i);
InvokeCallBack(self->pCall,SCANPOINT,self);
self->WriteScanPoints(self,i);
if(self->pRecover)
{
@ -1178,7 +1236,14 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
self->fPreset = fPreset;
/* do some preprocessing */
iRet = PrepareScan(self);
if(self->PrepareScan != NULL)
{
iRet = self->PrepareScan(self);
}
else
{
iRet = 1;
}
if(!iRet)
{
self->pCon = NULL;
@ -2381,3 +2446,8 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
return 0;
}
}