43#include "input_output/FGModelLoader.h"
44#include "input_output/FGLog.h"
82bool FGModel::InitModel(
void)
85 return FGModelFunctions::InitModel();
94 if (rate == 1)
return false;
96 if (exe_ctr >= rate) exe_ctr = 0;
98 if (exe_ctr++ == 1)
return false;
104SGPath FGModel::FindFullPathName(
const SGPath& path)
const
114 Element* document = ModelLoader.Open(el);
116 if (!document)
return false;
120 log <<
" Read model '" << document->
GetName()
121 <<
"' while expecting model '" << el->
GetName() <<
"'" << endl;
128 result = FGModelFunctions::Load(document, FDMExec);
130 if (document != el) {
138 LocalProperties.Load(el, PropertyManager.get(),
true);
171void FGModel::Debug(
int from)
173 if (debug_lvl <= 0)
return;
180 if (debug_lvl & 2 ) {
181 FGLogging log(LogLevel::DEBUG);
182 if (from == 0) log <<
"Instantiated: FGModel" << endl;
183 if (from == 1) log <<
"Destroyed: FGModel" << endl;
185 if (debug_lvl & 4 ) {
186 FGLogging log(LogLevel::DEBUG);
187 if (from ==2) log <<
"Entering Run() for model " << Name << endl;
189 if (debug_lvl & 8 ) {
191 if (debug_lvl & 16) {
193 if (debug_lvl & 64) {
Element * FindElement(const std::string &el="")
Searches for a specified element.
const std::string & GetName(void) const
Retrieves the element name.
void MergeAttributes(Element *el)
Merges the attributes of the current element with another element.
Element * FindNextElement(const std::string &el="")
Searches for the next element as specified.
void AddChildElement(Element *el)
Adds a child element to the list of children stored for this element.
void SetParent(Element *p)
This function sets the value of the parent class attribute to the supplied Element pointer.
Encapsulates the JSBSim simulation executive.
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
std::shared_ptr< FGPropertyManager > GetPropertyManager(void) const
Returns a pointer to the property manager object.
~FGModel() override
Destructor.
FGModel(FGFDMExec *)
Constructor.
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
bool Upload(Element *el, bool preLoad)
Uploads this model in memory.
Main namespace for the JSBSim Flight Dynamics Model.