Skip to content

Archive Trac docs integerpair

madscatt edited this page Jun 20, 2026 · 1 revision

Docs Integerpair

Legacy Trac archive page imported from docs_integerpair. Source: https://genapp.rocks/wiki/wiki/docs_integerpair. Review age, links, and examples before treating as current.

integerpair repeater example

background

  • an integerpair repeater provides a matrix of repeats

example module json

  • in this example, there are two integer repeaters (intr1, intr2) which generate the row & column counts
  • the integerpair repeater (mpair) gets these values via the "calc":"intr1,intr2"
  • the integerpair repeater is hidden as its values are coming from the integer repeaters
  • the integerpair repeater's headers field defines the ids for the integer repeater's repeat's values which will propagate to the row and column headers
    • note multiple repeats can be defined, e.g. "headers" : { "row" : [ "repeati1", "repeati1b" ] }
      • genapp will join those values with a space separater in listed order to build the headers
  • the use of vector default initialization for the integer repeaters is not required.
{
    "moduleid"    : "matrixrepeat"
    ,"label"      : "Matrixrepeat"
    ,"help"       : "help for Matrixrepeat"
    ,"executable" : "matrixrepeat.py"
    ,"fields"   : [
        {
            "role"            : "input"
            ,"id"             : "intr1"
            ,"label"          : "how many rows?"
            ,"min"            : 0
            ,"default"        : 1
            ,"type"           : "integer"
            ,"repeater"       : "true"
            ,"tableize"       : "true"
        }
        ,{
            "role"            : "input"
            ,"id"             : "repeati1"
            ,"label"          : "row names"
            ,"type"           : "text"
            ,"default"        : [ "row1", "row2", "row3" ]
            ,"repeat"         : "intr1"
        }
        ,{
            "role"            : "input"
            ,"id"             : "intr2"
            ,"label"          : "how many cols?"
            ,"type"           : "integer"
            ,"min"            : 0
            ,"default"        : 1
            ,"repeater"       : "true"
            ,"tableize"       : "true"
        }
        ,{
            "role"            : "input"
            ,"id"             : "repeati2"
            ,"label"          : "column names"
            ,"type"           : "text"
            ,"default"        : [ "col1", "col2", "col3" ]
            ,"repeat"         : "intr2"
        }
        ,{
            "role"            : "input"
            ,"id"             : "mpair"
            ,"label"          : "integerpair value (readonly)"
            ,"type"           : "integerpair"
            ,"calc"           : "intr1,intr2"
            ,"readonly"       : "true"
            ,"repeater"       : "true"
            ,"hidden"         : "true"
            ,"headers"        : {
                "row"           : [ "repeati1" ]
                ,"column"       : [ "repeati2" ]
                ,"corner"       : "top left corner fixed text"
            }
        }
        ,{
            "role"            : "input"
            ,"id"             : "repeatmpair"
            ,"label"          : "matrix elements"
            ,"type"           : "text"
            ,"repeat"         : "mpair"
            # optional default values
            ,"default"        : [
                                 [ 11, 12, 13 ]
                                 ,[ 21, 22, 23 ]
                                ]
        }
    ]
}

notes & limitations

  • multiple repeats on the integerpair repeater are supported as one large matrix
    • if you wish individual matrices, the recommendation is to have multiple integerpair repeaters
      • they can calc off the same integer repeaters to maintain consistent dimensions
  • most types should work as integerpair repeater repeats, but not all have been tested.
    • text, float, checkboxes do work well
  • nested repeaters under integerpair has not been tested
  • integerpair repeaters under other repeaters be functional for "checkbox" and "listbox" repeaters
    • only tested at a single depth
    • the "calc" fields are functional under the same repeater or at the top level (not under a repeater) or split (one under a repeater, the other at the top level)
      • current layout is cleanest with all under the same repeater

Clone this wiki locally