Sign in to follow this  
Brian_Gladden

Poll for an upcoming freeware gauge for developers only

Recommended Posts

Hi all,I'm planning to release a SDK set in order to allow a panel and gauge developer to be able to use LCD screens, such as the ones featured in the Reality XP Flight Line Avionics NAV/COM radios, in anyone's panel.This would be offered as a freeware gauge, and a typical code skeleton to use it. The actual implementation would most likely be a gauge file, which takes a 5th parameter to indicate a named variable in the panel.cfg directly. Then a gauge which would disply something on this screen gauge would just have to retrieve the named variable for a pointer to a structure with the available parameters to change the displayed text, make characters blink...If there is enough interest in such a gauge, I'll make it available. Just let me know!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Jean,I would appreciate anything you can make for the communitee!BTW, are you still using BCC5.5, command line compiler.I download a newer version of GCC 3.2. I still get some errors during compile but the gauges seem to work. One of the errors has to do with the gauge info version. It seems to want four characters vice the three.

Share this post


Link to post
Share on other sites

Which gauges.h do you use?The fs2k2gauges.h in sd2gau13.zip should be compatible to BCC and GCC new or old version.Arne Bartels

Share this post


Link to post
Share on other sites

Bonjour JeanLuc.That would be wonderful! Thanks for the initiative!

Share this post


Link to post
Share on other sites

I am using the fs2k2gauges.h in sd2gau13.zip with the MinGW-2.0.0.3 ver 3.2.I was trying to make the fs2002 gauge sample but I can't find the notes on the darn flightmap extra stuff I believe you put out just after fs2002 was released.I then did the fs2000 sample, it seems to compile okay with several errors (I compile it again and save the errors). Is there a switch to have it save an error log in a text file vice just the command window?I loaded it in a sample panel I have for the c172 and all the gauges worked. Another insteresting thing is the size of the increased. With MinGW2.95.2 - 484KB, MinGW3.2 - 492KB. The different fs2k2gauges.h could have some effect also, I suppose.

Share this post


Link to post
Share on other sites

The SDK.flightmap.c needs a bit of work in the ScalePoint function as far as I remember:static POINT ScalePoint (PLATLONALT llaRef, PLATLONALT llaPoint, FLOAT64 fRefDirection, FLOAT64 dx, FLOAT64 dy){ ANGL48 anglDiff = SUB_ANGL48_ANGL48 (llaPoint->lon, llaRef->lon ); FLOAT64 fDeltaLonDeg = ANGL48_TO_DEGREES (anglDiff ); FLOAT64 fLatRad = LAT_METERS48_TO_RADIANS (llaRef->lat) ; FLOAT64 fLOMeters = LON_DEG_TO_METERS_AT_LAT_RAD (fDeltaLonDeg, fLatRad ); FLOAT64 fLAMeters = SIF48_TO_FLOAT64 (SUB_SIF48_SIF48 (llaPoint->lat, llaRef->lat)); FLOAT64 fSin = sin (fRefDirection); FLOAT64 fCos = cos (fRefDirection); FLOAT64 fX = fLOMeters * fCos - fLAMeters * fSin; FLOAT64 fY = -fLOMeters * fSin - fLAMeters * fCos; INT lX = (INT) (fX * dx * SCALE_MAP_FACTOR); INT lY = (INT) (fY * dy * SCALE_MAP_FACTOR); POINT result = { 0, 0 }; result.x = lX; result.y = lY ; return result;}As usually MS doesn't care too much about ANSI C.>Is there a switch to have it save an error log in a text file vice just the command window?AFAIK there is no way to get the errors in a logfile. GCC writes errors to stderr and this can't be redirected easily as in Unix/Linux etc. >Another insteresting thing is the size of the increased.I haven't checked that, but at least still smaller as the VC or BCC result.Arne Bartels

Share this post


Link to post
Share on other sites

Hi,stderr can be output (with stdout) in a file on Win2000/WinXP/WinNT:[command] >[filepath+filenameForOutput] 2>&1examplecompile.bat >C:compoutput.txt 2>&1Regards,Marcel

Share this post


Link to post
Share on other sites

Fine, so MS learned that at last. Unfortunately I have Win98, so I can't use it.Arne Bartels

Share this post


Link to post
Share on other sites

