34 #include "FGPropertyValue.h"
42 FGPropertyValue::FGPropertyValue(
const std::string& propName,
43 FGPropertyManager* propertyManager)
44 : PropertyManager(propertyManager), PropertyNode(nullptr),
45 PropertyName(propName), Sign(1.0)
47 if (PropertyName[0] ==
'-') {
48 PropertyName.erase(0,1);
52 if (PropertyManager->HasNode(PropertyName))
53 PropertyNode = PropertyManager->GetNode(PropertyName);
58 FGPropertyNode* FGPropertyValue::GetNode(
void)
const
61 FGPropertyNode* node = PropertyManager->GetNode(PropertyName);
64 throw(std::string(
"FGPropertyValue::GetValue() The property " +
65 PropertyName +
" does not exist."));
75 double FGPropertyValue::GetValue(
void)
const
77 return GetNode()->getDoubleValue()*Sign;
82 void FGPropertyValue::SetValue(
double value)
87 GetNode()->setDoubleValue(value);
92 std::string FGPropertyValue::GetName(
void)
const
95 return PropertyNode->GetName();
102 std::string FGPropertyValue::GetNameWithSign(
void)
const
106 if (Sign < 0.0) name =
"-";
115 std::string FGPropertyValue::GetFullyQualifiedName(
void)
const
118 return PropertyNode->GetFullyQualifiedName();
125 std::string FGPropertyValue::GetPrintableName(
void)
const
128 return PropertyNode->GetPrintableName();