New "glass cockpit" Gauges Written

Only for Genuine FS fanatics! Taking this hobby from Real to Surreal? Or maybe just combining 4 hobbies into 1 ;)

New "glass cockpit" Gauges Written

Postby JBaymore » Mon Oct 27, 2003 2:34 am

Moving toward the new cockpit some more.

I spent some time today with VB6 and wrote a couple of new external gauge programs for FS2004 that access the data stream with FSUIPC.  I am quite excited about getting the hang of some simple programming using the interface.  It isn't all that hard.  And there is an amazing amount of stuff you can access this way.

My "generic jet" homebuild cockpit project is being influenced a lot by the BAe 146-200 that I fly a lot.  That aircraft has a digital readout radio altimeter with the decision height readout right next to it on the main panel.  So I set out to recreate it for my cockpit.

A bit of VB6 code....... and I now have a radio altimeter gauge that reflects the AGL altitude (not necessarily matching the regular altimeter).  Displayed next to that reading is the decision height that has been selected in the sim.

The "range" of the radio altimeter is 4500 feet AGL (matches the BAe specs I have).  Above that, the display changes to a red "-RNG-" warning.  The normal display I created is white on black.  When the AGL gets below 1000 feet.... the display changes to a pink color....and when the AGL gets to the decision height that has been set, it turns to red.

I likely will add some aural tone alerts as well later.


Then I also wanted a set of Outer, Middle, and Inner marker indicator lights.  I now have them in blue, orange, and white.  This was a really simple gauge to write.

I also now have a small annunciator panel that gives me "Overspeed", "Low Altitude", "Master Caution" and Master Warning" indicators.

These kinds of things are amazingly easy to do using FSUIPC and the interface code supplied in the SDK.  I expect to eventually share these external gauges as "freeware" when I get them fully debugged and tested out.

Just a note here in case you are not really familiar with the "homebuild cockpits" concept.........

These gauges I am writing are not for use in "normal" virtual aircraft in the sim.  They work as external gauges running outside the sim on stand alone PC's.

best,

.....................john
Image ImageIntel i7 960 quad 3.2G LGA 1366, Asus P6X58D Premium, 750W Corsair, 6 gig 1600 DDR3, Spinpoint 1TB 720
User avatar
JBaymore
Global Moderator
Global Moderator
 
Posts: 10020
Joined: Sat May 24, 2003 9:15 am
Location: New Hampshire

Re: New "glass cockpit" Gauges Written

Postby JBaymore » Tue Oct 28, 2003 1:43 am

Started working on the "fine details" on the BAe type radar altimeter.

It now writes the exact location of the gauge (display window) on the screen to the Windows Registry on exit and reads it back when it starts......... so that when you restart the program the next time.... it is in the place you left it.  Necessary to keep them aligned with the panel holes you cut ;).

I figured out how to play a .wav file out of VB6.... so there is now a tone alert when you reach the decision height.... but it still needs tweaking.  Plays on the way UP too.  Drat.  Got me stumped for the moment.  Other tones will be added for some other events after I figure out this one.

I also now have it so that you can't inadvertantly run two instances of the gauge at the same time.

Programming can get addictive....... you always want to add just one more feature  ;).


best,

......................john
Image ImageIntel i7 960 quad 3.2G LGA 1366, Asus P6X58D Premium, 750W Corsair, 6 gig 1600 DDR3, Spinpoint 1TB 720
User avatar
JBaymore
Global Moderator
Global Moderator
 
Posts: 10020
Joined: Sat May 24, 2003 9:15 am
Location: New Hampshire

Re: New "glass cockpit" Gauges Written

Postby Smoke2much » Tue Oct 28, 2003 2:40 pm

I can't program for toffee but I believe you should be able to make a sound dependant on two variables.  If you were to have it:

"If height = 250feet and VSI<-1FPM then play sound"

The VSI would then have to be negative and you would therefore have to be descending to make the .wav file play.

Will
Who switched the lights off?
User avatar
Smoke2much
Major
Major
 
Posts: 2755
Joined: Sun Jan 05, 2003 6:33 pm
Location: Sittingbourne, Kent,

Re: New "glass cockpit" Gauges Written

Postby JBaymore » Tue Oct 28, 2003 8:25 pm

Will,

THANKS!

Never thought of the VSI reading!
Last edited by JBaymore on Tue Oct 28, 2003 8:29 pm, edited 1 time in total.
Image ImageIntel i7 960 quad 3.2G LGA 1366, Asus P6X58D Premium, 750W Corsair, 6 gig 1600 DDR3, Spinpoint 1TB 720
User avatar
JBaymore
Global Moderator
Global Moderator
 
