]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ground.cxx
I had hoped that gmtime's lack of thread-safety wouldn't bite us. It does.
[flightgear.git] / src / ATC / ground.cxx
index 4685600354def2c440dbf55c2ee11ce2dd2f13b4..32e01c1dda9d1b05c4ac96b4ab77b2431c477282 100644 (file)
@@ -54,7 +54,6 @@ a_path::a_path() {
 FGGround::FGGround() {
        ATCmgr = globals->get_ATC_mgr();
        _type = GROUND;
-       display = false;
        networkLoadOK = false;
        ground_traffic.erase(ground_traffic.begin(), ground_traffic.end());
        ground_traffic_itr = ground_traffic.begin();
@@ -69,7 +68,6 @@ FGGround::FGGround() {
 
 FGGround::FGGround(string id) {
        ATCmgr = globals->get_ATC_mgr();
-       display = false;
        networkLoadOK = false;
        ground_traffic.erase(ground_traffic.begin(), ground_traffic.end());
        ground_traffic_itr = ground_traffic.begin();
@@ -274,7 +272,6 @@ bool FGGround::LoadNetwork() {
 }
 
 void FGGround::Init() {
-       display = false;
        untowered = false;
        
        // Figure out which is the active runway - TODO - it would be better to have ground call tower
@@ -318,7 +315,7 @@ void FGGround::Update(double dt) {
                                trns += " taxi holding point runway ";  // TODO - add the holding point name
                                // eg " taxi holding point G2 runway "
                                trns += ConvertRwyNumToSpokenString(activeRwy);
-                               if(display) {
+                               if(_display) {
                                        globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
                                }
                                g->planePtr->RegisterTransmission(1);   // cleared to taxi
@@ -336,7 +333,7 @@ void FGGround::Update(double dt) {
                        char buf[10];
                        sprintf(buf, "%.2f", f);
                        trns += buf;
-                       if(display) {
+                       if(_display) {
                                globals->get_ATC_display()->RegisterSingleMessage(trns, 0);
                        }
                        g->planePtr->RegisterTransmission(2);   // contact tower
@@ -370,25 +367,25 @@ void FGGround::DoRwyDetails() {
        FGRunway runway;
        bool rwyGood = globals->get_runways()->search(ident, int(hdg), &runway);
        if(rwyGood) {
-               activeRwy = runway.rwy_no;
-               rwy.rwyID = runway.rwy_no;
+               activeRwy = runway._rwy_no;
+               rwy.rwyID = runway._rwy_no;
                SG_LOG(SG_ATC, SG_INFO, "In FGGround, active runway for airport " << ident << " is " << activeRwy);
                
                // Get the threshold position
-               double other_way = runway.heading - 180.0;
+               double other_way = runway._heading - 180.0;
                while(other_way <= 0.0) {
                        other_way += 360.0;
                }
        // move to the +l end/center of the runway
-               //cout << "Runway center is at " << runway.lon << ", " << runway.lat << '\n';
-       Point3D origin = Point3D(runway.lon, runway.lat, aptElev);
+               //cout << "Runway center is at " << runway._lon << ", " << runway._lat << '\n';
+       Point3D origin = Point3D(runway._lon, runway._lat, aptElev);
                Point3D ref = origin;
        double tshlon, tshlat, tshr;
                double tolon, tolat, tor;
-               rwy.length = runway.length * SG_FEET_TO_METER;
+               rwy.length = runway._length * SG_FEET_TO_METER;
        geo_direct_wgs_84 ( aptElev, ref.lat(), ref.lon(), other_way, 
                                rwy.length / 2.0 - 25.0, &tshlat, &tshlon, &tshr );
-       geo_direct_wgs_84 ( aptElev, ref.lat(), ref.lon(), runway.heading, 
+       geo_direct_wgs_84 ( aptElev, ref.lat(), ref.lon(), runway._heading, 
                                rwy.length / 2.0 - 25.0, &tolat, &tolon, &tor );
                // Note - 25 meters in from the runway end is a bit of a hack to put the plane ahead of the user.
                // now copy what we need out of runway into rwy
@@ -396,7 +393,7 @@ void FGGround::DoRwyDetails() {
                Point3D takeoff_end = Point3D(tolon, tolat, aptElev);
                //cout << "Threshold position = " << tshlon << ", " << tshlat << ", " << aptElev << '\n';
                //cout << "Takeoff position = " << tolon << ", " << tolat << ", " << aptElev << '\n';
-               rwy.hdg = runway.heading;
+               rwy.hdg = runway._heading;
                // Set the projection for the local area based on this active runway
                ortho.Init(rwy.threshold_pos, rwy.hdg); 
                rwy.end1ortho = ortho.ConvertToLocal(rwy.threshold_pos);        // should come out as zero