Board index Other Hangar talk

Command Line

Talk about (almost) anything, as long as it is no serious FlightGear talk and does not fit in the other subforums.
Forum rules
Please refrain from discussing politics.

Command Line

Postby MickeySkooter » Sat Aug 04, 2018 3:24 pm

I know it is possible to preload frequencies for Com 1, com2 and so on ... but is it possible to have a switch for specific airports like ' if apt=KGGG com1=xxx.xx ?
MickeySkooter
 
Posts: 109
Joined: Tue Feb 20, 2018 5:33 am
Location: Montz, Louisiana
Callsign: NC3110
Version: 2017.3.1
OS: Windows 10

Re: Command Line

Postby wkitty42 » Sat Aug 04, 2018 6:28 pm

not that i know of... you could do it with some scripting to build your command line, though... i would imagine you'd have a lookup table of freqs for an airport and then have the script choose and set them in your command line building...

off the top of my head using hard coded airports and freqs eg:
Code: Select all
#!/bin/bash
# the first parameter, $1, is the departure airport.
# there must be one parameter given when calling this script.
if [ "$#" -ne 1 ]; then
  printf "\nIllegal number of parameters: $#\n"
  printf "$0 requires the departure airport to be specified on the command line.\n"
  printf "eg:\n"
  printf "  $0 KGGG\n"
  printf "\nAborting...\n"
  exit 1
else
  myairport=$1
fi

# fg-root is where fgdata is located
myfgroot="--fg-root=/path/to/your/fgdata"

# $myradio settings contains the radio freqs we want set
if [ "$myairport" == "KGGG" ] ; then
  myradiosettings="--com1=123.45 --com2=134.23 --nav1=154.3 --nav2=164.2"
elif [ "$myairport" == "KOAK" ] ; then
  myradiosettings="--com1=321.0 --com2=413.5 --nav1=184.3 --nav2=175.2"
elif [ "$myairport" == "KSFO" ] ; then
  myradiosettings="--com1=111.0 --com2=222.5 --nav1=121.3 --nav2=145.6"
fi

# put the command line together so it includes all parts
cmdline="$myfgroot $myairport $myradiosettings"

# load FG using our built command line
printf "executing: fgfs \"$cmdline\"\n"
fgfs "$cmdline"
unset cmdline
unset myfgroot
unset myairport
unset myradiosettings
<eof>
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9162
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 22.04


Return to Hangar talk

Who is online

Users browsing this forum: No registered users and 6 guests