Posts: 10020
Joined: Sat May 24, 2003 9:15 am
Location: New Hampshire

Re: New "glass cockpit" Gauges Written

Postby Smoke2much » Wed Oct 29, 2003 8:02 am

That's no problem John.  I know what I want to do with programming I simply don't have the skills to do it :)

Will
Who switched the lights off?
User avatar
Smoke2much
Major
Major
 
Posts: 2755
Joined: Sun Jan 05, 2003 6:33 pm
Location: Sittingbourne, Kent,

Re: New "glass cockpit" Gauges Written

Postby JBaymore » Thu Oct 30, 2003 8:03 am

Will,

I have found that programming is about 90 pecent about spending the TIME to do it.
Last edited by JBaymore on Thu Oct 30, 2003 8:04 am, edited 1 time in total.
Image ImageIntel i7 960 quad 3.2G LGA 1366, Asus P6X58D Premium, 750W Corsair, 6 gig 1600 DDR3, Spinpoint 1TB 720
User avatar
JBaymore
Global Moderator
Global Moderator
 
Posts: 10020
Joined: Sat May 24, 2003 9:15 am
Location: New Hampshire

Re: New "glass cockpit" Gauges Written

Postby Smoke2much » Thu Oct 30, 2003 8:12 am

I have visual basic John but I cant work out where to start.  It wants me to fill out forms or something ???

there doesn't seem to be anywhere to put the:

10 ? "I am silly"
20 goto 10

Will
Who switched the lights off?
User avatar
Smoke2much
Major
Major
 
Posts: 2755
Joined: Sun Jan 05, 2003 6:33 pm
Location: Sittingbourne, Kent,

Re: New "glass cockpit" Gauges Written

Postby JBaymore » Thu Oct 30, 2003 10:13 am

Will,

Let's see if this helps a tad for you to get going......

The "form" is the place that you get the output to the windows screen to show up when you run the program.  It is sort of the "visual" part of visual basic  ;).

You create a form...... give it a name related to it's function (you can make multiple "windows....which are the "forms").  In this example let's call it "frmName".  On the frmName form you locate stuff that you can sort of think of as "variables".  These variables are more actually like "containers" for stuff.  These containers have properties that you can manipulate.

One property that you can manipulate is the "caption" that is displayed where a "container" is located on the screen.  You alter this "caption" by assigning a "value" to the "caption" of the container.  The properties of a visual basic container are pretty logically named and are designated by a period after the "container's name" and the property you want to alter.  So for example........

lblMyName.caption = "JOHN" would print  JOHN in the location whre you placed the "container" you called "lblMyName" (using "lbl" to start the name is a way to remember what the thing you are working with is) on the frmName form.

Bet you know what the "frm" part relates to now  ;).

If you wanted to change the font for the word JOHN on the screen...that is possible..... if you want to change the color...... if you want to do a LOT of things it is possible.

Within the frmName form.... you can assign actual code.  If you look at the upper control bar on VB you'll see a pull diown menu that includes "View Code" in it's options.  If you do this you see the code that is associated with frmName.

In this area you can use BASIC code that is VERY similar to what you seem to already know.  But line numbers are no longer needed in BASIC.  You reference in different ways. (Too complex to explain perfectly right now.)  The jumping around is sort of like the old GOTO or GOSUB statements.

So you can create subroutines that do stuff you want.  You get to them by calling their NAME .... not a line number.  On the frmName form.... you can associate stuff like clicking on a particular "container" with a "call" to "GOSUB" a particular routine of code.  Or to open another form (window).  And so on.

The code flows as it always did....top down.  So if on frmName you put in the code

X=1
If x = 1 then
lblMyName.caption= "JOHN"
else lblMyName.caption = "Not JOHN"
end if

This would assign "JOHN" to the caption displayed on the form when it is run.  


Anyway..... hope this is a start.

best,

...................john
Image ImageIntel i7 960 quad 3.2G LGA 1366, Asus P6X58D Premium, 750W Corsair, 6 gig 1600 DDR3, Spinpoint 1TB 720
User avatar
JBaymore
Global Moderator
Global Moderator
 
Posts: 10020
Joined: Sat May 24, 2003 9:15 am
Location: New Hampshire


Return to Home Cockpits and Setups

Who is online

Users browsing this forum: No registered users and 255 guests