]> git.mxchange.org Git - flightgear.git/commitdiff
Roy Vegard Ovesen:
authorcurt <curt>
Fri, 3 Dec 2004 21:21:16 +0000 (21:21 +0000)
committercurt <curt>
Fri, 3 Dec 2004 21:21:16 +0000 (21:21 +0000)
I've finished the emigration of the radiostack, and I've also removed it
completely. It turned out that the comm radio is completely implemented in
the ATC subsystem. I've changed the affected ATC files to point
to /instrumentation/com, but I guess that the maintainer of the ATC code
should decide wether to make it configureable, and how.

I also had to change some files in Network and Main. The changes in network
should be obvious, but the changes in Main were a bit suspect. The files
included radiostack.hxx, but they weren't directly depending on
radiostack-hxx. They were depending on other files that were included by
radiostack.hxx. I got it to compile, but I'm not sure if I included the
correct directly depending file.

For the data directory I changed every occurrence of /radios/
with /instrumentation/ with this simple one-liner that I found on the net:

find -name '*.xml' -type f | xargs perl -pi -e
's/\/radios\//\/instrumentation\//g'

Instead of me sending all the files that got changed by this I suggest that
you execute the one-liner yourself. Of course I can not guarantee that this
will work perfectly, but I considered hand editing to be not an option (I'm
lazy). I don't want to test every aircraft to see if everything still works,
I think it's better to wait and see if anyone complaints about broken nav
radios/instruments.

17 files changed:
src/ATC/AIPlane.cxx
src/ATC/ATC.cxx
src/ATC/ATCmgr.cxx
src/ATC/approach.cxx
src/Cockpit/Makefile.am
src/Cockpit/radiostack.cxx [deleted file]
src/Cockpit/radiostack.hxx [deleted file]
src/Instrumentation/navradio.cxx
src/Instrumentation/navradio.hxx
src/Main/fg_init.cxx
src/Main/main.cxx
src/Main/renderer.cxx
src/Network/ATC-Inputs.cxx
src/Network/ATC-Inputs.hxx
src/Network/atlas.cxx
src/Network/native_gui.cxx
src/Network/opengc.cxx

