3 # position.pl - Handle repositioning aircraft (in air/on ground)
5 # Written by Curtis L. Olson, started January 2004
7 # Copyright (C) 2004 Curtis L. Olson - http://www.flightgear.org/~curt
9 # This code is placed in the public domain by Curtis L. Olson.
10 # There is no warranty, etc. etc. etc.
13 # ----------------------------------------------------------------------------
20 my( $airport_id ) = "KSNA";
21 my( $rwy_no ) = "19R";
22 my( $reset_sec ) = 300;
24 my( $server ) = "localhost";
33 my( $offset_dist ) = shift;
34 my( $glideslope_deg ) = shift;
35 my( $altitude_ft ) = shift;
36 my( $airspeed_kt ) = shift;
41 $HASH{ "/sim/presets/airport-id" } = $aptid;
42 $HASH{ "/sim/presets/runway" } = $rwy;
43 $HASH{ "/sim/presets/offset-distance" } = $offset_dist;
44 if ( $glideslope_deg > 0 ) {
45 $HASH{ "/sim/presets/glideslope-deg" } = $glideslope_deg;
46 $HASH{ "/sim/presets/altitude-ft" } = "";
48 $HASH{ "/sim/presets/glideslope-deg" } = "";
49 $HASH{ "/sim/presets/altitude-ft" } = $altitude_ft;
52 $HASH{ "/sim/presets/airspeed-kt" } = $airspeed_kt;
53 $HASH{ "/sim/presets/vor-id" } = "";
54 $HASH{ "/sim/presets/vor-freq" } = "";
55 $HASH{ "/sim/presets/ndb-id" } = "";
56 $HASH{ "/sim/presets/ndb-freq" } = "";
57 $HASH{ "/sim/presets/fix" } = "";
58 $HASH{ "/sim/presets/longitude-deg" } = "-9999.0";
59 $HASH{ "/sim/presets/latitude-deg" } = "-9999.0";
60 $HASH{ "/sim/presets/offset-azimuth" } = "";
61 $HASH{ "/sim/presets/heading-deg" } = "-9999.0";
63 foreach $prop ( keys(%HASH) ) {
64 $value = $HASH{$prop};
65 print "setting $prop = $value\n";
66 &set_prop( $fgfs, $prop, $value );
69 &send( $fgfs, "run presets-commit" );
81 $HASH{ "/sim/presets/airport-id" } = $aptid;
82 $HASH{ "/sim/presets/runway" } = $rwy;
83 $HASH{ "/sim/presets/offset-distance" } = "";
84 $HASH{ "/sim/presets/glideslope-deg" } = "";
85 $HASH{ "/sim/presets/altitude-ft" } = "";
86 $HASH{ "/sim/presets/airspeed-kt" } = "";
87 $HASH{ "/sim/presets/vor-id" } = "";
88 $HASH{ "/sim/presets/vor-freq" } = "";
89 $HASH{ "/sim/presets/ndb-id" } = "";
90 $HASH{ "/sim/presets/ndb-freq" } = "";
91 $HASH{ "/sim/presets/fix" } = "";
92 $HASH{ "/sim/presets/longitude-deg" } = "-9999.0";
93 $HASH{ "/sim/presets/latitude-deg" } = "-9999.0";
94 $HASH{ "/sim/presets/offset-azimuth" } = "";
95 $HASH{ "/sim/presets/heading-deg" } = "-9999.0";
97 foreach $prop ( keys(%HASH) ) {
98 $value = $HASH{$prop};
99 print "setting $prop = $value\n";
100 &set_prop( $fgfs, $prop, $value );
103 &send( $fgfs, "run presets-commit" );