[PROGRAM] Python GUI for YSRADAR

Note that alterations to the YSFlight .EXE is forbidden
User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

[PROGRAM] Python GUI for YSRADAR

Post by u2fly » Wed Jan 06, 2016 11:41 am

u2fly wrote:UPDATE: YS RADAR GUI ver.0.0.2
Image
CHANGELOG:
  • change look of aircraft marker and text
  • add date and clock with GMT time (see footer)
  • rename window title (make shorter)
  • add version number into main window (see left-up corner)
  • (other small changes)
Grab and test GUI prototype now!
ysradar-gui-0_0_2.zip
--
This is some draft and code example how make GUI for YSRADAR using Python with Tkinter library.
gui-ysradar.png
For working this demo install: Then try run it from terminal on your system.
--
P.S. Here also are example of radarscope on pure C
http://www.codeproject.com/Articles/200 ... ay-Using-C
--
Attachments
gui-ysradar_prototype.zip
(code & screenshot)
(151.71 KiB) Downloaded 66 times
Last edited by u2fly on Thu Jan 07, 2016 4:59 pm, edited 3 times in total.
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
mrmofumofu
Modding Team
Modding Team
Posts: 73
Joined: Mon Nov 02, 2015 4:45 pm
Favorite Aircraft: MiG-35
Location: Nara, Japan
OS: Linux(Arch Linux)
Has thanked: 20 times
Been thanked: 90 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by mrmofumofu » Wed Jan 06, 2016 11:50 am

Poseidon 2 include YSFLIGHT packet stacker in Python 3.
https://github.com/pasutisu/poseidon2
C/C++/C#/Python/PHP/JavaScript...etc
For support me, bought me a vodka!

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Wed Jan 06, 2016 12:09 pm

mrmofumofu wrote:Poseidon 2 include YSFLIGHT packet stacker in Python 3.
https://github.com/pasutisu/poseidon2
Thanks.
But I steal can't understand how your tool work (I'm not good programmer and you dont give us any documentation about your project in English).
Anyway, can you convert my example to work with Poseidon2?
Also it will be good if you make one more Poseidon2 version for Python2.x !
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
Strats
Rookie
Rookie
Posts: 32
Joined: Tue Dec 15, 2015 3:17 am
Favorite Aircraft: B757 and CF-18
Location: Canada
OS: Windows XP and 7:HP
Has thanked: 14 times
Been thanked: 5 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by Strats » Wed Jan 06, 2016 12:30 pm

I like where this project is going. Only issues I notice are how you would get the "user" blip to appear. I could see a potential collaboration with this idea and the integration of ATC. I propose YS could have commands that relay info on the users position and plane type as well as how it is in the air (it's state, speed, etc) to the program. Flight Tracking Strips in YS would be able to allow for ATC to work efficiently in conjunction with this program.

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Wed Jan 06, 2016 6:41 pm

Make update GUI skeleton for YSRADAR
gui-ysradar.png
--
UPDATE:
  • add transparency
  • make window on top
  • add title to main window
  • enlarge window size and fix it
  • add text line under aircraft marker for altitude as '@ <value>'
  • (some other improvements)
--
Attachments
ysradar-gui-0_0_1.zip
(975 Bytes) Downloaded 42 times
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
mrmofumofu
Modding Team
Modding Team
Posts: 73
Joined: Mon Nov 02, 2015 4:45 pm
Favorite Aircraft: MiG-35
Location: Nara, Japan
OS: Linux(Arch Linux)
Has thanked: 20 times
Been thanked: 90 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by mrmofumofu » Thu Jan 07, 2016 1:38 am

u2fly wrote:Thanks.
But I steal can't understand how your tool work (I'm not good programmer and you dont give us any documentation about your project in English).
Anyway, can you convert my example to work with Poseidon2?
Also it will be good if you make one more Poseidon2 version for Python2.x !
Poseidon 2 is for server...so cannot include it. But Packet and PacketStacker class in src/pos/packet.py useful for develop proxy for current YSFLIGHT.

And OfficerFlake's Orb and OpenYS source is very very good YSFLIGHT Protocol Reference.
C/C++/C#/Python/PHP/JavaScript...etc
For support me, bought me a vodka!

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Thu Jan 07, 2016 11:02 am

