Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

"animation in C" - or, "Guess who's stuck again?"

Featured Replies

Once again, my ignorance rears its ugly head and I am stuck... I have 5 icon images of a pitch trim wheel I need to animate. In XML, it is quite easy to accomplish by use of this formula: (A:Elevator Trim Position,radians) 1000 * int 10000 + 3 % This returns a sequence of integer "values" from 0 to 5 and allows the .bmp files to sequentially display in "forward" or "reverse" motion. How can I "translate" this into a C function? I'm totally clueless, since EG insists that the token variable "ELEVATOR_TRIM" may only be used "...in an instrument gauge." What the heck am I making, chopped liver???BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

I'm not used to easygauge to be honest, but in C forcing an integer is casting with "(int)value" (or floor(value) or ceil(value)), and the modulao for integers is also "%", for floats fmod(value,divider). If that helps, I don't know. Also for MAKE_ICONs it's possible to use ICON_SWITCH_TYPE_SET_CUR_USING_RANGE together with proper range pparmas to avoid the need to convert to fixed integers, a modulo is still needed in your case.Arne Bartels

I was rather sure the operands were the same, but the mechanics of working "inside the box" with EG is difficult' an irony to be sure... :(I also need to convert a Rankine ITT to celcius. The formula is quite easy, but again it's the durn mechanics that're eluding me:

Hey BillFor the temperature conversion, just use one of the several conversions MS has already supplied us in the gauges.h Check out Line 4398 for the macro RANKINE_TO_CELSIUS( rankine ), where rankine is your temperature in

Actually, I believe it was Arne who added those in to the header file. The one straight from MS doesn't include those conversions.Matt

Matt Kaprocki

Boeing777_Banner_DevTeam.jpg

For fastest support, please submit a ticket at http://support.precisionmanuals.com

AFAIK EG uses my gauges.h so the macros can be available there.Arne Bartels

HA!Wouldn't you know it??? Sorry about that, Arne, I had no idea you had included those!!! Well, I should've known better. MS trying to help us? Nahhhh, too good to be true...

>Hey Bill>>For the temperature conversion, just use one of the several>conversions MS has already supplied us in the gauges.h Check>out Line 4398 for the macro RANKINE_TO_CELSIUS( rankine ),>where rankine is your temperature in

Hey Bill.SO I am assuming there is no access to the actual code when using EG?

>SO I am assuming there is no access to the actual code when>using EG?Actually, there is... by simply hand-editing the gaugenameG.c file output by EG, one can easily add or modify the actual program instructions, and then recompile it outside the EG environment. After all, it is - strictly speaking - a C source file! :)Of course, the downside is that the very next time you run EG again to make any changes to the gauge, all those mods would have to be re-entered, since there's no way to incorporate them into EG's 'master source file' stored in its own, unique .esk format.BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Hi Bill and others,you can edit the *.c file in the source folder and add all the things you need.Every detail I add makes the program more difficult. I have to find a balance between usability and functionality. EG has a lot of possibilities - just have a look at Lonny Payne's 757 panel which is completely made with EG - even a small moving map is included. Of course, if you want to develop an FMC, EasyGauge is definately the wrong program - so have a look C++.I appreciate the suggestions and I will include a "makro" editor into the next version.King Regards,Marcel Burrchief programming departement (PC12, EasyGauge)bluesky software development

>Hi Bill and others,>>you can edit the *.c file in the source folder and add all the>things you need.>>Every detail I add makes the program more difficult. I have to>find a balance between usability and functionality. EG has a>lot of possibilities - just have a look at Lonny Payne's 757>panel which is completely made with EG - even a small moving>map is included. I think you've done a marvelous job with EG, Marcell! I also understand the limitations you face regarding a proper "balance between usability and functionality."Perhaps if more people would post sample .esk files it would help a lot! I know that whenever I manage to achieve animating the pitch trim wheel I'll most certainly publish the .esk on the support site! :)Now I just wish someone would write a similar WYSIWYG environment for XML coding, especially since FS2004 is exclusively XML gauging... :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Bill, just a correction.FS2004 is exclusevily XML only on the stock gauges. C and C++ will remain far superior than XML for more complex gauges, so my guess is you will continue to see most dvelopers, particularly commerical ones (also for security reasons), use these languages for gauges.And Marcel, I have not used EG, but I hear wonderful things about it!

>Bill, just a correction.>>FS2004 is exclusevily XML only on the stock gauges. C and C++>will remain far superior than XML for more complex gauges, so>my guess is you will continue to see most dvelopers,>particularly commerical ones (also for security reasons), use>these languages for gauges.It would be nice if MS would redo the .CAB to make it password protected, just for the sake of security. Now that would be a truly useful utility for someone to make! :) I have no real problem with folks using any of the XML gauges made for freeware release, but there should be a way to protect the intellectual rights of commercial developers.Of course FS2004 will continue to support C type gauges. They have to maintain backward compatibility! I didn't mean to imply otherwise... :)EG is a lot like a new pair of shoes: it will simply take time to get 'broken in' and comfortable. For basic layout and mouse area definition, it is fantastic! As Marcell pointed out, with the "Programmer's Edition" it is possible to work outside the EG environment and add to or modify the .c file as needed.I am extremely pleased with it so far!BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://catholic-hymns.com/frbill/FS2002/images/fartslogo.jpg

Hi Bill,I cannot really believe that XML will support GDI functions. Can you prove it or did you only hear this from "somewhere"?Only one small thing, Bill: my name is written without a second "l", only Marcel ;-)No problem so far, enjoy gauge programming!King Reagards,Marcel Burrbluesky

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.