index 97789d7d2157d0b32e10af0e351b163529a46c1c..6191558b44a25ee6384ea3ec77005ec8e9f668dc 100644 (file)
@@ -90,8 +90,8 @@ void FGAIPlane::Update(double dt) {
        // TODO - turn it off if user switches to another freq - keep track of where in message we are etc.
        if(_transmit) {
                //cout << "transmit\n";
-               double user_freq0 = fgGetDouble("/radios/comm[0]/frequencies/selected-mhz");
-               double user_freq1 = fgGetDouble("/radios/comm[1]/frequencies/selected-mhz");
+               double user_freq0 = fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz");
+               double user_freq1 = fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz");
                _counter = 0.0;
                _max_count = 5.0;               // FIXME - hardwired length of message - need to calculate it!
                
@@ -191,7 +191,7 @@ void FGAIPlane::Render(string refname, bool repeating) {
                        SGSoundSample* simple = new SGSoundSample(buf, len, 8000, false);
                        // TODO - at the moment the volume is always set off comm1 
                        // and can't be changed after the transmission has started.
-                       simple->set_volume(5.0 * fgGetDouble("/radios/comm[0]/volume"));
+                       simple->set_volume(5.0 * fgGetDouble("/instrumentation/comm[0]/volume"));
                        globals->get_soundmgr()->add(simple, refname);
                        if(repeating) {
                                globals->get_soundmgr()->play_looped(refname);
index 955cb8195f982a695bbd021ece95de9e4c1562a8..f6ee03ae478a794d141c0d02208871a4e8dc4eeb 100644 (file)
@@ -230,7 +230,7 @@ void FGATC::Render(string msg, string refname, bool repeating) {
                             = new SGSoundSample(buf, len, 8000, false);
                        // TODO - at the moment the volume is always set off comm1 
                        // and can't be changed after the transmission has started.
-                       simple->set_volume(5.0 * fgGetDouble("/radios/comm[0]/volume"));
+                       simple->set_volume(5.0 * fgGetDouble("/instrumentation/comm[0]/volume"));
                        globals->get_soundmgr()->add(simple, refname);
                        if(repeating) {
                                globals->get_soundmgr()->play_looped(refname);
index 6f8b911aaadcb91a383cf7e40a21f55859d04b08..e4a5407c5410f8ecd174e00a7d72a842f735b461 100644 (file)
@@ -86,8 +86,8 @@ void FGATCMgr::unbind() {
 void FGATCMgr::init() {
        //cout << "ATCMgr::init called..." << endl;
        
-       comm_node[0] = fgGetNode("/radios/comm[0]/frequencies/selected-mhz", true);
-       comm_node[1] = fgGetNode("/radios/comm[1]/frequencies/selected-mhz", true);
+       comm_node[0] = fgGetNode("/instrumentation/comm[0]/frequencies/selected-mhz", true);
+       comm_node[1] = fgGetNode("/instrumentation/comm[1]/frequencies/selected-mhz", true);
        lon_node = fgGetNode("/position/longitude-deg", true);
        lat_node = fgGetNode("/position/latitude-deg", true);
        elev_node = fgGetNode("/position/altitude-ft", true);
index f8901029d5693bb638b98e144e16dddcf0a4078b..ec68db5002f5e70b33e3c3af762aa37e738377f5 100644 (file)
@@ -36,8 +36,8 @@
 
 //Constructor
 FGApproach::FGApproach(){
-  comm1_node = fgGetNode("/radios/comm[0]/frequencies/selected-mhz", true);
-  comm2_node = fgGetNode("/radios/comm[1]/frequencies/selected-mhz", true);
+  comm1_node = fgGetNode("/instrumentation/comm[0]/frequencies/selected-mhz", true);
+  comm2_node = fgGetNode("/instrumentation/comm[1]/frequencies/selected-mhz", true);
   
   _type = APPROACH;
 
index 74d3bce804ab1cd3739831babce404dcfe8e9846..c79daf8f49cefddfab6a17871a9a6196ce30deba 100644 (file)
@@ -10,8 +10,7 @@ libCockpit_a_SOURCES = \
        hud_scal.cxx hud_tbi.cxx \
        navcom.cxx navcom.hxx \
        panel.cxx panel.hxx \
-        panel_io.cxx panel_io.hxx \
-       radiostack.cxx radiostack.hxx
+        panel_io.cxx panel_io.hxx
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
 
diff --git a/src/Cockpit/radiostack.cxx b/src/Cockpit/radiostack.cxx
deleted file mode 100644 (file)
index 09986f0..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-// radiostack.cxx -- class to manage an instance of the radio stack
-//
-// Written by Curtis Olson, started April 2000.
-//
-// Copyright (C) 2000  Curtis L. Olson - http://www.flightgear.org/~curt
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-// $Id$
-
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <stdio.h>     // snprintf
-
-#include <simgear/compiler.h>
-#include <simgear/math/sg_random.h>
-
-#include <Aircraft/aircraft.hxx>
-#include <Navaids/navlist.hxx>
-
-#include "radiostack.hxx"
-
-#include <string>
-SG_USING_STD(string);
-
-
-FGRadioStack *current_radiostack;
-
-
-// Constructor
-FGRadioStack::FGRadioStack() {
-}
-
-
-// Destructor
-FGRadioStack::~FGRadioStack() 
-{
-    //adf.unbind();
-    //beacon.unbind();
-    navcom1.unbind();
-    navcom2.unbind();
-    //xponder.unbind();
-}
-
-
-void
-FGRadioStack::init ()
-{
-    navcom1.set_bind_index( 0 );
-    navcom1.init();
-
-    navcom2.set_bind_index( 1 );
-    navcom2.init();
-
-    //adf.init();
-    //beacon.init();
-    //xponder.init();
-
-    search();
-    update(0);                 // FIXME: use dt
-
-    // Search radio database once per second
-    globals->get_event_mgr()->addTask( "fgRadioSearch()", current_radiostack,
-                                       &FGRadioStack::search, 1 );
-}
-
-
-void
-FGRadioStack::bind ()
-{
-    //adf.bind();
-    //beacon.bind();
-    //dme.bind();
-    navcom1.set_bind_index( 0 );
-    navcom1.bind();
-    navcom2.set_bind_index( 1 );
-    navcom2.bind();
-    //xponder.bind();
-}
-
-
-void
-FGRadioStack::unbind ()
-{
-    //adf.unbind();
-    //beacon.unbind();
-    //dme.unbind();
-    navcom1.unbind();
-    navcom2.unbind();
-    //xponder.unbind();
-}
-
-
-// Update the various nav values based on position and valid tuned in navs
-void 
-FGRadioStack::update(double dt) 
-{
-    //adf.update( dt );
-    //beacon.update( dt );
-    navcom1.update( dt );
-    navcom2.update( dt );
-    //dme.update( dt );           // dme is updated after the navcom's
-    //xponder.update( dt );
-}
-
-
-// Update current nav/adf radio stations based on current postition
-void FGRadioStack::search() 
-{
-    //adf.search();
-    //beacon.search();
-    navcom1.search();
-    navcom2.search();
-    //dme.search();
-    //xponder.search();
-}
diff --git a/src/Cockpit/radiostack.hxx b/src/Cockpit/radiostack.hxx
deleted file mode 100644 (file)
index fb6e875..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-// radiostack.hxx -- class to manage an instance of the radio stack
-//
-// Written by Curtis Olson, started April 2000.
-//
-// Copyright (C) 2000  Curtis L. Olson - http://www.flightgear.org/~curt
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License as
-// published by the Free Software Foundation; either version 2 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-// $Id$
-
-
-#ifndef _FG_RADIOSTACK_HXX
-#define _FG_RADIOSTACK_HXX
-
-
-#include <Main/fg_props.hxx>
-
-#include <simgear/compiler.h>
-#include <simgear/structure/subsystem_mgr.hxx>
-#include <simgear/math/interpolater.hxx>
-#include <simgear/timing/timestamp.hxx>
-
-#include <Navaids/navlist.hxx>
-#include <Sound/beacon.hxx>
-#include <Sound/morse.hxx>
-
-//#include "dme.hxx"
-//#include "kt_70.hxx"            // Transponder
-//#include "marker_beacon.hxx"
-#include "navcom.hxx"
-
-
-class FGRadioStack : public SGSubsystem
-{
-    //FGDME dme;
-    //FGKR_87 adf;                // King KR 87 Digital ADF model
-    //FGKT_70 xponder;            // Bendix/King KT 70 Panel-Mounted Transponder
-    //FGMarkerBeacon beacon;
-    FGNavCom navcom1;
-    FGNavCom navcom2;
-
-public:
-
-    FGRadioStack();
-    ~FGRadioStack();
-
-    void init ();
-    void bind ();
-    void unbind ();
-    void update (double dt);
-
-    // Update nav/adf radios based on current postition
-    void search ();
-
-    //inline FGDME *get_dme() { return &dme; }
-    inline FGNavCom *get_navcom1() { return &navcom1; }
-    inline FGNavCom *get_navcom2() { return &navcom2; }
-};
-
-
-extern FGRadioStack *current_radiostack;
-
-#endif // _FG_RADIOSTACK_HXX
index 6d00f42b2e08961e816dc712d09c3f3d2b5a1e5a..414595cd8d9eda38a5658c8bab64ec089194694c 100644 (file)
@@ -128,9 +128,15 @@ FGNavRadio::init ()
     cdi_serviceable = (node->getChild("cdi", 0, true))
        ->getChild("serviceable", 0, true);
     gs_serviceable = (node->getChild("gs", 0, true))
-       ->getNode("serviceable");
+       ->getChild("serviceable");
     tofrom_serviceable = (node->getChild("to-from", 0, true))
        ->getChild("serviceable", 0, true);
+
+    std::ostringstream temp;
+    temp << name << "nav-ident" << num;
+    nav_fx_name = temp.str();
+    temp << name << "dme-ident" << num;
+    dme_fx_name = temp.str();
 }
 
 void
@@ -176,6 +182,12 @@ FGNavRadio::bind ()
     fgTie( (branch + "/radials/target-radial-deg").c_str(),
           this, &FGNavRadio::get_nav_target_radial_true );
 
+    fgTie( (branch + "/radials/reciprocal-radial-deg").c_str(),
+          this, &FGNavRadio::get_nav_reciprocal_radial );
+
+    fgTie( (branch + "/radials/target-radial2-deg").c_str(),
+          this, &FGNavRadio::get_nav_target_radial );
+
     fgTie( (branch + "/radials/target-auto-hdg-deg").c_str(),
           this, &FGNavRadio::get_nav_target_auto_hdg );
 
@@ -206,6 +218,12 @@ FGNavRadio::bind ()
     fgTie( (branch + "/gs-needle-deflection").c_str(),
           this, &FGNavRadio::get_nav_gs_deflection );
 
+    fgTie( (branch + "/gs-distance").c_str(),
+          this, &FGNavRadio::get_nav_gs_dist_signed );
+
+    fgTie( (branch + "/nav-distance").c_str(),
+          this, &FGNavRadio::get_nav_loc_dist );
+
     fgTie( (branch + "/nav-id").c_str(),
           this, &FGNavRadio::get_nav_id );
 
index 24ca32a6d658e78bba0c0f343fd5de39c0addcdf..b75c5aa15ae17510bcd1c99fb596e1f29b582951 100644 (file)
@@ -56,8 +56,8 @@ class FGNavRadio : public SGSubsystem
     time_t nav_last_time;
 
     int index;                  // used for property binding
-    char nav_fx_name[256];
-    char dme_fx_name[256];
+    string nav_fx_name;
+    string dme_fx_name;
 
     bool need_update;
 
@@ -136,12 +136,13 @@ public:
 
     // Update nav/adf radios based on current postition
     void search ();
-
+/*
     inline void set_bind_index( int i ) {
         index = i;
         sprintf( nav_fx_name, "nav%d-vor-ident", index );
         sprintf( dme_fx_name, "dme%d-vor-ident", index );
     }
+*/
 
     // NavCom Setters
     inline void set_power_btn( bool val ) { power_btn = val; }
index 791a141e6b88266718b12e99955e239bc2e82c7a..7d29df4d245804d257eefc4c5a132bd0fc95ba2b 100644 (file)
@@ -79,7 +79,6 @@
 #include <Autopilot/route_mgr.hxx>
 #include <Autopilot/xmlauto.hxx>
 #include <Cockpit/cockpit.hxx>
-#include <Cockpit/radiostack.hxx>
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
 #ifdef ENABLE_SP_FMDS
 #include <Scenery/tilemgr.hxx>
 #include <Scripting/NasalSys.hxx>
 #include <Sound/fg_fx.hxx>
+#include <Sound/beacon.hxx>
+#include <Sound/morse.hxx>
 #include <Systems/system_mgr.hxx>
 #include <Time/light.hxx>
 #include <Time/moonpos.hxx>
@@ -1714,14 +1715,6 @@ bool fgInitSubsystems() {
 
 
 
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the radio stack subsystem.
-    ////////////////////////////////////////////////////////////////////
-    current_radiostack = new FGRadioStack;
-    current_radiostack->init();
-    current_radiostack->bind();
-
-
     ////////////////////////////////////////////////////////////////////
     // Initialize the cockpit subsystem
     ////////////////////////////////////////////////////////////////////
index 0d43799a6dc33adee1bc5ed70861ac01c14cdff5..103fb951bb3a4a55f8da7fdc8598790dfceb75aa 100644 (file)
 
 #include <Include/general.hxx>
 #include <Cockpit/cockpit.hxx>
-#include <Cockpit/radiostack.hxx>
 #include <Cockpit/hud.hxx>
 #include <Model/panelnode.hxx>
 #include <Model/modelmgr.hxx>
 #include <Model/acmodel.hxx>
 #include <Scenery/scenery.hxx>
 #include <Scenery/tilemgr.hxx>
+#include <Sound/beacon.hxx>
+#include <Sound/morse.hxx>
 #include <FDM/flight.hxx>
 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
 // #include <FDM/ADA.hxx>
@@ -184,8 +185,6 @@ void fgUpdateTimeDepCalcs() {
                                   globals->get_time_params()->getLst(),
                                   cur_fdm_state->get_Latitude() );
 
-    // Update radio stack model
-    current_radiostack->update(delta_time_sec);
 }
 
 
index 12fbeda9a7de11ff7cdbe5302984682d60effefb..8e9cbe890e17f26b8cb03da3b2b228ce2ad50c98 100644 (file)
@@ -60,7 +60,6 @@
 #include <Aircraft/aircraft.hxx>
 #include <Cockpit/panel.hxx>
 #include <Cockpit/cockpit.hxx>
-#include <Cockpit/radiostack.hxx>
 #include <Cockpit/hud.hxx>
 #include <Model/panelnode.hxx>
 #include <Model/modelmgr.hxx>
index d950dc8242f81ac5e7efef89dfe3d7069623e1e7..16817743e2c076a41a1ae637c5e9d7c74a4764c1 100644 (file)
@@ -136,9 +136,8 @@ bool FGATCInput::open() {
     init_config();
 
     SG_LOG( SG_IO, SG_ALERT,
-           "Initializing ATC 610x hardware, please wait ..." );
+           "Initializing ATC hardware, please wait ..." );
 
-    snprintf( lock_file, 256, "/proc/atc610x/board%d/lock", board );
     snprintf( analog_in_file, 256, "/proc/atc610x/board%d/analog_in", board );
     snprintf( radios_file, 256, "/proc/atc610x/board%d/radios", board );
     snprintf( switches_file, 256, "/proc/atc610x/board%d/switches", board );
@@ -149,15 +148,6 @@ bool FGATCInput::open() {
     // Open the /proc files
     /////////////////////////////////////////////////////////////////////
 
-    lock_fd = ::open( lock_file, O_RDWR );
-    if ( lock_fd == -1 ) {
-       SG_LOG( SG_IO, SG_ALERT, "errno = " << errno );
-       char msg[256];
-       snprintf( msg, 256, "Error opening %s", lock_file );
-       perror( msg );
-       exit( -1 );
-    }
-
     analog_in_fd = ::open( analog_in_file, O_RDONLY );
     if ( analog_in_fd == -1 ) {
        SG_LOG( SG_IO, SG_ALERT, "errno = " << errno );
@@ -192,7 +182,7 @@ bool FGATCInput::open() {
     /////////////////////////////////////////////////////////////////////
 
     SG_LOG( SG_IO, SG_ALERT,
-           "Done initializing ATC 610x hardware." );
+           "Done initializing ATC hardware." );
 
     is_open = true;
 
@@ -871,15 +861,6 @@ bool FGATCInput::close() {
 
     int result;
 
-    result = ::close( lock_fd );
-    if ( result == -1 ) {
-       SG_LOG( SG_IO, SG_ALERT, "errno = " << errno );
-       char msg[256];
-       snprintf( msg, 256, "Error closing %s", lock_file );
-       perror( msg );
-       exit( -1 );
-    }
-
     result = ::close( analog_in_fd );
     if ( result == -1 ) {
        SG_LOG( SG_IO, SG_ALERT, "errno = " << errno );
index 146d7c858202acba2e97925bae421e8baf9791a6..0295ddd5de45e68302276a37171d304ec5a7949b 100644 (file)
@@ -44,16 +44,12 @@ class FGATCInput {
     int board;
     SGPath config;
 
-    int lock_fd;
     int analog_in_fd;
     int radios_fd;
     int switches_fd;
 
-    char lock_file[256];
     char analog_in_file[256];
-    char lamps_file[256];
     char radios_file[256];
-    char stepper_file[256];
     char switches_file[256];
 
     unsigned char analog_in_bytes[ATC_ANAL_IN_BYTES];
index fec8ce48eb160cb689e7212ad8b813f54141b406..5e052d42deda0e8322da0ca3bc868f72b20d1d82 100644 (file)
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/io/iochannel.hxx>
 
-#include <Cockpit/radiostack.hxx>
+
 #include <FDM/flight.hxx>
 #include <Main/globals.hxx>
+#include <Main/fg_props.hxx>
+#include <Main/fg_init.hxx>
 
 #include "atlas.hxx"
 
@@ -65,6 +67,10 @@ bool FGAtlas::gen_message() {
 
     static SGPropertyNode *adf_freq
         = fgGetNode("/instrumentation/kr-87/outputs/selected-khz", true);
+    static SGPropertyNode *nav_freq
+        = fgGetNode("/instrumentation/nav/frequencies/selected-mhz", false);
+    static SGPropertyNode *nav_sel_radial
+        = fgGetNode("/instrumentation/van/radials/selected-deg", false);
 
     char rmc[256], gga[256], patla[256];
     char rmc_sum[10], gga_sum[10], patla_sum[10];
@@ -129,10 +135,10 @@ bool FGAtlas::gen_message() {
     sprintf( gga_sum, "%02X", calc_atlas_cksum(gga) );
 
     sprintf( patla, "PATLA,%.2f,%.1f,%.2f,%.1f,%.0f",
-            current_radiostack->get_navcom1()->get_nav_freq(),
-            current_radiostack->get_navcom1()->get_nav_sel_radial(),
-            current_radiostack->get_navcom1()->get_nav_freq(),
-            current_radiostack->get_navcom1()->get_nav_sel_radial(),
+            nav_freq->getDoubleValue(),
+            nav_sel_radial->getDoubleValue(),
+            nav_freq->getDoubleValue(),
+            nav_sel_radial->getDoubleValue(),
             adf_freq->getDoubleValue() );
     sprintf( patla_sum, "%02X", calc_atlas_cksum(patla) );
 
index 33d8743ac0371800a92505ebc4b46be99b0fb070..7335b6be531258a1ace65b9567ff47201d39ffe2 100644 (file)
@@ -30,7 +30,6 @@
 #include <simgear/io/iochannel.hxx>
 #include <simgear/timing/sg_time.hxx>
 
-#include <Cockpit/radiostack.hxx>
 #include <FDM/flight.hxx>
 #include <Time/tmp.hxx>
 #include <Main/fg_props.hxx>
@@ -121,6 +120,22 @@ bool FGNativeGUI::open() {
 
 
 void FGProps2NetGUI( FGNetGUI *net ) {
+    static SGPropertyNode *nav_freq
+       = fgGetNode("/instrumentation/nav/frequencies/selected-mhz", false);
+    static SGPropertyNode *nav_target_radial
+       = fgGetNode("/instrumentation/nav/radials/target-radial2-deg", false);
+    static SGPropertyNode *nav_inrange
+       = fgGetNode("instrumentation/nav/in-range", false);
+    static SGPropertyNode *nav_loc
+       = fgGetNode("instrumentation/nav/nav-loc", false);
+    static SGPropertyNode *nav_gs_dist_signed
+       = fgGetNode("instrumentation/nav/gs-distance", false);
+    static SGPropertyNode *nav_loc_dist
+       = fgGetNode("instrumentation/nav/nav-distance", false);
+    static SGPropertyNode *nav_reciprocal_radial
+       = fgGetNode("instrumentation/nav/reciprocal-radial-deg", false);
+    static SGPropertyNode *nav_gs_deflection
+       = fgGetNode("instrumentation/nav/gs-needle-deflection", false);
     int i;
 
     // Version sanity checking
@@ -151,24 +166,25 @@ void FGProps2NetGUI( FGNetGUI *net ) {
     net->ground_elev = globals->get_scenery()->get_cur_elev();
 
     // Approach
-    net->tuned_freq = current_radiostack->get_navcom1()->get_nav_freq();
-    net->nav_radial = current_radiostack->get_navcom1()->get_nav_target_radial();
-    net->in_range = current_radiostack->get_navcom1()->get_nav_inrange();
+    net->tuned_freq = nav_freq->getDoubleValue();
+    net->nav_radial = nav_target_radial->getDoubleValue();
+    net->in_range = nav_inrange->getBoolValue();
 
-    if ( current_radiostack->get_navcom1()->get_nav_loc() ) {
+    if ( nav_loc->getBoolValue() ) {
         // is an ILS
         net->dist_nm
-            = current_radiostack->get_navcom1()->get_nav_gs_dist_signed()
+            = nav_gs_dist_signed->getDoubleValue()
               * SG_METER_TO_NM;
     } else {
         // is a VOR
-        net->dist_nm = current_radiostack->get_navcom1()->get_nav_loc_dist()
+        net->dist_nm = nav_loc_dist->getDoubleValue()
             * SG_METER_TO_NM;
     }
 
     net->course_deviation_deg
-        = current_radiostack->get_navcom1()->get_nav_reciprocal_radial()
-        - current_radiostack->get_navcom1()->get_nav_target_radial();
+        = nav_reciprocal_radial->getDoubleValue()
+        - nav_target_radial->getDoubleValue();
+
     if ( net->course_deviation_deg < -1000.0 
          || net->course_deviation_deg > 1000.0 )
     {
@@ -187,10 +203,10 @@ void FGProps2NetGUI( FGNetGUI *net ) {
                 ? -net->course_deviation_deg - 180.0
                 : -net->course_deviation_deg + 180.0 );
 
-    if ( current_radiostack->get_navcom1()->get_nav_loc() ) {
+    if ( nav_loc->getBoolValue() ) {
         // is an ILS
         net->gs_deviation_deg
-            = current_radiostack->get_navcom1()->get_nav_gs_deflection()
+            = nav_gs_deflection->getDoubleValue()
             / 5.0;
     } else {
         // is an ILS
index 1cb2e3070bccd780c7c98166a05c1ad019282934..7b61fd7d90827d57d849177fa3c503a1d3de907f 100644 (file)
@@ -36,7 +36,6 @@
 #include "opengc.hxx"
 #include <FDM/flight.hxx>
 #include <Main/globals.hxx>
-#include <Cockpit/radiostack.hxx>
 #include <Controls/controls.hxx>
 #include <Main/fg_props.hxx>