43#include "input_output/FGModelLoader.h"
69 if (debug_lvl & 2) cout <<
" FGModel Base Class" << endl;
76 if (debug_lvl & 2) cout <<
"Destroyed: FGModel" << endl;
81bool FGModel::InitModel(
void)
84 return FGModelFunctions::InitModel();
91 if (debug_lvl & 4) cout <<
"Entering Run() for model " << Name << endl;
93 if (rate == 1)
return false;
95 if (exe_ctr >= rate) exe_ctr = 0;
97 if (exe_ctr++ == 1)
return false;
103SGPath FGModel::FindFullPathName(
const SGPath& path)
const
113 Element* document = ModelLoader.Open(el);
115 if (!document)
return false;
119 <<
" Read model '" << document->
GetName()
120 <<
"' while expecting model '" << el->
GetName() <<
"'" << endl;
127 result = FGModelFunctions::Load(document, FDMExec);
129 if (document != el) {
137 LocalProperties.Load(el, PropertyManager.get(),
true);
170void FGModel::Debug(
int from)
172 if (debug_lvl <= 0)
return;
179 if (debug_lvl & 2 ) {
180 if (from == 0) cout <<
"Instantiated: FGModel" << endl;
181 if (from == 1) cout <<
"Destroyed: FGModel" << endl;
183 if (debug_lvl & 4 ) {
185 if (debug_lvl & 8 ) {
187 if (debug_lvl & 16) {
189 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.
std::string ReadFrom(void) const
Return a string that contains a description of the location where the current XML element was read fr...
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.