]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ground.cxx
Fix the nmea and garmin output to a) fake a GSA sentence, b) fix a y2k bug
[flightgear.git] / src / ATC / ground.cxx
index 9c78282fbc0993882e189a94aeeee787301a484b..5f0072f5e03ae8f741f796546f7a5344b5c20c93 100644 (file)
@@ -60,7 +60,7 @@ FGGround::FGGround() {
        
        // Init the property nodes - TODO - need to make sure we're getting surface winds.
        wind_from_hdg = fgGetNode("/environment/wind-from-heading-deg", true);
-       wind_speed_knots = fgGetNode("/environment/wind-speed-kts", true);
+       wind_speed_knots = fgGetNode("/environment/wind-speed-kt", true);
        
        // TODO - get the actual airport elevation
        aptElev = 0.0;
@@ -76,7 +76,7 @@ FGGround::FGGround(string id) {
        
        // Init the property nodes - TODO - need to make sure we're getting surface winds.
        wind_from_hdg = fgGetNode("/environment/wind-from-heading-deg", true);
-       wind_speed_knots = fgGetNode("/environment/wind-speed-kts", true);
+       wind_speed_knots = fgGetNode("/environment/wind-speed-kt", true);
        
        // TODO - get the actual airport elevation
        aptElev = 0.0;
@@ -331,9 +331,9 @@ void FGGround::Update(double dt) {
                        // NOTE - we don't need to do the contact tower bit unless we have separate tower and ground
                        string trns = g->plane.callsign;
                        trns += " contact Tower ";
-                       double f = globals->get_ATC_mgr()->GetFrequency(ident, TOWER);
+                       double f = globals->get_ATC_mgr()->GetFrequency(ident, TOWER) / 100.0;
                        char buf[10];
-                       sprintf(buf, "%f", f);
+                       sprintf(buf, "%.2f", f);
                        trns += buf;
                        if(display) {
                                globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
@@ -345,6 +345,9 @@ void FGGround::Update(double dt) {
                }                               
                ++ground_traffic_itr;
        }
+       
+       // Call the base class update for the response time handling.
+       FGATC::Update(dt);
 }
 
 // Figure out which runways are active.
@@ -356,10 +359,6 @@ void FGGround::DoRwyDetails() {
        //cout << "GetRwyDetails called" << endl;
        
        // Based on the airport-id and wind get the active runway
-       SGPath path( globals->get_fg_root() );
-       path.append( "Airports" );
-       path.append( "runways.mk4" );
-       FGRunways r_ways( path.c_str() );
        
        //wind
        double hdg = wind_from_hdg->getDoubleValue();
@@ -368,7 +367,7 @@ void FGGround::DoRwyDetails() {
        //cout << "Heading = " << hdg << '\n';
        
        FGRunway runway;
-       bool rwyGood = r_ways.search(ident, int(hdg), &runway);
+       bool rwyGood = globals->get_runways()->search(ident, int(hdg), &runway);
        if(rwyGood) {
                activeRwy = runway.rwy_no;
                rwy.rwyID = runway.rwy_no;
@@ -457,6 +456,7 @@ Gate* FGGround::GetGateNode() {
 
 // WARNING - This is hardwired to my prototype logical network format
 // and will almost certainly change when Bernie's stuff comes on-line.
+// Returns NULL if it can't find a valid node.
 node* FGGround::GetThresholdNode(string rwyID) {
        // For now go through all the nodes and parse their names
        // Maybe in the future we'll map threshold nodes by ID