]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/AV400Sim.cxx
Remove unnecessary includes/using
[flightgear.git] / src / Network / AV400Sim.cxx
index 2d704a83ebe71b75a8e317818cf796f01d1d1433..cbbe2b4950b6ef907f47c3b64d7950abe969d477 100644 (file)
 #  include "config.h"
 #endif
 
+#include <cstdlib>
+#include <cstring>
+#include <cstdio>
+
 #include <simgear/debug/logstream.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/io/iochannel.hxx>
 #include <simgear/timing/sg_time.hxx>
 
-#include <FDM/flight.hxx>
+#include <FDM/flightProperties.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 
 #include "AV400Sim.hxx"
 
 FGAV400Sim::FGAV400Sim() {
+  fdm = new FlightProperties;
 }
 
 FGAV400Sim::~FGAV400Sim() {
+  delete fdm;
 }
 
 
@@ -60,7 +66,7 @@ bool FGAV400Sim::gen_message() {
     double min;
 
     // create msg_a
-    double latd = cur_fdm_state->get_Latitude() * SGD_RADIANS_TO_DEGREES;
+    double latd = fdm->get_Latitude() * SGD_RADIANS_TO_DEGREES;
     if ( latd < 0.0 ) {
        latd = -latd;
        dir = 'S';
@@ -72,7 +78,7 @@ bool FGAV400Sim::gen_message() {
     sprintf( msg_a, "a%c %03d %04.0f\r\n", dir, deg, min);
 
     // create msg_b
-    double lond = cur_fdm_state->get_Longitude() * SGD_RADIANS_TO_DEGREES;
+    double lond = fdm->get_Longitude() * SGD_RADIANS_TO_DEGREES;
     if ( lond < 0.0 ) {
        lond = -lond;
        dir = 'W';
@@ -84,7 +90,7 @@ bool FGAV400Sim::gen_message() {
     sprintf( msg_b, "b%c %03d %04.0f\r\n", dir, deg, min);
 
     // create msg_c
-    double alt = cur_fdm_state->get_Altitude();
+    double alt = fdm->get_Altitude();
     if ( alt > 99999.0 ) { alt = 99999.0; }
     sprintf( msg_c, "c%05.0f\r\n", alt );