+++ /dev/null
-#!/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;
-}
+++ /dev/null
-#!/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
my( $airport_id ) = "KSNA";
my( $rwy_no ) = "19R";
-my( $reset_sec ) = 30;
+my( $reset_sec ) = 300;
my( $server ) = "localhost";
my( $port ) = 5401;
// 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() );
// draw runway lighting
if ( draw_otw ) {
+ ssgCullAndDraw( globals->get_scenery()->get_vasi_lights_root() );
ssgCullAndDraw( globals->get_scenery()->get_rwy_lights_root() );
}
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" );
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;
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;
}
#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 "