FlightGear
next
FGInputType.h
Go to the documentation of this file.
1
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3
Header: FGInputType.h
4
Author: Paul Chavent
5
Date started: 01/20/15
6
7
------------- Copyright (C) 2015 Paul Chavent -------------
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
01/20/15 PC Created
29
30
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31
SENTRY
32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34
#ifndef FGINPUTTYPE_H
35
#define FGINPUTTYPE_H
36
37
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38
INCLUDES
39
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41
#include "
models/FGModel.h
"
42
43
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44
FORWARD DECLARATIONS
45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46
47
namespace
JSBSim
{
48
49
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50
CLASS DOCUMENTATION
51
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52
68
69
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70
CLASS DECLARATION
71
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
72
73
class
FGInputType
:
public
FGModel
74
{
75
public
:
79
FGInputType
(
FGFDMExec
* fdmex);
80
82
~FGInputType
()
override
;
83
87
void
SetIdx
(
unsigned
int
idx);
88
92
bool
Load
(
Element
* el)
override
;
93
95
bool
InitModel
(
void
)
override
;
96
103
bool
Run
(
bool
Holding)
override
;
104
109
virtual
void
Read
(
bool
Holding) = 0;
110
112
void
Enable
(
void
) {
enabled
=
true
; }
114
void
Disable
(
void
) {
enabled
=
false
; }
118
bool
Toggle
(
void
) {
enabled
= !
enabled
;
return
enabled
;}
119
125
virtual
void
SetInputName
(
const
std::string&
name
) {
Name
=
name
; }
126
129
virtual
const
std::string&
GetInputName
(
void
)
const
{
return
Name
; }
130
131
protected
:
132
unsigned
int
InputIdx
;
133
bool
enabled
;
134
135
void
Debug
(
int
from)
override
;
136
};
137
}
138
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
139
#endif
FGModel.h
JSBSim::Element
Definition
FGXMLElement.h:143
JSBSim::FGFDMExec
Definition
FGFDMExec.h:186
JSBSim::FGInputType::Load
bool Load(Element *el) override
Init the input directives from an XML file (implement the FGModel interface).
Definition
FGInputType.cpp:72
JSBSim::FGInputType::~FGInputType
~FGInputType() override
Destructor.
Definition
FGInputType.cpp:58
JSBSim::FGInputType::Toggle
bool Toggle(void)
Toggles the input generation.
Definition
FGInputType.h:118
JSBSim::FGInputType::Enable
void Enable(void)
Enables the input generation.
Definition
FGInputType.h:112
JSBSim::FGInputType::InitModel
bool InitModel(void) override
Init the input model according to its configitation.
Definition
FGInputType.cpp:88
JSBSim::FGInputType::SetInputName
virtual void SetInputName(const std::string &name)
Overwrites the name identifier under which the input will be read.
Definition
FGInputType.h:125
JSBSim::FGInputType::InputIdx
unsigned int InputIdx
Definition
FGInputType.h:132
JSBSim::FGInputType::enabled
bool enabled
Definition
FGInputType.h:133
JSBSim::FGInputType::GetInputName
virtual const std::string & GetInputName(void) const
Get the name identifier to which the input will be directed.
Definition
FGInputType.h:129
JSBSim::FGInputType::Read
virtual void Read(bool Holding)=0
Generate the input.
JSBSim::FGInputType::Debug
void Debug(int from) override
Definition
FGInputType.cpp:131
JSBSim::FGInputType::SetIdx
void SetIdx(unsigned int idx)
Set the idx for this input instance.
Definition
FGInputType.cpp:65
JSBSim::FGInputType::Disable
void Disable(void)
Disables the input generation.
Definition
FGInputType.h:114
JSBSim::FGInputType::Run
bool Run(bool Holding) override
Executes the input directives (implement the FGModel interface).
Definition
FGInputType.cpp:98
JSBSim::FGInputType::FGInputType
FGInputType(FGFDMExec *fdmex)
Constructor (implement the FGModel interface).
Definition
FGInputType.cpp:50
JSBSim::FGModel::FGModel
FGModel(FGFDMExec *)
Constructor.
Definition
FGModel.cpp:57
JSBSim::FGModel::Name
std::string Name
Definition
FGModel.h:103
name
const char * name
Definition
fg_commands.cxx:1136
JSBSim
Definition
FGFDMExec.cpp:67
src
FDM
JSBSim
input_output
FGInputType.h
Generated on Tue Jun 3 2025 12:58:37 for FlightGear by
1.13.2