• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

c++ gauge call backs

Messages
70
Country
unitedkingdom
hi I am working with sd2gau v35 and playing around with the voltage code. My problem that I can not get my head around is the RPM_SRC_CB.

Code:
    1    IntelliSense: no instance of overloaded function "rpm_src_cb" matches the required type    c:\Users\admin\Desktop\Aircraft dev\panel design\C++ Panels\Shorts_360 panel\Short.Voltmeter.cpp    40    1    Shorts360

has anybody came across this before, if so how did you fix it?

regards

Daniel
 
Looks like there are several function signatures for rpm_src_cb. Can you post them please?
 
hey JB3DG

the rpm_src_cb is just the name I gave to MODULE_VAR_CB.
Code:
MODULE_VAR_CB    rpm_src_cb;

looking around the gauges header file i find:
Code:
typedef FLOAT64 FSAPI MODULE_VAR_CB   ( PMODULE_VAR   val );
typedef               MODULE_VAR_CB   *PMODULE_VAR_CB;

further down when the header file I come to the needle etc
Code:
typedef struct ELEMENT_NEEDLE
{
    HEADER;
    MODULE_VAR              source_var;             
    PMODULE_VAR_CB          source_var_cb;

regards
Daniel
 
This is the only place i make a call to rpm_src_cb. I am using thre gauges.h supplied by p3d v3. could it be an error in the header file possibly?

Code:
MAKE_NEEDLE(    batt_ind,
                BMP_VOLTMETER_NEEDLE,
                NULL,
                NULL,
                IMAGE_USE_TRANSPARENCY | IMAGE_USE_ERASE | IMAGE_USE_BRIGHT,
                0,
                151, 151,
                23, 23,
                MODULE_VAR_NONE,
                rpm_src_cb,
                set_voltage,
                0 )

PELEMENT_HEADER        plist1[] =
{
    &batt_ind.header,
    NULL
};
 
You have it in the wrong place. It should be in the place of MODULE_VAR_NONE. The 3rd last parameter of the MAKE_NEEDLE macro is a pointer to a function that the simulator will call, not a variable.
 
I figured out what I done wrong, MODULE_VAR_NONE is in the correct place as I am using my own function to determine the movement of the needle. I was missing a closing bracket in the code to manipulate the data being sent to the needle.
Thank you for the help JB3DG

Daniel
 
just remember, when I do first time jump in C++ using SDK doc and Dai Griffiths tutorials, I use code like on previous post. good tutorial and I can make a gauge from that. just I need a complex gauge to achieve, then fit with template build by @JB3DG
 
Back
Top