YSFlight Radar Refresh

YSFlight addon development, questions, tutorials, & more!
User avatar
decaff_42
Staff
Staff
Posts: 3557
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 622 times
Been thanked: 1351 times
Contact:

Re: YSFlight Radar Refresh

Post by decaff_42 » Tue Sep 20, 2016 10:38 pm

Question on line 371 in the gui.py, why did you make the rework comment? There are a whole bunch of menu options that I simply did not code in because I didn't get to them, so they do nothing.

Code: Select all

filemenu.add_command(label="Open Map Config File",command=self.OpenConfigFile) #u2fly: Need rework!
In YSFlightRadar.py I recommend changing line 8 for grammar to this:

Code: Select all

print('YSFlight ATC Radar running...','\nCredits:',__author__,'\nVersion:',__version__,'('+__date__+')')

I'd also recommend using classes for each instance of an aircraft and also using it to help draw the aircraft on the scope.
Here is a start:

Code: Select all

class Aircraft():
    def __init__(self, lat, long, altitude, username, AC_Type, heading, speed):
        self.lat = lat  # North-South position of aircraft (meters) [NUMBER]
        self.long = long    # East-West position of aircrage (meters) [NUMBER]
        self.alt = altitude    # Altitude of aircraft (feet) [NUMBER]
        self.name = username    # username of player [STRING]
        self.AC_Type = AC_Type  # Name of aircraft from dat file [STRING]
        self.heading = heading  # Compass heading of aircraft (degrees) [NUMBER]
        self.speed = speed      # Aircraft True Air Speed (knots) [NUMBER]

    def Update(lat,long,altitude,AC_Type,heading,speed):
        # This function will update the aircraft's parameters
        self.lat = lat
        self.long = long
        self.alt = altitude
        self.AC_Type = AC_Type      # Needed in case the user switches airplanes
        self.heading = heading
        self.speed = speed
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Server Flight Log
Addon Database

User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1259
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 754 times
Been thanked: 277 times
Contact:

Re: YSFlight Radar Refresh

Post by u2fly » Wed Sep 21, 2016 8:42 am

decaff_42 wrote:Question on line 371 in the gui.py, why did you make the rework comment? There are a whole bunch of menu options that I simply did not code in because I didn't get to them, so they do nothing.

Code: Select all

filemenu.add_command(label="Open Map Config File",command=self.OpenConfigFile) #u2fly: Need rework!
Think, I add this comment before I define "OpenConfigFile". Now I will remove this comment.

Thanks for the other ideas, try implement them in next preview release, but need deeper learn Python 3.4 by myself.

If your platform is MacOS or Windows can your test current version and give console output?
/!\ READ YSFLIGHT HANDBOOK (online + PDF) | updated 2019/04/25

U.S. Senator John McCain wrote:
“Spending #NewYearsEve w/ brave #Ukrainian Marines at a forward combat outpost - we stand w/ them in their fight against #Putin's aggression”
http://pic.twitter.com/vkz0gdozVV
(31 DEC 2016)

User avatar
decaff_42
Staff
Staff
Posts: 3557
Joined: Sat Oct 29, 2011 7:23 pm
Favorite Aircraft: SR-71 Blackbird
Location: Eastern United States
OS: Mac OSX
Has thanked: 622 times
Been thanked: 1351 times
Contact:

Re: YSFlight Radar Refresh

Post by decaff_42 » Wed Sep 21, 2016 11:17 am

Code: Select all

YSFlight ATC Radar running... 
Credits: Decaff_42, u2fly 
Version: 0.2 (Sep 20, 2016)
Platform: Darwin (WHAT IS IT?) 
Python: 3.4.2 (TESTED OK)
Check out my website YSDecaff for all my tutorials and addon releases.
Visit by Bitbucket page for Python codes: https://bitbucket.org/decaff42/

Server Flight Log
Addon Database

User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1259
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 754 times
Been thanked: 277 times
Contact:

Re: YSFlight Radar Refresh

Post by u2fly » Thu Sep 22, 2016 8:46 pm

decaff_42 wrote:

Code: Select all

YSFlight ATC Radar running... 
Credits: Decaff_42, u2fly 
Version: 0.2 (Sep 20, 2016)
Platform: Darwin (WHAT IS IT?) 
Python: 3.4.2 (TESTED OK)
Thanks, need fix MacOS identifier.

I have a question about application icon: how use GIF as application icon in "gui.py" using next trick? I want use GIF as alternative to ICO and XBM, because last two are not crossplatform formats.
/!\ READ YSFLIGHT HANDBOOK (online + PDF) | updated 2019/04/25

U.S. Senator John McCain wrote:
“Spending #NewYearsEve w/ brave #Ukrainian Marines at a forward combat outpost - we stand w/ them in their fight against #Putin's aggression”
http://pic.twitter.com/vkz0gdozVV
(31 DEC 2016)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests