- fixed a anticollider bug

- fixed problems with the synchronization code
- fixed some small TASP problems
This commit is contained in:
cvs
2003-04-22 09:29:13 +00:00
parent cb4bbbc93c
commit b06a473cf5
9 changed files with 151 additions and 13 deletions

View File

@@ -201,6 +201,43 @@ extern char *tasVariableOrder[] = {
"hconv4",
"polfile",
NULL};
/*-------------------------------------------------------------------
Normally SICS does not store motor hardware limits into status files as
they are read from the motor controller. However, in order to better
synchronize simulation and instrument this has to be done for TASP.
TasSave does just that: saving hard limits in order for the simulation to
be able to read them.
------------------------------------------------------------------------*/
static int TasSaveStatus(void *self, char *name, FILE *fd)
{
int i = 0;
pMotor pMot;
float value;
SConnection *pCon = NULL;
pCon = SCCreateDummyConnection(pServ->pSics);
if(!pCon)
{
return 0;
}
while(tasMotorOrder[i] != NULL)
{
pMot = FindMotor(pServ->pSics,tasMotorOrder[i]);
if(pMot)
{
MotorGetPar(pMot,"hardupperlim",&value);
fprintf(fd,"%s hardupperlim %f\n",tasMotorOrder[i], value);
MotorGetPar(pMot,"hardlowerlim",&value);
fprintf(fd,"%s hardlowerlim %f\n",tasMotorOrder[i], value);
MotorGetSoftPosition(pMot,pCon,&value);
fprintf(fd,"run %s %f\n",tasMotorOrder[i], value);
}
i++;
}
SCDeleteConnection(pCon);
fprintf(fd,"success\n");
return 1;
}
/*---------------------------------------------------------------------
There is a special feauture in MAD where the count mode is determined
which variable, MN for monitor od TI for time has been set as the last
@@ -300,6 +337,7 @@ int TASFactory(SConnection *pCon, SicsInterp *pSics, void *pData,
return 0;
}
pNew->iPOL = -1;
pNew->pDes->SaveStatus = TasSaveStatus;
/* connect to all the variables */
iPtr = 0; iError = 0;