FlightGear next
|
Base class for other autopilot components. More...
#include <component.hxx>
Inherits SGSubsystem.
Inherited by FGXMLAutopilot::AnalogComponent, FGXMLAutopilot::DigitalComponent, and StateMachineComponent.
Public Member Functions | |
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 | |
virtual bool | configure (SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root) |
virtual void | update (bool firstTime, double dt)=0 |
pure virtual function to be implemented by the derived classes. | |
virtual void | disabled (double dt) |
overideable method being called from the update() method if this component is disabled. | |
Protected Attributes | |
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. | |
Base class for other autopilot components.
Definition at line 33 of file component.hxx.
Component::Component | ( | ) |
A constructor for an empty Component.
Definition at line 30 of file component.cxx.
|
virtual |
virtual destructor to clean up resources
Definition at line 38 of file component.cxx.
|
protectedvirtual |
Reimplemented in FGXMLAutopilot::AnalogComponent, FGXMLAutopilot::DigitalComponent, FGXMLAutopilot::DigitalFilter, FGXMLAutopilot::FlipFlop, FGXMLAutopilot::PIDController, FGXMLAutopilot::PISimpleController, and FGXMLAutopilot::Predictor.
Definition at line 67 of file component.cxx.
|
virtual |
configure this component from a property node.
Iterates through all nodes found as children under configNode and calls configure of the derived class for each child.
prop_root | Property root for all relative paths |
cfg | Property node containing the configuration |
Reimplemented in FGXMLAutopilot::DigitalFilter.
Definition at line 44 of file component.cxx.
|
inlineprotectedvirtual |
overideable method being called from the update() method if this component is disabled.
It's a noop by default.
Reimplemented in FGXMLAutopilot::AnalogComponent.
Definition at line 60 of file component.hxx.
bool Component::isPropertyEnabled | ( | ) |
check if this component is enabled as configured in the <enable> section
If a <condition> is defined, this condition is evaluated, <prop> and <value> tags are ignored.
If a <prop> is defined and no <value> is defined, the property named in the <prop><prop> tags is evaluated as boolean.
If a <prop> is defined and a <value> is defined, the property named in <prop></prop> is compared (as a string) to the value defined in <value></value>
Returns true, if neither <condition> nor <prop> exists
Definition at line 119 of file component.cxx.
|
protectedpure 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
firstTime | set to true if this is the first update call since this component has been enabled. Set to false for every subsequent call. |
dt | the elapsed time since the last call |
Implemented in FGXMLAutopilot::DigitalFilter, FGXMLAutopilot::FlipFlop, FGXMLAutopilot::Logic, FGXMLAutopilot::PIDController, FGXMLAutopilot::PISimpleController, FGXMLAutopilot::Predictor, and StateMachineComponent.
|
override |
Definition at line 134 of file component.cxx.
|
protected |
debug flag, true if this component should generate some useful output on every iteration
Definition at line 66 of file component.hxx.
|
protected |
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.
Definition at line 73 of file component.hxx.