JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGInput.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGInput.h
4  Author: Jon Berndt
5  Date started: 12/2/98
6 
7  ------------- Copyright (C) 1999 Jon S. Berndt (jon@jsbsim.org) -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25 
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/02/98 JSB Created
29 19/01/15 PCH Split the code in several classes (see input_output dir)
30 
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 SENTRY
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
34 
35 #ifndef FGINPUT_H
36 #define FGINPUT_H
37 
38 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 INCLUDES
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41 
42 #include "FGModel.h"
43 #include "input_output/FGInputType.h"
44 
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 DEFINITIONS
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48 
49 #define ID_INPUT "$Id: FGInput.h,v 1.14 2017/02/25 14:23:19 bcoconni Exp $"
50 
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 FORWARD DECLARATIONS
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54 
55 namespace JSBSim {
56 
57 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 CLASS DOCUMENTATION
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
60 
87 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88 CLASS DECLARATION
89 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
90 
91 class FGInput : public FGModel
92 {
93 public:
95  ~FGInput();
96 
101  bool Load(Element* el);
102 
109  bool InitModel(void);
110 
118  bool Run(bool Holding);
119 
125  bool SetDirectivesFile(const SGPath& fname);
126 
128  void Enable(void) { enabled = true; }
130  void Disable(void) { enabled = false; }
137  bool Toggle(int idx);
138 
146  bool SetInputName(unsigned int idx, const std::string& name);
151  std::string GetInputName(unsigned int idx) const;
152 
153 private:
154  std::vector<FGInputType*> InputTypes;
155  bool enabled;
156 
157  void Debug(int from);
158 };
159 }
160 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161 #endif
void Enable(void)
Enables the input generation for all input instances.
Definition: FGInput.h:128
std::string GetInputName(unsigned int idx) const
Get the name identifier to which the input will be directed.
Definition: FGInput.cpp:190
bool Toggle(int idx)
Toggles the input generation of each input instance.
Definition: FGInput.cpp:170
bool Run(bool Holding)
Runs the Input model; called by the Executive Can pass in a value indicating if the executive is dire...
Definition: FGInput.cpp:141
Base class for all scheduled JSBSim models.
Definition: FGModel.h:74
bool SetDirectivesFile(const SGPath &fname)
Adds a new input instance to the Input Manager.
Definition: FGInput.cpp:156
bool Load(Element *el)
Load the input directives and adds a new input instance to the Input Manager list.
Definition: FGInput.cpp:81
Handles simulation input.
Definition: FGInput.h:91
bool InitModel(void)
Initializes the instance.
Definition: FGInput.cpp:126
bool SetInputName(unsigned int idx, const std::string &name)
Overwrites the name identifier under which the input will be logged.
Definition: FGInput.cpp:180
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:189
void Disable(void)
Disables the input generation for all input instances.
Definition: FGInput.h:130