namespace JSBSim {
-IDENT(IdSrc,"$Id: FGInitialCondition.cpp,v 1.95 2014/05/01 18:32:54 bcoconni Exp $");
+IDENT(IdSrc,"$Id: FGInitialCondition.cpp,v 1.97 2014/11/15 11:57:37 bcoconni Exp $");
IDENT(IdHdr,ID_INITIALCONDITION);
//******************************************************************************
{
bool result = true;
- if (document->FindElement("latitude"))
- SetLatitudeRadIC(document->FindElementValueAsNumberConvertTo("latitude", "RAD"));
+ if (document->FindElement("latitude")) {
+ double latitude = document->FindElementValueAsNumberConvertTo("latitude", "RAD");
+ string lat_type = document->FindElement("latitude")->GetAttributeValue("type");
+ if (lat_type == "geod" || lat_type == "geodetic")
+ position.SetPositionGeodetic(0.0, latitude, 0.0); // Longitude and altitude will be set later on
+ else
+ position.SetLatitude(latitude);
+ }
+
if (document->FindElement("longitude"))
SetLongitudeRadIC(document->FindElementValueAsNumberConvertTo("longitude", "RAD"));
if (document->FindElement("elevation"))
position = position.GetTi2ec() * position_el->FindElementTripletConvertTo("FT");
} else if (frame == "ecef") {
if (!position_el->FindElement("x") && !position_el->FindElement("y") && !position_el->FindElement("z")) {
+ Element* latitude_el = position_el->FindElement("latitude");
+ if (latitude_el) {
+ string lat_type = latitude_el->GetAttributeValue("type");
+ double latitude = position_el->FindElementValueAsNumberConvertTo("latitude", "RAD");
+ if (lat_type == "geod" || lat_type == "geodetic")
+ position.SetPositionGeodetic(0.0, latitude, 0.0); // Longitude and altitude will be set later on
+ else
+ position.SetLatitude(latitude);
+ }
if (position_el->FindElement("longitude"))
position.SetLongitude(position_el->FindElementValueAsNumberConvertTo("longitude", "RAD"));
result = false;
}
- Element* latitude_el = position_el->FindElement("latitude");
- if (latitude_el) {
- string lat_type = latitude_el->GetAttributeValue("type");
- double latitude = position_el->FindElementValueAsNumberConvertTo("latitude", "RAD");
- if (lat_type == "geod" || lat_type == "geodetic") {
- double longitude = position.GetLongitude();
- double altitude = position.GetAltitudeASL(); // SetPositionGeodetic() assumes altitude
- position.SetPositionGeodetic(longitude, latitude, altitude); // is geodetic, but it's close enough for now.
- position.SetAltitudeAGL(altitude, 0.0);
- } else {
- position.SetLatitude(latitude);
- }
- }
} else {
position = position_el->FindElementTripletConvertTo("FT");
}
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_PROPERTYMANAGER "$Id: FGPropertyManager.h,v 1.28 2013/09/28 14:43:15 bcoconni Exp $"
+#define ID_PROPERTYMANAGER "$Id: FGPropertyManager.h,v 1.29 2014/11/15 11:32:54 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
* Assign a bool value to a property. If the property does not
* yet exist, it will be created and its type will be set to
* BOOL; if it has a type of UNKNOWN, the type will also be set to
- * BOOL; otherwise, the bool value will be converted to the property's
+ * BOOL; otherwise, the value type will be converted to the property's
* type.
*
* @param name The property name.
* Assign an int value to a property. If the property does not
* yet exist, it will be created and its type will be set to
* INT; if it has a type of UNKNOWN, the type will also be set to
- * INT; otherwise, the bool value will be converted to the property's
+ * INT; otherwise, the value type will be converted to the property's
* type.
*
* @param name The property name.
* Assign a long value to a property. If the property does not
* yet exist, it will be created and its type will be set to
* LONG; if it has a type of UNKNOWN, the type will also be set to
- * LONG; otherwise, the bool value will be converted to the property's
+ * LONG; otherwise, the value type will be converted to the property's
* type.
*
* @param name The property name.
* Assign a float value to a property. If the property does not
* yet exist, it will be created and its type will be set to
* FLOAT; if it has a type of UNKNOWN, the type will also be set to
- * FLOAT; otherwise, the bool value will be converted to the property's
+ * FLOAT; otherwise, the value type will be converted to the property's
* type.
*
* @param name The property name.
#include "FGRealValue.h"
+#include "input_output/string_utilities.h"
+
+using namespace std;
+
namespace JSBSim {
-IDENT(IdSrc,"$Id: FGRealValue.cpp,v 1.6 2014/01/13 10:46:03 ehofman Exp $");
+IDENT(IdSrc,"$Id: FGRealValue.cpp,v 1.7 2014/11/18 18:38:27 bcoconni Exp $");
IDENT(IdHdr,ID_REALVALUE);
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
return Value;
}
+std::string FGRealValue::GetName(void) const
+{
+ return std::string("constant value ") + to_string(Value);
+}
+
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGParameter.h"
-#include "input_output/string_utilities.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_REALVALUE "$Id: FGRealValue.h,v 1.6 2014/08/28 13:44:27 bcoconni Exp $"
+#define ID_REALVALUE "$Id: FGRealValue.h,v 1.7 2014/11/18 18:38:25 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
~FGRealValue() {};
double GetValue(void) const;
- std::string GetName(void) const
- { return std::string("constant value ") + to_string(Value); }
+ std::string GetName(void) const;
private:
double Value;