set_enabled( true );
+ // initialize time stamp to something reasonably current
+ last_time.stamp();
+
+ // Is this really needed here ????
cur_fdm_state->_set_Sea_level_radius( SG_EQUATORIAL_RADIUS_FT );
+
return true;
}
FGNetFDM2Props( &buf );
}
} else {
- while ( io->read( (char *)(& buf), length ) == length ) {
- SG_LOG( SG_IO, SG_DEBUG, "Success reading data." );
- FGNetFDM2Props( &buf );
+ // double dt = 1000000.0 / 30.0;
+ // SGTimeStamp current; current.stamp();
+ 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;
}
}