- Added polarisation support for TAS

This commit is contained in:
cvs
2002-04-03 15:32:26 +00:00
parent a5346ddedc
commit 0ce72deb58
17 changed files with 557 additions and 89 deletions

10
simev.c
View File

@ -76,6 +76,10 @@
pMe = (pSimST)self->pPrivate;
assert(pMe);
if(pMe->fFailure < .0){
return 1;
}
if((int)time(&tD) > pMe->tFinish)
{
return 1;
@ -101,7 +105,11 @@
if(RunComplete(self))
{
if(pMe->fFailure < .0){
*fPos = pMe->fTarget;
} else {
*fPos = pMe->fTarget + SimRandom();
}
}
else /* simulate a mispositioned motor */
{
@ -126,6 +134,7 @@
if(fDiff < .0) fDiff = -fDiff;
pMe->tFinish = (int)time(&tD) + (int)(fDiff/pMe->fSpeed);
pMe->fTarget = fVal;
/* in a fifth the failures, simply die, else simply do not find pos */
if(SimRandom() < (pMe->fFailure/5))
@ -133,7 +142,6 @@
return 0;
}
pMe->fTarget = fVal;
return 1;
}
/*--------------------------------------------------------------------------*/