X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2FFGOutput.h;h=e22dc1319f80f7b40b74fa6d28180a386d553569;hb=416ba93a417c4cadde025ba4d7bbcce71d613372;hp=1646dadb008e680faccc6285aed4fb4c13f8a1cb;hpb=a6db6d89ff41a619569e6433409e8bf62ff98499;p=flightgear.git diff --git a/src/FDM/JSBSim/models/FGOutput.h b/src/FDM/JSBSim/models/FGOutput.h index 1646dadb0..e22dc1319 100644 --- a/src/FDM/JSBSim/models/FGOutput.h +++ b/src/FDM/JSBSim/models/FGOutput.h @@ -41,19 +41,17 @@ INCLUDES #include "FGModel.h" -#include #include -#include "input_output/FGfdmSocket.h" #include "input_output/FGXMLFileRead.h" #include "input_output/net_fdm.hxx" - +#include "input_output/FGfdmSocket.h" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_OUTPUT "$Id$" +#define ID_OUTPUT "$Id: FGOutput.h,v 1.22 2011/03/11 13:02:26 jberndt Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -61,6 +59,8 @@ FORWARD DECLARATIONS namespace JSBSim { +class FGfdmSocket; + /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DOCUMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ @@ -124,7 +124,7 @@ CLASS DOCUMENTATION propulsion ON|OFF NOTE that Time is always output with the data. - @version $Id$ + @version $Id: FGOutput.h,v 1.22 2011/03/11 13:02:26 jberndt Exp $ */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -140,23 +140,26 @@ public: bool InitModel(void); bool Run(void); - void DelimitedOutput(string); + void Print(void); + void DelimitedOutput(const std::string&); void SocketOutput(void); void FlightGearSocketOutput(void); - void SocketStatusOutput(string); + void SocketStatusOutput(const std::string&); void SocketDataFill(FGNetFDM* net); - - void SetType(string); + void SetType(const std::string& type); + void SetProtocol(const std::string& protocol); + void SetPort(const std::string& port); void SetStartNewFile(bool tt) {StartNewFile = tt;} void SetSubsystems(int tt) {SubSystems = tt;} + void SetOutputFileName(const std::string& fname) {Filename = fname;} + void SetDirectivesFile(const std::string& fname) {DirectivesFile = fname;} + void SetRate(double rt); void Enable(void) { enabled = true; } void Disable(void) { enabled = false; } bool Toggle(void) {enabled = !enabled; return enabled;} + bool Load(Element* el); - void SetOutputFileName(string fname) {Filename = fname;} - void SetDirectivesFile(string fname) {DirectivesFile = fname;} - void SetRate(int rt); string GetOutputFileName(void) const {return Filename;} /// Subsystem types for specifying which will be output in the FDM data logging @@ -169,27 +172,27 @@ public: /** Subsystem: Moments (= 32) */ ssMoments = 32, /** Subsystem: Atmosphere (= 64) */ ssAtmosphere = 64, /** Subsystem: Mass Properties (= 128) */ ssMassProps = 128, - /** Subsystem: Coefficients (= 256) */ ssCoefficients = 256, + /** Subsystem: Coefficients (= 256) */ ssAeroFunctions = 256, /** Subsystem: Propagate (= 512) */ ssPropagate = 512, /** Subsystem: Ground Reactions (= 1024) */ ssGroundReactions = 1024, /** Subsystem: FCS (= 2048) */ ssFCS = 2048, /** Subsystem: Propulsion (= 4096) */ ssPropulsion = 4096 } subsystems; - FGNetFDM fgSockBuf; private: enum {otNone, otCSV, otTab, otSocket, otTerminal, otFlightGear, otUnknown} Type; + FGfdmSocket::ProtocolType Protocol; bool sFirstPass, dFirstPass, enabled; int SubSystems; int runID_postfix; bool StartNewFile; - string output_file_name, delimeter, BaseFilename, Filename, DirectivesFile; - ofstream datafile; + std::string output_file_name, delimeter, BaseFilename, Filename, DirectivesFile; + std::string Port; + std::ofstream datafile; FGfdmSocket* socket; - FGfdmSocket* flightGearSocket; - vector OutputProperties; + std::vector OutputProperties; void Debug(int from); };