- Initial commit of a UB calculation setup for four circle
diffractometers
This commit is contained in:
47
scan.c
47
scan.c
@ -42,37 +42,6 @@
|
||||
#include "lld.h"
|
||||
#include "stdscan.h"
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
static char *fixExtension(char *filename)
|
||||
{
|
||||
if(strstr(filename,".hdf") != NULL)
|
||||
{
|
||||
changeExtension(filename,"dat");
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
char *ScanMakeFileName(SicsInterp *pSics, SConnection *pCon)
|
||||
{
|
||||
pSicsVariable pPath = NULL, pPref = NULL, pEnd = NULL;
|
||||
char *pRes = NULL;
|
||||
int iLen, iNum, iYear;
|
||||
char pNumText[10];
|
||||
CommandList *pCom = NULL;
|
||||
|
||||
/*
|
||||
make a simulated filename if in simulation mode
|
||||
*/
|
||||
if(pServ->simMode)
|
||||
return strdup("sim001001901.sim");
|
||||
|
||||
pRes = makeFilename(pSics,pCon);
|
||||
if(pRes == NULL)
|
||||
{
|
||||
pRes = strdup("emergency.scn");
|
||||
}
|
||||
return fixExtension(pRes);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void DeleteCountEntry(void *pData)
|
||||
{
|
||||
@ -688,21 +657,7 @@ CountEntry CollectCounterData(pScanData self)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* allocate a new data file */
|
||||
pPtr = ScanMakeFileName(self->pSics,self->pCon);
|
||||
if(!pPtr)
|
||||
{
|
||||
SCWrite(self->pCon,
|
||||
"ERROR: cannot allocate new data filename, Scan aborted",
|
||||
eError);
|
||||
self->pCon = NULL;
|
||||
self->pSics = NULL;
|
||||
return 0;
|
||||
}
|
||||
sprintf(pBueffel,"Writing data file: %s ...",pPtr);
|
||||
SCWrite(self->pCon,pBueffel,eWarning);
|
||||
strcpy(self->pFile,pPtr);
|
||||
free(pPtr);
|
||||
|
||||
iRet = self->WriteHeader(self);
|
||||
if(!iRet)
|
||||
{
|
||||
|
Reference in New Issue
Block a user