- Fixed bugs in sinqhttp.c, most notatbly the unknown error on hm init
- Added first slit to amorset - Added untested code for the POLDI strees machine
This commit is contained in:
74
amorset.c
74
amorset.c
@ -29,11 +29,16 @@ static int readMotors(pamorSet self, SConnection *pCon){
|
||||
float val;
|
||||
|
||||
result = LLDcreate(sizeof(MotControl));
|
||||
status = addMotorToList(result,"d2t",.0);
|
||||
if(status != 1){
|
||||
SCWrite(pCon,"ERROR: configuration error: d2t not found", eError);
|
||||
return -1;
|
||||
}
|
||||
status = addMotorToList(result,"d1t",.0);
|
||||
if(status != 1){
|
||||
SCWrite(pCon,"ERROR: configuration error: d1t not found", eError);
|
||||
return -1;
|
||||
}
|
||||
status = addMotorToList(result,"d2t",.0);
|
||||
if(status != 1){
|
||||
SCWrite(pCon,"ERROR: configuration error: d2t not found", eError);
|
||||
return -1;
|
||||
}
|
||||
status = addMotorToList(result,"d3t",.0);
|
||||
if(status != 1){
|
||||
SCWrite(pCon,"ERROR: configuration error: d3t not found", eError);
|
||||
@ -91,21 +96,37 @@ static int calcAmorSettings(pamorSet self,SConnection *pCon){
|
||||
val = dist*Tand(-self->targetm2t) - self->dspar;
|
||||
addMotorToList(self->driveList,"dbs",val);
|
||||
}
|
||||
|
||||
/*
|
||||
* slit 1 is before the monochromator and does not need to be
|
||||
* driven when m2t changes. This is here to make sure that d1b is
|
||||
* in a feasible position.
|
||||
*/
|
||||
if(self->D1.activeFlag == 1){
|
||||
mot = getListMotorPosition(readList,"d1t");
|
||||
if(mot < -99999){
|
||||
SCWrite(pCon,"WARNING: skipping d1 because of bad read on d1t",
|
||||
eWarning);
|
||||
} else {
|
||||
val = - .5 * mot;
|
||||
addMotorToList(self->driveList,"d1b",val);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* slit 2
|
||||
*/
|
||||
if(self->D2.activeFlag == 1){
|
||||
dist = ABS(calcCompPosition(&self->D2) - calcCompPosition(&self->M));
|
||||
mot = getListMotorPosition(readList,"d2t");
|
||||
if(mot < -99999){
|
||||
SCWrite(pCon,"WARNING: skipping d2 because of bad read on d2t",
|
||||
eWarning);
|
||||
} else {
|
||||
val = dist*Tand(-self->targetm2t) - .5 * mot;
|
||||
addMotorToList(self->driveList,"d2b",val);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* slit 2
|
||||
*/
|
||||
if(self->D2.activeFlag == 1){
|
||||
dist = ABS(calcCompPosition(&self->D2) - calcCompPosition(&self->M));
|
||||
mot = getListMotorPosition(readList,"d2t");
|
||||
if(mot < -99999){
|
||||
SCWrite(pCon,"WARNING: skipping d2 because of bad read on d2t",
|
||||
eWarning);
|
||||
} else {
|
||||
val = dist*Tand(-self->targetm2t) - .5 * mot;
|
||||
addMotorToList(self->driveList,"d2b",val);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* slit 3
|
||||
@ -362,7 +383,8 @@ static int amorSetSave(void *data, char *name,FILE *fd){
|
||||
saveAmorComp(fd,name,"chopper",&self->chopper);
|
||||
saveAmorComp(fd,name,"mono",&self->M);
|
||||
saveAmorComp(fd,name,"ds",&self->DS);
|
||||
saveAmorComp(fd,name,"slit2",&self->D2);
|
||||
saveAmorComp(fd,name,"slit1",&self->D2);
|
||||
saveAmorComp(fd,name,"slit2",&self->D2);
|
||||
saveAmorComp(fd,name,"slit3",&self->D3);
|
||||
saveAmorComp(fd,name,"sample",&self->S);
|
||||
saveAmorComp(fd,name,"slit4",&self->D4);
|
||||
@ -423,7 +445,9 @@ static void killAmorSet(void *data){
|
||||
/*-------------------------------------------------------------------*/
|
||||
static int testRequiredMotors(SConnection *pCon){
|
||||
char motList[][20] = {"soz", "com",
|
||||
"cox","coz","dbs","d2b","d2t",
|
||||
"cox","coz","dbs",
|
||||
"d1t", "d1b",
|
||||
"d2b","d2t",
|
||||
"d3b", "d3t", "d4b","d4t",
|
||||
"d5t", "d5b","aoz", "aom"};
|
||||
int i = 0, status = 1;
|
||||
@ -431,7 +455,7 @@ static int testRequiredMotors(SConnection *pCon){
|
||||
char pBueffel[132];
|
||||
|
||||
|
||||
for(i = 0; i < 15; i++){
|
||||
for(i = 0; i < 17; i++){
|
||||
pMot = NULL;
|
||||
pMot = FindMotor(pServ->pSics,motList[i]);
|
||||
if(pMot == NULL){
|
||||
@ -507,8 +531,10 @@ static pamorComp locateComponent(pamorSet self, char *name){
|
||||
return &self->M;
|
||||
} else if(strcmp(name,"ds") == 0){
|
||||
return &self->DS;
|
||||
}else if(strcmp(name,"slit2") == 0){
|
||||
return &self->D2;
|
||||
}else if(strcmp(name,"slit1") == 0){
|
||||
return &self->D1;
|
||||
}else if(strcmp(name,"slit2") == 0){
|
||||
return &self->D2;
|
||||
}else if(strcmp(name,"slit3") == 0){
|
||||
return &self->D3;
|
||||
}else if(strcmp(name,"sample") == 0){
|
||||
|
Reference in New Issue
Block a user