From: curt Date: Wed, 31 Jan 2001 22:21:36 +0000 (+0000) Subject: Added a specific "altas" format for output which includes a proprietary string X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a4d27fe7bc81a3c5acca18b76d4f10406b74f8a3;p=flightgear.git Added a specific "altas" format for output which includes a proprietary string to convey the radio stack settings. --- diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index 9c3afb745..2a7afcfbe 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -34,14 +34,15 @@ #include #include -#include +#include #include +#include +#include #include #include #include #include #include -#include #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; } diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 1073c5635..5c63442e4 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -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 ) { diff --git a/src/Network/atlas.cxx b/src/Network/atlas.cxx index a56721d8d..7f3321be4 100644 --- a/src/Network/atlas.cxx +++ b/src/Network/atlas.cxx @@ -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);