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:

    Name:  cplustut016fj.jpg
Views: 766
Size:  55.7 KB

    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 adding a three-four letter 'prefix' to designate the subgauge's revisions. In this case, MAP_ seems to be a logical choice.

    Here is the revised .h file:

    Click image for larger version. 

Name:	cplustut039wl.jpg 
Views:	215 
Size:	111.3 KB 
ID:	158980

    Now I'll modify the .rc file:

    Click image for larger version. 

Name:	cplustut045bw.jpg 
Views:	234 
Size:	117.5 KB 
ID:	158981

    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.
    Last edited by n4gix; 11-10-2013 at 11:11 AM.
    Bill Leaming
    Gauge Programming - 3d Modeling Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - EVGA GTX770 4GB - 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... ;)

    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.

    Click image for larger version. 

Name:	cplustut05a9dx.jpg 
Views:	208 
Size:	181.9 KB 
ID:	158982
    Click image for larger version. 

Name:	cplustut05b3hy.jpg 
Views:	199 
Size:	130.2 KB 
ID:	158983
    Name:  cplustut05c8oj.jpg
Views: 725
Size:  55.1 KB
    Click image for larger version. 

Name:	cplustut05d8lb.jpg 
Views:	195 
Size:	73.1 KB 
ID:	158985
    Click image for larger version. 

Name:	cplustut05e5sn.jpg 
Views:	212 
Size:	124.4 KB 
ID:	158986
    Click image for larger version. 

Name:	cplustut05f1tg.jpg 
Views:	204 
Size:	50.5 KB 
ID:	158987
    Last edited by n4gix; 11-10-2013 at 11:15 AM.
    Bill Leaming
    Gauge Programming - 3d Modeling Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - EVGA GTX770 4GB - 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:

    Name:  cplustut068kw.jpg
Views: 795
Size:  62.0 KB

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

    Name:  cplustut071me.jpg
Views: 755
Size:  66.7 KB

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

    Name:  cplustut083yv.jpg
Views: 768
Size:  59.1 KB
    Name:  cplustut095fd.jpg
Views: 761
Size:  85.8 KB

    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... ;)

    Name:  cplustut107ck.jpg
Views: 742
Size:  78.9 KB

    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...

    Click image for larger version. 

Name:	cplustut118xl.jpg 
Views:	253 
Size:	101.2 KB 
ID:	159000

    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! ;)

    Click image for larger version. 

Name:	cplustut121sj.jpg 
Views:	210 
Size:	113.3 KB 
ID:	159001
    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!
    Last edited by n4gix; 11-10-2013 at 11:26 AM.
    Bill Leaming
    Gauge Programming - 3d Modeling Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - EVGA GTX770 4GB - 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. Multi-Monitor, Multi Windows
    By bradrcfii in forum FSX
    Replies: 1
    Last Post: 10-09-2010, 01:09 AM
  2. repaint textures-converting them to fs format
    By thetriple7 in forum FS2004
    Replies: 1
    Last Post: 05-09-2007, 09:28 PM
  3. Replies: 1
    Last Post: 07-09-2006, 07:05 PM
  4. Question on format-converting (Repaint)
    By Mr767 in forum DreamFleet General Discussion Forum
    Replies: 2
    Last Post: 09-17-2002, 04:17 AM
  5. Replies: 0
    Last Post: 06-04-2002, 10:10 AM

Posting Permissions

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