[PROGRAM] Python GUI for YSRADAR

Note that alterations to the YSFlight .EXE is forbidden
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

[PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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 496 times
Last edited by u2fly on Thu Jan 07, 2016 4:59 pm, edited 3 times in total.

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
Deleted User 2704

Re: [PROGRAM] Python GUI for YSRADAR

Post by Deleted User 2704 »

Poseidon 2 include YSFLIGHT packet stacker in Python 3.
https://github.com/pasutisu/poseidon2
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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 !

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
Deleted User 2722

Re: [PROGRAM] Python GUI for YSRADAR

Post by Deleted User 2722 »

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
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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 417 times

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
Deleted User 2704

Re: [PROGRAM] Python GUI for YSRADAR

Post by Deleted User 2704 »

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.
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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 649 times

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
User avatar
Barr
Veteran
Veteran
Posts: 1012
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 272 times
Been thanked: 206 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by Barr »

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
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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?

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
User avatar
Barr
Veteran
Veteran
Posts: 1012
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 272 times
Been thanked: 206 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by Barr »

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
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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.

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
Deleted User 2704

Re: [PROGRAM] Python GUI for YSRADAR

Post by Deleted User 2704 »

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.
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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?

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
Deleted User 2704

Re: [PROGRAM] Python GUI for YSRADAR

Post by Deleted User 2704 »

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.
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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.

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
Deleted User 2704

Re: [PROGRAM] Python GUI for YSRADAR

Post by Deleted User 2704 »

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())
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

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?

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: [PROGRAM] Python GUI for YSRADAR

Post by Flake »

mrmofumofu wrote:(i thought it simple but take long time...)
Story of my life hahaha! :lol:
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Barr
Veteran
Veteran
Posts: 1012
Joined: Wed Mar 28, 2012 8:49 pm
Favorite Aircraft: The Boeing 757
Location: Providence, Rhode Island
OS: Windows 10/Gentoo
Has thanked: 272 times
Been thanked: 206 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by Barr »

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
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: [PROGRAM] Python GUI for YSRADAR

Post by u2fly »

Now I'm try make "YS RADAR" GUI closer to "OpenRadar" look
http://wiki.flightgear.org/OpenRadar
Here are few "OpenRadar" screenshots.
Image
Image

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”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests