38 const std::string& cfg_name,
39 SGPropertyNode& prop_root )
41 if( cfg_name ==
"config" ) {
46 if (cfg_name ==
"seconds") {
47 _seconds.push_back(
new simgear::Value(prop_root, cfg_node, 0));
51 if (cfg_name ==
"filter-gain") {
52 _filter_gain.push_back(
new simgear::Value(prop_root, cfg_node, 0));
68 double current = (ivalue - _last_value)/dt;
69 _average = dt < 1.0 ? ((1.0 - dt) * _average + current * dt) : current;
72 double output = ivalue +
73 (1.0 - _filter_gain.get_value()) * (_average * _seconds.get_value()) +
74 _filter_gain.get_value() * (current * _seconds.get_value());
75 output =
clamp( output );
void set_output_value(double value)
simgear::ValueList _valueInput
the value input
bool configure(SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root) override
This method configures this analog component from a property node.
AnalogComponent()
A constructor for an analog component.
double clamp(double value) const
clamp the given value if <min> and/or <max> inputs were given
virtual bool configure(SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root)
virtual bool configure(SGPropertyNode &cfg_node, const std::string &cfg_name, SGPropertyNode &prop_root)
This method configures this analog component from a property node.
void update(bool firstTime, double dt)
pure virtual function to be implemented by the derived classes.
SGSubsystemMgr::Registrant< Predictor > registrantPredictor