1
0
Fork 0

YASIM: rename method getMAC to getMACLength

This commit is contained in:
Henning Stahlke 2017-11-19 11:20:46 +01:00
parent c3bfeb4ba0
commit 43af435085
3 changed files with 6 additions and 6 deletions

View file

@ -320,7 +320,7 @@ float Airplane::compileWing(Wing* w)
_wingsN->getNode("wing-area", true)->setFloatValue(w->getArea()); _wingsN->getNode("wing-area", true)->setFloatValue(w->getArea());
_wingsN->getNode("aspect-ratio", true)->setFloatValue(w->getAspectRatio()); _wingsN->getNode("aspect-ratio", true)->setFloatValue(w->getAspectRatio());
_wingsN->getNode("standard-mean-chord", true)->setFloatValue(w->getSMC()); _wingsN->getNode("standard-mean-chord", true)->setFloatValue(w->getSMC());
_wingsN->getNode("mac", true)->setFloatValue(w->getMAC()); _wingsN->getNode("mac", true)->setFloatValue(w->getMACLength());
_wingsN->getNode("mac-x", true)->setFloatValue(w->getMACx()); _wingsN->getNode("mac-x", true)->setFloatValue(w->getMACx());
_wingsN->getNode("mac-y", true)->setFloatValue(w->getMACy()); _wingsN->getNode("mac-y", true)->setFloatValue(w->getMACy());
} }
@ -547,8 +547,8 @@ void Airplane::compile()
aeroWgt += compileWing(_wing); aeroWgt += compileWing(_wing);
// convert % to absolute x coordinates // convert % to absolute x coordinates
_cgDesiredFront = _wing->getMACx() - _wing->getMAC()*_cgDesiredMin; _cgDesiredFront = _wing->getMACx() - _wing->getMACLength()*_cgDesiredMin;
_cgDesiredAft = _wing->getMACx() - _wing->getMAC()*_cgDesiredMax; _cgDesiredAft = _wing->getMACx() - _wing->getMACLength()*_cgDesiredMax;
if (baseN != 0) { if (baseN != 0) {
SGPropertyNode_ptr n = fgGetNode("/fdm/yasim/model", true); SGPropertyNode_ptr n = fgGetNode("/fdm/yasim/model", true);
n->getNode("cg-x-range-front", true)->setFloatValue(_cgDesiredFront); n->getNode("cg-x-range-front", true)->setFloatValue(_cgDesiredFront);
@ -1034,7 +1034,7 @@ float Airplane::getCGMAC()
if (_wing) { if (_wing) {
float cg[3]; float cg[3];
_model.getBody()->getCG(cg); _model.getBody()->getCG(cg);
return (_wing->getMACx() - cg[0]) / _wing->getMAC(); return (_wing->getMACx() - cg[0]) / _wing->getMACLength();
} }
return 0; return 0;
} }

View file

@ -78,7 +78,7 @@ public:
float getArea() const { return _wingspan*_meanChord; }; float getArea() const { return _wingspan*_meanChord; };
float getAspectRatio() const { return _aspectRatio; }; float getAspectRatio() const { return _aspectRatio; };
float getSMC() const { return _meanChord; }; float getSMC() const { return _meanChord; };
float getMAC() const { return _mac; }; // get length of MAC float getMACLength() const { return _mac; }; // get length of MAC
float getMACx() const { return _macX; }; // get x-coord of MAC leading edge float getMACx() const { return _macX; }; // get x-coord of MAC leading edge
float getMACy() const { return _base[1]+_macRootDistance; }; // get y-coord of MAC leading edge float getMACy() const { return _base[1]+_macRootDistance; }; // get y-coord of MAC leading edge

View file

@ -248,7 +248,7 @@ int main(int argc, char** argv)
float MAC = 0, MACx = 0, MACy = 0; float MAC = 0, MACx = 0, MACy = 0;
Wing* wing = a->getWing(); Wing* wing = a->getWing();
if (wing) { if (wing) {
MAC = a->getWing()->getMAC(); MAC = a->getWing()->getMACLength();
MACx = a->getWing()->getMACx(); MACx = a->getWing()->getMACx();
MACy = a->getWing()->getMACy(); MACy = a->getWing()->getMACy();
} }