1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FSX C gauges ¡very confused!

Discussion in 'Gauges' started by palacio802, 11 Sep 2017.

  1. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Thank you very much, Daniel. I'll try to follow your instructions. Personally I prefer XML but I think C++ is more powerful and flexible. I can't imagine why P3D don't implement string variable capability. It would be great if we could write:
    'LEZL' (>S:Scratchpad) or if we had the posibility to read/write files without the use of third party modules...
     
    Last edited: 12 Sep 2017
  2. WarpD

    WarpD

    Joined:
    9 Dec 2007
    Messages:
    949
    Country:
    us-ohio
    Strings (aka data buffer) are the #1 method of finding a way to crash into the secure side of a server/OS. Of course XML for the sim was designed to eliminate the ability to get around the OS security.
     
  3. rpmc

    rpmc

    Joined:
    14 Oct 2007
    Messages:
    1,185
    Country:
    thailand
    Sounds like an anti-aliasing problem. Is the problem similar to the issue shown in this thread ? Pls read reply #13 and #14.

    Including an appropriate background color or use of a raster font (ms sans serif, leros or yamaha*) should mitigate the problem.

    Bob

    * leros and yamaha are monospace raster, or bitmap, fonts that I found on the web.
     
  4. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,807
    Country:
    unitedstates
    Your English is just fine my friend. Actually it is better than that of a lot of folks who's native language is English! :rotfl:

    My formal education in programming is very dated, and even so involved COBOL, SNOBOL, Fortran IV, and RPG (yes, I know it's not technically a "language"). My major focus however was in "Systems Analysis and Design" which doesn't really help much with C++/GDI+ programming!

    Many years ago Marcel and his brother released a payware program they named EasyGauge. My dirty little secret is that I used that expensive ($350 IIRC) program to gain a solid foundation in how FS gauges are constructed. I hinted at this in my ancient tutorial but didn't make a big deal out of it. Sadly, that program was abandoned, along with the ability to even install it on any other computers. I still have a really antique P4 computer with EasyGauge installed and can at least use it to whip out sub-gauge code rather quickly and copy/paste to my current development computer for massaging and compiling!

    As for crisp and nice looking "glass gauges" I use GDI+, but I'm sure that Jon will insist that I'm behind the times and should use D3D instead. Since I've mostly taken up modeling now and don't do much (if any) gauge coding, I'm not all that interested in devoting the time I'd need to become proficient. Well, that and turning sixty-nine next January, I really don't anticipate having time... :oops:

    EDIT: Just for giggles, I performed some "googlefu" and found this archived link to the EasyGauge website. The "Demo" version is still available for download/installation, but it is rather useless since the "Demo" version will not save the "raw" C files for examination.
    http://web.archive.org/web/20071220234814/www.easygauge.net/main.htm
     
    Last edited: 13 Sep 2017
  5. Kyrelel

    Kyrelel

    Joined:
    5 Sep 2016
    Messages:
    9
    Country:
    unitedkingdom
    'And it contains some errors (a few days ago, flying the mission "baltic sea rescue" I couldn't find Barth NDB...)'

    It might not be an error. The Navaids update is "real world", so if a Navaid is no longer active in RW it is removed by the update.
     
    palacio802 likes this.
  6. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain

    Yes, in this case you are right. I have checked it with Navigraph data and it seems that BTH NDB in Germany is not operative. But in the area I'm used to fly (Spain)
    I have updated charts and I have detected many errors. Believe me. :) Next time I go to Baltic Sea I will create a user waypoint with Barth NDB coordinates...
     
  7. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Yes, it's the same problem. This is a screen capture of the pfd and mfd. I made needles and CDI in the pfd with vectors, and they look fine. The heading bug
    is also a polygon. This is useful because the color of these elements change depending if the nav source is just selected (blue) or the ap mode is engaged (magenta).
    It was tricky to do the discontinuous CDI needle in a single element using a line width of 0. It draws clean. So I draw with vectors every element I can. But I
    can't say the same about gauge text. Many times the background color is given (you can't change it) and I don't like the result (FMS in the MFD is almost illegible
    while HDG is right because of the blue color of the sea).

    screens.jpg
     
    Last edited: 13 Sep 2017
  8. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Well, after HOURS of trials and errors I have managed to build some gauges from SDK with visual studio 2015. I used P3Dv3 SDK, I don't know if this
    helped. The SDK sample is a multi-gauge and I have been able to "trim" it to a single gauge (first attitude and after that temperature indicator). Now I
    can say I have a working template to start my adventure with C++.

    One question: what is the difference between .gau and .dll gauges? What I'm creating (at first by mistake) is .dll gauges and they seem to work well.
     
  9. ddawson

    ddawson Resource contributor

    Joined:
    27 Sep 2006
    Messages:
    675
    Country:
    canada
    Compiled gauges are windows dll's. Always have been. In FSX, the capability of loading files named with the dll extension was added.
    I follow the convention of naming anything that is expected to work in FS9 or earlier with the gau extension, while anything that will only work in FSX or later I name with the dll extension.

    Doug
     
  10. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,104
    Country:
    southafrica
    Not quite accurate :).

    GDI+ isn't as performance killing as I thought, especially when the gauge is properly threaded. I use a bit of a hybrid depending on the need. GDI+ for all vector graphics and D3D for raster and things like map displays.
     
  11. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Hi guys. I keep trying and trying. I'm able to compile the SDK sample with VS2015 and I can make some changes. But
    if I try to start a new gauge following the step-by-step guide of Bill I get dozens of errors. I have even copied the text
    of Bill's files, so I think the code is right. The errors are almost all crazy sintax errors, such as NULL identifier not
    declared (from a make static). It is like if the compiler couldn't read the gauges.h file, but I have checked the include
    and it is there. I have tried even with the full path, but nothing changes.

    What can I be missiong?? :banghead:
     
  12. ddawson

    ddawson Resource contributor

    Joined:
    27 Sep 2006
    Messages:
    675
    Country:
    canada
    If you're getting dozens of errors, it's because you are including the individual sub-gauge cpp files in the build. They should be excluded from the build (right click on the file in Solution Explorer, select Properties)
    Each of these files is #included in the main cpp file for the project.
     
  13. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Thankyou, I had already done it, as this is one step in Bill's tutorial. But I have realised that the method of Bill
    doesn't work in my project (perhpas VS2105?) so I have used the "exclude from the project" command. The
    sub-gauge cpp is not anymore in the listing window. This has solved most of the problems. With only two
    errors I could spot a missing comma and voila. It compiles. Now I can say I have created my first C++
    gauge. Just a background image but this is only the beginning.

    Thank you very much for your time.
     
  14. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,104
    Country:
    southafrica
  15. Daniel Lord

    Daniel Lord

    Joined:
    13 Sep 2016
    Messages:
    36
    Country:
    unitedkingdom
    Congrats palacio802 I myself have successfully created my first gauge last night with the help of ddawson. No the task of writing more begins to get a complete working panel :)

    Sent from my SM-G955F using Tapatalk
     
  16. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
  17. ddawson

    ddawson Resource contributor

    Joined:
    27 Sep 2006
    Messages:
    675
    Country:
    canada
    They can be, yes. I'm going to go out on a limb here and suggest that the consensus is that it just isn't worth the effort to use another IDE.
    The header file gauges.h invokes windows.h and compiled gauges will be dependent on the Windows OS dll's kernel32.dll and user32.dll.
    You have to set up Dev C++ to support this. I'm sure in today's day and age that there is a tutorial out there somewhere that explains how to do so, but really, why bother if VS will do it out of box?
     
  18. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Just guessing. These unswers and questions help me to get the full picture. I'm more used to Dev C++. And I do not like
    visual studio because it's windows philosophy. Just imagine. I wanted the compiler warnings in English to transcribe them
    here. So I went to international settings, get language set. I clicked 'English' and ok. One hour after that, the download
    and installation proccesses ended. "Installation success BUT you have to restart the system". Ok, I restarted. Another
    hour (I guess it downloaded zillions of updates as well, and you know, why not installing all that stuff without user
    permission. Perhaps he/she is in a rush. In a presentation in front of 1000 people. But, who cares!).

    Three days after that I have repeated the proccess several times BUT still I do not have the English warnings. Still in
    Spanish. All I got is a strange behaviour in my keyboard. Windows people seem to convert simple things into very
    complicated issues.
     
  19. Daniel Lord

    Daniel Lord

    Joined:
    13 Sep 2016
    Messages:
    36
    Country:
    unitedkingdom
    I could be wrong but I have read elsewhere on the internet that windows 10 uses your OS language as default for program language . In theory changing a programs settings to use English should do the trick but does not always do so with out changing your OS to use English as well.
     
  20. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Sorry for the silly question but... what is the best way to declare a string variable in c++ gauges in order
    to change its content, concatenate it with others, get its length, etc...??