FlightGear
next
FGInput.h
Go to the documentation of this file.
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
79
80
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81
CLASS DECLARATION
82
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
83
84
class
FGInput
:
public
FGModel
85
{
86
public
:
87
FGInput
(
FGFDMExec
*);
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
FGInputType.h
FGModel.h
JSBSim::Element
Definition
FGXMLElement.h:143
JSBSim::FGFDMExec
Definition
FGFDMExec.h:186
JSBSim::FGInput::Toggle
bool Toggle(int idx)
Toggles the input generation of each input instance.
Definition
FGInput.cpp:170
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::~FGInput
~FGInput() override
Definition
FGInput.cpp:65
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::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::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::SetDirectivesFile
bool SetDirectivesFile(const SGPath &fname)
Adds a new input instance to the Input Manager.
Definition
FGInput.cpp:151
JSBSim::FGInput::FGInput
FGInput(FGFDMExec *)
Definition
FGInput.cpp:55
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::FGInput::Disable
void Disable(void)
Disables the input generation for all input instances.
Definition
FGInput.h:123
JSBSim::FGModel::FGModel
FGModel(FGFDMExec *)
Constructor.
Definition
FGModel.cpp:57
name
const char * name
Definition
fg_commands.cxx:1136
JSBSim
Definition
FGFDMExec.cpp:67
src
FDM
JSBSim
models
FGInput.h
Generated on Tue Jun 3 2025 12:58:38 for FlightGear by
1.13.2