JSBSim Flight Dynamics Model 1.2.2 (22 Mar 2025)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
FGStateSpace::ComponentVector Class Reference

Detailed Description

Definition at line 102 of file FGStateSpace.h.

Public Member Functions

 ComponentVector (const ComponentVector &componentVector)
 
 ComponentVector (FGFDMExec *fdm, FGStateSpace *stateSpace)
 
void add (Component *comp)
 
void clear ()
 
std::vector< double > get () const
 
void get (double *array) const
 
double get (int i)
 
double get (int i) const
 
ComponentgetComp (int i)
 
ComponentgetComp (int i) const
 
std::vector< double > getDeriv () const
 
void getDeriv (double *array) const
 
double getDeriv (int i)
 
std::vector< std::string > getName () const
 
std::string getName (int i) const
 
size_t getSize () const
 
std::vector< std::string > getUnit () const
 
std::string getUnit (int i) const
 
ComponentVectoroperator= (ComponentVector &componentVector)
 
void set (double *array)
 
void set (int i, double val)
 
void set (std::vector< double > vals)
 

Constructor & Destructor Documentation

◆ ComponentVector() [1/2]

ComponentVector ( FGFDMExec fdm,
FGStateSpace stateSpace 
)
inline

Definition at line 105 of file FGStateSpace.h.

105 :
106 m_stateSpace(stateSpace), m_fdm(fdm), m_components() {}

◆ ComponentVector() [2/2]

ComponentVector ( const ComponentVector componentVector)
inline

Definition at line 114 of file FGStateSpace.h.

114 :
115 m_stateSpace(componentVector.m_stateSpace),
116 m_fdm(componentVector.m_fdm),
117 m_components(componentVector.m_components)
118 {
119 }

Member Function Documentation

◆ add()

void add ( Component comp)
inline

Definition at line 120 of file FGStateSpace.h.

121 {
122 comp->setStateSpace(m_stateSpace);
123 comp->setFdm(m_fdm);
124 m_components.push_back(comp);
125 }

◆ clear()

void clear ( )
inline

Definition at line 205 of file FGStateSpace.h.

205 {
206 m_components.clear();
207 }

◆ get() [1/4]

std::vector< double > get ( ) const
inline

Definition at line 151 of file FGStateSpace.h.

152 {
153 std::vector<double> val;
154 for (unsigned int i=0;i<getSize();i++) val.push_back(m_components[i]->get());
155 return val;
156 }

◆ get() [2/4]

void get ( double *  array) const
inline

Definition at line 157 of file FGStateSpace.h.

158 {
159 for (unsigned int i=0;i<getSize();i++) array[i] = m_components[i]->get();
160 }

◆ get() [3/4]

double get ( int  i)
inline

Definition at line 147 of file FGStateSpace.h.

148 {
149 return m_components[i]->get();
150 };

◆ get() [4/4]

double get ( int  i) const
inline

Definition at line 138 of file FGStateSpace.h.

139 {
140 return m_components[i]->get();
141 };

◆ getComp() [1/2]

Component * getComp ( int  i)
inline

Definition at line 134 of file FGStateSpace.h.

135 {
136 return m_components[i];
137 };

◆ getComp() [2/2]

Component * getComp ( int  i) const
inline

Definition at line 130 of file FGStateSpace.h.

131 {
132 return m_components[i];
133 };

◆ getDeriv() [1/3]

std::vector< double > getDeriv ( ) const
inline

Definition at line 165 of file FGStateSpace.h.

166 {
167 std::vector<double> val;
168 for (unsigned int i=0;i<getSize();i++) val.push_back(m_components[i]->getDeriv());
169 return val;
170 }

◆ getDeriv() [2/3]

void getDeriv ( double *  array) const
inline

Definition at line 171 of file FGStateSpace.h.

172 {
173 for (unsigned int i=0;i<getSize();i++) array[i] = m_components[i]->getDeriv();
174 }

◆ getDeriv() [3/3]

double getDeriv ( int  i)
inline

Definition at line 161 of file FGStateSpace.h.

162 {
163 return m_components[i]->getDeriv();
164 };

◆ getName() [1/2]

std::vector< std::string > getName ( ) const
inline

Definition at line 189 of file FGStateSpace.h.

190 {
191 std::vector<std::string> name;
192 for (unsigned int i=0;i<getSize();i++) name.push_back(m_components[i]->getName());
193 return name;
194 }

◆ getName() [2/2]

std::string getName ( int  i) const
inline

Definition at line 185 of file FGStateSpace.h.

186 {
187 return m_components[i]->getName();
188 };

◆ getSize()

size_t getSize ( ) const
inline

Definition at line 126 of file FGStateSpace.h.

127 {
128 return m_components.size();
129 }

◆ getUnit() [1/2]

std::vector< std::string > getUnit ( ) const
inline

Definition at line 199 of file FGStateSpace.h.

200 {
201 std::vector<std::string> unit;
202 for (unsigned int i=0;i<getSize();i++) unit.push_back(m_components[i]->getUnit());
203 return unit;
204 }

◆ getUnit() [2/2]

std::string getUnit ( int  i) const
inline

Definition at line 195 of file FGStateSpace.h.

196 {
197 return m_components[i]->getUnit();
198 };

◆ operator=()

ComponentVector & operator= ( ComponentVector componentVector)
inline

Definition at line 107 of file FGStateSpace.h.

108 {
109 m_stateSpace = componentVector.m_stateSpace;
110 m_fdm = componentVector.m_fdm;
111 m_components = componentVector.m_components;
112 return *this;
113 }

◆ set() [1/3]

void set ( double *  array)
inline

Definition at line 180 of file FGStateSpace.h.

181 {
182 for (unsigned int i=0;i<getSize();i++) m_components[i]->set(array[i]);
183 m_stateSpace->run();
184 }

◆ set() [2/3]

void set ( int  i,
double  val 
)
inline

Definition at line 142 of file FGStateSpace.h.

143 {
144 m_components[i]->set(val);
145 m_stateSpace->run();
146 };

◆ set() [3/3]

void set ( std::vector< double >  vals)
inline

Definition at line 175 of file FGStateSpace.h.

176 {
177 for (unsigned int i=0;i<getSize();i++) m_components[i]->set(vals[i]);
178 m_stateSpace->run();
179 }

The documentation for this class was generated from the following file: