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

P3D v2 C++ complex gauge multi screen

Discussion in 'Gauges' started by kalong, 14 May 2015.

  1. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    first of all i'm beginners modeler, programmer.
    i build gauge C++ from Dai Griffiths gauge tutorials,
    use example from dai, SDK, and some examples or advice can I use from this thread ( i find and read till page 29- sorry not to read all thread) to build my gauge. till now working good

    i need help for make multi-screen gauge ( each screen have complex gauge tree)!
    how to change 1 screen to another screen, 1 screen active another screen hiding.

    in XML i just use <visibility> in the top of tree and sub tree below it will be follow.

    how about in C++?
    i have 4 screen in 1 gauge, PFD, NAV, FUEL, EICAS

    :pushpin:i can use ( have not tried yet)
    from bill, using the twin macros from gauges.h, SHOW_IMAGE and HIDE_IMAGE

    if ( HSIpower == 1 ) { SHOW_IMAGE(pelement) ; } else { HIDE_IMAGE(pelement) ; }
    sprintf(pelement->string,"HDG %03.0f",rwert);

    if i use complex macros, this will be much should i do (each element)
    simple way is great ( sometimes simple not easy) :scratchch

    thanks.
     
  2. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
  3. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    some people suggest to use GDI+/D2D, why i not using that? because there no tutorial and example available ( i'm still beginner, need guidance ).
    in C++, i still trying to figure out.
    GDI+/D2D seems quite promising, some tutorial will be great to start.

    this my project gauges i was working on. 1 screen done, another screen waiting.
     

    Attached Files:

  4. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
    You got Skype? It takes a little more than a tutorial....I would be happy to walk you through the basics.
     
  5. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    I'm afraid can not use skype, my bandwidth very limited.

    but it is an interesting offer, possibly with a step by step video tutorial is pretty good.
    so I can repeat again and again if the project is carried out there is a problem.
     
  6. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
    You should be able to. No need to do actual voice calls. Use the Skype text chat. My bandwidth is also low but I can manage.
     
  7. cheangjc

    cheangjc

    Joined:
    14 Aug 2011
    Messages:
    104
    Country:
    singapore
    I would strongly recommend you attempt the direct2d tutorials before attempting a full scale gauge.

    This is coming from someone who used D2D for a complex gauge.
     
  8. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    for a while I will keep using C++ until I understand it, then I'm going to expand to another program.
     
  9. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
    I was actually thinking start with GDI+ as it is easier to understand and you can use it in that example I posted. Do get hold of Skype though. There is nothing like personal one on one real time help.
     
  10. cheangjc

    cheangjc

    Joined:
    14 Aug 2011
    Messages:
    104
    Country:
    singapore
    I can also offer some help on Skype if you need it. I think since we are in the same time zone, it will be easier to find me.
     
  11. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    wow,this very good offer.
    I'm not holding back, I just need a clear path, where I will be heading

    but,the first thing I'm going to find out about the GDI+ / D2D! or you can explain (short explain) why using GDI+ rather than C++.
    in C++ i'm still in the dark, moreover GDI+/D2D.

    Using C++ in my gauge (MV-22B/ CV-22B) there many features, Camera view, map, IR radar. from your experience whether it would be easier to using GDI+.
    I put all the gauge is in VC.
    i start building from simple one, just only one, then slowly increasing to the complex one (Bill Leaming advice).
    could you please give a sample, short sample and simple, just need *.h, *.cpp

    from your template, there many file to "include" for creating just simple one( maybe just "make static"), and just for check its working or not.
    or this GDI+ just like C++, i dont know ........

    some searching on web, so with this GDI no need image ( make fps drop). so where i start drawing. X, Y, Z.
     
    Last edited: 17 May 2015
  12. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
    Ok first of all, GDI+ is just a graphics library that was built using C++.
    Second, GDI+ allows far more freedom in what you can draw using vectors (lines, rectangles, polygons, ellipses, and other primitive shapes) and in many ways makes things easier (fewer lines of code thanks to using loops and such) than the purely bitmap based approach of the fsx gauge macros.

    There is only 1 MAKE_STATIC macro used for each gauge and it covers the whole surface of the gauge. It provides the surface which GDI+ can be used to procedurally draw on.

    The template I sent doesn't have any rendering code in it (its just a blank template) but it does show how to set up a separate thread for your rendering which will effectively eliminate fps drop. Get Skype and we can walk you through the steps.
     
  13. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    wait, i still trying using skype, it wont connect. more than 2 year i'm not using it. :banghead:
     
  14. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
    download the latest version :)
     
  15. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    correct, done. so where to start

    naruto-kun there so many name on skype.
    cheangjc just only one, hope it correct person
     
    Last edited: 18 May 2015
  16. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,102
    Country:
    southafrica
    PM me with your Skype name and ill add you.
     
  17. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    SLOW BUT SURE
    thanks to Naruto-kun
    many modification has been done. this GDI+ better graphics than native C ++ ( from FSX SDK tutorials). The hard one is there no much tutorials and sample creating gauge in GDI+ available on the net, so always ask to Naruto-Kun.

    Left gauge is GDI+
    Right gauge still using native C++
    [​IMG]

    edit : added attachment file
     

    Attached Files:

    Last edited: 21 Jul 2015
  18. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,803
    Country:
    unitedstates
  19. phjvh

    phjvh

    Joined:
    1 Mar 2014
    Messages:
    58
    Country:
    netherlands
    Nice flight attendants.....
     
  20. kalong

    kalong

    Joined:
    19 Dec 2009
    Messages:
    400
    Country:
    indonesia
    80 % for PFD all rewrite to GDI+
    map using modified b737 gauge

    see the different smooth graphics

    [​IMG]

    from my earlier issue i had solved that problem and i had 5 working menu on my gauge, with GDI+ output size also smaller than i build gauge for the first time using C++.
     
    Last edited: 29 Jul 2015

Share This Page