41#include "FGOutputType.h"
42#include "FGXMLElement.h"
43#include "FGPropertyManager.h"
44#include "math/FGTemplateFunc.h"
45#include "math/FGFunctionValue.h"
80 for (
auto param: OutputParameters)
90 string outputProp = CreateIndexedPropertyName(
"simulation/output", idx);
93 PropertyManager->Tie(outputProp +
"/enabled", &enabled);
130 while (property_element) {
131 string property_str = property_element->
GetDataLine();
135 log << LogFormat::RED << LogFormat::BOLD <<
" No property by the name "
136 << property_str <<
" has been defined. This property will "
137 <<
"not be logged. You should check your configuration file.\n"
142 auto f = FDMExec->GetTemplateFunc(function_str);
147 log << LogFormat::RED << LogFormat::BOLD <<
" No function by the name "
148 << function_str <<
" has been defined. This property will "
149 <<
"not be logged. You should check your configuration file.\n"
159 OutputCaptions.push_back(
"");
164 double outRate = 1.0;
177 bool ret = FGModel::InitModel();
202 rtHz = rtHz>1000?1000:(rtHz<0?0:rtHz);
216 return 1.0 / (rate * FDMExec->
GetDeltaT());
223 for (
auto prop: outputProperties)
247void FGOutputType::Debug(
int from)
249 if (debug_lvl <= 0)
return;
255 FGLogging log(LogLevel::DEBUG);
256 if (SubSystems &
ssSimulation) log <<
" Simulation parameters logged\n";
257 if (SubSystems &
ssAerosurfaces) log <<
" Aerosurface parameters logged\n";
258 if (SubSystems &
ssRates) log <<
" Rate parameters logged\n";
259 if (SubSystems &
ssVelocities) log <<
" Velocity parameters logged\n";
260 if (SubSystems &
ssForces) log <<
" Force parameters logged\n";
261 if (SubSystems &
ssMoments) log <<
" Moments parameters logged\n";
262 if (SubSystems &
ssAtmosphere) log <<
" Atmosphere parameters logged\n";
263 if (SubSystems &
ssMassProps) log <<
" Mass parameters logged\n";
264 if (SubSystems &
ssAeroFunctions) log <<
" Coefficient parameters logged\n";
265 if (SubSystems &
ssPropagate) log <<
" Propagate parameters logged\n";
267 if (SubSystems &
ssFCS) log <<
" FCS parameters logged\n";
268 if (SubSystems &
ssPropulsion) log <<
" Propulsion parameters logged\n";
269 if (!OutputParameters.empty()) log <<
" Properties logged:\n";
270 for (
auto param: OutputParameters)
271 log <<
" - " << param->GetName() <<
"\n";
274 if (debug_lvl & 2 ) {
275 FGLogging log(LogLevel::DEBUG);
276 if (from == 0) log <<
"Instantiated: FGOutputType\n";
277 if (from == 1) log <<
"Destroyed: FGOutputType\n";
279 if (debug_lvl & 4 ) {
281 if (debug_lvl & 8 ) {
283 if (debug_lvl & 16) {
285 if (debug_lvl & 64) {
Element * FindElement(const std::string &el="")
Searches for a specified element.
double GetAttributeValueAsNumber(const std::string &key)
Retrieves an attribute value as a double precision real number.
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.
std::string GetDataLine(unsigned int i=0)
Gets a line of data belonging to an element.
std::string FindElementValue(const std::string &el="")
Searches for the named element and returns the string data belonging to it.
Element * FindNextElement(const std::string &el="")
Searches for the next element as specified.
bool HasAttribute(const std::string &key)
Determines if an element has the supplied attribute.
Encapsulates the JSBSim simulation executive.
std::shared_ptr< FGWinds > GetWinds(void) const
Returns the FGWinds pointer.
std::shared_ptr< FGBuoyantForces > GetBuoyantForces(void) const
Returns the FGBuoyantForces pointer.
std::shared_ptr< FGAircraft > GetAircraft(void) const
Returns the FGAircraft pointer.
std::shared_ptr< FGFCS > GetFCS(void) const
Returns the FGFCS pointer.
double GetDeltaT(void) const
Returns the simulation delta T.
std::shared_ptr< FGPropagate > GetPropagate(void) const
Returns the FGPropagate pointer.
std::shared_ptr< FGAerodynamics > GetAerodynamics(void) const
Returns the FGAerodynamics pointer.
std::shared_ptr< FGExternalReactions > GetExternalReactions(void) const
Returns the FGExternalReactions pointer.
std::shared_ptr< FGGroundReactions > GetGroundReactions(void) const
Returns the FGGroundReactions pointer.
std::shared_ptr< FGMassBalance > GetMassBalance(void) const
Returns the FGAircraft pointer.
std::shared_ptr< FGPropulsion > GetPropulsion(void) const
Returns the FGPropulsion pointer.
std::shared_ptr< FGAuxiliary > GetAuxiliary(void) const
Returns the FGAuxiliary pointer.
std::shared_ptr< FGAccelerations > GetAccelerations(void) const
Returns the FGAccelerations pointer.
Represents a property value on which a function is applied.
Base class for all scheduled JSBSim models.
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
void SetRate(unsigned int tt)
Set the ouput rate for the model in frames.
bool Load(Element *el) override
Init the output directives from an XML file (implement the FGModel interface).
~FGOutputType() override
Destructor.
void SetOutputProperties(std::vector< SGPropertyNode_ptr > &outputProperties)
Set the list of properties that should be output for this output instance.
void SetRateHz(double rtHz)
Set the output rate for this output instances.
void SetIdx(unsigned int idx)
Set the idx for this output instance.
bool Run(bool Holding) override
Executes the output directives (implement the FGModel interface).
FGOutputType(FGFDMExec *fdmex)
Constructor (implement the FGModel interface).
bool InitModel(void) override
Init the output model according to its configitation.
void Disable(void)
Disables the output generation.
double GetRateHz(void) const
Get the output rate in Hz for this output.
virtual void Print(void)=0
Generate the output.
void Enable(void)
Enables the output generation.
@ ssPropulsion
Subsystem: Propulsion (= 4096)
@ ssForces
Subsystem: Forces (= 16)
@ ssAtmosphere
Subsystem: Atmosphere (= 64)
@ ssPropagate
Subsystem: Propagate (= 512)
@ ssGroundReactions
Subsystem: Ground Reactions (= 1024)
@ ssFCS
Subsystem: FCS (= 2048)
@ ssMoments
Subsystem: Moments (= 32)
@ ssRates
Subsystem: Body rates (= 4)
@ ssVelocities
Subsystem: Velocities (= 8)
@ ssAerosurfaces
Subsystem: Aerosurfaces (= 2)
@ ssMassProps
Subsystem: Mass Properties (= 128)
@ ssSimulation
Subsystem: Simulation (= 1)
@ ssAeroFunctions
Subsystem: Coefficients (= 256)
Represents a property value which can use late binding.
A node in a property tree.
Main namespace for the JSBSim Flight Dynamics Model.