Results 1 to 3 of 3

Thread: Converting the Gauge Project to Multi-Gauge Format

  1. #1

    Default Converting the Gauge Project to Multi-Gauge Format

    This is a continuation of the previous tutorial, which discussed setting up the MSVC++ .NET 2003 IDE for gauge development. In particular, the sample gauge file used in that tutorial will be used in this new installment.

    Using the gauge code already discussed, I am now going to illustrate the process by which we need to modify the original code such that it will be ready for conversion to a true multi-gauge format.

    NOTE: I suffer no illusions that this is the "best" way to handle the conversion of Easy Gauge source files to a multi-gauge format! However, it is simple, logical and most importantly, IT WORKS! ;)

    As a first step, I have created a new subfolder in my gauge project and named it \subgauges. I have moved the xxxG.c file to this new subfolder:

    http://img342.imageshack.us/img342/4...ustut016fj.jpg

    Now I need to modify the main .c file to show where I've now located the xxxG.c file:

    http://img247.imageshack.us/img247/3...ustut022oy.jpg

    Next, I need to make the resource id's for this subgauge unique. I have adopted the convention of addint a three-four letter 'prefix' to designate the subgauge's revisions. In this case, [font color=red]MAP_[/font] seems to be a logical choice.

    Here is the revised .h file:

    http://img247.imageshack.us/img247/7...ustut039wl.jpg

    Now I'll modify the .rc file:

    http://img39.imageshack.us/img39/2280/cplustut045bw.jpg

    The final step in this process is a bit longer and I'll have to use a number of pictures to illustrate the full process. I'll continue this in the next section.
    Bill Leaming
    Gauge Programming - 3d Modeling Eaglesoft & Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - GeForce GTX550Ti 1GB - Win7 64bit Home Premium
    Development Rig1: Intel Core i7-3770k - 16GB DDR3 - Dual Radeon HD7770 SLI 1GB - Win7 64bit Professional
    Development Rig2: Intel Core i7-860 - 8GB DDR3 Corsair - GeForce GTS240 1GB - Win7 64bit Home Premium
    NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...

  2. #2

    Default Converting the Gauge Project to Multi-Gauge Format #2

    Using the same 'prefix' convention, I'll now modify the main gauge source file (xxxG.c) as illustrated in the series of pictures following.

    I've made ample notes on the pictures, so I'll keep the explanation short... ;)

    http://img256.imageshack.us/img256/8...stut05a9dx.jpg
    http://img256.imageshack.us/img256/2...stut05b3hy.jpg
    http://img256.imageshack.us/img256/2...stut05c8oj.jpg
    http://img440.imageshack.us/img440/4...stut05d8lb.jpg
    http://img440.imageshack.us/img440/5...stut05e5sn.jpg
    http://img440.imageshack.us/img440/3...stut05f1tg.jpg

    The final step I need to take prior to attempting a new compile of this project is to 'fix' a little path problem with the IDE.

    If you remember, I added the xxxG.c file to the project and set its Properties to "Excluded from Build." Well, since I've moved that file to a new subfolder, I need to let the IDE know about that move... ;)

    Highlight the xxxG.c filename and right-click. Choose the "Remove" option to delete the filename. Now, right-click on the "Source Files" again, an choose "Add/Add Existing Item." Navigate to the subgauge folder and highlight the xxxG.c file again.

    Now, right-click on the xxxG.c filename, and using Properties, set the file to be "Exluded from Build" again.

    Now I will rebuild the gauge project and check for any errors... Since I was very careful, I have none! Hooray!

    In the next installment, I'll discuss adding a new subgauge to this project. Once that's done, you should be able to successfully continue adding subgauges until your project is finished. ;)
    Bill Leaming
    Gauge Programming - 3d Modeling Eaglesoft & Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - GeForce GTX550Ti 1GB - Win7 64bit Home Premium
    Development Rig1: Intel Core i7-3770k - 16GB DDR3 - Dual Radeon HD7770 SLI 1GB - Win7 64bit Professional
    Development Rig2: Intel Core i7-860 - 8GB DDR3 Corsair - GeForce GTS240 1GB - Win7 64bit Home Premium
    NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...

  3. #3

    Default Converting the Gauge Project to Multi-Gauge Format #3

    Now, I'll add another gauge to the Project to make this a true 'multi-gauge!' ;)

    First, I copy/paste the existing .c, .h, .rc. and G.c source code to the Project's \subgauges folder:

    http://img402.imageshack.us/img402/9...ustut068kw.jpg

    Next, copy/paste all the .bmp files to the Project's \res folder:

    http://img402.imageshack.us/img402/9...ustut071me.jpg

    Next, open the new gauge's .c file and copy/paste the highlighted entries to the Project's master .c file:

    http://img402.imageshack.us/img402/5...ustut083yv.jpg
    http://img402.imageshack.us/img402/8...ustut095fd.jpg

    Next, copy/paste the GAUGE_TABLE_ENTRY line from the x.c file as illustrated. Now you may delete the x.c file from the \subgauges folder to keep things tidy... ;)

    http://img248.imageshack.us/img248/5...ustut107ck.jpg

    Now, open the x.h file and copy the resource lines to the master .h file as shown below. Add the 'prefix' you want to the RecX entries. Now you may close and delete the x.h file to keep things tidy...

    http://img248.imageshack.us/img248/2...ustut118xl.jpg

    Now, open the x.rc file and copy the bitmap entries to the master .rc file, and make the edits as shown below. Close the file and delete the x.rc file from the subfolder. There should now only be xG.c files remaining in the \subgauges folder! ;)

    http://img46.imageshack.us/img46/8545/cplustut121sj.jpg

    The last step I'm not going to "illustrate," since it is basically the same thing that's been covered already. You need to edit the xG.c file for the new subgauge to add the 'prefix' as shown previously, and make the other edits & deletions of unnecessary and redundant code.

    Finally, run Rebuild MyNewGauge and check for errors. If you've been careful, you should have none!
    Bill Leaming
    Gauge Programming - 3d Modeling Eaglesoft & Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - GeForce GTX550Ti 1GB - Win7 64bit Home Premium
    Development Rig1: Intel Core i7-3770k - 16GB DDR3 - Dual Radeon HD7770 SLI 1GB - Win7 64bit Professional
    Development Rig2: Intel Core i7-860 - 8GB DDR3 Corsair - GeForce GTS240 1GB - Win7 64bit Home Premium
    NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...

Similar Threads

  1. Project open sky 777 gauge problem
    By tigisfat in forum FSX
    Replies: 7
    Last Post: 06-16-2010, 04:11 PM
  2. Airwolf Production Stills: Gauge Work: Radar Tracking Gauge
    By Ragtopjohnny in forum MSFS Screen Shot Forum
    Replies: 12
    Last Post: 08-06-2009, 10:44 AM
  3. Replies: 0
    Last Post: 10-14-2007, 10:32 PM
  4. Project Airbus gauge problem
    By callum666 in forum FS2004
    Replies: 0
    Last Post: 11-13-2003, 06:42 PM
  5. Replies: 1
    Last Post: 07-06-2002, 05:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •