- Various little fixes to the TAS software

- Added a sync command for synchronizing a simulation server with the
  master server.
This commit is contained in:
cvs
2001-03-16 16:09:33 +00:00
parent 5be8359212
commit bae18e8686
24 changed files with 494 additions and 78 deletions

View File

@@ -50,7 +50,7 @@
A SIMCOUNTER HAS a BUILT IN FAILURE RATE OF 10% FOR TESTING ERROR HANDLING
CODE. A negative failure rate means absolute success.
*/
#define FAILRATE 0.05
static float FAILRATE;
/*----------------------------------------------------------------------------*/
static float SimRandom(void)
{
@@ -147,6 +147,11 @@
pSim->lEnd = 0;
}
if(FAILRATE < .0)
{
return OKOK;
}
if(SimRandom() < FAILRATE)
{
return HWFault;
@@ -195,6 +200,11 @@
pSim->iPause = 0;
if(FAILRATE < .0)
{
return OKOK;
}
if(SimRandom() < FAILRATE)
{
return HWFault;
@@ -212,6 +222,11 @@
pSim = (SimSt *)self->pData;
assert(pSim);
if(FAILRATE < .0)
{
return OKOK;
}
if(SimRandom() < FAILRATE)
{
return HWFault;
@@ -295,7 +310,7 @@
return 1;
}
/*---------------------------------------------------------------------------*/
pCounterDriver NewSIMCounter(char *name)
pCounterDriver NewSIMCounter(char *name, float fFail)
{
pCounterDriver pRes = NULL;
SimSt *pData = NULL;
@@ -335,6 +350,7 @@
pRes->Get = SIMGet;
pRes->Send = SIMSend;
FAILRATE = fFail;
return pRes;
}
/*--------------------------------------------------------------------------*/