From: mfranz Date: Sun, 24 Jun 2007 17:15:48 +0000 (+0000) Subject: - don't mix /instrumentation/radar and /instrumentation/wxradar wildly X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;ds=sidebyside;h=1b55d67ff72861c3db1ecf68d2d814260e724ba8;p=flightgear.git - don't mix /instrumentation/radar and /instrumentation/wxradar wildly together -- there's only *one* instrument node now - don't take "random" tacan, but from the instrumentation config (or /instrumentation/tacan[0] by default) - don't take "random" display-controls from /instrumentation/tacan[0] - default name is now "radar" (formerly "wxradar") --- diff --git a/src/Instrumentation/wxradar.cxx b/src/Instrumentation/wxradar.cxx index 0cee87b23..943a660a5 100644 --- a/src/Instrumentation/wxradar.cxx +++ b/src/Instrumentation/wxradar.cxx @@ -59,7 +59,7 @@ static const char *odgauge_name = "Aircraft/Instruments/Textures/od_wxradar.rgb"; wxRadarBg::wxRadarBg ( SGPropertyNode *node) : - _name(node->getStringValue("name", "wxRadar")), + _name(node->getStringValue("name", "radar")), _num(node->getIntValue("number", 0)), _last_switchKnob( "off" ), _sim_init_done ( false ), @@ -67,6 +67,9 @@ wxRadarBg::wxRadarBg ( SGPropertyNode *node) : wxEcho( 0 ), _odg( 0 ) { + const char *tacan_source = node->getStringValue("tacan-source", + "/instrumentation/tacan"); + _Tacan = fgGetNode(tacan_source, true); } wxRadarBg::~wxRadarBg () @@ -80,7 +83,7 @@ wxRadarBg::init () branch = "/instrumentation/" + _name; _Instrument = fgGetNode(branch.c_str(), _num, true ); - _serviceable_node = _Instrument->getChild("serviceable", 0, true); + _serviceable_node = _Instrument->getNode("serviceable", true); SGPath tpath(globals->get_fg_root()); tpath.append("Aircraft/Instruments/Textures/wxecho.rgb"); @@ -114,29 +117,26 @@ wxRadarBg::init () _user_speed_east_fps_node = fgGetNode("/velocities/speed-east-fps", true); _user_speed_north_fps_node = fgGetNode("/velocities/speed-north-fps", true); - _Tacan = fgGetNode("/instrumentation/tacan", _num, true); _tacan_serviceable_node = _Tacan->getNode("serviceable", true); _tacan_distance_node = _Tacan->getNode("indicated-distance-nm", true); _tacan_name_node = _Tacan->getNode("name", true); _tacan_bearing_node = _Tacan->getNode("indicated-bearing-true-deg", true); _tacan_in_range_node = _Tacan->getNode("in-range", true); - _Radar = fgGetNode("/instrumentation/radar/display-controls", _num, true); - _radar_weather_node = _Radar->getNode("WX", true); - _radar_position_node = _Radar->getNode("pos", true); - _radar_data_node = _Radar->getNode("data", true); - _radar_centre_node = _Radar->getNode("centre", true); - - _radar_centre_node->setBoolValue(false); - - _Radar = fgGetNode("/instrumentation/radar/", _num, true); - _radar_mode_control_node = _Radar->getNode("mode-control", true); - _radar_coverage_node = _Radar->getNode("limit-deg", true); - _radar_ref_rng_node = _Radar->getNode("reference-range-nm", true); - + _radar_mode_control_node = _Instrument->getNode("mode-control", true); + _radar_coverage_node = _Instrument->getNode("limit-deg", true); + _radar_ref_rng_node = _Instrument->getNode("reference-range-nm", true); _radar_coverage_node->setFloatValue(120); _radar_ref_rng_node->setDoubleValue(35); + SGPropertyNode *n = _Instrument->getNode("display-controls", true); + _radar_weather_node = n->getNode("WX", true); + _radar_position_node = n->getNode("pos", true); + _radar_data_node = n->getNode("data", true); + _radar_centre_node = n->getNode("centre", true); + + _radar_centre_node->setBoolValue(false); + _ai_enabled_node = fgGetNode("/sim/ai/enabled", true); _x_displacement = 0; diff --git a/src/Instrumentation/wxradar.hxx b/src/Instrumentation/wxradar.hxx index 4d285a374..cc6677b87 100644 --- a/src/Instrumentation/wxradar.hxx +++ b/src/Instrumentation/wxradar.hxx @@ -46,10 +46,7 @@ class FGAIBase; class FGODGauge; - class wxRadarBg : public SGSubsystem { - - public: wxRadarBg ( SGPropertyNode *node ); @@ -78,7 +75,6 @@ private: SGPropertyNode_ptr _serviceable_node; SGPropertyNode_ptr _Instrument; SGPropertyNode_ptr _Tacan; - SGPropertyNode_ptr _Radar; SGPropertyNode_ptr _Radar_controls; SGPropertyNode_ptr _user_lat_node;