- Added polarisation support for TAS
This commit is contained in:
10
simev.c
10
simev.c
@ -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;
|
||||
}
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user