• 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.

P3D v4 Fifth parameter code not working any more? [Solved]

DragonflightDesign

Resource contributor
Messages
1,397
Country
northernireland
If someone is building a C-gauge for P3Dv4, I'd be grateful if they could insert the following code and check to see if P3Dv4 still allows you to grab a fifth parameter from the gauge info in the panel.cfg file e.g.

myGauge!myInstrument 3,4,100,100,fifth

Code:
//**************************************************************************
//Get the gauge parameter as a string up to 100 characters
//**************************************************************************
// Usage within a gauge:
// gaugeParam=(PCHAR)pgauge->parameters;
// panelParam(gaugeParam,0) // where 0 = string, 1 = integer

PCHAR gaugeParam=NULL;
char paramData[100]="";
int paramNo = 0;

void panelParam (char *param, int type)
{
    int i=0;

    // char
    if (!type)
    {
        for (i = 0; param[i]; i++) param[i] = tolower(param[i]);
        strcpy_s(paramData, param);
    }
    // int
    else paramNo = atoi(param);

    return;
}

It don't seem to be working, not no more.

-Dai
 
During PRE_UPDATE. The debugger shows gaugeParam always returned as '0\0'. Possibly a bad move as Arne's original code runs in the string callback, yet PRE_UPDATE has always worked in FSX. Let me have another go at this...
 
Last edited:
Okay... it works when the parameter is applied to the first instance of the gauge but doesn't seem to work for subsequent instances e.g. I have an RPM gauge that appears first on the pilot's panel and then on the FE's panel. The parameter is retrieved from the pilot's panel but not the FE. From this situation the obvious recourse is to 'invert' the reading of the parameter ('if I find it then I'm on the pilot's panel') but both panels have popouts, meaning the gauge has four instances. I can kludge round it, but I'd rather not. Back to the research... :)

[EDIT] The answer is to use PRE_INSTALL to grab the parameter. Many thanks for running the check, Ed.
 
Last edited:
Sorry, I had to get some sleep... yes.. PRE_INSTALL is best moment to obtain it.
 
Osprey have 5th parameter and still working in P3D v4.4
I just can't (yet) debug it with VS2015 (edit and continue).
 
'Edit and continue'..... (shudders and runs away) :rotfl:That got me into way too much trouble a long time ago. It's pretty much top of my 'code to avoid like the plague' list now.
 
It was just one really bad experience when I royally screwed up some (non-FS) paying work. For all the length of time it takes to recompile, I decided to avoid it after that. Before you ask...



...yes. I'd made a load of changes, got the code working and forgot to save it. Rather, I told it not to save because I wasn't watching what I was doing. :banghead:
 
Should have said this was back in the days of Visual C v5. It became a habit after that to turn E&C off. It may have been that I had some other setting wrong and E&C didn't automatically save when it could have done.
 
Back
Top