}
else
{
- current_time += dt * speed_up->getDoubleValue();
+ current_time += dt;
was_finished_already = false;
}
replay_time->setDoubleValue(current_time);
return;
{
- double new_sim_time = sim_time + dt * speed_up->getDoubleValue();
+ double new_sim_time = sim_time + dt;
// don't record multiple records with the same timestamp (or go backwards in time)
if (new_sim_time <= sim_time)
{
}
int
-FGInterface::_calc_multiloop (double dt)
+FGInterface::_calc_multiloop (double)
{
- // Since some time the simulation time increments we get here are
- // already a multiple of the basic update frequency.
- // So, there is no need to do our own multiloop rounding with all bad
- // roundoff problems when we already have nearly accurate values.
- // Only the speedup thing must be still handled here
- int hz = fgGetInt("/sim/model-hz");
- double speedup = fgGetDouble("/sim/speed-up");
- double loops = dt * hz * speedup + delta_loops;
- int iloops = SGMiscd::roundToInt(loops);
- delta_loops = loops-iloops; // delta_loops required for speed-ups < 1 (to do one iteration every n-th step)
- return iloops;
+ // this method is now obsolete - multiloop is handled by
+ // SGSubsystemGroup; the FDM group operates with a fixed time interval
+ // (defined by /sim/model-hz), so at this level we always want to run
+ // exactly one FDM iteration
+ return 1;
}
_state.climb_rate=0;
_state.altitude_agl=0;
_state.track=0;
-
- delta_loops = 0.0;
}
void
// Have we bound to the property system
bool bound;
- double delta_loops;
-
// periodic update management variable. This is a scheme to run
// the fdm with a fixed delta-t. We control how many iteration of
// the fdm to run with the fixed dt based on the elapsed time from
fgGetNode("/environment/pressure-inhg", true);
_sea_node =
fgGetNode("/environment/pressure-sea-level-inhg", true);
- _speed_up_node =
- fgGetNode("/sim/speed-up", true);
_speed_node =
node->getNode("indicated-speed-fps", true);
_speed_min_node =
{
double pressure_inhg = _pressure_node->getDoubleValue();
double sea_inhg = _sea_node->getDoubleValue();
- double speed_up = _speed_up_node->getDoubleValue();
-
- // must work by speed up
- if( speed_up > 1 )
- {
- dt *= speed_up;
- }
-
+
// limit effect of external environment
double rate_sea_inhg_per_s = ( sea_inhg - _internal_sea_inhg ) / dt;
* /instrumentation/inst-vertical-speed-indicator/serviceable
* /environment/pressure-inhg
* /environment/pressure-sea-level-inhg
- * /sim/speed-up
* /sim/freeze/master
*
* Output properties:
_speed_fpm_node = node->getChild("indicated-speed-fpm", 0, true);
_speed_mps_node = node->getChild("indicated-speed-mps", 0, true);
_speed_kts_node = node->getChild("indicated-speed-kts", 0, true);
- _speed_up_node = fgGetNode("/sim/speed-up", true);
reinit();
}
if (_serviceable_node->getBoolValue()) {
double pressure_inHg = _pressure_node->getDoubleValue() ;
double pressure_Pa = pressure_inHg * SG_INHG_TO_PA;
- double speed_up = _speed_up_node->getDoubleValue();
double Fsign = 0.;
double orifice_mach = 0.0;
- if( speed_up > 1 )
- dt *= speed_up;
// This is a thermodynamically correct model of a mechanical vertical speed indicator:
// It represents an aneroid in a closed (constant volume) casing with the aneroid internal pressure = static pressure
SGPropertyNode_ptr _speed_fpm_node;
SGPropertyNode_ptr _speed_mps_node;
SGPropertyNode_ptr _speed_kts_node;
- SGPropertyNode_ptr _speed_up_node;
};
if (_clockFreeze->getBoolValue() || wait_for_scenery) {
simDt = 0;
} else {
- simDt = dt;
+ // sim time can be scaled
+ simDt = dt * fgGetDouble("/sim/speed-up");
}
_lastStamp = currentStamp;