Programming Question Python Question

kerlix

Donator
Donator
Joined
Mar 28, 2010
Messages
291
Reaction score
40
Points
28
I apologize of this is the wrong forum. Please feel free to move it to wherever is appropriate.

I'm in the beginning stages of learning Python. I know that I could use it, along with something like PyQt to create a GUI, to create a program that takes user input about something like a rocket (or any type of projectile and have it spit out the results like max altitude/height AGL reached, max velocity, etc.

But is it possible to have it not just display the end results instantly? Like a real time read out of the data as the simulation runs? Things like update the result fields in increments of .5 seconds or something similar, possibly even v-synced?

And even more, possibly a 2-D graphic of things like a circle representing the ground/earth and a dot or something showing the progress with ideally a trailing line behind it to show the past progress?

I hope that makes sense. I don't know if ALL the data would be in the Python code itself or in a DB that Python pulls from for things that are unchanging, like the thrust of a specific engine, the circle and gravity, the atmospheric density model, etc.

I just have an end goal in mind for a fun project. I'm just at the beginning and don't really know what it is or is not possible with Python. Or if I'd need to incorporate Java or something similar to get the results.

I also thought about learning C# (mainly for the GUI stuff) and seeing if it would be possible in that as well.

Any input or guidance is very much appreciated.

Stay safe and healthy, everyone.
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Addon Developer
Webmaster
GFX Staff
Donator
Beta Tester
Joined
Aug 9, 2009
Messages
6,629
Reaction score
101
Points
138
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
What's your aim here? Is this something you're hoping to plug into Orbiter, to simulate yourself fully in Python, or to track a real-life spacecraft?

Either way, in any of those scenarios what you describe should indeed be possible to achieve in Python, yes, though some will be more difficult than others.
 

Face

Addon Developer
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,153
Reaction score
93
Points
73
Location
Vienna
I also thought about learning C# (mainly for the GUI stuff) and seeing if it would be possible in that as well

Since you can create mixed-mode assemblies with C# .NET, you can do just the same as with native Orbiter modules. GUI stuff like WPF is also possible with it. Just keep in mind that C# (and .NET as such) is quite a different beast than Python.

But I think your idea is not coming across clear enough. Do you think about a server-based thingy that pulls from some running session, or more like an in-sim tool?
 

kerlix

Donator
Donator
Joined
Mar 28, 2010
Messages
291
Reaction score
40
Points
28
I was actually thinking about a stand-alone program/simulation-type thing outside of Orbiter.

The user would select the type of launch vehicle they want, possibly change the type and number of engines on it (random customization), number of stages, payload weight, etc. and then just simulate the flight.

I initially started with Python because I kept reading about how it was a good "introductory" programming language for someone that's never programmed before.
 

kerlix

Donator
Donator
Joined
Mar 28, 2010
Messages
291
Reaction score
40
Points
28
Addendum: I guess in some circumstances, it could be used as an in-sim tool for Orbiter as well. I just hadn't thought about that.
 

n72.75

Addon Developer
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
1,828
Reaction score
186
Points
63
Location
Biddeford ME
Website
www.adabsurdumpublishing.com
I was actually thinking about a stand-alone program/simulation-type thing outside of Orbiter.

The user would select the type of launch vehicle they want, possibly change the type and number of engines on it (random customization), number of stages, payload weight, etc. and then just simulate the flight.

I initially started with Python because I kept reading about how it was a good "introductory" programming language for someone that's never programmed before.


This series on YouTube may be of help to you.
 
Top