1
0
Fork 0

Autopilot code tweaks

Move config.h include to correct place, and use
override instead of virtual in a few places.
This commit is contained in:
James Turner 2021-12-25 12:29:53 +00:00
parent 6414df325d
commit a12a7e9bec
4 changed files with 12 additions and 23 deletions

View file

@ -91,9 +91,9 @@ protected:
* @param prop_root Property root for all relative paths * @param prop_root Property root for all relative paths
* @return true if the node was handled, false otherwise. * @return true if the node was handled, false otherwise.
*/ */
virtual bool configure( SGPropertyNode& cfg_node, bool configure( SGPropertyNode& cfg_node,
const std::string& cfg_name, const std::string& cfg_name,
SGPropertyNode& prop_root ); SGPropertyNode& prop_root ) override;
/** /**
* @brief clamp the given value if <min> and/or <max> inputs were given * @brief clamp the given value if <min> and/or <max> inputs were given
@ -107,7 +107,7 @@ protected:
* is disabled. Analog components feed back it's output value to the active * is disabled. Analog components feed back it's output value to the active
input value if disabled and feedback-if-disabled is true input value if disabled and feedback-if-disabled is true
*/ */
virtual void disabled( double dt ); void disabled( double dt ) override;
/** /**
* @brief return the current double value of the output property * @brief return the current double value of the output property

View file

@ -20,12 +20,7 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// //
#ifndef __COMPONENT_HXX #pragma once
#define __COMPONENT_HXX 1
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <simgear/structure/subsystem_mgr.hxx> #include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/props/propsfwd.hxx> #include <simgear/props/propsfwd.hxx>
@ -122,6 +117,5 @@ public:
bool isPropertyEnabled(); bool isPropertyEnabled();
}; };
} } // of namespace FGXMLAutopilot
#endif // COMPONENT_HXX

View file

@ -20,12 +20,7 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// //
#ifndef __DIGITALFILTER_HXX #pragma once
#define __DIGITALFILTER_HXX 1
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "analogcomponent.hxx" #include "analogcomponent.hxx"
@ -47,12 +42,12 @@ private:
}; };
protected: protected:
virtual bool configure( SGPropertyNode& cfg_node, bool configure( SGPropertyNode& cfg_node,
const std::string& cfg_name, const std::string& cfg_name,
SGPropertyNode& prop_root ); SGPropertyNode& prop_root ) override;
virtual void update( bool firstTime, double dt); void update( bool firstTime, double dt) override;
InitializeTo _initializeTo; InitializeTo _initializeTo = INITIALIZE_INPUT;
public: public:
DigitalFilter(); DigitalFilter();
@ -66,4 +61,4 @@ public:
}; };
} // namespace FGXMLAutopilot } // namespace FGXMLAutopilot
#endif

View file

@ -86,7 +86,7 @@ public:
// Subsystem identification. // Subsystem identification.
static const char* staticSubsystemClassId() { return "pid-controller"; } static const char* staticSubsystemClassId() { return "pid-controller"; }
void update( bool firstTime, double dt ); void update( bool firstTime, double dt ) override;
}; };
} }