Updated gauges.h file
-
- Posts: 4
- Joined: Tue Nov 01, 2011 5:39 pm
I see some familiar names here.... At John Nicol's request I'm posting a copy of the updated gauges.h file (called fsxgauges_sp2.h) that I've included in the sd2gau-series C-gauge builder's tutorial hosted over on the Avsim forums.
John - it would be easier for you to read down through the header file as all of the changes I've made over the years are clearly commented. Most are ease-of-use, some are corrections but where stuff has been changed the original line(s) have been commented and not removed. I also 'cleaned up' the file last time round and passed out a lot of the ease-of-use stuff into a new header called conversions.h. However, I'm sure that some of the macros in that file are not really accurate enough for the Prepar3D SDK.
I cannot claim any form of copyright on any of those changes. If they are of any use, please feel free to use them.
I'd also like to draw your attention to these lines here (information passed to me by Bill Leaming):
Code:
#define KEY_FREEZE_LATITUDE_LONGITUDE_TOGGLE (KEY_ID_MIN + 1293) //LONGITUE typo fix
#define KEY_FREEZE_LATITUDE_LONGITUDE_SET (KEY_ID_MIN + 1294) //LONGITUE typo fix
Is the key event ID correct? These lines are also listed for key events 1295 and 1296.
-Dai
www.simpilot.net/~sc/prepar3d/dfd_gaugesh.zip
John - it would be easier for you to read down through the header file as all of the changes I've made over the years are clearly commented. Most are ease-of-use, some are corrections but where stuff has been changed the original line(s) have been commented and not removed. I also 'cleaned up' the file last time round and passed out a lot of the ease-of-use stuff into a new header called conversions.h. However, I'm sure that some of the macros in that file are not really accurate enough for the Prepar3D SDK.
I cannot claim any form of copyright on any of those changes. If they are of any use, please feel free to use them.
I'd also like to draw your attention to these lines here (information passed to me by Bill Leaming):
Code:
#define KEY_FREEZE_LATITUDE_LONGITUDE_TOGGLE (KEY_ID_MIN + 1293) //LONGITUE typo fix
#define KEY_FREEZE_LATITUDE_LONGITUDE_SET (KEY_ID_MIN + 1294) //LONGITUE typo fix
Is the key event ID correct? These lines are also listed for key events 1295 and 1296.
-Dai
www.simpilot.net/~sc/prepar3d/dfd_gaugesh.zip
- Beau Hollis
- Lockheed Martin
- Posts: 2452
- Joined: Wed Oct 06, 2010 3:25 pm
-
- Posts: 4
- Joined: Tue Nov 01, 2011 5:39 pm
Hello Beau
Thank you for the response. It's more than likely I didn't make myself too clear: what concerns me is that your corrected lines use key IDs 1293 and 1294, but if you check your existing gauges.h files, you'll find this directly below:
Code:
#define KEY_FREEZE_LATITUDE_LONGITUE_TOGGLE (KEY_ID_MIN + 1295)
#define KEY_FREEZE_LATITUDE_LONGITUE_SET (KEY_ID_MIN + 1296)
i.e. the lines are repeated (with the incorrect spelling) but with a different pair of key IDs. It's entirely possible that I was given the wrong information, but I'd rather ask a silly question and be safe.
-Dai
Thank you for the response. It's more than likely I didn't make myself too clear: what concerns me is that your corrected lines use key IDs 1293 and 1294, but if you check your existing gauges.h files, you'll find this directly below:
Code:
#define KEY_FREEZE_LATITUDE_LONGITUE_TOGGLE (KEY_ID_MIN + 1295)
#define KEY_FREEZE_LATITUDE_LONGITUE_SET (KEY_ID_MIN + 1296)
i.e. the lines are repeated (with the incorrect spelling) but with a different pair of key IDs. It's entirely possible that I was given the wrong information, but I'd rather ask a silly question and be safe.
-Dai
-
- Lockheed Martin
- Posts: 1382
- Joined: Mon Sep 20, 2010 6:17 pm
Hi Dai,
You are correct. The information currently inside the gauges.h file is the correct information.
I am assuming those entries were created by whoever updated the gauges.h you are using (there is a gap between 1290 and 1295).
We have not modified the key sequencing from the original ESP other than adding to the end of the sequence, which would not cause the misalignment you are referencing.
Let us know if you need any more details,
Adam
You are correct. The information currently inside the gauges.h file is the correct information.
I am assuming those entries were created by whoever updated the gauges.h you are using (there is a gap between 1290 and 1295).
We have not modified the key sequencing from the original ESP other than adding to the end of the sequence, which would not cause the misalignment you are referencing.
Let us know if you need any more details,
Adam
Prepar3D® Engineering Project Manager
Adam, I'm a bit confused now, since this information came from Beau Hollis to begin with! See the thread immediately below this one:
http://www.prepar3d.com/forum-5/?mingle ... opic&t=518
I should like to point out that neither FSX nor ESP1 had these corrected entries in their SDK's gauges.h files either. It appears that MS/ACES never updated them to reflect the addition of the two missing key_events or the two spelling corrections...
http://www.prepar3d.com/forum-5/?mingle ... opic&t=518
I should like to point out that neither FSX nor ESP1 had these corrected entries in their SDK's gauges.h files either. It appears that MS/ACES never updated them to reflect the addition of the two missing key_events or the two spelling corrections...
Bill Leaming
Modeler and Programmer
Military Visualizations
Modeler and Programmer
Military Visualizations
-
- Posts: 11
- Joined: Sat Oct 30, 2010 12:42 am
-
- Posts: 4
- Joined: Tue Nov 01, 2011 5:39 pm
If I had to take a flyer at this (oof. Sorry about the unintended pun), my guess would be that Beau meant this:-
Code:
#define KEY_FREEZE_LATITUDE_LONGITUDE_TOGGLE (KEY_ID_MIN + 1293) //LONGITUE typo fix
#define KEY_FREEZE_LATITUDE_LONGITUDE_SET (KEY_ID_MIN + 1294) //LONGITUE typo fix
#define KEY_FREEZE_LATITUDE_LONGITUE_TOGGLE (KEY_ID_MIN + 1293)
#define KEY_FREEZE_LATITUDE_LONGITUE_SET (KEY_ID_MIN + 1294)
- and that he meant to keep the backwards compatibility but fell prey to our very old friend Finger Trouble. Now there's someone who's knocked at my front door far too often...
-Dai
Code:
#define KEY_FREEZE_LATITUDE_LONGITUDE_TOGGLE (KEY_ID_MIN + 1293) //LONGITUE typo fix
#define KEY_FREEZE_LATITUDE_LONGITUDE_SET (KEY_ID_MIN + 1294) //LONGITUE typo fix
#define KEY_FREEZE_LATITUDE_LONGITUE_TOGGLE (KEY_ID_MIN + 1293)
#define KEY_FREEZE_LATITUDE_LONGITUE_SET (KEY_ID_MIN + 1294)
- and that he meant to keep the backwards compatibility but fell prey to our very old friend Finger Trouble. Now there's someone who's knocked at my front door far too often...
-Dai
- Beau Hollis
- Lockheed Martin
- Posts: 2452
- Joined: Wed Oct 06, 2010 3:25 pm
I did a copy and paste from source code. I'm pretty sure we handle both events the same, so it doesn't really matter which one you use. I know it seems silly to create new KEY_ID entries just to fix a typo, but there is a little method to the madness. Gauges use a header, so we could fix the misspelling without breaking comparability by redefining the same id as was suggested above. SimConnect add-ons use stings though, so an older SimConnect addon may use "KEY_FREEZE_LATITUDE_LONGITUE_TOGGLE" while a new one uses "KEY_FREEZE_LATITUDE_LONGITUDE_TOGGLE". We need a unique key id in the back-end because of the way our string-lookup table is generated.
The moral of the story is that we should really try to spell things right the first time
Beau
The moral of the story is that we should really try to spell things right the first time
Beau
Beau Hollis
Prepar3D Software Architect
Prepar3D Software Architect
-
- Posts: 4
- Joined: Tue Nov 01, 2011 5:39 pm