53#if defined(WIN32) && !defined(__CYGWIN__)
56# include <netinet/in.h>
60# define min(X,Y) X<Y?X:Y
64#define isLittleEndian (*((char *) &endianTest ) != 0)
86 Double_Overlay = (
int *) &x;
87 Holding_Buffer = Double_Overlay [0];
89 Double_Overlay [0] = htonl (Double_Overlay [1]);
90 Double_Overlay [1] = htonl (Holding_Buffer);
103 Float_Overlay = (
int *) &x;
104 Holding_Buffer = Float_Overlay [0];
106 Float_Overlay [0] = htonl (Holding_Buffer);
120 memset(&fgSockBuf, 0x0,
sizeof(fgSockBuf));
125 cerr <<
"This vehicle has " <<
Propulsion->GetNumEngines() <<
" engines, but the current " << endl
131 cerr <<
"This vehicle has " <<
Propulsion->GetNumTanks() <<
" tanks, but the current " << endl
137 cerr <<
"This vehicle has " <<
GroundReactions->GetNumGearUnits() <<
" bogeys, but the current " << endl
156 outputOptions.useSimTime =
true;
174void FGOutputFG::SocketDataFill(
FGNetFDM* net)
234 net->
rpm[
i] = (float)(piston_engine->
getRPM());
237 net->
egt[
i] = (float)(piston_engine->
GetEGT());
250 net->
rpm[
i] =
static_cast<float>(
static_cast<FGElectric*
>(engine)->getRPM());
276 if (outputOptions.useSimTime) {
278 net->
cur_time =
static_cast<uint32_t
>(
FDMExec->GetSimTime()*outputOptions.timeFactor);
380 int length =
sizeof(fgSockBuf);
383 if (!
socket->GetConnectStatus())
return;
385 SocketDataFill(&fgSockBuf);
386 socket->Send((
char *)&fgSockBuf, length);
static const int endianTest
uint32_t wow[FG_MAX_WHEELS]
float cht[FG_MAX_ENGINES]
float fuel_flow[FG_MAX_ENGINES]
float mp_osi[FG_MAX_ENGINES]
float gear_steer[FG_MAX_WHEELS]
float gear_pos[FG_MAX_WHEELS]
float tit[FG_MAX_ENGINES]
float egt[FG_MAX_ENGINES]
float oil_temp[FG_MAX_ENGINES]
float rpm[FG_MAX_ENGINES]
uint32_t eng_state[FG_MAX_ENGINES]
float gear_compression[FG_MAX_WHEELS]
float fuel_quantity[FG_MAX_TANKS]
float fuel_px[FG_MAX_ENGINES]
float oil_px[FG_MAX_ENGINES]
double GetAttributeValueAsNumber(const std::string &key)
Retrieves an attribute value as a double precision real number.
bool HasAttribute(const std::string &key)
Determines if an element has the supplied attribute.
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.
Element * FindElement(const std::string &el="")
Searches for a specified element.
double Getbeta(void) const
double GetPilotAccel(int idx) const
double GetEulerRates(int axis) const
double Getalpha(void) const
double GetVcalibratedKTS(void) const
Returns Calibrated airspeed in knots.
Base class for all engines.
virtual double getFuelFlow_gph() const
virtual bool GetCranking(void) const
virtual bool GetRunning(void) const
EngineType GetType(void) const
int GetDebugLevel(void) const
Retrieves the current debug level setting.
bool Load(Element *) override
Evaluate the output directives from an XML file.
void Print(void) override
Generate the output.
FGOutputFG(FGFDMExec *fdmex)
Constructor.
FGOutputSocket(FGFDMExec *fdmex)
Constructor.
bool Load(Element *el) override
Init the output directives from an XML file.
FGGroundReactions * GroundReactions
FGPropulsion * Propulsion
Models a Supercharged Piston engine.
double getOilPressure_psi(void) const
double getOilTemp_degF(void) const
double getRPM(void) const
double getCylinderHeadTemp_degF(void) const
double GetEGT(void) const
double getManifoldPressure_inHg(void) const
double GetGeodLatitudeRad(void) const
double GetLongitude(void) const
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles that define the vehicle orientation.
double GetAltitudeASL(void) const
Returns the current altitude above sea level.
double GetDistanceAGL(void) const
double Gethdot(void) const
Returns the current altitude rate.
const FGColumnVector3 & GetUVW(void) const
Retrieves the body frame vehicle velocity vector.
const FGColumnVector3 & GetVel(void) const
Retrieves the velocity vector.
unsigned int GetNumEngines(void) const
Retrieves the number of engines defined for the aircraft.
FGEngine * GetEngine(unsigned int index) const
Retrieves an engine object pointer from the list of engines.
static void htonf(float &x)
static void htond(double &x)