Mercurial > atc
changeset 12:243941ec0a36
Make the plane info more realistic
Plane specs include shortname
Added QUIT command
Added 2 images of real radars
committer: Jeff Sipek <jeffpc@jeff.(none)> 1120798856 -0400
author | Jeff Sipek <jeffpc@jeff.(none)> |
---|---|
date | Fri, 08 Jul 2005 05:00:56 -0400 |
parents | 300ba3412449 |
children | 4a95c5552d3b |
files | atc_plane.py atc_plane_specs.py atc_single.py data/image/background.xcf eventually_useful/radarscreen.gif eventually_useful/russian.jpg |
diffstat | 6 files changed, 21 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/atc_plane.py Fri Jul 08 03:26:11 2005 -0400 +++ b/atc_plane.py Fri Jul 08 05:00:56 2005 -0400 @@ -220,14 +220,17 @@ y = int(768/2-m2pix(self.pos["Y"])) - 5 # FIXME: display geographic coordinates with NSWE appended/prepended + #strings = ( self.flightno, + # self.callsign + " " + str(self.status), + # "Alt: " + str(int(self.pos["Z"])), + # "Lat: " + self.calc_geo(self.pos["Y"],"NS"), + # "Long: " + self.calc_geo(self.pos["X"],"EW"), + # "Head: " + str(int(atc_utils.todeg(self.vel["heading"]))), + # "AS: " + str(int(self.vel["speed"]*3.6))) strings = ( self.flightno, - self.callsign + " " + str(self.status), - "Alt: " + str(int(self.pos["Z"])), - "Lat: " + self.calc_geo(self.pos["Y"],"NS"), - "Long: " + self.calc_geo(self.pos["X"],"EW"), - "Head: " + str(int(atc_utils.todeg(self.vel["heading"]))), - "AS: " + str(int(self.vel["speed"]*3.6))) - + "%03d %03d" % (int(atc_utils.todeg(self.vel["heading"])), int(self.vel["speed"]*3.6)), + self.specs["name"]) + for stri in strings: alt = font.render(stri, 1, color) altpos = alt.get_rect()
--- a/atc_plane_specs.py Fri Jul 08 03:26:11 2005 -0400 +++ b/atc_plane_specs.py Fri Jul 08 05:00:56 2005 -0400 @@ -21,12 +21,16 @@ # */ # all measurements in meters/sec or meters -plane_SPECS = ({"name": "Piper PA28-140 Cherokee", +plane_SPECS = ({"fullname": "Piper PA28-140 Cherokee", + "name": "PA28", + "heavy": False, "stall_speed": 16.667, "climb_normal": 182.0, "max_altitude": 6500.0}, - {"name": "Boeing 747-400", + {"fullname": "Boeing 747-400", + "name": "B747", + "heavy": True, "stall_speed": 62.572, "climb_normal": 900.0, "max_altitude": 13000.0})
--- a/atc_single.py Fri Jul 08 03:26:11 2005 -0400 +++ b/atc_single.py Fri Jul 08 05:00:56 2005 -0400 @@ -158,6 +158,10 @@ pass # fixme, tab complete call signs/flight numbers, commands, etc. if (event.key == pygame.K_KP_ENTER) or (event.key == pygame.K_RETURN): + if (cmd == "QUIT"): + mess.pickup_kill = 1 + return + flno = cmd_plane(cmd) cmd = cmd_cmd(cmd) print "plane = " + flno + ", cmd = " + cmd @@ -165,7 +169,7 @@ if plane.flightno.upper() == flno.upper(): print "Found match!" plane.process(cmd) - break; + break cmd = "" screen.blit(background, (0, 0))