Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29588/src/models/propulsion
Modified Files:
FGTank.h FGTank.cpp
Log Message:
Expose tank positions (X,Y,Z) to be set via properties; this allows better modelling of variable geometry.
Index: FGTank.h
===================================================================
RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGTank.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** FGTank.h 9 Dec 2015 04:28:18 -0000 1.31
--- FGTank.h 21 Feb 2017 21:07:04 -0000 1.32
***************
*** 284,287 ****
--- 284,294 ----
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;}
Index: FGTank.cpp
===================================================================
RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGTank.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** FGTank.cpp 5 May 2016 17:23:10 -0000 1.45
--- FGTank.cpp 21 Feb 2017 21:07:04 -0000 1.46
***************
*** 466,469 ****
--- 466,477 ----
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);
+
}
|