Update from PSI
r1039 | ffr | 2006-08-03 09:59:29 +1000 (Thu, 03 Aug 2006) | 2 lines
This commit is contained in:
committed by
Douglas Clowes
parent
4aa50787c2
commit
074f1cb3cd
70
tasub.c
70
tasub.c
@@ -241,6 +241,10 @@ int TasUBFactory(SConnection *pCon,SicsInterp *pSics, void *pData,
|
||||
SCWrite(pCon,"ERROR: need name to install tasUB",eError);
|
||||
return 0;
|
||||
}
|
||||
if(argc > 2 && argc < 14){
|
||||
SCWrite(pCon,"ERROR: not enough motor names specified form MakeTasUB",eError);
|
||||
return 0;
|
||||
}
|
||||
pNew = MakeTasUB();
|
||||
if(pNew == NULL){
|
||||
SCWrite(pCon,"ERROR: out of memory creating tasUB",eError);
|
||||
@@ -250,19 +254,39 @@ int TasUBFactory(SConnection *pCon,SicsInterp *pSics, void *pData,
|
||||
/*
|
||||
assign motors
|
||||
*/
|
||||
pNew->motors[0] = FindMotor(pSics,"a1");
|
||||
pNew->motors[1] = FindMotor(pSics,"a2");
|
||||
pNew->motors[2] = FindMotor(pSics,"mcv");
|
||||
pNew->motors[3] = FindMotor(pSics,"mch");
|
||||
pNew->motors[4] = FindMotor(pSics,"a3");
|
||||
pNew->motors[5] = FindMotor(pSics,"a4");
|
||||
pNew->motors[6] = FindMotor(pSics,"sgu");
|
||||
pNew->motors[7] = FindMotor(pSics,"sgl");
|
||||
pNew->motors[8] = FindMotor(pSics,"a5");
|
||||
pNew->motors[9] = FindMotor(pSics,"a6");
|
||||
pNew->motors[10] = FindMotor(pSics,"acv");
|
||||
pNew->motors[11] = FindMotor(pSics,"ach");
|
||||
|
||||
if(argc < 14){
|
||||
/*
|
||||
* default names and assignement
|
||||
*/
|
||||
pNew->motors[0] = FindMotor(pSics,"a1");
|
||||
pNew->motors[1] = FindMotor(pSics,"a2");
|
||||
pNew->motors[2] = FindMotor(pSics,"mcv");
|
||||
pNew->motors[3] = FindMotor(pSics,"mch");
|
||||
pNew->motors[4] = FindMotor(pSics,"a3");
|
||||
pNew->motors[5] = FindMotor(pSics,"a4");
|
||||
pNew->motors[6] = FindMotor(pSics,"sgu");
|
||||
pNew->motors[7] = FindMotor(pSics,"sgl");
|
||||
pNew->motors[8] = FindMotor(pSics,"a5");
|
||||
pNew->motors[9] = FindMotor(pSics,"a6");
|
||||
pNew->motors[10] = FindMotor(pSics,"acv");
|
||||
pNew->motors[11] = FindMotor(pSics,"ach");
|
||||
} else {
|
||||
/*
|
||||
* user defined names
|
||||
*/
|
||||
pNew->motors[0] = FindMotor(pSics,argv[2]);
|
||||
pNew->motors[1] = FindMotor(pSics,argv[3]);
|
||||
pNew->motors[2] = FindMotor(pSics,argv[4]);
|
||||
pNew->motors[3] = FindMotor(pSics,argv[5]);
|
||||
pNew->motors[4] = FindMotor(pSics,argv[6]);
|
||||
pNew->motors[5] = FindMotor(pSics,argv[7]);
|
||||
pNew->motors[6] = FindMotor(pSics,argv[8]);
|
||||
pNew->motors[7] = FindMotor(pSics,argv[9]);
|
||||
pNew->motors[8] = FindMotor(pSics,argv[10]);
|
||||
pNew->motors[9] = FindMotor(pSics,argv[11]);
|
||||
pNew->motors[10] = FindMotor(pSics,argv[12]);
|
||||
pNew->motors[11] = FindMotor(pSics,argv[13]);
|
||||
}
|
||||
/*
|
||||
curvature motors may be missing, anything else is a serious problem
|
||||
*/
|
||||
@@ -275,6 +299,7 @@ int TasUBFactory(SConnection *pCon,SicsInterp *pSics, void *pData,
|
||||
status += testMotor(pNew, pCon,"a5",A5);
|
||||
status += testMotor(pNew, pCon,"a6",A6);
|
||||
if(status != 8){
|
||||
SCWrite(pCon,"ERROR: a required motor is mssing, tasub NOT installed",eError);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1489,6 +1514,25 @@ int TasUBWrapper(SConnection *pCon,SicsInterp *pSics, void *pData,
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
return 1;
|
||||
}
|
||||
} else if(strcmp(argv[1],"silent") == 0){
|
||||
if(argc > 2){
|
||||
strtolower(argv[2]);
|
||||
if(!SCMatchRights(pCon,usUser)){
|
||||
return 0;
|
||||
}
|
||||
status = Tcl_GetInt(InterpGetTcl(pSics),argv[2],&newSS);
|
||||
if(status != TCL_OK){
|
||||
SCWrite(pCon,"ERROR: failed to convert argument to number",eError);
|
||||
return 0;
|
||||
}
|
||||
self->silent = newSS;
|
||||
SCSendOK(pCon);
|
||||
return 1;
|
||||
} else {
|
||||
snprintf(pBueffel,131,"%s.silent = %d",argv[0],self->silent);
|
||||
SCWrite(pCon,pBueffel,eValue);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
snprintf(pBueffel,131,"ERROR: subcommand %s to %s not defined",argv[1],
|
||||
argv[0]);
|
||||
|
||||
Reference in New Issue
Block a user