If the main frame rate is less than the requested io rate, don't send multiple
copies of the same data for the sole purpose of faking it.
This commit is contained in:
parent
652863db06
commit
a552e3bc82
1 changed files with 10 additions and 13 deletions
|
@ -267,17 +267,12 @@ FGIO::init()
|
|||
}
|
||||
|
||||
|
||||
// process any serial port work
|
||||
// process any IO channel work
|
||||
void
|
||||
FGIO::update( double delta_time_sec )
|
||||
{
|
||||
// cout << "processing I/O channels" << endl;
|
||||
|
||||
// SGTimeStamp current_time;
|
||||
// current_time.stamp();
|
||||
// static SGTimeStamp start_time = current_time;
|
||||
// double elapsed_time = (current_time - start_time) / 1000000.0;
|
||||
// cout << " Elapsed time = " << elapsed_time << endl;
|
||||
// cout << " Elapsed time = " << delta_time_sec << endl;
|
||||
|
||||
typedef vector< FGProtocol* > container;
|
||||
container::iterator i = io_channels.begin();
|
||||
|
@ -287,14 +282,16 @@ FGIO::update( double delta_time_sec )
|
|||
|
||||
if ( p->is_enabled() ) {
|
||||
p->dec_count_down( delta_time_sec );
|
||||
double dt = 1 / p->get_hz();
|
||||
while ( p->get_count_down() < 0.33 * dt ) {
|
||||
p->process();
|
||||
double dt = 1 / p->get_hz();
|
||||
if ( p->get_count_down() < 0.33 * dt ) {
|
||||
p->process();
|
||||
p->inc_count();
|
||||
while ( p->get_count_down() < 0.33 * dt ) {
|
||||
p->inc_count_down( dt );
|
||||
p->inc_count();
|
||||
}
|
||||
// double ave = elapsed_time / p->get_count();
|
||||
// cout << " ave rate = " << ave << endl;
|
||||
}
|
||||
// double ave = elapsed_time / p->get_count();
|
||||
// cout << " ave rate = " << ave << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue