%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGExternalReactions.h"
+#include "input_output/FGXMLElement.h"
+#include <iostream>
#include <string>
+using namespace std;
+
namespace JSBSim {
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
bool FGExternalReactions::Load(Element* el)
{
- Debug(2);
+ FGModel::Load(el); // Call the base class Load() function to load interface properties.
- // Interface properties are all stored in the interface properties array.
- // ToDo: Interface properties should not be created if they already exist.
- // A check should be done prior to creation. This ought to make it easier
- // to work with FlightGear, where some properties used in definitions may
- // already have been created, but would not be seen when JSBSim is run
- // in standalone mode.
-
- Element* property_element;
- property_element = el->FindElement("property");
- while (property_element) {
- double value=0.0;
- if ( ! property_element->GetAttributeValue("value").empty())
- value = property_element->GetAttributeValueAsNumber("value");
- interface_properties.push_back(new double(value));
- string interface_property_string = property_element->GetDataLine();
- PropertyManager->Tie(interface_property_string, interface_properties.back());
- property_element = el->FindNextElement("property");
- }
+ Debug(2);
// Parse force elements
force_element = el->FindNextElement("force");
}
+ FGModel::PostLoad(el);
+
return true;
}
{
for (unsigned int i=0; i<Forces.size(); i++) delete Forces[i];
Forces.clear();
- for (unsigned int i=0; i<interface_properties.size(); i++) delete interface_properties[i];
- interface_properties.clear();
+
Debug(1);
}
if (FDMExec->Holding()) return false; // if paused don't execute
if (NoneDefined) return true;
+ RunPreFunctions();
+
vTotalForces.InitMatrix();
vTotalMoments.InitMatrix();
vTotalMoments += Forces[i]->GetMoments();
}
+ RunPostFunctions();
+
return false;
}