- Added another slit for AMOR
- Fixed timeout for pimotor - Fixed a bug which could cause tabledrive to go into an endless loop
This commit is contained in:
18
amorset.c
18
amorset.c
@ -380,6 +380,8 @@ static int amorSetSave(void *data, char *name,FILE *fd){
|
||||
fprintf(fd,"%s dspar %f\n", name, self->dspar);
|
||||
fprintf(fd,"%s detectoroffset %f\n", name, self->detectoroffset);
|
||||
fprintf(fd,"%s verbose %d\n", name, self->verbose);
|
||||
fprintf(fd,"%s targets %f %f %f\n", name, self->targetath, self->targetm2t,
|
||||
self->targets2t);
|
||||
saveAmorComp(fd,name,"chopper",&self->chopper);
|
||||
saveAmorComp(fd,name,"mono",&self->M);
|
||||
saveAmorComp(fd,name,"ds",&self->DS);
|
||||
@ -619,6 +621,22 @@ int AmorSetAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
return 1;
|
||||
}
|
||||
}else if(strcmp(argv[1],"targets") == 0){
|
||||
if(argc >= 5){
|
||||
if(!SCMatchRights(pCon,usMugger)){
|
||||
return 0;
|
||||
}
|
||||
self->targetath = atof(argv[2]);
|
||||
self->targetm2t = atof(argv[3]);
|
||||
self->targets2t = atof(argv[4]);
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
snprintf(pBueffel,131,"%s targets = %f %f %F", argv[0],
|
||||
self->targetath, self->targetm2t, self->targets2t);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
return 1;
|
||||
}
|
||||
}else if(strcmp(argv[1],"verbose") == 0){
|
||||
if(argc > 2){
|
||||
if(!SCMatchRights(pCon,usMugger)){
|
||||
|
14
julcho.c
14
julcho.c
@ -643,7 +643,7 @@ static int ConfigureSingleJulCho(pHdb parent, pJulCho driv,
|
||||
return 0;
|
||||
}
|
||||
AppendHipadabaCallback(child,HCBSET,pCb);
|
||||
AddHipadabaChild(parent,child);
|
||||
AddHipadabaChild(parent,child,NULL);
|
||||
|
||||
child = MakeHipadabaNode("gatewidth",HIPFLOAT,0);
|
||||
if(child == NULL){
|
||||
@ -659,7 +659,7 @@ static int ConfigureSingleJulCho(pHdb parent, pJulCho driv,
|
||||
return 0;
|
||||
}
|
||||
AppendHipadabaCallback(child,HCBSET,pCb);
|
||||
AddHipadabaChild(parent,child);
|
||||
AddHipadabaChild(parent,child,NULL);
|
||||
|
||||
if(!AppendJulChoROPar(parent,"nomspeed",HIPINT)){
|
||||
return 0;
|
||||
@ -769,7 +769,7 @@ static int InitJulChoPar(pJulCho driv){
|
||||
if(!ConfigureSingleJulCho(child,driv,"","::::")){
|
||||
return 0;
|
||||
}
|
||||
AddHipadabaChild(driv->parNode,child);
|
||||
AddHipadabaChild(driv->parNode,child,NULL);
|
||||
|
||||
child = MakeHipadabaNode(CH2N,HIPNONE,0);
|
||||
if(child == NULL){
|
||||
@ -797,7 +797,7 @@ static int InitJulChoPar(pJulCho driv){
|
||||
return 0;
|
||||
}
|
||||
AppendHipadabaCallback(parChild,HCBSET,pCb);
|
||||
AddHipadabaChild(driv->parNode,child);
|
||||
AddHipadabaChild(driv->parNode,child,NULL);
|
||||
|
||||
child = MakeHipadabaNode(CH3N,HIPNONE,0);
|
||||
if(child == NULL){
|
||||
@ -806,7 +806,7 @@ static int InitJulChoPar(pJulCho driv){
|
||||
if(!ConfigureSingleJulCho(child,driv,"::","::")){
|
||||
return 0;
|
||||
}
|
||||
AddHipadabaChild(driv->parNode,child);
|
||||
AddHipadabaChild(driv->parNode,child,NULL);
|
||||
|
||||
child = MakeHipadabaNode(CH4N,HIPNONE,0);
|
||||
if(child == NULL){
|
||||
@ -815,7 +815,7 @@ static int InitJulChoPar(pJulCho driv){
|
||||
if(!ConfigureSingleJulCho(child,driv,":::",":")){
|
||||
return 0;
|
||||
}
|
||||
AddHipadabaChild(driv->parNode,child);
|
||||
AddHipadabaChild(driv->parNode,child,NULL);
|
||||
|
||||
child = MakeHipadabaNode(CH5N,HIPNONE,0);
|
||||
if(child == NULL){
|
||||
@ -824,7 +824,7 @@ static int InitJulChoPar(pJulCho driv){
|
||||
if(!ConfigureSingleJulCho(child,driv,"::::","")){
|
||||
return 0;
|
||||
}
|
||||
AddHipadabaChild(driv->parNode,child);
|
||||
AddHipadabaChild(driv->parNode,child,NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -416,7 +416,7 @@
|
||||
KillC804(pNew);
|
||||
return NULL;
|
||||
}
|
||||
SerialConfig(&pNew->pSerial,5000);
|
||||
SerialConfig(&pNew->pSerial,50000);
|
||||
|
||||
/* switch on, just to make sure */
|
||||
iTmo = SerialGetTmo(&pNew->pSerial);
|
||||
|
@ -86,10 +86,16 @@ static long TableDriveSetValue(void *pData, SConnection *pCon, float fVal){
|
||||
static int findOrientingMotor(pTableDrive self, ptdMotor moti){
|
||||
int status;
|
||||
|
||||
if(!self->oriInvalid){
|
||||
*moti = self->oriMotor;
|
||||
return 1;
|
||||
}
|
||||
status = LLDnodePtr2First(self->motorTable);
|
||||
while(status != 0){
|
||||
LLDnodeDataTo(self->motorTable,moti);
|
||||
if(strcmp(moti->motorName,self->orientMotor) == 0){
|
||||
self->oriMotor = *moti;
|
||||
self->oriInvalid = 0;
|
||||
return 1;
|
||||
}
|
||||
status = LLDnodePtr2Next(self->motorTable);
|
||||
@ -227,6 +233,7 @@ static float TableDriveGetValue(void *pData, SConnection *pCon){
|
||||
}
|
||||
value = locatePosition(orient,pCon);
|
||||
checkSync(self,pCon, value);
|
||||
|
||||
self->currentPosition = value;
|
||||
return value;
|
||||
}
|
||||
@ -612,6 +619,7 @@ int TableDriveFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
pNew->state = OUTOFSYNC;
|
||||
pNew->tableLength = 0;
|
||||
pNew->targetPosition = 0;
|
||||
pNew->oriInvalid = 1;
|
||||
|
||||
if(!loadTable(pNew,argv[2],pCon)){
|
||||
killTableDrive(pNew);
|
||||
@ -684,6 +692,7 @@ int TableDriveAction(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
return 0;
|
||||
}
|
||||
strncpy(self->orientMotor,argv[2],80);
|
||||
self->oriInvalid = 1;
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
|
@ -37,6 +37,8 @@ typedef struct{
|
||||
int state;
|
||||
char orientMotor[80];
|
||||
int debug;
|
||||
tdMotor oriMotor;
|
||||
int oriInvalid;
|
||||
}TableDrive, *pTableDrive;
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user