UPDATE: YS RADAR GUI ver.0.0.2
gui-ysradar_0_0_2.jpg
CHANGELOG:
  • change look of aircraft marker and text
  • add date and clock with GMT time (see footer)
  • rename window title (make shorter)
  • add version number into main window (see left-up corner)
  • (other small changes)
Attachments
ysradar-gui-0_0_2.zip
(1.45 KiB) Downloaded 91 times
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
Granny Apple Smith
Veteran
Veteran
Posts: 999
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 259 times
Been thanked: 199 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by Granny Apple Smith » Thu Jan 07, 2016 12:26 pm

Very very nice work u2fly!

Now a question is it possible to have ground objects show on the radar? How about just certain objects? How about an underlaying image like a simple map?
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Thu Jan 07, 2016 12:56 pm

BARRACUZ wrote:Very very nice work u2fly!

Now a question is it possible to have ground objects show on the radar? How about just certain objects? How about an underlaying image like a simple map?
Thanks & Lets do it!
Give me a sketch (paint on attached screenshot) how you want it will look!
Then I try answer correctly.
--
Also, did you try it on your PC? Is this demo work for you?
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
Granny Apple Smith
Veteran
Veteran
Posts: 999
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 259 times
Been thanked: 199 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by Granny Apple Smith » Thu Jan 07, 2016 1:07 pm

u2fly wrote:
BARRACUZ wrote:Very very nice work u2fly!

Now a question is it possible to have ground objects show on the radar? How about just certain objects? How about an underlaying image like a simple map?
Thanks & Lets do it!
Give me a sketch (paint on attached screenshot) how you want it will look!
Then I try answer correctly.
--
Also, did you try it on your PC? Is this demo work for you?
No not yet.

Well my thoughts were to have like a GPS style setup where the map/image will move inside the radar
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Thu Jan 07, 2016 1:34 pm

BARRACUZ wrote: No not yet.
What system you use? (I use Linux)
BARRACUZ wrote:Well my thoughts were to have like a GPS style setup where the map/image will move inside the radar
Ok, its not hard, only issue is that GUI planned for ATC tower that fixed on map. But, think, will make it usable as aircraft radar too.
Can you give me an image with examples? Try google it and give me one that you like.
Image
Also look this
Image
Is it what you think?
---
Last edited by u2fly on Thu Jan 07, 2016 5:03 pm, edited 1 time in total.
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
mrmofumofu
Modding Team
Modding Team
Posts: 73
Joined: Mon Nov 02, 2015 4:45 pm
Favorite Aircraft: MiG-35
Location: Nara, Japan
OS: Linux(Arch Linux)
Has thanked: 20 times
Been thanked: 90 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by mrmofumofu » Thu Jan 07, 2016 3:47 pm

u2fly, I think it need these function.

- Packet Capture
-- Entity Spawn
-- Move Entity

- Entity Manager
-- Entity ID
-- Entity Owner
-- Entity Name
-- Entity IFF
-- Last Entity Place

and calculate between Entity method needed.
C/C++/C#/Python/PHP/JavaScript...etc
For support me, bought me a vodka!

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Thu Jan 07, 2016 4:37 pm

mrmofumofu wrote:u2fly, I think it need these function.
- Packet Capture
-- Entity Spawn
-- Move Entity
- Entity Manager
-- Entity ID
-- Entity Owner
-- Entity Name
-- Entity IFF
-- Last Entity Place
and calculate between Entity method needed.
Can you give me some example code for Python2.7, that I can test with this GUI?
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
mrmofumofu
Modding Team
Modding Team
Posts: 73
Joined: Mon Nov 02, 2015 4:45 pm
Favorite Aircraft: MiG-35
Location: Nara, Japan
OS: Linux(Arch Linux)
Has thanked: 20 times
Been thanked: 90 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by mrmofumofu » Fri Jan 08, 2016 4:59 am

Example...at first, you need to understand YSFLIGHT Protocol.
YSFLIGHT uses TCP socket so capturing them needs "socket" module in Python 2.7/3.
YS Packets are raw C struct so extracting them needs "struct" module in Python 2.7/3.

All YS Packet has following structure.

4byte-uint Packet Body Length(n)
4byte-uint Packet Body Type
nbyte-struct Packet Body

Packet Type is about 50 type(Check OpenYS Code) like entity spawn, move object, damaged...etc.