Thank you all (just 3? :-( ) for supporting the idea!YEs I'm still using BCC5.5 Free Command Line compiler. It not only compiles almost 10 times faster than VC++ (very handy when switching back and forth FS2002 and the editor to test a new build) and the code is really optimized to an extent I've not reached with VC++. Not only from the fact that in ANSI C I don't have the overhead of the THIS member of any class to be passed along any function call, but also because there is no creator/destructor overhead. This, plus a very good optimization algorithm which takes in account CPU pipelining, I really don't have to code a single line a assembly to make some of my vector gauges ;-)For the SDK, the only change I've made is:static POINT ScalePoint (PLATLONALT llaRef, PLATLONALT llaPoint, FLOAT64 fRefDirection, FLOAT64 dx, FLOAT64 dy){// declared here for BCC POINT result; ANGL48 anglDiff = SUB_ANGL48_ANGL48 (llaPoint->lon, llaRef->lon ); FLOAT64 fDeltaLonDeg = ANGL48_TO_DEGREES (anglDiff ); FLOAT64 fLatRad = LAT_METERS48_TO_RADIANS (llaRef->lat) ; FLOAT64 fLOMeters = LON_DEG_TO_METERS_AT_LAT_RAD (fDeltaLonDeg, fLatRad ); FLOAT64 fLAMeters = SIF48_TO_FLOAT64 (SUB_SIF48_SIF48 (llaPoint->lat, llaRef->lat)); FLOAT64 fSin = sin (fRefDirection); FLOAT64 fCos = cos (fRefDirection); FLOAT64 fX = fLOMeters * fCos - fLAMeters * fSin; FLOAT64 fY = -fLOMeters * fSin - fLAMeters * fCos; INT lX = (INT) (fX * dx * SCALE_MAP_FACTOR); INT lY = (INT) (fY * dy * SCALE_MAP_FACTOR);// changed for BCC// POINT result = { lX, lY }; result.x = lX; result.y = lY; return result;}As for the slew/pause, motitoring the ELAPSED_SECOND works well for pause.For slew, I'm using a slightly different approach that I will share with you:==================================UINT32 MIASMEM;HMODULE GLOBALHANDLE;GLOBALHANDLE = GetModuleHandle("GLOBAL.DLL");// then find the Linkage exported functionif ((GLOBALHANDLE) != NULL){MIASMEM = ((UINT32) GetProcAddress(GLOBALHANDLE,"Linkage")) + 0x02BC;}else{MIASMEM = 0;}====================================BOOL SLEW;MODULE_VAR MMIAS = {AIRSPEED};FLOAT64 MIAS;// fetch the IAS from the Globals to overide the TAS/IAS user settingif (MIASMEM != 0){MIAS = ((FLOAT64) (* (UINT32 *) MIASMEM)) / 128.0;}else{// safeguard here - shouldn't occurlookup_var(&MMIAS); MIAS = MMIAS.var_value.n; }// fetch the current FS IAS (in TAS or IAS according to user settinglookup_var(&MMIAS);// and check for discrepencyif ((MIAS / MMIAS.var_value.n) > 10.0){SLEW = TRUE;}else{SLEW = FALSE;}Hope this helps! ;-)

Share this post


Link to post
Share on other sites

what I wouldn't mind seeing is a set of "generic name brand" gauges made with XML like the ones seen in alot of homebuilts. Things along the lines of the Vision Microsystems VM 1000 multi gauge, and some Garmin 430 lookalikes that are actualy readable. I'm not asking for all the bels and whistles but something that looks like a garmin but just has the radi0 frequencies.Or some programer can come up with a WYSIWYG XML gauge design program.Brian

Share this post


Link to post
Share on other sites

I'll try that! Looks not too easy for me on first sight, but thanks! :-)Etienne :-wave

Share this post


Link to post
Share on other sites

JeanLuc_Thanks for the additional info for BCC 5.5 CLC. I have not had good luck with it. It may be that I have it installed incorrectly, in that, there were two updates to it. When I opened update 1 and reviewed the files, they seemed to be for an earlier version 5.0 and had dates preceeding 5.5 so I didn't install those. I did install update 2. I could never get a straight answer on the BCC forums about this and they are into other products anyway.I had success for fs2000 with MingW 2.95.2. I also compiled the fs2000 sample with MingW 3.2 but had some errors show on the dos screen, however the gauges seemed to work in fs2002.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this