]> git.mxchange.org Git - flightgear.git/commitdiff
Added a specific "altas" format for output which includes a proprietary string
authorcurt <curt>
Wed, 31 Jan 2001 22:21:36 +0000 (22:21 +0000)
committercurt <curt>
Wed, 31 Jan 2001 22:21:36 +0000 (22:21 +0000)
to convey the radio stack settings.

src/Main/fg_io.cxx
src/Main/options.cxx
src/Network/atlas.cxx

index 9c3afb745c84826ce4fbf37ac0b33d82d4657d68..2a7afcfbe7dda2e61e5d508aa9937a75af76ee27 100644 (file)
 #include <simgear/timing/timestamp.hxx>
 
 #include <Network/protocol.hxx>
-#include <Network/native.hxx>
+#include <Network/atlas.hxx>
 #include <Network/garmin.hxx>
+#include <Network/joyclient.hxx>
+#include <Network/native.hxx>
 #include <Network/nmea.hxx>
 #include <Network/props.hxx>
 #include <Network/pve.hxx>
 #include <Network/ray.hxx>
 #include <Network/rul.hxx>
-#include <Network/joyclient.hxx>
 
 #include "globals.hxx"
 
@@ -72,12 +73,18 @@ static FGProtocol *parse_port_config( const string& config )
     FG_LOG( FG_IO, FG_INFO, "  protocol = " << protocol );
 
     FGProtocol *io;
-    if ( protocol == "native" ) {
-       FGNative *native = new FGNative;
-       io = native;
+    if ( protocol == "atlas" ) {
+       FGAtlas *atlas = new FGAtlas;
+       io = atlas;
     } else if ( protocol == "garmin" ) {
        FGGarmin *garmin = new FGGarmin;
        io = garmin;
+    } else if ( protocol == "joyclient" ) {
+       FGJoyClient *joyclient = new FGJoyClient;
+       io = joyclient;
+    } else if ( protocol == "native" ) {
+       FGNative *native = new FGNative;
+       io = native;
     } else if ( protocol == "nmea" ) {
        FGNMEA *nmea = new FGNMEA;
        io = nmea;
@@ -93,9 +100,6 @@ static FGProtocol *parse_port_config( const string& config )
     } else if ( protocol == "rul" ) {
        FGRUL *rul = new FGRUL;
        io = rul;
-    } else if ( protocol == "joyclient" ) {
-       FGJoyClient *joyclient = new FGJoyClient;
-       io = joyclient;
     } else {
        return NULL;
     }
index 1073c5635472bf8ffa5ede6c2b1f25ffdbe52eb9..5c63442e4fa99a89d4d1522855c0e93765e0d07f 100644 (file)
@@ -765,6 +765,8 @@ parse_option (const string& arg)
         fgSetString("/sim/hud/frame-stat-type", "tris");
     } else if ( arg == "--hud-culled" ) {
         fgSetString("/sim/hud/frame-stat-type", "culled");
+    } else if ( arg.find( "--atlas=" ) != string::npos ) {
+       parse_channel( "atlas", arg.substr(8) );
     } else if ( arg.find( "--native=" ) != string::npos ) {
        parse_channel( "native", arg.substr(9) );
     } else if ( arg.find( "--garmin=" ) != string::npos ) {
index a56721d8dae98fd5af428356c914fc7b9e739c07..7f3321be47b6457f9e92ccd2eab1f749cd908643 100644 (file)
@@ -451,6 +451,56 @@ bool FGAtlas::parse_message() {
     
            FG_LOG( FG_IO, FG_INFO, " altitude  = " << altitude );
 
+       } else if ( sentence == "PATLA" ) {
+           // nav1 freq
+           end = msg.find(",", begin);
+           if ( end == string::npos ) {
+               return false;
+           }
+    
+           string nav1_freq = msg.substr(begin, end - begin);
+           begin = end + 1;
+           FG_LOG( FG_IO, FG_INFO, "  nav1_freq = " << nav1_freq );
+
+           // nav1 selected radial
+           end = msg.find(",", begin);
+           if ( end == string::npos ) {
+               return false;
+           }
+    
+           string nav1_rad = msg.substr(begin, end - begin);
+           begin = end + 1;
+           FG_LOG( FG_IO, FG_INFO, "  nav1_rad = " << nav1_rad );
+
+           // nav2 freq
+           end = msg.find(",", begin);
+           if ( end == string::npos ) {
+               return false;
+           }
+    
+           string nav2_freq = msg.substr(begin, end - begin);
+           begin = end + 1;
+           FG_LOG( FG_IO, FG_INFO, "  nav2_freq = " << nav2_freq );
+
+           // nav2 selected radial
+           end = msg.find(",", begin);
+           if ( end == string::npos ) {
+               return false;
+           }
+    
+           string nav2_rad = msg.substr(begin, end - begin);
+           begin = end + 1;
+           FG_LOG( FG_IO, FG_INFO, "  nav2_rad = " << nav2_rad );
+
+           // adf freq
+           end = msg.find("*", begin);
+           if ( end == string::npos ) {
+               return false;
+           }
+    
+           string adf_freq = msg.substr(begin, end - begin);
+           begin = end + 1;
+           FG_LOG( FG_IO, FG_INFO, "  adf_freq = " << adf_freq );
        }
 
        // printf("%.8f %.8f\n", lon, lat);