+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/sg_path.hxx>
char buf[256];
for(int i=0; i<_fdm->getAirplane()->getModel()->numThrusters(); i++) {
- sprintf(buf, "/engines/engine[%d]/fuel-flow-gph", i); fgUntie(buf);
- sprintf(buf, "/engines/engine[%d]/rpm", i); fgUntie(buf);
- sprintf(buf, "/engines/engine[%d]/mp-osi", i); fgUntie(buf);
- sprintf(buf, "/engines/engine[%d]/egt-degf", i); fgUntie(buf);
+ sprintf(buf, "/engines/engine[%d]/fuel-flow-gph", i); fgUntie(buf);
+ sprintf(buf, "/engines/engine[%d]/rpm", i); fgUntie(buf);
+ sprintf(buf, "/engines/engine[%d]/mp-osi", i); fgUntie(buf);
+ sprintf(buf, "/engines/engine[%d]/egt-degf", i); fgUntie(buf);
+ sprintf(buf, "/engines/engine[%d]/oil-temperature-degf", i); fgUntie(buf);
}
}
SGPropertyNode * node = fgGetNode("gear/gear", i, true);
float pos[3];
g->getPosition(pos);
- node->setDoubleValue("xoffset-in", pos[0]);
- node->setDoubleValue("yoffset-in", pos[1]);
- node->setDoubleValue("zoffset-in", pos[2]);
+ node->setDoubleValue("xoffset-in", pos[0] * M2FT * 12);
+ node->setDoubleValue("yoffset-in", pos[1] * M2FT * 12);
+ node->setDoubleValue("zoffset-in", pos[2] * M2FT * 12);
}
// Are we at ground level? If so, lift the plane up so the gear
void YASim::copyToYASim(bool copyState)
{
// Physical state
- float lat = get_Latitude();
- float lon = get_Longitude();
+ double lat = get_Latitude();
+ double lon = get_Longitude();
float alt = get_Altitude() * FT2M;
float roll = get_Phi();
float pitch = get_Theta();
double lat, lon, alt;
sgCartToGeod(s->pos, &lat, &lon, &alt);
_set_Geodetic_Position(lat, lon, alt*M2FT);
- _update_ground_elev_at_pos();
+ double groundlevel_m = get_groundlevel_m(lat, lon, alt);
+ _set_Runway_altitude(groundlevel_m*SG_METER_TO_FEET);
+ _set_Altitude_AGL((alt-groundlevel_m)*SG_METER_TO_FEET);
+
+ // the smallest agl of all gears
+ fgSetFloat("/position/gear-agl-m", model->getAGL());
+ fgSetFloat("/position/gear-agl-ft", model->getAGL()*M2FT);
// UNUSED
//_set_Geocentric_Position(Glue::geod2geocLat(lat), lon, alt*M2FT);
- _set_Altitude_AGL(model->getAGL() * M2FT);
-
// useful conversion matrix
float xyz2ned[9];
Glue::xyz2nedMat(lat, lon, xyz2ned);
node->setBoolValue("has-brake", g->getBrake() != 0);
node->setBoolValue("wow", g->getCompressFraction() != 0);
node->setFloatValue("compression-norm", g->getCompressFraction());
+ node->setFloatValue("compression-m", g->getCompressDist());
node->setFloatValue("caster-angle-deg", g->getCasterAngle() * RAD2DEG);
node->setFloatValue("rollspeed-ms", g->getRollSpeed());
}
if(l) {
SGPropertyNode * node = fgGetNode("gear/launchbar", 0, true);
node->setFloatValue("position-norm", l->getCompressFraction());
+ node->setFloatValue("holdback-position-norm", l->getHoldbackCompressFraction());
+ node->setStringValue("state", l->getState());
+ node->setBoolValue("strop", l->getStrop());
}
+
}