topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 9:43 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Aviation Business Project using a Flight Simulator  (Read 23333 times)

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Aviation Business Project using a Flight Simulator
« on: July 21, 2011, 06:33 PM »
Hello DCers,

I would like to create a virtual aviation business environment using a flight simulator, like Flightgear, X-Plane, FSX, FS9, etc. Most likely it will be the FS9/FSX route.

For the purpose of this discussion, Ill use the following abbreviations...

-- N009BH = The callsign of a specific aircraft.
-- FSApp = Flight Simulator Application
-- FCA = Stands for "FS Control Application which is the client software the pilot will interface with.
-- FSUIPC = Flight Simulator User Interface Personal Computer - A module by Pete Dowson integrated with flight simulator variables which allow for reading and writing of those variables.
-- AFL = Aircraft Fuel Level
-- TEH = Total Engine Hours

What I would *like* to do is...

@ Pilot manually opens the FSApp, loads the aircraft and the FCA.
@ Pilot enters or selects from a drop-down, an aircraft, such as "N009BH" into the "Aircraft" field and presses the "Get Aircraft Data" button on the FCA.
@ The FCA connects to a specific URL where a table of data is stored.
@ The "N009BH" row is located on the table and the "AFL" and "TEH" fields are located and retrieved to the FCA.
@ FCA disconnects from the URL
@ FCA seeds the FSApp with new values via the FSUIPC.
@ Pilot flies......
@ At end of the flight, the pilot clicks the "Send Aircraft Data" button on the FCA.
@ The FCA reads the FSApp values from the FSUIPC and connects back to the URL.
@ The "N009BH" row is located on the table again and the new "AFL" and "TEH" values are overwritten.
@ FCA disconnects from the URL.

Actually there is a lot more values I need to work with, i.e., "Battery_Level," "Engine_Component_Failure_Coefficient, etc. for the aircraft and various fields for the Pilot Logbook. If I can get just the simple(?) AFL and TEH above working correctly, I'm sure I can make the rest hum.

I realize there must be some steps I missed, but I just wanted to give a reasonable idea of what was happening.

Now...

How would you suggest I go about doing this project? To my mind's eye it seems fairly simple, but the four things I don't know are...

1. How to have the client get to the URL?
2. How to make the table (or should I just parse a text file)?
3. How to access table values and read/write?
4. How to make it reasonably secure (UID and PWD)?

I'm doing some experimenting with the Joomla CMS, but I don't think I can automate locating the URL with the FCA. Also, I realize that FCA, FSApp, FSUIPC, etc. abbreviations may drive you bats, but since I am anticipating this project (and this thread) may take some time, I thought having some shorthand would be good.

~CT
« Last Edit: July 24, 2011, 07:51 AM by CodeTRUCKER »

hamradio

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 825
  • Amateur Radio Guy
    • View Profile
    • HamRadioUSA.net
    • Read more about this member.
    • Donate to Member
Re: Flight Simulator Family Project
« Reply #1 on: July 21, 2011, 08:34 PM »
Regarding NANY 2012 - See -> https://www.donation...ndex.php?board=304.0

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Aviation Business Project using a Flight Simulator
« Reply #2 on: July 21, 2011, 09:57 PM »
Regarding NANY 2012 - See -> https://www.donation...ndex.php?board=304.0

I was really just trying to tease Perry a bit.  I had no idea the NANY was starting this early, but thanks for the link.
« Last Edit: July 21, 2011, 10:13 PM by CodeTRUCKER »

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #3 on: July 22, 2011, 02:25 PM »
I've been giving this some more thought... would it be better to put the aircraft data in a text ini-type file, instead of on a table?  I know how to parse text.  Anyone see any problems with this?

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 588
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #4 on: July 22, 2011, 02:34 PM »
Your plans sound ambitious and complicated. Therefore, I say go with a proper database and thus a table within said database. That way, no matter how complicated it gets, you already have a place where you can stow all the stuff. One-to-many relationships are tough in plain text, nevermind many-to-many ones which are a complete hell.

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #5 on: July 22, 2011, 02:41 PM »
Your plans sound ambitious and complicated. Therefore, I say go with a proper database and thus a table within said database. That way, no matter how complicated it gets, you already have a place where you can stow all the stuff. One-to-many relationships are tough in plain text, nevermind many-to-many ones which are a complete hell.

Alrighty then, I have to learn how to do it, so is php my friend, or MySQL, etc.?  I don't mind doing the work, but I need a push in the right direction.  :)

How would you do it?

worstje

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 588
  • The Gent with the White Hat
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #6 on: July 22, 2011, 03:43 PM »
They serve different purposes. PHP is for the logic, MySQL is for the data (and thus also the relationships between the data).

Proper database design is a course on its own, and I really can't begin to explain the finer points. A good one to keep in mind however is that you should never duplicate data (example: storing John's birthdate twice, once for his passport and once for his birth certificate), and that a field can only describe a single thing (example: list of hotel rooms on the fourth floor should NOT be a comma seperated '401,402,404,405' but instead the proper database relationships should be used so such information can be stored and properly queried). Finally, it also pays to keep in mind that a table should be considered to represent the blueprint of an entity, and a record in said table is such an entity.

To be honest, I am way too tired to go into your specific project. But I'd imagine an airplane table (which describes the aircraft), pilots (describing pilot qualifications), flights (which describes flights of different aircrafts with different pilots), pilot_log (storing dated log entries for all the pilots), etc. Just try to work out in your mind what sort of relationships the various pieces of data have to each others. One on one? Many on many? One on many? Etc.

