More updates to refine the output data to make it more useful for an
external GUI and approach path plotter.
This commit is contained in:
parent
2bcb4f099f
commit
4226eab6bd
2 changed files with 33 additions and 6 deletions
|
@ -149,8 +149,19 @@ void FGProps2NetGUI( FGNetGUI *net ) {
|
|||
net->warp = globals->get_warp();
|
||||
|
||||
// Approach
|
||||
net->dist_nm = current_radiostack->get_navcom1()->get_nav_gs_dist()
|
||||
* SG_METER_TO_NM;
|
||||
net->tuned_freq = current_radiostack->get_navcom1()->get_nav_freq();
|
||||
net->in_range = current_radiostack->get_navcom1()->get_nav_inrange();
|
||||
|
||||
if ( current_radiostack->get_navcom1()->get_nav_loc() ) {
|
||||
// is an ILS
|
||||
net->dist_nm = current_radiostack->get_navcom1()->get_nav_gs_dist()
|
||||
* SG_METER_TO_NM;
|
||||
} else {
|
||||
// is a VOR
|
||||
net->dist_nm = current_radiostack->get_navcom1()->get_nav_loc_dist()
|
||||
* SG_METER_TO_NM;
|
||||
}
|
||||
|
||||
net->course_deviation_deg
|
||||
= current_radiostack->get_navcom1()->get_nav_heading()
|
||||
- current_radiostack->get_navcom1()->get_nav_radial();
|
||||
|
@ -165,9 +176,16 @@ void FGProps2NetGUI( FGNetGUI *net ) {
|
|||
= ( net->course_deviation_deg<0.0
|
||||
? -net->course_deviation_deg - 180.0
|
||||
: -net->course_deviation_deg + 180.0 );
|
||||
net->gs_deviation_deg
|
||||
= current_radiostack->get_navcom1()->get_nav_gs_needle_deflection()
|
||||
/ 5.0;
|
||||
|
||||
if ( current_radiostack->get_navcom1()->get_nav_loc() ) {
|
||||
// is an ILS
|
||||
net->gs_deviation_deg
|
||||
= current_radiostack->get_navcom1()->get_nav_gs_needle_deflection()
|
||||
/ 5.0;
|
||||
} else {
|
||||
// is an ILS
|
||||
net->gs_deviation_deg = -9999.0;
|
||||
}
|
||||
|
||||
#if defined( FG_USE_NETWORK_BYTE_ORDER )
|
||||
// Convert the net buffer to network format
|
||||
|
@ -190,6 +208,8 @@ void FGProps2NetGUI( FGNetGUI *net ) {
|
|||
net->cur_time = htonl( net->cur_time );
|
||||
net->warp = htonl( net->warp );
|
||||
|
||||
htonf(net->tuned_freq);
|
||||
net->in_range = htonl(net->in_range);
|
||||
htonf(net->dist_nm);
|
||||
htonf(net->course_deviation_deg);
|
||||
htonf(net->gs_deviation_deg);
|
||||
|
@ -221,6 +241,8 @@ void FGNetGUI2Props( FGNetGUI *net ) {
|
|||
net->cur_time = ntohl(net->cur_time);
|
||||
net->warp = ntohl(net->warp);
|
||||
|
||||
htonf(net->tuned_freq);
|
||||
net->in_range = htonl(net->in_range);
|
||||
htonf(net->dist_nm);
|
||||
htonf(net->course_deviation_deg);
|
||||
htonf(net->gs_deviation_deg);
|
||||
|
@ -254,6 +276,9 @@ void FGNetGUI2Props( FGNetGUI *net ) {
|
|||
globals->set_warp( net->warp );
|
||||
|
||||
// Approach
|
||||
fgSetDouble( "/radios/nav[0]/frequencies/selected-mhz",
|
||||
net->tuned_freq );
|
||||
fgSetBool( "/radios/nav[0]/in-range", net->in_range );
|
||||
fgSetDouble( "/radios/dme/distance-nm", net->dist_nm );
|
||||
fgSetDouble( "/radios/nav[0]/heading-needle-deflection",
|
||||
net->course_deviation_deg );
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
const int FG_NET_GUI_VERSION = 2;
|
||||
const int FG_NET_GUI_VERSION = 3;
|
||||
|
||||
|
||||
// Define a structure containing the top level flight dynamics model
|
||||
|
@ -75,6 +75,8 @@ public:
|
|||
long int warp; // offset in seconds to unix time
|
||||
|
||||
// Approach
|
||||
float tuned_freq; // currently tuned frequency
|
||||
bool in_range; // tuned navaid is in range?
|
||||
float dist_nm; // distance to tuned navaid in nautical miles
|
||||
float course_deviation_deg; // degrees off target course
|
||||
float gs_deviation_deg; // degrees off target glide slope
|
||||
|
|
Loading…
Add table
Reference in a new issue