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

MFD Sub Pages/on-off control

Messages
10,163
Country
us-arizona
Hey guys,

I am working on an MFD that is similar to that of an automobile GPS screen or 'info' screen. This has all the controls for the AC system, navigation and GPS, power, etc.

I am using 'enum' for thumbing through the pages. It works great until I get to 'sub' pages that are outside of the enum system.

Is there a way to write a code that will open a page (non-enum) and close it and open another?

The problem is that the sub pages will not turn off, and the click zones remain active for the enum page underneath it, (the enum page is still active, and needs to terminate or switch off).

I could easily do all of the pages in the same enum system (only have one) but I want branched out pages that will not be accessable via the page-up and page-down flip through system.


Would it be easier to just make ALL of the system pages in this gauge to link into the same enum system, or is there a way to turn off one enum and turn on another page set? Also, can I have breaks in the enum system? For instance, can I go from 0 to 12, then jump to 30, 31, 40, 41, 42? From what I am finding, that too does not work.


Bill
 
Last edited:
Ok... I think I just had a mini Epiphany.


I can use a 'Element' to power on a 'enum' group, and do this also with another 'enum' group. The trick would be to;
* Turn one enum system on, the other off, and
* Figure out how to write a 'turn this off and go to that' code string system.


enum system one power on..................(L:Primary Page System Power)
enum system two power on..................(L:Secondary Page System Power)
enum system three power on................(L:Third Page System Power)

enum system one...............................(L:Page CascadeA,enum) 0 ==
enum system two...............................(L:Page CascadeB,enum) 0 ==
enum system three.............................(L:Page CascadeC,enum) 0 ==

so, to have a visible for page 4 of the primary page system, I would have;

<Visibility> (L:Primary Page System Power)
(L:Page CascadeA,enum) 3 ==</Visibility>

That would be a visibility (above) that would enable the page to show.

But if I want to go to page 2 of the Third page system, how would that be written where it would shut off the first Primary page system and turn on the other and go to page 2?

Going to go out on a limb here;

Code:
<!--   NAV CD APP -->
   <Area Left="430" Top="310" Right="587" Bottom="467">
     <Visible>(L:Primary Page System,bool) 
                 (L:List_CascadeA,enum) 8 ==</Visible>
        <Tooltip>NAV CD Player</Tooltip>
         <Cursor Type="Hand"/>
        <Click Kind="LeftSingle">
                  (L:Third Page System,bool) ! (>L:Third Page System,bool)
                  2 (L:Page CascadeC,enum)
                  if{ 1 (L:Primary Page System,bool) } else {0}
                  1 (&gt;L:XMLSND59,enum)
        </Click>
      </Area>
 
Last edited:
Roger that. I see where I forgot at least one.

Ok, I just found this snippet and I believe this is the function equasion that I am looking for.


<Click>0 (>L:Primary Menu Power, bool) 1 (>L:Secondary Menu Power, bool)</Click>

This will shut down one code and start another. Am I correct?
 
This seems to be working smoothly.


Click out of a enum zone into a private branched screen;

Code:
        <Click Kind="LeftSingle">
                  0 (>L:List_CascadeB,enum)         [turns off present enum set]
                  1 (>L:CD PLAYER SCREEN,bool)    [turns on new screen page]
                  1 (&gt;L:XMLSND59,enum)          [plays sound effect]
        </Click>



Click back from there into enum zone;


Code:
        <Click Kind="Hand">
                  0 (>L:CD PLAYER SCREEN,bool)    [turns off present screen]
                  8 (>L:List_CascadeB,enum)         [turns on new enum screen page going to page 9]
                  1 (&gt;L:XMLSND61,enum)          [plays sound effect]
        </Click>


sweetness....
 
Last edited:
So... Lesson for me learned was that I can place a 1 or 0 in front of a command string to make it true or false, on or off, with zero being off.

Man... I wish I had known about this simple equasion, lol....

