FlightGear next
autopilot.hxx
Go to the documentation of this file.
1// autopilot.hxx - an even more flexible, generic way to build autopilots
2//
3// Written by Torsten Dreyer
4// Based heavily on work created by Curtis Olson, started January 2004.
5//
6// Copyright (C) 2004 Curtis L. Olson - http://www.flightgear.org/~curt
7// Copyright (C) 2010 Torsten Dreyer - Torsten (at) t3r (dot) de
8//
9// This program is free software; you can redistribute it and/or
10// modify it under the terms of the GNU General Public License as
11// published by the Free Software Foundation; either version 2 of the
12// License, or (at your option) any later version.
13//
14// This program is distributed in the hope that it will be useful, but
15// WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17// General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with this program; if not, write to the Free Software
21// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22//
23#ifndef __AUTOPILOT_HXX
24#define __AUTOPILOT_HXX 1
25
26#include <simgear/props/props.hxx>
27#include <simgear/structure/subsystem_mgr.hxx>
28
29namespace FGXMLAutopilot {
30
31class Component;
32
37class Autopilot : public SGSubsystemGroup
38{
39public:
40 Autopilot( SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode = NULL );
41 ~Autopilot();
42
43 // Subsystem API.
44 void bind() override;
45 void unbind() override;
46 void update(double dt) override;
47
48 // Subsystem identification.
49 static const char* staticSubsystemClassId() { return "autopilot"; }
50
51 void set_serviceable( bool value ) { _serviceable = value; }
52 bool is_serviceable() const { return _serviceable; }
53
54 std::string get_name() const { return _name; }
55 void set_name( const std::string & name ) { _name = name; }
56
57 void add_component( Component * component, double updateInterval );
58
59protected:
60
61private:
62 std::string _name;
63 bool _serviceable;
64 SGPropertyNode_ptr _rootNode;
65};
66
67}
68
69#endif // __AUTOPILOT_HXX 1
Autopilot(SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode=NULL)
void set_serviceable(bool value)
Definition autopilot.hxx:51
void update(double dt) override
bool is_serviceable() const
Definition autopilot.hxx:52
static const char * staticSubsystemClassId()
Definition autopilot.hxx:49
std::string get_name() const
Definition autopilot.hxx:54
void set_name(const std::string &name)
Definition autopilot.hxx:55
void add_component(Component *component, double updateInterval)
Autopilot(SGPropertyNode_ptr rootNode, SGPropertyNode_ptr configNode=NULL)
Base class for other autopilot components.
Definition component.hxx:34
const char * name