- fixed a anticollider bug
- fixed problems with the synchronization code - fixed some small TASP problems
This commit is contained in:
38
tasinit.c
38
tasinit.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user