From: Bertrand <bco...@us...> - 2017-05-26 10:49:43
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv21785/src/models Modified Files: FGExternalForce.cpp FGExternalForce.h FGExternalReactions.cpp FGExternalReactions.h Log Message: Code clean up: remove duplicate methods FGExternalForce::GetLoc[XYZ] and deprecated FGExternalReactions members Index: FGExternalForce.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** FGExternalForce.cpp 18 Dec 2014 09:56:05 -0000 1.16 --- FGExternalForce.cpp 26 May 2017 10:49:39 -0000 1.17 *************** *** 66,70 **** //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGExternalForce::FGExternalForce(FGFDMExec *FDMExec, Element *el, int index) : FGForce(FDMExec) { --- 66,70 ---- //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! FGExternalForce::FGExternalForce(FGFDMExec *FDMExec, Element *el) : FGForce(FDMExec) { *************** *** 125,131 **** SetLocation(location); } ! PropertyManager->Tie( BasePropertyName + "/location-x-in", (FGExternalForce*)this, &FGExternalForce::GetLocX, &FGExternalForce::SetLocX); ! PropertyManager->Tie( BasePropertyName + "/location-y-in", (FGExternalForce*)this, &FGExternalForce::GetLocY, &FGExternalForce::SetLocY); ! PropertyManager->Tie( BasePropertyName + "/location-z-in", (FGExternalForce*)this, &FGExternalForce::GetLocZ, &FGExternalForce::SetLocZ); direction_element = el->FindElement("direction"); --- 125,134 ---- SetLocation(location); } ! PropertyManager->Tie( BasePropertyName + "/location-x-in", (FGForce*)this, ! &FGForce::GetLocationX, &FGForce::SetLocationX); ! PropertyManager->Tie( BasePropertyName + "/location-y-in", (FGForce*)this, ! &FGForce::GetLocationY, &FGForce::SetLocationY); ! PropertyManager->Tie( BasePropertyName + "/location-z-in", (FGForce*)this, ! &FGForce::GetLocationZ, &FGForce::SetLocationZ); direction_element = el->FindElement("direction"); Index: FGExternalForce.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalForce.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** FGExternalForce.h 25 Nov 2014 01:44:17 -0000 1.13 --- FGExternalForce.h 26 May 2017 10:49:39 -0000 1.14 *************** *** 127,133 **** @code ! external_reactions/{force name}/locx ! external_reactions/{force name}/locy ! external_reactions/{force name}/locz @endcode --- 127,133 ---- @code ! external_reactions/{force name}/location-x-in ! external_reactions/{force name}/location-y-in ! external_reactions/{force name}/location-z-in @endcode *************** *** 151,155 **** @param index the position of this force object in the whole list. */ ! FGExternalForce(FGFDMExec *FDMExec, Element *el, int index); /** Copy Constructor --- 151,155 ---- @param index the position of this force object in the whole list. */ ! FGExternalForce(FGFDMExec *FDMExec, Element *el); /** Copy Constructor *************** *** 173,183 **** void SetY(double y) {vDirection(eY) = y;} void SetZ(double z) {vDirection(eZ) = z;} ! double GetLocX(void) const {return vActingXYZn(eX);} ! double GetLocY(void) const {return vActingXYZn(eY);} ! double GetLocZ(void) const {return vActingXYZn(eZ);} ! void SetLocX(double x) {vXYZn(eX) = x; vActingXYZn(eX) = x;} ! void SetLocY(double y) {vXYZn(eY) = y; vActingXYZn(eY) = y;} ! void SetLocZ(double z) {vXYZn(eZ) = z; vActingXYZn(eZ) = z;} ! private: --- 173,177 ---- void SetY(double y) {vDirection(eY) = y;} void SetZ(double z) {vDirection(eZ) = z;} ! private: Index: FGExternalReactions.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** FGExternalReactions.cpp 31 Jan 2015 14:56:21 -0000 1.21 --- FGExternalReactions.cpp 26 May 2017 10:49:39 -0000 1.22 *************** *** 64,69 **** FGExternalReactions::FGExternalReactions(FGFDMExec* fdmex) : FGModel(fdmex) { - NoneDefined = true; - Debug(0); } --- 64,67 ---- *************** *** 81,90 **** // Parse force elements - int index=0; Element* force_element = el->FindElement("force"); while (force_element) { ! Forces.push_back( new FGExternalForce(FDMExec, force_element, index) ); ! NoneDefined = false; ! index++; force_element = el->FindNextElement("force"); } --- 79,85 ---- // Parse force elements Element* force_element = el->FindElement("force"); while (force_element) { ! Forces.push_back( new FGExternalForce(FDMExec, force_element) ); force_element = el->FindNextElement("force"); } *************** *** 92,96 **** PostLoad(el, PropertyManager); ! if (!NoneDefined) bind(); return true; --- 87,91 ---- PostLoad(el, PropertyManager); ! if (!Forces.empty()) bind(); return true; *************** *** 125,129 **** if (FGModel::Run(Holding)) return true; if (Holding) return false; // if paused don't execute ! if (NoneDefined) return true; RunPreFunctions(); --- 120,124 ---- if (FGModel::Run(Holding)) return true; if (Holding) return false; // if paused don't execute ! if (Forces.empty()) return true; RunPreFunctions(); Index: FGExternalReactions.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGExternalReactions.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** FGExternalReactions.h 27 Feb 2015 20:36:47 -0000 1.17 --- FGExternalReactions.h 26 May 2017 10:49:39 -0000 1.18 *************** *** 168,173 **** FGColumnVector3 vTotalMoments; - bool NoneDefined; - void bind(void); void Debug(int from); --- 168,171 ---- |