From ef9fa25b94ef0eab739461665e7a813868b95b87 Mon Sep 17 00:00:00 2001 From: Henning Stahlke Date: Tue, 18 Apr 2017 22:27:35 +0200 Subject: [PATCH] YASim: update default for desired cg range. --- src/FDM/YASim/Airplane.cpp | 4 ---- src/FDM/YASim/Airplane.hpp | 10 +++++----- src/FDM/YASim/FGFDM.cpp | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/FDM/YASim/Airplane.cpp b/src/FDM/YASim/Airplane.cpp index 57c0d4fa9..68ae0d9fb 100644 --- a/src/FDM/YASim/Airplane.cpp +++ b/src/FDM/YASim/Airplane.cpp @@ -57,10 +57,6 @@ Airplane::Airplane() _failureMsg = 0; _wingsN = 0; - _cgMax = -1e6; - _cgMin = 1e6; - _cgDesiredMax = 0.33f; // FIXME find reasonable default value - _cgDesiredMin = 0.1f; // FIXME find reasonable default value } Airplane::~Airplane() diff --git a/src/FDM/YASim/Airplane.hpp b/src/FDM/YASim/Airplane.hpp index b90723424..8ee625fd5 100644 --- a/src/FDM/YASim/Airplane.hpp +++ b/src/FDM/YASim/Airplane.hpp @@ -194,11 +194,11 @@ private: float _tailIncidence; Control _approachElevator; const char* _failureMsg; - - float _cgMax; // hard limits for cg from gear position - float _cgMin; // hard limits for cg from gear position - float _cgDesiredMax; // desired cg max in %MAC from config - float _cgDesiredMin; // desired cg min in %MAC from config + + float _cgMax = -1e6; // hard limits for cg from gear position + float _cgMin = 1e6; // hard limits for cg from gear position + float _cgDesiredMax = 0.3f; // desired cg max in %MAC from config + float _cgDesiredMin = 0.25f; // desired cg min in %MAC from config float _cgDesiredFront; // calculated desired cg x max float _cgDesiredAft; // calculated desired cg x min bool _autoBallast = false; diff --git a/src/FDM/YASim/FGFDM.cpp b/src/FDM/YASim/FGFDM.cpp index 3a604ef28..8bcd6437f 100644 --- a/src/FDM/YASim/FGFDM.cpp +++ b/src/FDM/YASim/FGFDM.cpp @@ -259,7 +259,7 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts) if( !_airplane.isVersionOrNewer( Version::YASIM_VERSION_CURRENT ) ) { SG_LOG(SG_FLIGHT, SG_DEV_ALERT, "This aircraft does not use the latest yasim configuration version."); } - _airplane.setDesiredCGRangeInPercentOfMAC(attrf(a, "cg-min", 0.1f), attrf(a, "cg-max", 0.3f)); //FIXME find reasonable defaults + _airplane.setDesiredCGRangeInPercentOfMAC(attrf(a, "cg-min", 0.25f), attrf(a, "cg-max", 0.3f)); //FIXME find reasonable defaults if (attrb(a, "auto-ballast")) { _airplane.setAutoBallast(true); }