You can do a similar thing with lots of rows and columns in the display, but it would be a lot more work, and the display wouldn't be nicely tuned.
The fnmapping element works by looking for variables with names like "F2 controls output 1". Specifically, it's looking for a name that consists of four (or five) parts:
After finding all the matching variables in the configuration file, the fnmapping element creates a rectangular grid to display them.
In the context of a fnmapping element, variables have several useful attributes and elements:
Several attributes and elements (e.g. "tooltip" & "label") on a fnmapping variable are ignored and should not be added to a definition file:
Several attributes and elements of the "model" element of the decoder file also affect affect the Function Map display:
The block of definitions for function zero in the forward direction look like this:
<variable item="FL(f) controls output 1" CV="33" mask="XXXXXXXV" minOut="1" default="1"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="FL(f) controls output 2" CV="33" mask="XXXXXXVX" minOut="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="FL(f) controls output 3" CV="33" mask="XXXXXVXX" minOut="3"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="FL(f) controls output 4" CV="33" mask="XXXXVXXX" minOut="4"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="FL(f) controls output 5" CV="33" mask="XXXVXXXX" minOut="5"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="FL(f) controls output 6" CV="33" mask="XXVXXXXX" minOut="6"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="FL(f) controls output 7" CV="33" mask="XVXXXXXX" minOut="7"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="FL(f) controls output 8" CV="33" mask="VXXXXXXX" minOut="8"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>Note that the "minOut" attribute ensure that only outputs actually defined as present are displayed.
The similar block of definitions for function two configure a different CV, but are otherwise quite similar:
<variable item="F2 controls output 1" CV="36" mask="XXXXXXXV" minOut="1" minFn="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F2 controls output 2" CV="36" mask="XXXXXXVX" minOut="2" minFn="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F2 controls output 3" CV="36" mask="XXXXXVXX" minOut="3" minFn="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F2 controls output 4" CV="36" mask="XXXXVXXX" minOut="4" minFn="2" default="1"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F2 controls output 5" CV="36" mask="XXXVXXXX" minOut="5" minFn="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F2 controls output 6" CV="36" mask="XXVXXXXX" minOut="6" minFn="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F2 controls output 7" CV="36" mask="XVXXXXXX" minOut="7" minFn="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F2 controls output 8" CV="36" mask="VXXXXXXX" minOut="8" minFn="2"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>The only new thing here is that the "minFn" attribute is being used. This is useful when a family of decoders supports different numbers of functions (not outputs!) in different decoder models.
As you go to higher function numbers, the NMRA mapping between the bits in the CVs and the output numbers changes. You can see that by looking at an example of how function ten is mapped to outputs 7 through 14:
<variable item="F10 controls output 7" CV="44" mask="XXXXXXXV" minOut="7" minFn="10"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F10 controls output 8" CV="44" mask="XXXXXXVX" minOut="8" minFn="10"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F10 controls output 9" CV="44" mask="XXXXXVXX" minOut="9" minFn="10"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F10 controls output 10" CV="44" mask="XXXXVXXX" minOut="10" minFn="10"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F10 controls output 11" CV="44" mask="XXXVXXXX" minOut="11" minFn="10"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F10 controls output 12" CV="44" mask="XXVXXXXX" minOut="12" minFn="10" default="1"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F10 controls output 13" CV="44" mask="XVXXXXXX" minOut="13" minFn="10"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable> <variable item="F10 controls output 14" CV="44" mask="VXXXXXXX" minOut="14" minFn="10"> <enumVal> <enumChoice choice="No"/> <enumChoice choice="Yes"/> </enumVal> </variable>
<!-- Define the fixed Function-Output mapping --> <constant item="FL(f) controls output 1" minOut="1" default="1" /> <constant item="FL(r) controls output 2" minOut="2" default="1" /> <constant item="F1 controls output 3" minOut="3" minFn="1" default="1" /> <constant item="F2 controls output 4" minOut="4" minFn="2" default="1" /> <constant item="F3 controls output 5" minOut="5" minFn="3" default="1" /> <constant item="F4 controls output 6" minOut="6" minFn="4" default="1" /> <constant item="F5 controls output 7" minOut="7" minFn="5" default="1" /> <constant item="F6 controls output 8" minOut="8" minFn="6" default="1" /> <constant item="F7 controls output 9" minOut="9" minFn="7" default="1" /> <constant item="F8 controls output 10" minOut="10" minFn="8" default="1" />This will be displayed in the same way as other mappings, except that the individual checkboxes will be inactive (grayed out).