Vitus, I was hoping that Modulus would have worked. I must try to figure out something to work it with in this gauge.



Bill
 
Last edited:
The modulus operator - which is not quite real modulus - is best described as clock arithmetic.

Code:
(L:foo, number) 10 %

The above will limit foo to between 0 and 9. However, when foo gets to 10, it 'wraps around' and becomes 0 again, 11 becomes 1, and so on. The effective result is that we grab the units digit of foo( assuming, of course, foo is in base 10!:))

This can be used in combination with multiplication and division to get the other digits too. Dividing by 10 before the modulus and rounding down, like so:

Code:
(L:foo, number) 10 / int 10 %

Will give you the tens unit.

This type of thing is very useful when building mechanical dials that wrap around!

See here for a more complex recent example and some tips:
http://www.fsdeveloper.com/forum/showthread.php?t=75567
 
Last edited:
Scripting "Soft Keys" the "Easy Way..."

Bill (and anyone else interested), here is a very simple way to implement multiple sets of script for a single, multi-function "soft key" type button.

The following is the actual script used on my G1000 PFD for the leftmost softkey on the bottom row. Note that all three <Area>s are identical, and they only are "active" whenever the correct <Visibility> condition is set:

Code:
    <!--   ==========================  MENU BUTTON 1  ============================  -->
    <Area Left="112" Top="638" Width="34" Height="26">
      <Visible>(L:PFD_Select, bool) 0 == (L:XPDR_Select,enum) ! and</Visible>
      <Tooltip>TOGGLE ENGINE EICAS</Tooltip>
      <Cursor Type="Hand"/>
      <Click>
        (L:EICAS_Display,enum) 1 + (>L:EICAS_Display,enum)
        (L:EICAS_Display,enum) 3 > if{ 0 (>L:EICAS_Display,enum) }
      </Click>
    </Area>

    <!--   ==========================  MENU BUTTON 1B  ============================  -->
    <Area Left="112" Top="638" Width="34" Height="26">
      <Visible>(L:XPDR_Select, enum) 2 ==</Visible>
      <Cursor Type="Hand"/>
      <Click>
        1 (&gt;L:XMLClick,enum)
        (L:G1000_Cursor,enum) 1 + 6 min (&gt;L:G1000_Cursor,enum)
        (L:G1000_Cursor,enum) 1 == if{ 2 (&gt;L:G1000_Cursor,enum) }
        (L:G1000_Cursor,enum) 1 == if{ 0 (&gt;L:Digit1,enum) }
        (L:G1000_Cursor,enum) 2 == if{ 0 (&gt;L:Digit1,enum) }
        (L:G1000_Cursor,enum) 3 == if{ 0 (&gt;L:Digit2,enum) }
        (L:G1000_Cursor,enum) 4 == if{ 0 (&gt;L:Digit3,enum) }
        (L:G1000_Cursor,enum) 5 == if{ 0 (&gt;L:Digit4,enum) }
        (L:N0,bool) ! (&gt;L:N0,bool)
      </Click>
    </Area>

    <!--   ==========================  MENU BUTTON 1C  ============================  -->
    <Area Left="112" Top="638" Width="34" Height="26">
      <Visible>(L:PFD_Select, bool) 1 == (L:XPDR_Select,enum) ! and</Visible>
      <Tooltip>TOGGLE METRIC</Tooltip>
      <Cursor Type="Hand"/>
      <Click>(L:PFD_Metric_Display, bool) ! (>L:PFD_Metric_Display, bool)</Click>
    </Area>
 
Very nice work on that one Bill! Goodness. Quite a nice menu selection system for just a single click zone.
 
Very nice work on that one Bill! Goodness. Quite a nice menu selection system for just a single click zone.

It looks far more complex than it actually is though. My main point is that instead of trying to create some really complicated scheme in a single <Area>, one can have multiple <Area> sections that are only <Visible> when some simple conditions are true.
 
Back
Top