and some packet connected and inserted one frame.

I suggest to read OpenYS and Orb Packet Module and view YS Packet with Wireshark.
Poseidon 2 packet.py is reference implement for packet capturing.
C/C++/C#/Python/PHP/JavaScript...etc
For support me, bought me a vodka!

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Fri Jan 08, 2016 5:43 am

mrmofumofu wrote:Example...at first, you need to understand YSFLIGHT Protocol.
YSFLIGHT uses TCP socket so capturing them needs "socket" module in Python 2.7/3.
YS Packets are raw C struct so extracting them needs "struct" module in Python 2.7/3.
All YS Packet has following structure.
4byte-uint Packet Body Length(n)
4byte-uint Packet Body Type
nbyte-struct Packet Body
Packet Type is about 50 type(Check OpenYS Code) like entity spawn, move object, damaged...etc.
and some packet connected and inserted one frame.
I suggest to read OpenYS and Orb Packet Module and view YS Packet with Wireshark.
Poseidon 2 packet.py is reference implement for packet capturing.
Ok, think soon this GUI will use next Python 2.7 modules:
  • Tkinter
  • time
  • math
  • socket
  • struct
  • ...
--
Please, adapt your "packet.py" and Eric's "ysradar.py" for YSFlight 20150425 (using Python 2.7):
https://gist.github.com/EricTendian/8500747
... and give me simple example script that connect to YS server (20150425) as aircraft, and return coordinates using "print" command!
Last edited by u2fly on Fri Jan 08, 2016 6:10 am, edited 1 time in total.
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
mrmofumofu
Modding Team
Modding Team
Posts: 73
Joined: Mon Nov 02, 2015 4:45 pm
Favorite Aircraft: MiG-35
Location: Nara, Japan
OS: Linux(Arch Linux)
Has thanked: 20 times
Been thanked: 90 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by mrmofumofu » Fri Jan 08, 2016 6:09 am

Umm...it wont be simple...
Poseidon 2 is running as proxy needs 1200 line(i thought it simple but take long time...2 mean rewrited).

Getting IFF by ID will be like this.
print(EntityManager().getEntity(65537).getIFF())
C/C++/C#/Python/PHP/JavaScript...etc
For support me, bought me a vodka!

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Fri Jan 08, 2016 6:12 am

mrmofumofu wrote:Umm...it wont be simple...
Poseidon 2 is running as proxy needs 1200 line(i thought it simple but take long time...2 mean rewrited).

Getting IFF by ID will be like this.
print(EntityManager().getEntity(65537).getIFF())
Can you give me it as python script?
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

User avatar
Flake
Staff
Staff
Posts: 4162
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Honda CBR600RR. Shit I mean Boeing F/A-18A.
Location: Australia
OS: Windows 10 (x64)
Has thanked: 775 times
Been thanked: 1064 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by Flake » Sat Jan 09, 2016 6:28 am

mrmofumofu wrote:(i thought it simple but take long time...)
Story of my life hahaha! :lol:
Image
Oi. You. Yeah you. Subscribe to my videos. Text your cousins, tell them to do it too!

User avatar
Granny Apple Smith
Veteran
Veteran
Posts: 999
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 259 times
Been thanked: 199 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by Granny Apple Smith » Sat Jan 09, 2016 1:43 pm

Yea pretty much something like that. Nothing complex just aircraft and maybe vor/dmes and other navigational aids and list their names. That would make ATC alot easier and realistic
Image
Beginner ATC for hire!
Current Projects:
-Pilatus PC12
-Mooney M20
-New England Scenery
Fine Print:
**Word of Caution**
My knowledge is limited. Anything I write in my posts may or may not be accurate. To be honest I think its all crap.

User avatar
u2fly
Banned
Banned
Posts: 1156
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 645 times
Been thanked: 258 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly » Sun Mar 20, 2016 1:54 am

Now I'm try make "YS RADAR" GUI closer to "OpenRadar" look
http://wiki.flightgear.org/OpenRadar
Here are few "OpenRadar" screenshots.
Image
Image
/!\ READ YSFLIGHT HANDBOOK (.PDF) | updated 2017/05/03

“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
- John McCain, U.S. Senator for Arizona, Republican party
(31 DEC 2016)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest