34#include "FGPropertyValue.h"
44FGPropertyValue::FGPropertyValue(
const std::string& propName,
45 std::shared_ptr<FGPropertyManager> propertyManager, Element* el)
46 : PropertyManager(propertyManager), PropertyNode(nullptr), XML_def(el),
47 PropertyName(propName), Sign(1.0)
49 if (PropertyName[0] ==
'-') {
50 PropertyName.erase(0,1);
54 if (PropertyManager->HasNode(PropertyName)) {
55 PropertyNode = PropertyManager->GetNode(PropertyName);
66 if (PropertyNode)
return PropertyNode;
69 PropertyNode = PropertyManager->GetNode(PropertyName);
71 unique_ptr<LogException> err;
73 err.reset(
new XMLLogException(XML_def));
75 err.reset(
new LogException);
77 *err <<
"FGPropertyValue::GetValue() The property " << PropertyName
78 <<
" does not exist\n";
89double FGPropertyValue::GetValue(
void)
const
96void FGPropertyValue::SetValue(
double value)
101 GetNode()->setDoubleValue(value);
106std::string FGPropertyValue::GetName(
void)
const
109 return PropertyNode->getNameString();
116std::string FGPropertyValue::GetNameWithSign(
void)
const
120 if (Sign < 0.0) name =
"-";
129std::string FGPropertyValue::GetFullyQualifiedName(
void)
const
132 return JSBSim::GetFullyQualifiedName(PropertyNode);
139std::string FGPropertyValue::GetPrintableName(
void)
const
142 return JSBSim::GetPrintableName(PropertyNode);
A node in a property tree.
double getDoubleValue() const
Get a double value for this node.
Main namespace for the JSBSim Flight Dynamics Model.