• 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 Help with first gauge development

Messages
4
Country
australia
Hi Everyone,

I am a software developer and needed a checklist window to show up in VR in PMDG.

After reading a bit about gauges and panels, I created my first gauge! Everything went fine until I ran Prepar3d, clicked on Test Panel -> No Content. No errors when loading the PMDG either.

PMDG Panel.cfg:
Window20=Test Panel

[Window20]
Background_color=0,0,0
position=0
size_mm=768,1024
visible=00
ident=10001
gauge00=Checklist_Gauge!Checklist, 768, 1024

Gauge folder location: ...\Prepar3D v4\SimObjects\Airplanes\PMDG 737-800NGX\panel\Checklist_Gauge
XML file name: Checklist.xml

Not to sure what the issue is and any help/feedback is appreciated.

Cheers,

Vincent
 

Attachments

  • Checklist_Gauge.zip
    206.2 KB · Views: 193
Vincent,

The first thing is your panel.cfg entry : gauge00=Checklist_Gauge!Checklist, 768, 1024
With the above entry the gauge itself will be off window : gauge<number>=<gauge>!<sub gauge>, <location X>, <location Y>, optional (<size X>, <size Y>)
Maybe try : gauge00=Checklist_Gauge!Checklist, 0, 0, 768, 1024

A tip for trying new things in the panel?
Never use "Background_color=0,0,0" until it is known that the window / gauge entry works. Using 0,0,0 will be transparent - no idea if window is open or not, with a failed gauge.
Temporarily use something like "Background_color=255,0,0"

Also it looks like your mouse scripts will not do anything. They are doing calculations but not returning the result to the variable. (see below)
Unable to test, nowhere near a simulator.

Hope it helps,
Roman
XML:
<!-- WILL NOT WORK -->
<Script>(M:Event) &apos;LeftSingle&apos; scmp 0 == if{ (L:CUR Page) 0 != if{ (L:CUR Page) -- } } </Script>

<!-- SHOULD WORK -->
<Script>(M:Event) &apos;LeftSingle&apos; scmp 0 == if{ (L:CUR Page, number) 0 != if{ (L:CUR Page, number) -- (&gt;L:CUR Page, number) } } </Script>

<!-- AN ALTERNATE WAY -->
<Script>(M:Event) &apos;LeftSingle&apos; scmp 0 == if{ (L:CUR Page, number) -- 0 max (&gt;L:CUR Page, number) } </Script>
 
Hi Roman,

Thank you for your help, I made the changes as suggested and the gauge is now showing up successfully.

I still however have some issues with the mouse click scripts as it seems the events are not getting fired.

I have attached a new zip version of the checklist. This should be final.

Thank you again.

Vincent
 

Attachments

  • Checklist.zip
    799 bytes · Views: 169
Hi Vincent,
Unable to test since nowhere near my sim but here is what I would do..
1) Combine the wheel up & wheel down into one click area via code. You cannot have 2 "active" click areas using the same area.
2) The addition of ", number" to the variable seems suspect. You have a space between (<var name> <comma> <var type>) where I assume it should be (<var name><comma> <var type>) or (<var name><comma><var type>) EX:
(L:CUR Page , number) -- Suspect
(L:CUR Page, number) -- OK
(L:CUR Page,number) -- OK
3) Unsure about this too. In the case expression script the var name does not include the var type. Now one "could" get away without using var types but again, I assume it must be consistent throughout all the code as var lookup is via a string.
Being a new gauge maker I would advise to keep it as close to SDK style as possible, EX:
<Script>(L:CUR Page)</Script> -- Not the exact variable name as in the click section
<Script>(L:CUR Page, number)</Script> -- OK

Code below & attached with commented changes.

