JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
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 FORWARD DECLARATIONS
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48 
49 namespace JSBSim {
50 
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 CLASS DOCUMENTATION
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54 
80 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 CLASS DECLARATION
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
83 
84 class FGInput : public FGModel
85 {
86 public:
88  ~FGInput() override;
89 
94  bool Load(Element* el) override;
95 
102  bool InitModel(void) override;
103 
111  bool Run(bool Holding) override;
112 
118  bool SetDirectivesFile(const SGPath& fname);
119 
121  void Enable(void) { enabled = true; }
123  void Disable(void) { enabled = false; }
130  bool Toggle(int idx);
131 
139  bool SetInputName(unsigned int idx, const std::string& name);
144  std::string GetInputName(unsigned int idx) const;
145 
146 private:
147  std::vector<FGInputType*> InputTypes;
148  bool enabled;
149 
150  void Debug(int from) override;
151 };
152 }
153 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 #endif
JSBSim::FGInput::Load
bool Load(Element *el) override
Load the input directives and adds a new input instance to the Input Manager list.
Definition: FGInput.cpp:76
JSBSim::FGInput::Disable
void Disable(void)
Disables the input generation for all input instances.
Definition: FGInput.h:123
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGModel
Base class for all scheduled JSBSim models.
Definition: FGModel.h:68
JSBSim::FGInput::InitModel
bool InitModel(void) override
Initializes the instance.
Definition: FGInput.cpp:121
JSBSim::FGInput::Enable
void Enable(void)
Enables the input generation for all input instances.
Definition: FGInput.h:121
JSBSim::FGInput
Handles simulation input.
Definition: FGInput.h:84
JSBSim::FGInput::Toggle
bool Toggle(int idx)
Toggles the input generation of each input instance.
Definition: FGInput.cpp:170
JSBSim::FGInput::GetInputName
std::string GetInputName(unsigned int idx) const
Get the name identifier to which the input will be directed.
Definition: FGInput.cpp:190
JSBSim::FGInput::SetDirectivesFile
bool SetDirectivesFile(const SGPath &fname)
Adds a new input instance to the Input Manager.
Definition: FGInput.cpp:151
JSBSim::FGInput::Run
bool Run(bool Holding) override
Runs the Input model; called by the Executive Can pass in a value indicating if the executive is dire...
Definition: FGInput.cpp:136
JSBSim::FGInput::SetInputName
bool SetInputName(unsigned int idx, const std::string &name)
Overwrites the name identifier under which the input will be logged.
Definition: FGInput.cpp:180
JSBSim::Element
Definition: FGXMLElement.h:143