Added a specific "altas" format for output which includes a proprietary string
to convey the radio stack settings.
This commit is contained in:
parent
c7f1c662a1
commit
a4d27fe7bc
3 changed files with 64 additions and 8 deletions
|
@ -34,14 +34,15 @@
|
|||
#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;
|
||||
}
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue