- Improvements to the chooper driver for the SANS2 chopper
- Fixes to the new counter and motor drivers - Updated Linux makefiles to linux_def SKIPPED: psi/dornier2.c psi/el734hp.c psi/el737hpdriv.c psi/makefile_linux psi/psi.c psi/hardsup/makefile_linux psi/tecs/makefile_linux
This commit is contained in:
22
fitcenter.c
22
fitcenter.c
@ -102,17 +102,21 @@
|
|||||||
GetScanVarName(self->pScan,0,self->pName,131);
|
GetScanVarName(self->pScan,0,self->pName,131);
|
||||||
|
|
||||||
/* correct fAxis for softzero points and sign
|
/* correct fAxis for softzero points and sign
|
||||||
when the scan variable is a motor */
|
when the scan variable is a motor
|
||||||
pMot = FindMotor(pServ->pSics,self->pName);
|
*/
|
||||||
if(pMot)
|
if(!isScanVarSoft(self->pScan))
|
||||||
{
|
{
|
||||||
i = MotorGetPar(pMot,"softzero",&fZero);
|
pMot = FindMotor(pServ->pSics,self->pName);
|
||||||
i = MotorGetPar(pMot,"sign",&fSign);
|
if(pMot)
|
||||||
assert(i);
|
|
||||||
for(i = 0; i < self->iNP; i++)
|
|
||||||
{
|
{
|
||||||
self->fAxis[i] -= fZero;
|
i = MotorGetPar(pMot,"softzero",&fZero);
|
||||||
self->fAxis[i] *= fSign;
|
i = MotorGetPar(pMot,"sign",&fSign);
|
||||||
|
assert(i);
|
||||||
|
for(i = 0; i < self->iNP; i++)
|
||||||
|
{
|
||||||
|
self->fAxis[i] -= fZero;
|
||||||
|
self->fAxis[i] *= fSign;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,23 +5,18 @@
|
|||||||
# Mark Koennecke 1996-2001
|
# Mark Koennecke 1996-2001
|
||||||
# Markus Zolliker, March 2003
|
# Markus Zolliker, March 2003
|
||||||
#==========================================================================
|
#==========================================================================
|
||||||
# the following lines only for fortified version
|
|
||||||
#DFORTIFY=-DFORTIFY
|
|
||||||
#FORTIFYOBJ=strdup.o fortify.o
|
|
||||||
#==========================================================================
|
|
||||||
# assign if the National Instrument GPIB driver is available
|
# assign if the National Instrument GPIB driver is available
|
||||||
#NI= -DHAVENI
|
#NI= -DHAVENI
|
||||||
#NIOBJ= nigpib.o
|
#NIOBJ= nigpib.o
|
||||||
#NILIB=-lgpibenet
|
#NILIB=-lgpibenet
|
||||||
#----------------select proper Makefile
|
|
||||||
MFLAGS= -f makefile_linux
|
include linux_def
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -Ipsi/hardsup -I. \
|
CFLAGS = -I$(HDFROOT)/include -DHDF4 -DHDF5 $(NI) -Ipsi/hardsup -I. \
|
||||||
-fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY)
|
-fwritable-strings -DCYGNUS -DNONINTF -g $(DFORTIFY)
|
||||||
|
|
||||||
BINTARGET = bin
|
BINTARGET = bin
|
||||||
HDFROOT=/afs/psi.ch/project/sinq/linux
|
|
||||||
EXTRA=nintf.o
|
EXTRA=nintf.o
|
||||||
SUBLIBS = psi/libpsi.a psi/hardsup/libhlib.a matrix/libmatrix.a \
|
SUBLIBS = psi/libpsi.a psi/hardsup/libhlib.a matrix/libmatrix.a \
|
||||||
psi/tecs/libtecsl.a
|
psi/tecs/libtecsl.a
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
# Mark Koennecke, November 1996
|
# Mark Koennecke, November 1996
|
||||||
# Markus Zolliker, March 2003
|
# Markus Zolliker, March 2003
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# the following line only for fortified version
|
|
||||||
DFORTIFY=-DFORTIFY
|
include ../linux_def
|
||||||
#==========================================================================
|
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -g $(DFORTIFY)
|
CFLAGS = -g $(DFORTIFY)
|
||||||
|
1
motor.c
1
motor.c
@ -213,6 +213,7 @@ static int evaluateStatus(pMotor self, SConnection *pCon)
|
|||||||
MotorGetSoftPosition(self,pCon,&sCall.fVal);
|
MotorGetSoftPosition(self,pCon,&sCall.fVal);
|
||||||
sCall.pName = self->name;
|
sCall.pName = self->name;
|
||||||
InvokeCallBack(self->pCall, MOTEND, &sCall);
|
InvokeCallBack(self->pCall, MOTEND, &sCall);
|
||||||
|
|
||||||
MotorGetHardPosition(self,pCon,&fHard);
|
MotorGetHardPosition(self,pCon,&fHard);
|
||||||
self->fPosition = fHard;
|
self->fPosition = fHard;
|
||||||
if(absf(fHard - self->fTarget) > ObVal(self->ParArray,PREC))
|
if(absf(fHard - self->fTarget) > ObVal(self->ParArray,PREC))
|
||||||
|
6
scan.c
6
scan.c
@ -557,6 +557,7 @@ extern void SNXFormatTime(char *pBuffer, int iLen);
|
|||||||
self->ScanDrive = ScanDrive;
|
self->ScanDrive = ScanDrive;
|
||||||
self->ScanCount = ScanCount;
|
self->ScanCount = ScanCount;
|
||||||
self->CollectScanData = CollectScanData;
|
self->CollectScanData = CollectScanData;
|
||||||
|
self->posSoft = 0;
|
||||||
strcpy(self->ext,".dat");
|
strcpy(self->ext,".dat");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -1715,6 +1716,10 @@ int StoreScanCounts(pScanData self, char *data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*---------------------------------------------------------------------*/
|
||||||
|
int isScanVarSoft(pScanData self){
|
||||||
|
return self->posSoft;
|
||||||
|
}
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
int GetScanVarStep(pScanData self, int iWhich, float *fStep)
|
int GetScanVarStep(pScanData self, int iWhich, float *fStep)
|
||||||
{
|
{
|
||||||
@ -2330,6 +2335,7 @@ int StoreScanCounts(pScanData self, char *data)
|
|||||||
{
|
{
|
||||||
ResetScanFunctions(self);
|
ResetScanFunctions(self);
|
||||||
self->CollectScanData = CollectScanDataJochen;
|
self->CollectScanData = CollectScanDataJochen;
|
||||||
|
self->posSoft = 1;
|
||||||
SCSendOK(pCon);
|
SCSendOK(pCon);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
5
scan.h
5
scan.h
@ -37,6 +37,7 @@
|
|||||||
char *pName, int iLength);
|
char *pName, int iLength);
|
||||||
int GetScanVarStep(pScanData self, int iWhich,
|
int GetScanVarStep(pScanData self, int iWhich,
|
||||||
float *fStep);
|
float *fStep);
|
||||||
|
int isScanVarSoft(pScanData self);
|
||||||
int GetScanMonitor(pScanData self, int iWhich,
|
int GetScanMonitor(pScanData self, int iWhich,
|
||||||
long *lData, int iDataLen);
|
long *lData, int iDataLen);
|
||||||
int GetScanNP(pScanData self);
|
int GetScanNP(pScanData self);
|
||||||
@ -78,7 +79,3 @@
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3
scan.i
3
scan.i
@ -51,6 +51,7 @@
|
|||||||
(pScanData self,
|
(pScanData self,
|
||||||
int iP);
|
int iP);
|
||||||
long lPos;
|
long lPos;
|
||||||
|
int posSoft;
|
||||||
void *pCounterData;
|
void *pCounterData;
|
||||||
char pCounterName[512];
|
char pCounterName[512];
|
||||||
int iChannel;
|
int iChannel;
|
||||||
@ -62,5 +63,3 @@
|
|||||||
void *pSpecial;
|
void *pSpecial;
|
||||||
} ScanData;
|
} ScanData;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
4
scan.tex
4
scan.tex
@ -79,6 +79,7 @@ $\langle$scandata {\footnotesize ?}$\rangle\equiv$
|
|||||||
\mbox{}\verb@ (pScanData self,@\\
|
\mbox{}\verb@ (pScanData self,@\\
|
||||||
\mbox{}\verb@ int iP);@\\
|
\mbox{}\verb@ int iP);@\\
|
||||||
\mbox{}\verb@ long lPos;@\\
|
\mbox{}\verb@ long lPos;@\\
|
||||||
|
\mbox{}\verb@ int posSoft;@\\
|
||||||
\mbox{}\verb@ void *pCounterData;@\\
|
\mbox{}\verb@ void *pCounterData;@\\
|
||||||
\mbox{}\verb@ char pCounterName[512];@\\
|
\mbox{}\verb@ char pCounterName[512];@\\
|
||||||
\mbox{}\verb@ int iChannel;@\\
|
\mbox{}\verb@ int iChannel;@\\
|
||||||
@ -158,6 +159,8 @@ This function together with ScanDrive and the data writing functions allow for
|
|||||||
\item[CollectScanData] reads all the scan data into the scan's data
|
\item[CollectScanData] reads all the scan data into the scan's data
|
||||||
structures after any scan point. Overload this if a different storage
|
structures after any scan point. Overload this if a different storage
|
||||||
scheme is required especiallay for polarising scans.
|
scheme is required especiallay for polarising scans.
|
||||||
|
\item[posSoft] is a flag which is true if scan variable are stored with
|
||||||
|
soft position, i.e. with zeropoints applied.
|
||||||
\item[pCounterData] is a pointer to a counter structure. This defines the
|
\item[pCounterData] is a pointer to a counter structure. This defines the
|
||||||
counter to use and is initialized at creation of the scan data structure.
|
counter to use and is initialized at creation of the scan data structure.
|
||||||
\item[pCountername] is the name of the counter used.
|
\item[pCountername] is the name of the counter used.
|
||||||
@ -210,6 +213,7 @@ $\langle$scaninter {\footnotesize ?}$\rangle\equiv$
|
|||||||
\mbox{}\verb@ char *pName, int iLength);@\\
|
\mbox{}\verb@ char *pName, int iLength);@\\
|
||||||
\mbox{}\verb@ int GetScanVarStep(pScanData self, int iWhich, @\\
|
\mbox{}\verb@ int GetScanVarStep(pScanData self, int iWhich, @\\
|
||||||
\mbox{}\verb@ float *fStep);@\\
|
\mbox{}\verb@ float *fStep);@\\
|
||||||
|
\mbox{}\verb@ int isScanVarSoft(pScanData self);@\\
|
||||||
\mbox{}\verb@ int GetScanMonitor(pScanData self, int iWhich, @\\
|
\mbox{}\verb@ int GetScanMonitor(pScanData self, int iWhich, @\\
|
||||||
\mbox{}\verb@ long *lData, int iDataLen);@\\
|
\mbox{}\verb@ long *lData, int iDataLen);@\\
|
||||||
\mbox{}\verb@ int GetScanNP(pScanData self);@\\
|
\mbox{}\verb@ int GetScanNP(pScanData self);@\\
|
||||||
|
4
scan.w
4
scan.w
@ -74,6 +74,7 @@ steps in scan processing which is already partly implemented.
|
|||||||
(pScanData self,
|
(pScanData self,
|
||||||
int iP);
|
int iP);
|
||||||
long lPos;
|
long lPos;
|
||||||
|
int posSoft;
|
||||||
void *pCounterData;
|
void *pCounterData;
|
||||||
char pCounterName[512];
|
char pCounterName[512];
|
||||||
int iChannel;
|
int iChannel;
|
||||||
@ -146,6 +147,8 @@ This function together with ScanDrive and the data writing functions allow for
|
|||||||
\item[CollectScanData] reads all the scan data into the scan's data
|
\item[CollectScanData] reads all the scan data into the scan's data
|
||||||
structures after any scan point. Overload this if a different storage
|
structures after any scan point. Overload this if a different storage
|
||||||
scheme is required especiallay for polarising scans.
|
scheme is required especiallay for polarising scans.
|
||||||
|
\item[posSoft] is a flag which is true if scan variable are stored with
|
||||||
|
soft position, i.e. with zeropoints applied.
|
||||||
\item[pCounterData] is a pointer to a counter structure. This defines the
|
\item[pCounterData] is a pointer to a counter structure. This defines the
|
||||||
counter to use and is initialized at creation of the scan data structure.
|
counter to use and is initialized at creation of the scan data structure.
|
||||||
\item[pCountername] is the name of the counter used.
|
\item[pCountername] is the name of the counter used.
|
||||||
@ -193,6 +196,7 @@ functions:
|
|||||||
char *pName, int iLength);
|
char *pName, int iLength);
|
||||||
int GetScanVarStep(pScanData self, int iWhich,
|
int GetScanVarStep(pScanData self, int iWhich,
|
||||||
float *fStep);
|
float *fStep);
|
||||||
|
int isScanVarSoft(pScanData self);
|
||||||
int GetScanMonitor(pScanData self, int iWhich,
|
int GetScanMonitor(pScanData self, int iWhich,
|
||||||
long *lData, int iDataLen);
|
long *lData, int iDataLen);
|
||||||
int GetScanNP(pScanData self);
|
int GetScanNP(pScanData self);
|
||||||
|
4
test.tcl
4
test.tcl
@ -18,12 +18,12 @@ set shome /data/koenneck/src
|
|||||||
|
|
||||||
#ServerOption RedirectFile $shome/sics/stdout
|
#ServerOption RedirectFile $shome/sics/stdout
|
||||||
|
|
||||||
ServerOption ReadTimeOut 100
|
ServerOption ReadTimeOut 10
|
||||||
# timeout when checking for commands. In the main loop SICS checks for
|
# timeout when checking for commands. In the main loop SICS checks for
|
||||||
# pending commands on each connection with the above timeout, has
|
# pending commands on each connection with the above timeout, has
|
||||||
# PERFORMANCE impact!
|
# PERFORMANCE impact!
|
||||||
|
|
||||||
ServerOption AcceptTimeOut 100
|
ServerOption AcceptTimeOut 10
|
||||||
# timeout when checking for connection req.
|
# timeout when checking for connection req.
|
||||||
# Similar to above, but for connections
|
# Similar to above, but for connections
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ static int UserCount(pScanData self, int iPoint)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* invoke command */
|
/* invoke command */
|
||||||
sprintf(pBueffel,"%s %d",self->pCommand, iPoint);
|
snprintf(pBueffel,511,"%s %d",self->pCommand, iPoint);
|
||||||
status = Tcl_GlobalEval(self->pSics->pTcl,pBueffel);
|
status = Tcl_GlobalEval(self->pSics->pTcl,pBueffel);
|
||||||
if(status != TCL_OK)
|
if(status != TCL_OK)
|
||||||
{
|
{
|
||||||
|
6
velo.c
6
velo.c
@ -194,7 +194,11 @@
|
|||||||
|
|
||||||
iRet = self->pDriv->GetStatus(self->pDriv,&iSig,&fVal);
|
iRet = self->pDriv->GetStatus(self->pDriv,&iSig,&fVal);
|
||||||
InvokeCallBack(self->pCall,iSig,&fVal);
|
InvokeCallBack(self->pCall,iSig,&fVal);
|
||||||
switch(iRet)
|
if(SCGetInterrupt(pCon) != eContinue)
|
||||||
|
{
|
||||||
|
return HWFault;
|
||||||
|
}
|
||||||
|
switch(iRet)
|
||||||
{
|
{
|
||||||
case VSACCEL:
|
case VSACCEL:
|
||||||
return HWBusy;
|
return HWBusy;
|
||||||
|
Reference in New Issue
Block a user