]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a small mistake in the scene graph arrangement for vasi lights.
authorcurt <curt>
Sun, 11 Jan 2004 19:45:29 +0000 (19:45 +0000)
committercurt <curt>
Sun, 11 Jan 2004 19:45:29 +0000 (19:45 +0000)
scripts/perl/autopilot/flyplan.pl [deleted file]
scripts/perl/autopilot/telnet.pl [deleted file]
scripts/perl/examples/reset.pl
src/Main/main.cxx
src/Scenery/scenery.cxx
src/Scenery/scenery.hxx
src/Scenery/tilemgr.cxx

diff --git a/scripts/perl/autopilot/flyplan.pl b/scripts/perl/autopilot/flyplan.pl
deleted file mode 100755 (executable)
index 3924241..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/perl
-#
-# Written by Curtis L. Olson, started January 2003
-#
-# This file is in the Public Domain and comes with no warranty.
-#
-# $Id$
-# ----------------------------------------------------------------------------
-
-
-use strict;
-
-require "telnet.pl";
-
-my( $server ) = "localhost";
-my( $port ) = 5401;
-my( $timeout ) = 10;
-
-my( %Route );
-$Route{0} = "OAK:116.80:020";
-$Route{1} = "OAK:116.80:019:27";
-$Route{2} = "SAC:115.20:020";
-$Route{3} = "SAC:115.20:080:43";
-$Route{4} = "ECA:116.0:209";
-
-my( $i );
-
-foreach $i ( keys(%Route) ) {
-    &fly_to( $Route{$i} );
-}
-
-
-sub fly_to() {
-    my( $waypoint ) = shift;
-
-    # decode waypoint
-    my( $id, $freq, $radial, $dist ) = split( /:/, $waypoint );
-
-    print "Next way point is $id - $freq\n";
-    print "  Target radial is $radial\n";
-    if ( $dist ne "" ) {
-        print "  Flying outbound for $dist nm\n";
-    } else {
-        print "  Flying inbound to station\n";
-    }
-
-    # tune radio and set autopilot
-    my( $fgfs );
-    if ( !( $fgfs = &connect($server, $port, $timeout) ) ) {
-        print "Error: can't open socket\n";
-        return;
-    }
-    &send( $fgfs, "data" );     # switch to raw data mode
-    set_prop( $fgfs, "/radios/nav[0]/frequencies/selected-mhz", $freq );
-    set_prop( $fgfs, "/radios/nav[0]/radials/selected-deg", $radial );
-    set_prop( $fgfs, "/radios/dme/switch-position", "1" );
-    set_prop( $fgfs, "/autopilot/locks/nav", "true" );
-
-    # monitor progress until goal is achieved
-    my( $done ) = 0;
-    my( $last_range ) = 9999.0;
-    while ( !$done ) {
-        my( $inrange ) = get_prop( $fgfs, "/radios/nav[0]/in-range" );
-        if ( $inrange eq "false" ) {
-            print "Warning, VOR not in range, we are lost!\n";
-        }
-        my( $cur_range ) = get_prop( $fgfs, "/radios/dme/distance-nm" );
-        print "  range = $cur_range\n";
-        if ( $dist ne "" ) {
-            # a target dist is specified so assume we are flying outbound
-            if ( $cur_range > $dist ) {
-                $done = 1;
-            }
-        } else {
-            # no target dist is specified, assume we are flying
-            # inbound to the station
-            if ( $cur_range < 0.25 && $cur_range > 0.0 ) {
-                $done = 1;
-            } elsif ( $last_range < $cur_range ) {
-                $done = 1;
-            }
-        }
-        $last_range = $cur_range;
-
-        # loop once per second
-        sleep(1);
-    }
-
-    &send( $fgfs, "quit");
-    close $fgfs;
-}
diff --git a/scripts/perl/autopilot/telnet.pl b/scripts/perl/autopilot/telnet.pl
deleted file mode 100644 (file)
index c42bd30..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/perl
-#
-# Written by Curtis L. Olson, started December 2002
-# Some code portions courtesy of Melchior FRANZ
-#
-# This file is in the Public Domain and comes with no warranty.
-#
-# $Id$
-# ----------------------------------------------------------------------------
-
-
-use IO::Socket;
-
-use strict;
-
-
-sub get_prop() {
-    my( $handle ) = shift;
-
-    &send( $handle, "get " . shift );
-    eof $handle and die "\nconnection closed by host";
-    $_ = <$handle>;
-    s/\015?\012$//;
-    /^-ERR (.*)/ and die "\nfgfs error: $1\n";
-
-    return $_;
-}
-
-
-sub set_prop() {       
-    my( $handle ) = shift;
-    my( $prop ) = shift;
-    my( $value ) = shift;
-
-    &send( $handle, "set $prop $value");
-
-    # eof $handle and die "\nconnection closed by host";
-}
-
-
-sub send() {
-    my( $handle ) = shift;
-
-    print $handle shift, "\015\012";
-}
-
-
-sub connect() {
-    my( $host ) = shift;
-    my( $port ) = shift;
-    my( $timeout ) = (shift || 120);
-    my( $socket );
-    STDOUT->autoflush(1);
-    while ($timeout--) {
-        if ($socket = IO::Socket::INET->new( Proto => 'tcp',
-                                             PeerAddr => $host,
-                                             PeerPort => $port) )
-        {
-            $socket->autoflush(1);
-            return $socket;
-        }      
-        print "Attempting to connect ... " . $timeout . "\n";
-        sleep(1);
-    }
-    return 0;
-}
-
-
-return 1;                    # make perl happy
index ed77926e064e359061181b51d4c6f33712241372..1f122d9e47f175bbed6f43f0283bee84e80b0d37 100755 (executable)
@@ -6,7 +6,7 @@ use strict;
 
 my( $airport_id ) = "KSNA";
 my( $rwy_no ) = "19R";
