From 86d46ce79c10afe167d018828290c86a590e9086 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Tue, 21 Feb 2017 22:35:09 +0100 Subject: [PATCH] Sync w/ JSBSim --- src/FDM/JSBSim/models/FGLGear.cpp | 10 ++++++++-- src/FDM/JSBSim/models/propulsion/FGTank.cpp | 10 +++++++++- src/FDM/JSBSim/models/propulsion/FGTank.h | 9 ++++++++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/FDM/JSBSim/models/FGLGear.cpp b/src/FDM/JSBSim/models/FGLGear.cpp index 00ddba4fe..f8e6e2d81 100644 --- a/src/FDM/JSBSim/models/FGLGear.cpp +++ b/src/FDM/JSBSim/models/FGLGear.cpp @@ -61,7 +61,7 @@ DEFINITIONS GLOBAL DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -IDENT(IdSrc,"$Id: FGLGear.cpp,v 1.124 2016/06/25 17:48:02 bcoconni Exp $"); +IDENT(IdSrc,"$Id: FGLGear.cpp,v 1.125 2017/02/21 21:14:13 bcoconni Exp $"); IDENT(IdHdr,ID_LGEAR); // Body To Structural (body frame is rotated 180 deg about Y and lengths are given in @@ -784,9 +784,15 @@ void FGLGear::bind(void) property_name = base_property_name + "/WOW"; PropertyManager->Tie( property_name.c_str(), &WOW ); + property_name = base_property_name + "/x-position"; + PropertyManager->Tie( property_name.c_str(), (FGForce*)this, + &FGForce::GetLocationX, &FGForce::SetLocationX); + property_name = base_property_name + "/y-position"; + PropertyManager->Tie( property_name.c_str(), (FGForce*)this, + &FGForce::GetLocationY, &FGForce::SetLocationY); property_name = base_property_name + "/z-position"; PropertyManager->Tie( property_name.c_str(), (FGForce*)this, - &FGForce::GetLocationZ, &FGForce::SetLocationZ); + &FGForce::GetLocationZ, &FGForce::SetLocationZ); property_name = base_property_name + "/compression-ft"; PropertyManager->Tie( property_name.c_str(), &compressLength ); property_name = base_property_name + "/compression-velocity-fps"; diff --git a/src/FDM/JSBSim/models/propulsion/FGTank.cpp b/src/FDM/JSBSim/models/propulsion/FGTank.cpp index e4e8348e8..9451db599 100644 --- a/src/FDM/JSBSim/models/propulsion/FGTank.cpp +++ b/src/FDM/JSBSim/models/propulsion/FGTank.cpp @@ -48,7 +48,7 @@ using namespace std; namespace JSBSim { -IDENT(IdSrc,"$Id: FGTank.cpp,v 1.45 2016/05/05 17:23:10 bcoconni Exp $"); +IDENT(IdSrc,"$Id: FGTank.cpp,v 1.46 2017/02/21 21:07:04 bcoconni Exp $"); IDENT(IdHdr,ID_TANK); /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -465,6 +465,14 @@ void FGTank::bind(FGPropertyManager* PropertyManager) PropertyManager->Tie( property_name.c_str(), (FGTank*)this, &FGTank::GetIyy); property_name = base_property_name + "/local-izz-slug_ft2"; PropertyManager->Tie( property_name.c_str(), (FGTank*)this, &FGTank::GetIzz); + + property_name = base_property_name + "/x-position"; + PropertyManager->Tie(property_name.c_str(), (FGTank*)this, &FGTank::GetLocationX, &FGTank::SetLocationX); + property_name = base_property_name + "/y-position"; + PropertyManager->Tie(property_name.c_str(), (FGTank*)this, &FGTank::GetLocationY, &FGTank::SetLocationY); + property_name = base_property_name + "/z-position"; + PropertyManager->Tie(property_name.c_str(), (FGTank*)this, &FGTank::GetLocationZ, &FGTank::SetLocationZ); + } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/models/propulsion/FGTank.h b/src/FDM/JSBSim/models/propulsion/FGTank.h index 09f0ee9f3..d7ca94661 100644 --- a/src/FDM/JSBSim/models/propulsion/FGTank.h +++ b/src/FDM/JSBSim/models/propulsion/FGTank.h @@ -53,7 +53,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_TANK "$Id: FGTank.h,v 1.31 2015/12/09 04:28:18 jberndt Exp $" +#define ID_TANK "$Id: FGTank.h,v 1.32 2017/02/21 21:07:04 bcoconni Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -283,6 +283,13 @@ public: double GetIyy(void) const {return Iyy;} double GetIzz(void) const {return Izz;} + inline double GetLocationX(void) const { return vXYZ(eX); } + inline double GetLocationY(void) const { return vXYZ(eY); } + inline double GetLocationZ(void) const { return vXYZ(eZ); } + inline void SetLocationX(double x) { vXYZ(eX) = x; } + inline void SetLocationY(double y) { vXYZ(eY) = y; } + inline void SetLocationZ(double z) { vXYZ(eZ) = z; } + double GetStandpipe(void) const {return Standpipe;} int GetPriority(void) const {return Priority;}