- Created a modified swithc motor which takes into account the new motor drivers
- Added the missing linux_def file into the repository - Fixed a bug relating to scattering sense in selector.c SKIPPED: psi/make_gen psi/psi.c psi/swmotor.h psi/swmotor2.c
This commit is contained in:
12
linux_def
Normal file
12
linux_def
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# general defines used within the PSI makefile hierarchy
|
||||||
|
#
|
||||||
|
# Mark Koennecke, July 2003
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#DFORTIFY= -DFORTIFY
|
||||||
|
#FORTIFYOBJ= fortify.o strdup.o
|
||||||
|
|
||||||
|
MFLAGS= -f makefile_linux
|
||||||
|
|
||||||
|
HDFROOT=/afs/.psi.ch/project/sinq/linux
|
49
selector.c
49
selector.c
@ -555,7 +555,8 @@ end:
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
pDrivInt = self->pTwoTheta->pDescriptor->GetInterface(self->pTwoTheta,DRIVEID);
|
pDrivInt = self->pTwoTheta->pDescriptor->GetInterface(self->pTwoTheta,
|
||||||
|
DRIVEID);
|
||||||
if(!pDrivInt->CheckLimits(self->pTwoTheta,sNeu.fTwoTheta,
|
if(!pDrivInt->CheckLimits(self->pTwoTheta,sNeu.fTwoTheta,
|
||||||
error,iErrLen))
|
error,iErrLen))
|
||||||
{
|
{
|
||||||
@ -594,7 +595,8 @@ end:
|
|||||||
pDrivInt->Halt(self->pTheta);
|
pDrivInt->Halt(self->pTheta);
|
||||||
}
|
}
|
||||||
|
|
||||||
pDrivInt = self->pTwoTheta->pDescriptor->GetInterface(self->pTwoTheta,DRIVEID);
|
pDrivInt = self->pTwoTheta->pDescriptor->GetInterface(self->pTwoTheta,
|
||||||
|
DRIVEID);
|
||||||
if(pDrivInt)
|
if(pDrivInt)
|
||||||
{
|
{
|
||||||
pDrivInt->Halt(self->pTwoTheta);
|
pDrivInt->Halt(self->pTwoTheta);
|
||||||
@ -602,7 +604,8 @@ end:
|
|||||||
|
|
||||||
if(self->pBend1)
|
if(self->pBend1)
|
||||||
{
|
{
|
||||||
pDrivInt = self->pBend1->pDescriptor->GetInterface(self->pBend1,DRIVEID);
|
pDrivInt = self->pBend1->pDescriptor->GetInterface(self->pBend1,
|
||||||
|
DRIVEID);
|
||||||
if(pDrivInt)
|
if(pDrivInt)
|
||||||
{
|
{
|
||||||
pDrivInt->Halt(self->pBend1);
|
pDrivInt->Halt(self->pBend1);
|
||||||
@ -610,7 +613,8 @@ end:
|
|||||||
}
|
}
|
||||||
if(self->pBend2)
|
if(self->pBend2)
|
||||||
{
|
{
|
||||||
pDrivInt = self->pBend2->pDescriptor->GetInterface(self->pBend2,DRIVEID);
|
pDrivInt = self->pBend2->pDescriptor->GetInterface(self->pBend2,
|
||||||
|
DRIVEID);
|
||||||
if(pDrivInt)
|
if(pDrivInt)
|
||||||
{
|
{
|
||||||
pDrivInt->Halt(self->pBend2);
|
pDrivInt->Halt(self->pBend2);
|
||||||
@ -646,14 +650,16 @@ end:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* start each motor in turn */
|
/* start each motor in turn */
|
||||||
iRet = StartDevice(GetExecutor(),self->pTheta->name, self->pTheta->pDescriptor,
|
iRet = StartDevice(GetExecutor(),self->pTheta->name,
|
||||||
|
self->pTheta->pDescriptor,
|
||||||
self->pTheta,
|
self->pTheta,
|
||||||
pCon,sNeu.fTheta);
|
pCon,sNeu.fTheta);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
iRet = StartDevice(GetExecutor(),self->pTwoTheta->name, self->pTwoTheta->pDescriptor,
|
iRet = StartDevice(GetExecutor(),self->pTwoTheta->name,
|
||||||
|
self->pTwoTheta->pDescriptor,
|
||||||
self->pTwoTheta,
|
self->pTwoTheta,
|
||||||
pCon,sNeu.fTwoTheta);
|
pCon,sNeu.fTwoTheta);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
@ -665,7 +671,8 @@ end:
|
|||||||
/* bending motors */
|
/* bending motors */
|
||||||
if(self->pBend1)
|
if(self->pBend1)
|
||||||
{
|
{
|
||||||
iRet = StartDevice(GetExecutor(),self->pBend1->name, self->pBend1->pDescriptor,
|
iRet = StartDevice(GetExecutor(),self->pBend1->name,
|
||||||
|
self->pBend1->pDescriptor,
|
||||||
self->pBend1,
|
self->pBend1,
|
||||||
pCon,sNeu.fVert);
|
pCon,sNeu.fVert);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
@ -676,7 +683,8 @@ end:
|
|||||||
}
|
}
|
||||||
if(self->pBend2)
|
if(self->pBend2)
|
||||||
{
|
{
|
||||||
iRet = StartDevice(GetExecutor(),self->pBend2->name, self->pBend2->pDescriptor,
|
iRet = StartDevice(GetExecutor(),self->pBend2->name,
|
||||||
|
self->pBend2->pDescriptor,
|
||||||
self->pBend2,
|
self->pBend2,
|
||||||
pCon,sNeu.fHor);
|
pCon,sNeu.fHor);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
@ -684,7 +692,7 @@ end:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return OKOK;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
int MonoCheck(pSicsSelector self, SConnection *pCon)
|
int MonoCheck(pSicsSelector self, SConnection *pCon)
|
||||||
@ -703,7 +711,8 @@ end:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pDrivInt = self->pTwoTheta->pDescriptor->GetInterface(self->pTwoTheta,DRIVEID);
|
pDrivInt = self->pTwoTheta->pDescriptor->GetInterface(self->pTwoTheta,
|
||||||
|
DRIVEID);
|
||||||
if(pDrivInt)
|
if(pDrivInt)
|
||||||
{
|
{
|
||||||
iRet = pDrivInt->CheckStatus(self->pTwoTheta,pCon);
|
iRet = pDrivInt->CheckStatus(self->pTwoTheta,pCon);
|
||||||
@ -715,7 +724,8 @@ end:
|
|||||||
|
|
||||||
if(self->pBend1)
|
if(self->pBend1)
|
||||||
{
|
{
|
||||||
pDrivInt = self->pBend1->pDescriptor->GetInterface(self->pBend1,DRIVEID);
|
pDrivInt = self->pBend1->pDescriptor->GetInterface(self->pBend1,
|
||||||
|
DRIVEID);
|
||||||
if(pDrivInt)
|
if(pDrivInt)
|
||||||
{
|
{
|
||||||
iRet = pDrivInt->CheckStatus(self->pBend1,pCon);
|
iRet = pDrivInt->CheckStatus(self->pBend1,pCon);
|
||||||
@ -728,7 +738,8 @@ end:
|
|||||||
|
|
||||||
if(self->pBend2)
|
if(self->pBend2)
|
||||||
{
|
{
|
||||||
pDrivInt = self->pBend2->pDescriptor->GetInterface(self->pBend2,DRIVEID);
|
pDrivInt = self->pBend2->pDescriptor->GetInterface(self->pBend2,
|
||||||
|
DRIVEID);
|
||||||
if(pDrivInt)
|
if(pDrivInt)
|
||||||
{
|
{
|
||||||
iRet = pDrivInt->CheckStatus(self->pBend2,pCon);
|
iRet = pDrivInt->CheckStatus(self->pBend2,pCon);
|
||||||
@ -764,7 +775,8 @@ end:
|
|||||||
iRet = MotorGetSoftPosition(self->pTwoTheta,pCon,&fTwoTheta);
|
iRet = MotorGetSoftPosition(self->pTwoTheta,pCon,&fTwoTheta);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot read TwoTheta motor for monochromator %s\n",
|
sprintf(pBueffel,
|
||||||
|
"ERROR: cannot read TwoTheta motor for monochromator %s\n",
|
||||||
self->name);
|
self->name);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0.;
|
return 0.;
|
||||||
@ -784,7 +796,7 @@ end:
|
|||||||
dTheta =(double)fTheta;
|
dTheta =(double)fTheta;
|
||||||
dTheta = dTheta *(1.0/RD);
|
dTheta = dTheta *(1.0/RD);
|
||||||
fVal = 2.0 * (double)ObVal(self->pParams,LATD);
|
fVal = 2.0 * (double)ObVal(self->pParams,LATD);
|
||||||
fVal = fVal * sin(dTheta);
|
fVal = fVal * sin(dTheta) * ObVal(self->pParams,SS);
|
||||||
return fVal;
|
return fVal;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@ -805,7 +817,8 @@ end:
|
|||||||
iRet = MotorGetSoftPosition(self->pTwoTheta,pCon,f2TH);
|
iRet = MotorGetSoftPosition(self->pTwoTheta,pCon,f2TH);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot read TwoTheta motor for monochromator %s\n",
|
sprintf(pBueffel,
|
||||||
|
"ERROR: cannot read TwoTheta motor for monochromator %s\n",
|
||||||
self->name);
|
self->name);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0.;
|
return 0.;
|
||||||
@ -816,7 +829,8 @@ end:
|
|||||||
iRet = MotorGetSoftPosition(self->pBend1,pCon,fB1);
|
iRet = MotorGetSoftPosition(self->pBend1,pCon,fB1);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot read vertical bender motor for monochromator %s\n",
|
sprintf(pBueffel,
|
||||||
|
"ERROR: cannot read vertical bender motor for monochromator %s\n",
|
||||||
self->name);
|
self->name);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0.;
|
return 0.;
|
||||||
@ -827,7 +841,8 @@ end:
|
|||||||
iRet = MotorGetSoftPosition(self->pBend2,pCon,fB2);
|
iRet = MotorGetSoftPosition(self->pBend2,pCon,fB2);
|
||||||
if(!iRet)
|
if(!iRet)
|
||||||
{
|
{
|
||||||
sprintf(pBueffel,"ERROR: cannot read horizontal bender motor for monochromator %s\n",
|
sprintf(pBueffel,
|
||||||
|
"ERROR: cannot read horizontal bender motor for monochromator %s\n",
|
||||||
self->name);
|
self->name);
|
||||||
SCWrite(pCon,pBueffel,eError);
|
SCWrite(pCon,pBueffel,eError);
|
||||||
return 0.;
|
return 0.;
|
||||||
|
Reference in New Issue
Block a user