86 size_t dot_pos = fname.find(
':', 0);
87 size_t slash_pos = fname.find(
'/', 0);
89 string name = fname.substr(0, dot_pos);
92 if(dot_pos + 1 < slash_pos)
93 proto = fname.substr(dot_pos + 1, slash_pos - dot_pos - 1);
96 if(slash_pos < string::npos)
97 port = fname.substr(slash_pos + 1, string::npos);
100 Name =
name +
":" + port +
"/" + proto;
141 if (
socket == 0)
return false;
142 if (!
socket->GetConnectStatus())
return false;
159 socket->Clear(
"<LABELS>");
163 socket->Append(
"Aileron Command");
164 socket->Append(
"Elevator Command");
165 socket->Append(
"Rudder Command");
166 socket->Append(
"Flap Command");
167 socket->Append(
"Left Aileron Position");
168 socket->Append(
"Right Aileron Position");
169 socket->Append(
"Elevator Position");
170 socket->Append(
"Rudder Position");
171 socket->Append(
"Flap Position");
215 socket->Append(
"SL pressure");
216 socket->Append(
"Ambient pressure");
217 socket->Append(
"Turbulence Magnitude");
218 socket->Append(
"Turbulence Direction");
241 socket->Append(
"Altitude");
242 socket->Append(
"Phi (deg)");
243 socket->Append(
"Tht (deg)");
244 socket->Append(
"Psi (deg)");
245 socket->Append(
"Alpha (deg)");
246 socket->Append(
"Beta (deg)");
247 socket->Append(
"Latitude (deg)");
248 socket->Append(
"Longitude (deg)");
253 if (scratch.length() != 0)
socket->Append(scratch);
257 scratch =
FCS->GetComponentStrings(
",");
258 if (scratch.length() != 0)
socket->Append(scratch);
281 string asciiData, scratch;
284 if (!
socket->GetConnectStatus())
return;
341 socket->Append(
Winds->GetTotalWindNED().Dump(
","));
370 if (scratch.length() != 0)
socket->Append(scratch);
373 scratch =
FCS->GetComponentValues(
",");
374 if (scratch.length() != 0)
socket->Append(scratch);
399 asciiData = string(
"<STATUS>") + out_str;
400 socket->Append(asciiData.c_str());
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.
static constexpr double radtodeg
void SocketStatusOutput(const std::string &out_str)
Outputs a status thru the socket.
void Print(void) override
Generates the output.
FGfdmSocket::ProtocolType SockProtocol
~FGOutputSocket() override
Destructor.
bool InitModel(void) override
Initializes the instance.
void SetOutputName(const std::string &name) override
Overwrites the name identifier under which the output will be logged.
virtual void PrintHeaders(void)
FGOutputSocket(FGFDMExec *fdmex)
Constructor.
bool Load(Element *el) override
Init the output directives from an XML file.
@ ssGroundReactions
Subsystem: Ground Reactions (= 1024)
@ ssMoments
Subsystem: Moments (= 32)
@ ssPropagate
Subsystem: Propagate (= 512)
@ ssPropulsion
Subsystem: Propulsion (= 4096)
@ ssForces
Subsystem: Forces (= 16)
@ ssAerosurfaces
Subsystem: Aerosurfaces (= 2)
@ ssMassProps
Subsystem: Mass Properties (= 128)
@ ssFCS
Subsystem: FCS (= 2048)
@ ssRates
Subsystem: Body rates (= 4)
@ ssAtmosphere
Subsystem: Atmosphere (= 64)
@ ssAeroFunctions
Subsystem: Coefficients (= 256)
@ ssVelocities
Subsystem: Velocities (= 8)
FGGroundReactions * GroundReactions
std::vector< FGPropertyValue * > OutputParameters
FGAccelerations * Accelerations
FGPropulsion * Propulsion
FGOutputType(FGFDMExec *fdmex)
Constructor (implement the FGModel interface).
FGAtmosphere * Atmosphere
FGMassBalance * MassBalance
std::vector< std::string > OutputCaptions
bool Load(Element *el) override
Init the output directives from an XML file (implement the FGModel interface).
FGAerodynamics * Aerodynamics
bool InitModel(void) override
Init the output model according to its configitation.
Encapsulates an object that enables JSBSim to communicate via socket (input and/or output).
static int atoi(const string &str)
std::string & to_upper(std::string &str)