- fixed a anticollider bug
- fixed problems with the synchronization code - fixed some small TASP problems
This commit is contained in:
39
simdriv.c
39
simdriv.c
@ -2,10 +2,15 @@
|
||||
|
||||
SINQ suffers from a severe lack of hardware. In order to do something
|
||||
inspite of this, there is the Simulated motor for testing software and
|
||||
perhaps later on as a simulation engine for testing baqtch-files.
|
||||
perhaps later on as a simulation engine for testing batch-files.
|
||||
|
||||
Mark Koennecke, November 1996
|
||||
|
||||
Prepared for simulation mode by providing for zero failure operation
|
||||
Mark Koennecke, October 2001
|
||||
|
||||
Allowed for changing hardware limits: Mark Koennecke, April 2003
|
||||
|
||||
Copyright:
|
||||
|
||||
Labor fuer Neutronenstreuung
|
||||
@ -63,9 +68,7 @@
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
static int GetSimPos(void *self, float *fPos)
|
||||
{
|
||||
SIMDriv *pDriv;
|
||||
@ -232,6 +235,26 @@
|
||||
return HWBusy;
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------*/
|
||||
static int SimSetPar(void *self, SConnection *pCon, char *name, float newValue)
|
||||
{
|
||||
SIMDriv *pDriv = (SIMDriv *) self;
|
||||
|
||||
assert(self);
|
||||
assert(pCon);
|
||||
|
||||
if(strcmp(name,"hardupperlim") == 0)
|
||||
{
|
||||
pDriv->fUpper = newValue;
|
||||
return 1;
|
||||
}
|
||||
if(strcmp(name,"hardlowerlim") == 0)
|
||||
{
|
||||
pDriv->fLower = newValue;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
MotorDriver *CreateSIM(SConnection *pCon, int argc, char *argv[])
|
||||
{
|
||||
@ -329,6 +352,7 @@
|
||||
pDriv->GetStatus = SimStat;
|
||||
pDriv->GetError = SimError;
|
||||
pDriv->TryAndFixIt = SimFix;
|
||||
/* pDriv->SetDriverPar = SimSetPar; */
|
||||
pDriv->Halt = SimHalt;
|
||||
pDriv->fSpeed = .01;
|
||||
pDriv->iTime = 0;
|
||||
@ -357,3 +381,12 @@
|
||||
free(pDriv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user