Organization

ControlDeck creates software modules which are organized into systems. Systems are purely organizational; they don't actively do anything other than contain modules. Modules are instantiated within Systems; each Module is in exactly one System.

Modules create variables of various types. Variables, once created, are entirely separate from the module that created them: they exist in a separate block, not in any specific module or system. These variables are created and are uniquely identified by a group and name. In most cases, the group of a variable will be the same as the name of the System within which the module that created the variable is located. For example, if a module in system A creates a variable with the name pos, that variable will generally be in the group A. This allows multiple instantiations of the same module to create variables that are unique- if they all attempted to create variables in a hard-coded group, any instantiations after the first would fail.

It's important to note that this rule does not need to be followed. For instance, ControlDeck can manage a DSim simulation to provide data to the control system. In this case, DSim variables are mapped into ControlDeck variables within specific groups. Also, variables can be created with an explicit group (that needn't match any System name). In this case, multiple instantiations of the creating module would need to take care to not attempt to create multiple copies of the variable. This sort of nonstandard usage can be useful to allow modules in different Systems to communicate without worrying about System names.

When hardware is in the loop, individual ControlDeck modules will handle interactions with that hardware. Because the source of individual variables is unimportant to other modules wishing to make use of the variables, it is easy to gradually move from simulated to real hardware: as hardware is added into the loop, the variables representing that hardware in the simulation are removed from mapping, and instead a ControlDeck module interfacing with that hardware is written that creates variables with the same group and path. Other modules can interact with either simulated or "real" variables without any changes.