- Fixed a couple of small things with the TAS code
- Fixed new AMOR settings module - Initial implementation of the new SICS hierarchical parameter database SKIPPED: psi/amorset.c psi/libpsi.a psi/sps.c
This commit is contained in:
38
tasdrive.c
38
tasdrive.c
@ -192,22 +192,24 @@ static int TASHalt(void *pData){
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
static void writeMotPos(SConnection *pCon, char *name,
|
||||
static void writeMotPos(SConnection *pCon, int silent, char *name,
|
||||
float val, float target){
|
||||
char pBueffel[132];
|
||||
|
||||
snprintf(pBueffel,131,"Driving %5s from %8.3f to %8.3f",
|
||||
name, val, target);
|
||||
SCWrite(pCon,pBueffel,eWarning);
|
||||
|
||||
if(silent != 1) {
|
||||
snprintf(pBueffel,131,"Driving %5s from %8.3f to %8.3f",
|
||||
name, val, target);
|
||||
SCWrite(pCon,pBueffel,eWarning);
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int startMotors(ptasMot self, tasAngles angles,
|
||||
SConnection *pCon, int driveQ, int driveTilt){
|
||||
float val;
|
||||
double curve;
|
||||
int status;
|
||||
int status, silent;
|
||||
|
||||
silent = self->math->silent;
|
||||
/*
|
||||
monochromator
|
||||
*/
|
||||
@ -220,7 +222,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"a1",val, angles.monochromator_two_theta/2.);
|
||||
writeMotPos(pCon,silent,"a1",val, angles.monochromator_two_theta/2.);
|
||||
|
||||
val = self->math->motors[A2]->pDrivInt->GetValue(self->math->motors[A2],pCon);
|
||||
if(ABS(val - angles.monochromator_two_theta) > MOTPREC){
|
||||
@ -231,7 +233,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"a2",val, angles.monochromator_two_theta);
|
||||
writeMotPos(pCon,silent,"a2",val, angles.monochromator_two_theta);
|
||||
|
||||
if(self->math->motors[MCV] != NULL){
|
||||
curve = maCalcVerticalCurvature(self->math->machine.monochromator,
|
||||
@ -245,7 +247,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"mcv",val, curve);
|
||||
writeMotPos(pCon,silent,"mcv",val, curve);
|
||||
}
|
||||
|
||||
if(self->math->motors[MCH] != NULL){
|
||||
@ -260,7 +262,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"mch",val, curve);
|
||||
writeMotPos(pCon,silent,"mch",val, curve);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -277,7 +279,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,self->math->motors[A5]->name,
|
||||
writeMotPos(pCon,silent,self->math->motors[A5]->name,
|
||||
val, angles.analyzer_two_theta/2.);
|
||||
|
||||
val = self->math->motors[A6]->pDrivInt->GetValue(self->math->motors[A6],pCon);
|
||||
@ -289,7 +291,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"a6",val, angles.analyzer_two_theta);
|
||||
writeMotPos(pCon,silent,"a6",val, angles.analyzer_two_theta);
|
||||
|
||||
if(self->math->motors[ACV] != NULL){
|
||||
curve = maCalcVerticalCurvature(self->math->machine.analyzer,
|
||||
@ -303,7 +305,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"acv",val, curve);
|
||||
writeMotPos(pCon,silent,"acv",val, curve);
|
||||
}
|
||||
if(self->math->motors[ACH] != NULL){
|
||||
curve = maCalcHorizontalCurvature(self->math->machine.analyzer,
|
||||
@ -319,7 +321,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
}
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"ach",val, curve);
|
||||
writeMotPos(pCon,silent,"ach",val, curve);
|
||||
}
|
||||
|
||||
if(driveQ == 0){
|
||||
@ -338,7 +340,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"a3",val, angles.a3);
|
||||
writeMotPos(pCon,silent,"a3",val, angles.a3);
|
||||
|
||||
val = self->math->motors[A4]->pDrivInt->GetValue(self->math->motors[A4],pCon);
|
||||
if(ABS(val - angles.sample_two_theta) > MOTPREC){
|
||||
@ -349,7 +351,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"a4",val, angles.sample_two_theta);
|
||||
writeMotPos(pCon,silent,"a4",val, angles.sample_two_theta);
|
||||
|
||||
if(driveTilt == 1){
|
||||
val = self->math->motors[SGL]->pDrivInt->GetValue(self->math->motors[SGL],pCon);
|
||||
@ -361,7 +363,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"sgl",val, angles.sgl);
|
||||
writeMotPos(pCon,silent,"sgl",val, angles.sgl);
|
||||
|
||||
val = self->math->motors[SGU]->pDrivInt->GetValue(self->math->motors[SGU],pCon);
|
||||
if(ABS(val - angles.sgu) > MOTPREC){
|
||||
@ -372,7 +374,7 @@ static int startMotors(ptasMot self, tasAngles angles,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
writeMotPos(pCon,"sgu",val, angles.sgu);
|
||||
writeMotPos(pCon,silent,"sgu",val, angles.sgu);
|
||||
}
|
||||
self->math->mustDrive = 0;
|
||||
return OKOK;
|
||||
|
Reference in New Issue
Block a user