Built-in State Variables

Table of contents


Here’s a list of state variable types built into MVCS:

Model input and output types

These SV types will schedule the execution of the Model followed by synchronization of the View when changed. Instances of Input SV types will have an isInput property set to true. Instances of Output SV types will have an isOutput property set to true.

Numeric input and output types

The Numeric input and output types support formatted Numbers. Instances of Numeric input or output SV types will have an isNumber property set to true. Instances of Numeric input or output SV types that have a unit subName will have an isUnit property set to true and may be displayed with the unit abbreviation if requested.

The input mechanism can be a keyboard, a popup keypad, or a popup thumbwheel.

Unit input and output types

Unit input and output types have two or more Numeric subSvs, one for each alternate unit specified. The numeric subSvs are published and may be referred to separately. Assigning to one of the subSvs will update the others to the updated value converted into the respective units. Unit input and output types have a specified unitClass. The unit displayed is the current unit as selected by the unitSelector state variable that is assigned the same unitClass.

Unit input and output types have an isParent and isUnitParent property that will both be true.

Selector input types

Selector input types will have an isSelector property set to true.

Other input and output types

View input and output types

These SV types will schedule synchronization of the View when changed. Do not use these types if any Model input depends on it. It may be used within components for state that affects the displayed contents.

StateVar

This type will not schedule the Model or View. Do not use this type if any Model input depends on it or if any component sync() method depends on being scheduled after the value changes. It may be used for state unrelated to Model execution or View synchronization or for internal values that should be saved.