Try looking at the various images on this pagae for inspiration and a better understanding of what I am trying to get across. If you split all the data up sensibly, a proper SQL query can be launched from PHP at any time to get exactly the data you need. (Example: All of Pilot CodeTRUCKERs log entries between April and July, 2011. Or the amount of flights flown by him in Cessna model aircrafts.) The better your database schema, the easier the more difficult stuff becomes. (Comparitively speaking, anyway.)

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #7 on: July 22, 2011, 04:10 PM »
Worstje, that's a lot to chew on and exactly what I was looking for!  Thanks for your input.

I guess at this juncture I will...

@ ...chew on what you posted and explore your link.
@ ...search DC to find a good on PHP and MySQL.  I have an old copy of Sam's "PHP and MySQL Web Development" that is based on PHP 4, but it should give me a good start (~800 pages). 
@ ...give it some trial and error.
@ ...report back later or ask questions while I work through all the above.

steeladept

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,061
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #8 on: July 23, 2011, 02:59 AM »
If it helps any, the way I think of a database is this (it helps me to develop it conceptually):

An abstract object is a table:  Examples - aircraft, person, airport, etc.

Adjectives common to that object are your fields:  Examples for aircraft - color, engine size, engine type, etc.

Specifics about one particular object are your records:  Example for "My plane" - white, 185 hp, twin turbo, etc.

It doesn't go into the rules of who, when, how, where, or why; but it does make it easier to visualize the conceptual data structure to me.  The only thing it doesn't really explain are foreign keys which are how tables are joined together.  For this, I just remember that one field in one table (say person) is the same as one field in another table (say aircraft).  So in the aircraft table, you might only have one Beachcraft Premier I listing, and in the person table, it would show in an equally named field several times (once for each person owning one).  If all that makes sense to you, then you are much further ahead in database design than you think you are....and yet still so far to go.... :-\

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #9 on: July 24, 2011, 08:29 AM »
FYI - This is only the first stage of this project, i.e., setting up the DB and building the client.  The long-term goal of this project is to provide a realistic framework my children and others can experiment with starting and managing a virtual business.  Pursuant to this, what I would like to do in the future is to model...

@ A supply-and-demand market economy.
@ Real-life fuel sales, repair costs, maintenance costs, etc. according to location.
@ Real-life airplane and airport fixed-base operations (FBOs) purchases, etc.
@ Systematic "job" opportunities which will be seeded with A.I. and live-pilot buying and selling.
@ Accurate "wear" models of aircraft life which will be reflected in efficiency and performance.
@ The above "wear" will be based on "component" use and failure modeling.
@ ?????

As you can see this project is VERY ambitious and it will be years before it matures to everything envisioned.  In the meantime, the goal is to get some baseline interaction ("starting small") and build from there.  Besides coding, a massive amount of research will be necessary.  For example, consider how a poor pilot could impact the engine and airframe of the ubiquitous piston-engine Cessna 172 Skyhawk?  Modeling each engine component and airframe component is a daunting project.  Now imagine the interactions between each component and how a failure ( oil pump goes "boing!") could cascade through the others (piston rings, rods, etc.) and you get how large the project could grow.  As immense as all that adds up to, multiply it by the number of different aircraft models available and wowzee!  It's a big one (and I didn't mention turboprops and jets)!

Granted, I am trying to singularly accomplish with my feeble skills what whole corporations have been working toward for decades.  The chances I will succeed in everything is not realistic, but I will take the project as far as I can.  

To this end, there is an official forum for this specific project.  If this project sounds like something you would like dabble in every now and then send me a PM and I will provide more details.

It should be clear, but just so no one gets their tail twisted, this is in no way meant to proselytize anyone away from DonationCoder, but to allow any like-minded aviation enthusiasts a fuller participation in the project which would not be appropriate to do on the DC forums.  
« Last Edit: July 24, 2011, 08:33 AM by CodeTRUCKER »

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #10 on: July 25, 2011, 05:00 PM »
Great! This is really good information and the graphics *really* require some concentration.  Thanks a lot, folks!

[FYI - I am moving my PHP/MySQL self-teaching initiative to the "Programming School" board.]


kyrathaba

  • N.A.N.Y. Organizer
  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #11 on: August 04, 2011, 06:53 AM »
CT, PHP/MySQL can work together to accomplish what you want to do.  If you download and install XAMP (a free software suite that will allow you to simulate how your PHP webpage code would interact with a MySQL database), I have some working code for a very simple table that I can share with you, that may help you get a feel for how to pull data from a table and display it in a webpage.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,646
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #12 on: August 05, 2011, 04:38 PM »
[FYI - I am moving my PHP/MySQL self-teaching initiative to the "Programming School" board.]

I'm no expert, but I have slapped together a ton of PHP/MySQL stuff ... Let me know if you get stuck.

MKappy

  • Supporting Member
  • Joined in 2010
  • **
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #13 on: August 07, 2011, 01:11 PM »
Accidently posted into this thread by mistake.  sorry.
   Mark
« Last Edit: September 02, 2011, 01:25 PM by MKappy »

CodeTRUCKER

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,085
    • View Profile
    • Donate to Member
Re: Aviation Business Project using a Flight Simulator
« Reply #14 on: December 01, 2011, 03:04 PM »
Unless I can come up with some simple but positively ingenious app (along the lines of "Hello world!") for NANY2012, I will have to bow out this year.  Since the last time I posted, we have had to face some more funerals, we moved from Texas to Missouri and two months later were required to vacate and move back to Texas (expensive and exhausting).  I'm out of time for development this year.  Thanks to everyone for the help.  On another note, I am involved in writing an original holiday stage play ("A Sweet Christmas Tragedy").  I'll post the details in the "Living Room."

I'll be around, though.  :)