FlightGear next
FGXMLAutopilot::AnalogComponent Class Reference

Base class for analog autopilot components. More...

#include <analogcomponent.hxx>

Inherits FGXMLAutopilot::Component.

Inherited by FGXMLAutopilot::DigitalFilter, FGXMLAutopilot::PIDController, FGXMLAutopilot::PISimpleController, and FGXMLAutopilot::Predictor.

Public Member Functions

const simgear::PeriodicalValue_ptr getPeriodicalValue () const
 
void collectDependentProperties (std::set< const SGPropertyNode * > &props) const
 Add to <props> all properties that are used by this component.
 
- Public Member Functions inherited from FGXMLAutopilot::Component
 Component ()
 A constructor for an empty Component.
 
virtual ~Component ()
 virtual destructor to clean up resources
 
void update (double dt) override
 
virtual bool configure (SGPropertyNode &prop_root, SGPropertyNode &cfg)
 configure this component from a property node.
 
bool isPropertyEnabled ()
 check if this component is enabled as configured in the <enable> section
 

Protected Member Functions

 AnalogComponent ()
 A constructor for an analog component.
 
bool configure (SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root) override
 This method configures this analog component from a property node.
 
double clamp (double value) const
 clamp the given value if <min> and/or <max> inputs were given
 
void disabled (double dt) override
 overideable method being called from the update() method if this component is disabled.
 
double get_output_value () const
 return the current double value of the output property
 
void set_output_value (double value)
 
- Protected Member Functions inherited from FGXMLAutopilot::Component
virtual void update (bool firstTime, double dt)=0
 pure virtual function to be implemented by the derived classes.
 

Protected Attributes

simgear::ValueList _valueInput
 the value input
 
simgear::ValueList _referenceInput
 the reference input
 
simgear::ValueList _minInput
 the minimum output clamp input
 
simgear::ValueList _maxInput
 the maximum output clamp input
 
simgear::PeriodicalValue_ptr _periodical
 the configuration for periodical outputs
 
simgear::PropertyList _output_list
 
SGPropertyNode_ptr _passive_mode
 
- Protected Attributes inherited from FGXMLAutopilot::Component
bool _debug
 debug flag, true if this component should generate some useful output on every iteration
 
bool _honor_passive
 a (historic) flag signalling the derived class that it should compute it's internal state but shall not set the output properties if /autopilot/locks/passive-mode is true.
 

Detailed Description

Base class for analog autopilot components.

Each analog component has

  • one value input
  • one reference input
  • one minimum clamp input
  • one maximum clamp input
  • an optional periodical definition

Definition at line 43 of file analogcomponent.hxx.

Constructor & Destructor Documentation

◆ AnalogComponent()

AnalogComponent::AnalogComponent ( )
protected

A constructor for an analog component.

Call configure() to configure this component from a property node

Definition at line 30 of file analogcomponent.cxx.

Member Function Documentation

◆ clamp()

double AnalogComponent::clamp ( double value) const
protected

clamp the given value if <min> and/or <max> inputs were given

Parameters
thevalue to clamp
Returns
the clamped value

Definition at line 37 of file analogcomponent.cxx.

◆ collectDependentProperties()

void AnalogComponent::collectDependentProperties ( std::set< const SGPropertyNode * > & props) const

Add to <props> all properties that are used by this component.

Similar to SGExpression::collectDependentProperties().

Definition at line 124 of file analogcomponent.cxx.

◆ configure()

bool AnalogComponent::configure ( SGPropertyNode & cfg_node,
const std::string & cfg_name,
SGPropertyNode & prop_root )
overrideprotectedvirtual

This method configures this analog component from a property node.

Gets called multiple times from the base class configure method for every configuration node.

Parameters
cfg_nameName of the configuration node provided in cfg_node
cfg_nodeConfiguration node itself
prop_rootProperty root for all relative paths
Returns
true if the node was handled, false otherwise.

Reimplemented from FGXMLAutopilot::Component.

Reimplemented in FGXMLAutopilot::DigitalFilter, FGXMLAutopilot::PIDController, FGXMLAutopilot::PISimpleController, and FGXMLAutopilot::Predictor.

Definition at line 54 of file analogcomponent.cxx.

◆ disabled()

void FGXMLAutopilot::AnalogComponent::disabled ( double dt)
inlineoverrideprotectedvirtual

overideable method being called from the update() method if this component is disabled.

Analog components feed back it's output value to the active input value if disabled and feedback-if-disabled is true

Reimplemented from FGXMLAutopilot::Component.

Definition at line 150 of file analogcomponent.hxx.

◆ get_output_value()

double FGXMLAutopilot::AnalogComponent::get_output_value ( ) const
inlineprotected

return the current double value of the output property

Returns
the current value of the output property If no output property is configured, a value of zero will be returned. If more than one output property is configured, the value of the first output property is returned. The current value of the output property will be clamped to the configured values of <min> and/or <max>.

Definition at line 120 of file analogcomponent.hxx.

◆ getPeriodicalValue()

const simgear::PeriodicalValue_ptr FGXMLAutopilot::AnalogComponent::getPeriodicalValue ( ) const
inline

Definition at line 141 of file analogcomponent.hxx.

◆ set_output_value()

void FGXMLAutopilot::AnalogComponent::set_output_value ( double value)
inlineprotected

Definition at line 127 of file analogcomponent.hxx.

Member Data Documentation

◆ _maxInput

simgear::ValueList FGXMLAutopilot::AnalogComponent::_maxInput
protected

the maximum output clamp input

Definition at line 72 of file analogcomponent.hxx.

◆ _minInput

simgear::ValueList FGXMLAutopilot::AnalogComponent::_minInput
protected

the minimum output clamp input

Definition at line 67 of file analogcomponent.hxx.

◆ _output_list

simgear::PropertyList FGXMLAutopilot::AnalogComponent::_output_list
protected

Definition at line 124 of file analogcomponent.hxx.

◆ _passive_mode

SGPropertyNode_ptr FGXMLAutopilot::AnalogComponent::_passive_mode
protected

Definition at line 125 of file analogcomponent.hxx.

◆ _periodical

simgear::PeriodicalValue_ptr FGXMLAutopilot::AnalogComponent::_periodical
protected

the configuration for periodical outputs

Definition at line 77 of file analogcomponent.hxx.

◆ _referenceInput

simgear::ValueList FGXMLAutopilot::AnalogComponent::_referenceInput
protected

the reference input

Definition at line 62 of file analogcomponent.hxx.

◆ _valueInput

simgear::ValueList FGXMLAutopilot::AnalogComponent::_valueInput
protected

the value input

Definition at line 57 of file analogcomponent.hxx.


The documentation for this class was generated from the following files: