-// airspeed_indicator.cxx - a regular VSI.
+// airspeed_indicator.cxx - a regular pitot-static airspeed indicator.
// Written by David Megginson, started 2002.
//
// This file is in the Public Domain and comes with no warranty.
#include <Main/util.hxx>
+// A higher number means more responsive.
+#define RESPONSIVENESS 50.0
+
+
AirspeedIndicator::AirspeedIndicator ()
{
}
// Now, reverse the equation
double v_fps = sqrt((2 * q) / SEA_LEVEL_DENSITY_SLUGFT3);
- _speed_node->setDoubleValue(v_fps * FPSTOKTS);
+ // Publish the indicated airspeed
+ double last_speed_kt = _speed_node->getDoubleValue();
+ double current_speed_kt = v_fps * FPSTOKTS;
+ _speed_node->setDoubleValue(fgGetLowPass(last_speed_kt,
+ current_speed_kt,
+ dt * RESPONSIVENESS));
}
}
#include <Main/util.hxx>
+// A higher number means more responsive
+#define RESPONSIVENESS 10.0
+
+
// Altitude based on pressure difference from sea level.
// pressure difference inHG, altitude ft
static double altitude_data[][2] = {
if (_serviceable_node->getBoolValue()) {
double pressure = _pressure_node->getDoubleValue();
double setting = _setting_node->getDoubleValue();
- double altitude =
- fgGetLowPass(_altitude_node->getDoubleValue(),
- _altitude_table->interpolate(setting - pressure),
- dt * 10);
- _altitude_node->setDoubleValue(altitude);
+
+ // Move towards the current setting
+ double last_altitude = _altitude_node->getDoubleValue();
+ double current_altitude =
+ _altitude_table->interpolate(setting - pressure);
+ _altitude_node->setDoubleValue(fgGetLowPass(last_altitude,
+ current_altitude,
+ dt * RESPONSIVENESS));
}
}
// Use a bigger number to be more responsive, or a smaller number
-// to be more sluggish (the base time is 1.0).
-#define RESPONSIVENESS 0.25
+// to be more sluggish.
+#define RESPONSIVENESS 0.5
TurnIndicator::TurnIndicator () :