42 #include "FGFDMExec.h" 43 #include "input_output/FGModelLoader.h" 49 IDENT(IdSrc,
"$Id: FGModel.cpp,v 1.27 2017/02/25 14:23:19 bcoconni Exp $");
50 IDENT(IdHdr,ID_MODEL);
72 if (debug_lvl & 2) cout <<
" FGModel Base Class" << endl;
79 if (debug_lvl & 2) cout <<
"Destroyed: FGModel" << endl;
84 bool FGModel::InitModel(
void)
87 return FGModelFunctions::InitModel();
92 bool FGModel::Run(
bool Holding)
94 if (debug_lvl & 4) cout <<
"Entering Run() for model " << Name << endl;
96 if (rate == 1)
return false;
98 if (exe_ctr >= rate) exe_ctr = 0;
100 if (exe_ctr++ == 1)
return false;
106 SGPath FGModel::FindFullPathName(
const SGPath& path)
const 116 Element* document = ModelLoader.Open(el);
118 if (!document)
return false;
122 <<
" Read model '" << document->
GetName()
123 <<
"' while expecting model '" << el->
GetName() <<
"'" << endl;
127 bool result = FGModelFunctions::Load(document, PropertyManager);
129 if (document != el) {
137 LocalProperties.Load(el, PropertyManager,
true);
169 void FGModel::Debug(
int from)
171 if (debug_lvl <= 0)
return;
178 if (debug_lvl & 2 ) {
179 if (from == 0) cout <<
"Instantiated: FGModel" << endl;
180 if (from == 1) cout <<
"Destroyed: FGModel" << endl;
182 if (debug_lvl & 4 ) {
184 if (debug_lvl & 8 ) {
186 if (debug_lvl & 16) {
188 if (debug_lvl & 64) {
190 cout << IdSrc << endl;
191 cout << IdHdr << endl;
void AddChildElement(Element *el)
Adds a child element to the list of children stored for this element.
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
void SetParent(Element *p)
This function sets the value of the parent class attribute to the supplied Element pointer...
Element * FindElement(const std::string &el="")
Searches for a specified element.
FGPropertyManager * GetPropertyManager(void)
Returns a pointer to the property manager object.
void MergeAttributes(Element *el)
Merges the attributes of the current element with another element.
const std::string & GetName(void) const
Retrieves the element name.
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.
Encapsulates the JSBSim simulation executive.