Added some test code (currently commented out) to limit a remote visual
slave to a specific frame rate (i.e. 30hz). This is potentially desireable if you are running on the ragged edge between 30/60 hz ... It would be nice at some point to make the code a bit more flexible and configurable so it could be activated from the command line or preferences file.
This commit is contained in:
parent
d5d38ebe8c
commit
af13301cbd
1 changed files with 16 additions and 3 deletions
|
@ -401,10 +401,23 @@ bool FGNativeFDM::process() {
|
||||||
FGNetFDM2Props( &buf );
|
FGNetFDM2Props( &buf );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while ( io->read( (char *)(& buf), length ) == length ) {
|
// double dt = 1000000.0 / 30.0;
|
||||||
SG_LOG( SG_IO, SG_DEBUG, "Success reading data." );
|
// SGTimeStamp current; current.stamp();
|
||||||
FGNetFDM2Props( &buf );
|
int result;
|
||||||
|
result = io->read( (char *)(& buf), length );
|
||||||
|
if ( result == length ) {
|
||||||
|
SG_LOG( SG_IO, SG_DEBUG, " Success reading data." );
|
||||||
|
FGNetFDM2Props( &buf );
|
||||||
|
}
|
||||||
|
while ( result == length /* || current - last_time < dt */ ) {
|
||||||
|
result = io->read( (char *)(& buf), length );
|
||||||
|
if ( result == length ) {
|
||||||
|
SG_LOG( SG_IO, SG_DEBUG, " Success reading data." );
|
||||||
|
FGNetFDM2Props( &buf );
|
||||||
|
}
|
||||||
|
// current.stamp();
|
||||||
}
|
}
|
||||||
|
// last_time = current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue