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
    Hi guys!

    Last week I released as freeware my new version of AW139. I'm very happy with it but I'm always trying to improve things for the next release (developing is like a drug for me).

    The model is equipped with a functional FMS that I wrote in xml. Due to the limitations of xml it lacks of the capacity of storing flight plans and read sids and stars, though. For this reason I decided to introduce myself in the wolrd of C++ gauges. I can write basic applications in C++ so I thought that it wouldn't be so difficult. I have read many times the SDK, and some guide (such as the sd2gau24 by Dragonfly) but I have never found an up-to-date guide which shows step by step how to create and compile a gauge in C++. I'm really confused and full of questions without a clear and definitive answer. (F.i. which Visual Studio version to use? Can I use other IDEs?).

    If anyone could help in this I would be very grateful (and also the future users of this beauty:)

    aw139_ec_lja.jpg
     
    antaris likes this.
  2. rpmc

    rpmc

    Joined:
    14 Oct 2007
    Messages:
    1,185
    Country:
    thailand
    I don't mean to dissuade you from learning and developing in C++ as that will unlock the full potential of gauge development. It's a good move.

    However, in case you are not already aware, I'd like to point out that there is XML hard drive read/write capability using Logger which is a class in XMLTools or as a stand-alone app here. You can decide if use of Logger could address the flight plan and SID/STAR needs, especially considering that you wrote an XML FMS already. If I remember correctly, (at least) one other contributor to this forum has stored SID & STARS to HDD using Logger. Search for postings in this forum by Francois (Fdd_fr). He might have experience with SID/STAR, Logger, and an XML FMS and be able to comment about how well it worked out.

    Very nice looking helo!

    Bob
     
  3. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,507
    Country:
    germany
    rpmc likes this.
  4. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Thank you for your replies. I am making some trials with logger, to see if it can help me to do what I want to do.

    From the beginning I see some "cons". The first: I have always problems with modules because module installation
    is something that many people cannot do. My FMC uses XMLVARS and 80% of the problems/questions/demands
    of information are caused because a wrong installation of this module... I'm reluctant in adding more modules.
     
  5. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
  6. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Hi, kalong. And what do you use to compile it? How do you do it?
     
  7. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
  8. rpmc

    rpmc

    Joined:
    14 Oct 2007
    Messages:
    1,185
    Country:
    thailand
    Sounds like you may have already made the decision to re-write your FMC in C++ to avoid use of modules. I'm sure it will turn out nice.

    But regarding modules, please note that both XMLVARS and Logger are bundled in XMLTools, so if you stay with XML, your users need to install only one module: XMLTools. Further, XMLTools includes an installer.

    Good luck. Looks like you have a great project going.

    Bob
     
  9. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Hi Bob. Thank you for noting that. I downloaded and installed logger but I could use xmltools. Right. For the moment
    I'm trying with this in my FMS but I'm having problems.

    I want the FMS to be able to extract information from navigraph data, so that users can have updated information
    about waypoints, sid, stars and aerodromes. The big "pro" of using logger is that I have only to make some changes
    in the FMS. Where I had a fs9gps search, now I search with logger in a waypoints.txt file. The problem is that logger
    seems to have limitations and it's not possible to make a search through large files. If I seach for a waypoint which
    is at the end of the file, the simulator stops and closes (I never got this before just with a gauge!).

    I'm now trying to find a method to do the searches faster in order to avoid the crashes.
     
  10. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Thank you for your reply... but still... ¡the tutorial is dated in 2005! I have installed Visual Studio 2015 and everything is different (different menus, more options that can
    be chosen by mistake). As I said in the name of the thread: very confusing!!!
     
  11. Daniel Lord

    Daniel Lord

    Joined:
    13 Sep 2016
    Messages:
    36
    Country:
    unitedkingdom
    hey Palacio802

    I am very much in the same boat as you, I have experience in c++ plus i prefer C++ to XML its a personal choice :). you can use visual studio 2015 Community edition with out much issues. I myself am using VS2012 express whilst i learn the fundamentals of c++ gauge development and will move on to 2015 when I am ready to port my model over to 64bit. with regards to Kalong the setup is much the same but i will give it a whack to see if i can help.

    first off load your IDE, ill do it with 2015 to make things easier. Start off by clicking new project and click the drop down for visual C++ (I am assuming 32bit for now) and select WIN32, This will allow you to select WIN32 console application.
    http://prntscr.com/gk6wpg

    Give your project a name and click ok. This will start the wizard for you, click next to go to the next page/window. Here you want to select DLL and empty project (see screenshot)
    http://prntscr.com/gk6xti

    After that click finish and you have a empty project ready to go.
    http://prntscr.com/gk6yeb

    Now we still have some set up to do. Again I am not sure on the set up for 64bit so this is all still 32bit.

    Right click on the folder 'source' to add your first .cpp file this will be your main .cpp file that will include your #include header files as well as including the other .cpp files you will have. Once this file is generated you right click your project again to go to the properties.
    http://prntscr.com/gk729k

    you will be created by the properties window
    http://prntscr.com/gk72ns

    From here you will follow the link that Kalong gave you, they will be the same.

    the next bit which is excluding files from your build is actually the bit I am about to mess around with now to do a test compile of my own c++ gauge, When I am successful i will post below to let you know exactly what has to be done.

    if you want to as any questions just PM me ill be avaible for the next four hours then my 8month daughter will be home from her visit from grannies lol

    regards

    Daniel
     
    antaris and palacio802 like this.
  12. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    there a similarity, just need carefully read to not make a mistake (and it always needed when coding). the big different between VS2005 and VS2015 is on it "library",small different is UI (configuration manager) the coding are same, the work flow are same, the need file (*.h and *.cpp) are same for default.

    I can't give a tutorial as I'm still a beginner (my self some times get stuck and confused) and I doesn't have any programmer background. my knowledge still a dirt on the nail tip.
    I use VS2008 (setup configuration same as VS2005) at first project, compile everything work fine, then I open the project in VS2015, compile and work fine too. in VS2015 there no need any configuration setup any more.
    I doing many try and error, and C++ doesn't have much tutorial/sample available, only one available as far as I know.
    http://www.fsdeveloper.com/forum/resources/gdi-gauges-drawing-msdn-example.162/

    what I do:
    just make a simple gauge (maybe a needle), follow tutorial from Dai Griffins, setup by @n4gix, more reference sample from SDK documentation. then compile. this will know what wrong from your code for first compile. if it success, then expand it step by step. if not, you can post your code to get a help.
    this my first request help (2 years ago) : http://www.fsdeveloper.com/forum/threads/c-complex-gauge-multi-screen.433976/#post-709946

    if you want to try GDI+ use template from @JB3DG, thought it already setup just follow small describe in it. there no tutorial for this template, except from the guys who make the template.
    one more there a guy expert in C++ it was @virtuali , search his post you'll find a very good tutorial/explanation (include who he was)
     
    Daniel Lord likes this.
  13. Kyrelel

    Kyrelel

    Joined:
    5 Sep 2016
    Messages:
    9
    Country:
    unitedkingdom
    "I use VS2008 (setup configuration same as VS2005) at first project, compile everything work fine, then I open the project in VS2015, compile and work fine too. in VS2015 there no need any configuration setup any more."

    Is that because the required settings were imported with the project file(s) ?
     
  14. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    No, because I'm too lazy to do from scratch and setup again
     
  15. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,803
    Country:
    unitedstates
    Yes, I wrote that tutorial back when I wasn't working full time as a developer and actually had some free time. Yes, the GUI is radically different, but the essential principles for the requisite files and organization remain the same.

    Over the years some of the images have been lost by the image host I was using, which is unfortunate given that I too have long ago lost those images as well! :confused:

    I too have moved on to VS2015 and honestly do not like the new GUI at all. It is overcrowded with options that no gauge programmer will ever need to use, which of course makes those things the gauge programmer will need to use harder to find... :banghead:
     
  16. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,803
    Country:
    unitedstates
    Yes, when the 'conversion' is completed, the project should compile as usual. It is possible that some minor syntax changes and/or #include statements may need fixing up, but on the whole it's a relatively painless process.
     
  17. Heretic

    Heretic Resource contributor

    Joined:
    1 Feb 2007
    Messages:
    5,507
    Country:
    germany
    You can also get updated Navaids in non-payware form.
    http://aero.sors.fr/navaids3.html

    I think these can even be extracted susing the default GPS variables.
     
  18. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
    One of these days if permitted by KC I will write a tutorial on basic C++ gauge setup.....
     
  19. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Hi Bill. A pleasure talking to you. I think 80% of what I know about xml applied to FSX comes from you. And I think I have a thorough knowledge of it. So, thank you very
    much!. I'm a retired helicopter pilot who has always been interested in flight simulators and programming. Now I have more time and perhaps the opportunity to work in this
    world of simulation. I'm joinning a project for real aviation simulators and I want to give a "professional touch" to my AW139. I have been thinking about it, and finally I
    have decided that I would need to learn how to create C++ gauges because it gives me the flexibility that I need to build professional cockpits (you know, dozens of variables, exact
    replication of gauges with every feature available, etc...). I'm not a C++ programmer, but I have programmed many applications in C++ as well as in other languages such
    as visual C (I remember an emulator of the AN-ARC 210 radio that I wrote when I was in the Air Force that still is in use there).

    What puzzles me is that having some knowledge about FSX and programming, I can't understand exactly how to build a sample gauge in the SDK. Yeah, I get the general
    idea. But I only get error messages when I try to compile the gauge. There's a gap between xml programming (here you have a lot of tutorials) and c++ programming
    (with a total lack of updated and clear information). I hope that with your help I can
    cover that gap.

    BTW: what method do you think is better to obtain sharp graphics (to simulate a PFD, for instance)? My screens are writen in XML and they are ok but text with
    transparent background looks "blurry"...

    Regards (and sorry for my poor English...).
     
    antaris likes this.
  20. palacio802

    palacio802

    Joined:
    7 Sep 2014
    Messages:
    75
    Country:
    spain
    Yes. With this data you can update the internal FSX nav database and then you can read them with the built-in
    gps system. This is what my XML based FMS does. BUT it only includes VORs, NDBs, Localizers, (some) Intersections,
    Aerodromes, Localizers and some approaches. And it contains some errors (a few days ago, flying the mission
    "baltic sea rescue" I couldn't find Barth NDB...).

    On the other hand, I want to create a professional FMS and companies are reluctant to adopt software which
    depends on a third party like non-payware developers because they are more prone to discontinue (I guess).
    If you pay, you get some rights, while if you don't pay for something, perhaps it won't last much.
     

Share This Page