Parameterized preset that instantiate() turns into a concrete Preset. More...
| Header: | #include <PresetTemplate> |
| Since: | Phase 8 |
PresetTemplate is a value type. PresetTemplateBook loads and stores templates as JSON through toJson() and fromJson(), and the "create from template" flow fills in the parameters and calls instantiate().
Minimal substitution language:
{{paramName}} in any string field is replaced with the parameter value at instantiation time. An unresolved reference is left intact.forEach rules expand into variable-length actuator lists, driven by an int parameter (for example "legs") or by the safe pins of the target board.StanzaTemplate entry. instantiate() appends a stub stanza that names the template, in a "main" channel. The caller then instantiates the stanza template against the produced actuators, because that needs the stanza template book.More elaborate expression languages (arithmetic, generator functions) are out of scope for the first pass; if a preset needs legs * joints_per_leg actuators, use a single numJoints parameter and pre-multiply in the UI.
See also PresetTemplateBook, PresetTemplateWizardActivity, and Preset.