1
0
Fork 0

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:
curt 2003-03-29 03:43:39 +00:00
parent 652863db06
commit a552e3bc82

View file

@ -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();
@ -288,16 +283,18 @@ 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 ) {
if ( p->get_count_down() < 0.33 * dt ) {
p->process();
p->inc_count_down( dt );
p->inc_count();
while ( p->get_count_down() < 0.33 * dt ) {
p->inc_count_down( dt );
}
// double ave = elapsed_time / p->get_count();
// cout << " ave rate = " << ave << endl;
}
}
}
}
void