-my( $reset_sec ) = 30;
+my( $reset_sec ) = 300;
 
 my( $server ) = "localhost";
 my( $port ) = 5401;
index f65be189ed4d90800c0e75bee2e8278972d781fd..5c7d7c94c1d3341a3f91405c61402da9db142336 100644 (file)
@@ -341,6 +341,7 @@ void trRenderFrame( void ) {
     // draw the lights
     glFogf (GL_FOG_DENSITY, rwy_exp2_punch_through);
     ssgSetNearFar( scene_nearplane, scene_farplane );
+    ssgCullAndDraw( globals->get_scenery()->get_vasi_lights_root() );
     ssgCullAndDraw( globals->get_scenery()->get_rwy_lights_root() );
 
     ssgCullAndDraw( globals->get_scenery()->get_gnd_lights_root() );
@@ -711,6 +712,7 @@ void fgRenderFrame() {
 
         // draw runway lighting
         if ( draw_otw ) {
+            ssgCullAndDraw( globals->get_scenery()->get_vasi_lights_root() );
             ssgCullAndDraw( globals->get_scenery()->get_rwy_lights_root() );
         }
 
index 958e27f327d42c24cf0e64d69fee9cf8370bf498..88435c10cd7dc72a6677c388232e3a841f95e970 100644 (file)
@@ -72,6 +72,9 @@ void FGScenery::init() {
     gnd_lights_root = new ssgRoot;
     gnd_lights_root->setName( "Ground Lighting Root" );
 
+    vasi_lights_root = new ssgRoot;
+    vasi_lights_root->setName( "VASI/PAPI Lighting Root" );
+
     rwy_lights_root = new ssgRoot;
     rwy_lights_root->setName( "Runway Lighting Root" );
 
index 020405f83507147fed5f9e2326ad8a11795358b9..0ba923cd4a1e4404ba15f9b1a8fd7f258aa89f13 100644 (file)
@@ -63,6 +63,7 @@ class FGScenery : public SGSubsystem {
     ssgRoot *scene_graph;
     ssgBranch *terrain_branch;
     ssgRoot *gnd_lights_root;
+    ssgRoot *vasi_lights_root;
     ssgRoot *rwy_lights_root;
     ssgRoot *taxi_lights_root;
     ssgBranch *models_branch;
@@ -104,6 +105,13 @@ public:
         gnd_lights_root = r;
     }
 
+    inline ssgRoot *get_vasi_lights_root () const {
+        return vasi_lights_root;
+    }
+    inline void set_vasi_lights_root (ssgRoot *r) {
+        vasi_lights_root = r;
+    }
+
     inline ssgRoot *get_rwy_lights_root () const {
         return rwy_lights_root;
     }
index 313c67fabef6d2bb5926794acdd274412a81e2f4..29a1350bc1854ff9fc3824f3f3cb0522a3a77b6e 100644 (file)
@@ -322,7 +322,7 @@ void FGTileMgr::update_queues()
 #endif
         e->add_ssg_nodes( globals->get_scenery()->get_terrain_branch(),
                           globals->get_scenery()->get_gnd_lights_root(),
-                          globals->get_scenery()->get_taxi_lights_root(),
+                          globals->get_scenery()->get_vasi_lights_root(),
                           globals->get_scenery()->get_rwy_lights_root(),
                           globals->get_scenery()->get_taxi_lights_root() );
         // cout << "Adding ssg nodes for "