SubSystems = 0;
enabled = true;
-#ifdef FG_WITH_JSBSIM_SOCKET
- socket = new FGfdmSocket("localhost",1138);
-#endif
Debug(0);
}
} else {
// Not a valid type of output
}
-
+ return false;
} else {
+ return true;
}
}
return false;
Type = otSocket;
} else if (type == "TERMINAL") {
Type = otTerminal;
- } else if (type != string("NONE")){
+ } else if (type != string("NONE")) {
Type = otUnknown;
cerr << "Unknown type of output specified in config file" << endl;
}
outstream << "Aileron Cmd, ";
outstream << "Elevator Cmd, ";
outstream << "Rudder Cmd, ";
- outstream << "Aileron Pos, ";
+ outstream << "Flap Cmd, ";
+ outstream << "Left Aileron Pos, ";
+ outstream << "Right Aileron Pos, ";
outstream << "Elevator Pos, ";
- outstream << "Rudder Pos";
+ outstream << "Rudder Pos, ";
+ outstream << "Flap Pos";
}
if (SubSystems & ssRates) {
outstream << ", ";
outstream << ", ";
outstream << "Drag, Side, Lift, ";
outstream << "L/D, ";
- outstream << "Xforce, Yforce, Zforce";
+ outstream << "Xforce, Yforce, Zforce, ";
+ outstream << "xGravity, yGravity, zGravity, ";
+ outstream << "xCoriolis, yCoriolis, zCoriolis, ";
+ outstream << "xCentrifugal, yCentrifugal, zCentrifugal";
}
if (SubSystems & ssMoments) {
outstream << ", ";
outstream << ", ";
outstream << Aerodynamics->GetCoefficientStrings();
}
+ if (SubSystems & ssFCS) {
+ outstream << ", ";
+ outstream << FCS->GetComponentStrings();
+ }
if (SubSystems & ssGroundReactions) {
outstream << ", ";
outstream << GroundReactions->GetGroundReactionStrings();
outstream << FCS->GetDaCmd() << ", ";
outstream << FCS->GetDeCmd() << ", ";
outstream << FCS->GetDrCmd() << ", ";
- outstream << FCS->GetDaPos() << ", ";
+ outstream << FCS->GetDfCmd() << ", ";
+ outstream << FCS->GetDaLPos() << ", ";
+ outstream << FCS->GetDaRPos() << ", ";
outstream << FCS->GetDePos() << ", ";
- outstream << FCS->GetDrPos();
+ outstream << FCS->GetDrPos() << ", ";
+ outstream << FCS->GetDfPos();
}
if (SubSystems & ssRates) {
outstream << ", ";
outstream << Translation->Getqbar() << ", ";
outstream << Translation->GetVt() << ", ";
outstream << Translation->GetUVW() << ", ";
- outstream << Translation->GetvAeroUVW() << ", ";
+ outstream << Translation->GetAeroUVW() << ", ";
outstream << Position->GetVel();
}
if (SubSystems & ssForces) {
outstream << ", ";
outstream << Aerodynamics->GetvFs() << ", ";
outstream << Aerodynamics->GetLoD() << ", ";
- outstream << Aircraft->GetForces();
+ outstream << Aircraft->GetForces() << ", ";
+ outstream << Inertial->GetGravity() << ", ";
+ outstream << Inertial->GetCoriolis() << ", ";
+ outstream << Inertial->GetCentrifugal();
}
if (SubSystems & ssMoments) {
outstream << ", ";
outstream << ", ";
outstream << Aerodynamics->GetCoefficientValues();
}
+ if (SubSystems & ssFCS) {
+ outstream << ", ";
+ outstream << FCS->GetComponentValues();
+ }
if (SubSystems & ssGroundReactions) {
outstream << ", ";
outstream << GroundReactions->GetGroundReactionValues();
void FGOutput::SocketOutput(void)
{
string asciiData;
- /*
+
if (socket == NULL) return;
+ if (!socket->GetConnectStatus()) return;
socket->Clear();
if (sFirstPass) {
socket->Append("L");
socket->Append("M");
socket->Append("N");
- socket->Append("Throttle");
- socket->Append("Aileron");
- socket->Append("Elevator");
- socket->Append("Rudder");
+ socket->Append("Throttle Position");
+ socket->Append("Left Aileron Position");
+ socket->Append("Right Aileron Position");
+ socket->Append("Elevator Position");
+ socket->Append("Rudder Position");
sFirstPass = false;
socket->Send();
}
socket->Append(Translation->GetUVW(eU));
socket->Append(Translation->GetUVW(eV));
socket->Append(Translation->GetUVW(eW));
- socket->Append(Translation->GetvAeroUVW(eU));
- socket->Append(Translation->GetvAeroUVW(eV));
- socket->Append(Translation->GetvAeroUVW(eW));
+ socket->Append(Translation->GetAeroUVW(eU));
+ socket->Append(Translation->GetAeroUVW(eV));
+ socket->Append(Translation->GetAeroUVW(eW));
socket->Append(Position->GetVn());
socket->Append(Position->GetVe());
socket->Append(Position->GetVd());
- socket->Append(Translation->GetUdot());
- socket->Append(Translation->GetVdot());
- socket->Append(Translation->GetWdot());
- socket->Append(Rotation->GetP());
- socket->Append(Rotation->GetQ());
- socket->Append(Rotation->GetR());
- socket->Append(Rotation->GetPdot());
- socket->Append(Rotation->GetQdot());
- socket->Append(Rotation->GetRdot());
- socket->Append(Aircraft->GetFx());
- socket->Append(Aircraft->GetFy());
- socket->Append(Aircraft->GetFz());
+ socket->Append(Translation->GetUVWdot(eU));
+ socket->Append(Translation->GetUVWdot(eV));
+ socket->Append(Translation->GetUVWdot(eW));
+ socket->Append(Rotation->GetPQR(eP));
+ socket->Append(Rotation->GetPQR(eQ));
+ socket->Append(Rotation->GetPQR(eR));
+ socket->Append(Rotation->GetPQRdot(eP));
+ socket->Append(Rotation->GetPQRdot(eQ));
+ socket->Append(Rotation->GetPQRdot(eR));
+ socket->Append(Aircraft->GetForces(eX));
+ socket->Append(Aircraft->GetForces(eY));
+ socket->Append(Aircraft->GetForces(eZ));
socket->Append(Position->GetLatitude());
socket->Append(Position->GetLongitude());
socket->Append(Translation->Getqbar());
socket->Append(Translation->Getalpha());
- socket->Append(Aircraft->GetL());
- socket->Append(Aircraft->GetM());
- socket->Append(Aircraft->GetN());
- socket->Append(FCS->GetThrottle(0));
- socket->Append(FCS->GetDa());
- socket->Append(FCS->GetDe());
- socket->Append(FCS->GetDr());
- socket->Send(); */
+ socket->Append(Aircraft->GetMoments(eL));
+ socket->Append(Aircraft->GetMoments(eM));
+ socket->Append(Aircraft->GetMoments(eN));
+ socket->Append(FCS->GetThrottlePos(0));
+ socket->Append(FCS->GetDaLPos());
+ socket->Append(FCS->GetDaRPos());
+ socket->Append(FCS->GetDePos());
+ socket->Append(FCS->GetDrPos());
+ socket->Send();
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Output->SetFilename(token);
token = AC_cfg->GetValue("TYPE");
Output->SetType(token);
+
+#if defined( FG_WITH_JSBSIM_SOCKET ) || !defined( FGFS )
+ if (token == "SOCKET") {
+ socket = new FGfdmSocket("localhost",1138);
+ }
+#endif
+
AC_cfg->GetNextConfigLine();
while ((token = AC_cfg->GetValue()) != string("/OUTPUT")) {
}
if (debug_lvl & 16) { // Sanity checking
}
+ if (debug_lvl & 64) {
+ if (from == 0) { // Constructor
+ cout << IdSrc << endl;
+ cout << IdHdr << endl;
+ }
+ }
}