diff --git a/src/Instrumentation/turn_indicator.cxx b/src/Instrumentation/turn_indicator.cxx index 48c43c750..79159247a 100644 --- a/src/Instrumentation/turn_indicator.cxx +++ b/src/Instrumentation/turn_indicator.cxx @@ -26,6 +26,9 @@ using std::string; TurnIndicator::TurnIndicator ( SGPropertyNode *node) : _last_rate(0) { + if( !node->getBoolValue("new-default-power-path", 0) ){ + setDefaultPowerSupplyPath("/systems/electrical/outputs/turn-coordinator"); + } readConfig(node, "turn-indicator"); } @@ -42,6 +45,7 @@ TurnIndicator::init () _roll_rate_node = fgGetNode("/orientation/roll-rate-degps", true); _yaw_rate_node = fgGetNode("/orientation/yaw-rate-degps", true); _rate_out_node = node->getChild("indicated-turn-rate", 0, true); + _spin_node = node->getChild("spin", 0, true); initServicePowerProperties(node); @@ -62,6 +66,7 @@ TurnIndicator::update (double dt) _gyro.set_power_norm(isServiceableAndPowered()); _gyro.update(dt); double spin = _gyro.get_spin_norm(); + _spin_node->setDoubleValue( spin ); // Calculate the indicated rate double factor = 1.0 - ((1.0 - spin) * (1.0 - spin) * (1.0 - spin)); diff --git a/src/Instrumentation/turn_indicator.hxx b/src/Instrumentation/turn_indicator.hxx index 3dda563aa..aa867ac68 100644 --- a/src/Instrumentation/turn_indicator.hxx +++ b/src/Instrumentation/turn_indicator.hxx @@ -32,11 +32,33 @@ * /instrumentation/"name"/spin * /orientation/roll-rate-degps * /orientation/yaw-rate-degps - * /systems/electrical/outputs/turn-coordinator + * /systems/electrical/outputs/turn-coordinator (see below) * * Output properties: * * /instrumentation/"name"/indicated-turn-rate + * + * Configuration: + * + * name + * number + * new-default-power-path: use /systems/electrical/outputs/turn-indicator[ number ] instead of + * /systems/electrical/outputs/turn-coordinator as the default power + * supply path (not used when power-supply is set) + * power-supply + * minimum-supply-volts + * + * Notes on the power supply path: + * + * For backwards compatibility reasons, the default power path is + * /systems/electrical/outputs/turn-coordinator, unless new-default-power-path is set to 1, + * in which case the new default path /systems/electrical/outputs/turn-indicator[ number ] + * is used. As the new path is more logical and consistent with instrument naming, newly + * developed and actively maintained aircraft should switch their electrical system to write + * to /systems/electrical/outputs/turn-indicator[ number ] and set new-default-power-path. + * The legacy default path will eventually be phased out. + * The power path can always be set manually by using the power-supply config tag. + * */ class TurnIndicator : public AbstractInstrument { @@ -45,10 +67,8 @@ public: virtual ~TurnIndicator (); // Subsystem API. - //void bind() override; void init() override; void reinit() override; - //void unbind() override; void update(double dt) override; // Subsystem identification. @@ -61,4 +81,5 @@ private: SGPropertyNode_ptr _roll_rate_node; SGPropertyNode_ptr _yaw_rate_node; SGPropertyNode_ptr _rate_out_node; + SGPropertyNode_ptr _spin_node; };