Hope this helps,
Roman
XML:
<?xml version="1.0" encoding="UTF-8"?>
<SimBase.Document Type="AceXML" version="1,0" id="Checklist">
    <Descr>AceXML Document</Descr>
    <Filename>Checklist.xml</Filename>
    <SimGauge.Gauge id="Checklist" ArtDirectory="E:\Prepar3d\Prepar3D v4\SimObjects\Airplanes\PMDG 737-800NGX\panel\Checklist_Gauge">
        <FloatPosition>0.000000,0.000000</FloatPosition>
        <Size>952,1363</Size>
        <Element id="Element">
            <FloatPosition>0.000000,0.000000</FloatPosition>
            <Select id="Select">
                <Expression id="Expression">
                            <!-- ADDED ", number" TO THE VARIABLE NAME -->
                    <Script>(L:CUR Page, number)</Script>
                </Expression>
                <Case id="Case 0">
                    <ExpressionResult>0.000000</ExpressionResult>
                    <Image id="page1.bmp" Name="page1.bmp">
                        <Transparent>True</Transparent>
                    </Image>
                </Case>
                <Case id="Case 1">
                    <ExpressionResult>1.000000</ExpressionResult>
                    <Image id="page2.bmp" Name="page2.bmp">
                        <Transparent>True</Transparent>
                    </Image>
                </Case>
                <Case id="Case 2">
                    <ExpressionResult>2.000000</ExpressionResult>
                    <Image id="page3.bmp" Name="page3.bmp">
                        <Transparent>True</Transparent>
                    </Image>
                </Case>
                <Case id="Case 3">
                    <ExpressionResult>3.000000</ExpressionResult>
                    <Image id="page4.bmp" Name="page4.bmp">
                        <Transparent>True</Transparent>
                    </Image>
                </Case>
            </Select>
        </Element>
        <MouseArea id="MouseArea">
            <FloatPosition>0.000000,0.000000</FloatPosition>
            <Size>952,1363</Size>
            <MouseClick id="WheelUp">
                        <!-- WATCH COMMA SPACING IN THE VARIABLE, COMBINED WHEEL UP & WHEEL DOWN IN ONE CLICK AREA -->
                <Script>(M:Event) 'WheelUp' scmp 0 == if{ (L:CUR Page, number) 1 - 0 max } els{ (L:CUR Page, number) 1 + 3 min } (>L:CUR Page, number)</Script>
                <ClickType>WheelUp+WheelDown</ClickType>
                <MouseWheelFlip>True</MouseWheelFlip>
            </MouseClick>
                <!-- COMMENTED OUT THIS WHOLE SECION -->
<!--             <MouseClick id="WheelDown">
                <Script>(M:Event) &apos;WheelDown&apos; scmp 0 == if{ (L:CUR Page , number) 3 != if{ (L:CUR Page , number) 1 + (&gt;L:CUR Page , number) } }</Script>
                <ClickType>WheelDown</ClickType>
                <MouseWheelFlip>True</MouseWheelFlip>
            </MouseClick> -->
        </MouseArea>
    </SimGauge.Gauge>
</SimBase.Document>
 

Attachments

  • Checklist.zip
    955 bytes · Views: 173
Hi Roman,

Made the changes and the gauge is now working as expected. Here you go: first P3D gauge!

Thank you to both of you for your help.

Vincent
 
Apologies, 1 last question, added a close button, the hand cursor is showing but I am getting a key event missing error?

From the documentation, the below should technically toggle the panel ID 4?

Code below:

<MouseArea id="MouseArea all">
<FloatPosition>0.000000,0.000000</FloatPosition>
<Size>952,1363</Size>
<MouseArea id="MouseWheel">
<FloatPosition>0.000000,0.000000</FloatPosition>
<Size>952,1363</Size>
<MouseClick id="WheelEvent">
<Script>(M:Event) &apos;WheelDown&apos; scmp 0 == if{ (L:CUR Page) 3 != if{ (L:CUR Page) ++ (&gt;L:CUR Page) } } (M:Event) &apos;WheelUp&apos; scmp 0 == if{ (L:CUR Page) 0 != if{ (L:CUR Page) -- (&gt;L:CUR Page) } } </Script>
<ClickType>WheelDown+WheelUp</ClickType>
<MouseWheelFlip>True</MouseWheelFlip>
</MouseClick>
</MouseArea>
<MouseArea id="MouseClick">
<FloatPosition>900.000000,0.000000</FloatPosition>
<Size>50,50</Size>
<CursorType>Hand</CursorType>
<MouseClick id="MouseClick">
<KeyEvent>KEY_PANEL_4</KeyEvent>
<ClickType>LeftSingle</ClickType>
</MouseClick>
</MouseArea>
</MouseArea>

Thanks again,

Vincent
 
If your window ident is the same as in post #1 ( 10001 ) then replace the following line :
<KeyEvent>KEY_PANEL_4</KeyEvent>
with :
<Script>10001 (>K:PANEL_ID_CLOSE)</Script>
 
Back
Top