FlightGear next
FGXMLAutopilot::Predictor Class Reference

Simple moving average filter converts input value to predicted value "seconds". More...

#include <predictor.hxx>

Inherits FGXMLAutopilot::AnalogComponent.

Public Member Functions

 Predictor ()
 
 ~Predictor ()
 
void update (bool firstTime, double dt)
 pure virtual function to be implemented by the derived classes.
 
- Public Member Functions inherited from FGXMLAutopilot::AnalogComponent
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
 

Static Public Member Functions

static const char * staticSubsystemClassId ()
 

Protected Member Functions

virtual bool configure (SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root)
 This method configures this analog component from a property node.
 
- Protected Member Functions inherited from FGXMLAutopilot::AnalogComponent
 AnalogComponent ()
 A constructor for an analog component.
 
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)
 

Additional Inherited Members

- Protected Attributes inherited from FGXMLAutopilot::AnalogComponent
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

Simple moving average filter converts input value to predicted value "seconds".

Smoothing as described by Curt Olson: gain would be valid in the range of 0 - 1.0 1.0 would mean no filtering. 0.0 would mean no input. 0.5 would mean (1 part past value + 1 part current value) / 2 0.1 would mean (9 parts past value + 1 part current value) / 10 0.25 would mean (3 parts past value + 1 part current value) / 4

Definition at line 47 of file predictor.hxx.

Constructor & Destructor Documentation

◆ Predictor()

Predictor::Predictor ( )

Definition at line 29 of file predictor.cxx.

◆ ~Predictor()

FGXMLAutopilot::Predictor::~Predictor ( )
inline

Definition at line 62 of file predictor.hxx.

Member Function Documentation

◆ configure()

bool Predictor::configure ( SGPropertyNode & cfg_node,
const std::string & cfg_name,
SGPropertyNode & prop_root )
protectedvirtual

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::AnalogComponent.

Definition at line 37 of file predictor.cxx.

◆ staticSubsystemClassId()

static const char * FGXMLAutopilot::Predictor::staticSubsystemClassId ( )
inlinestatic

Definition at line 65 of file predictor.hxx.

◆ update()

void Predictor::update ( bool firstTime,
double dt )
virtual

pure virtual function to be implemented by the derived classes.

Gets called from the update method if it's not disabled with the firstTime parameter set to true if this is the first call after being enabled

Parameters
firstTimeset to true if this is the first update call since this component has been enabled. Set to false for every subsequent call.
dtthe elapsed time since the last call

Implements FGXMLAutopilot::Component.

Definition at line 60 of file predictor.cxx.


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