WaveSimHierarchy Module
The collapsed design hierarchy the wave selector shows. A design whose sheets instantiate one another multiplies out: seven sheets of a few instances each is tens of thousands of instances, and a selector with one entry per instance grows with that rather than with the design somebody wrote. So the hierarchy shown has one node per SHEET at each point in the tree, and the user says which instance of it they mean. This module works out, once per render, everything both panes of the selector need: which nodes there are, which instances each one could show, and which one it is showing. Both panes read the same answer, so they cannot disagree about it.
Types
| Type | Description |
Functions and values
| Function or value | Description |
|
|
Full Usage:
getSelectorHierarchy fs ws
Parameters:
FastSimulation
ws : WaveSimModel
Returns: SelectorHierarchy
|
|
|
The label each sheet instance carries on the canvas above it: what the user drew, and what tells two instances of one sheet apart when the selector offers a choice between them. A SimSheetName is not that. It is the whole path of labels down to the instance - MID2.LEAF1 - which is what makes it unique and what makes it unreadable in a box offering a choice between siblings, where everything but the last element is the same. (It was worse before: whatever suffix of the label told it apart from every other instance of that sheet in the design, or a bare ordinal where nothing did, so the box offered things like "20" and "3".) SimSheetStructure maps an instance to the custom component whose innards it is, which is the component carrying that label. Instances offered together are siblings on one canvas, so their labels are distinct.
|
|
For each sheet instance of the simulation, the instances of each sheet directly inside it - keyed by the containing instance and by the design-time name of the sheet instantiated, and sorted, so the head of each list is the default choice. SimSheetStructure maps a sheet instance to the custom component whose innards it is. That component carries both the instance it sits in, as its own SimSheetName, and the design-time name of what it instantiates, in its type - which is the whole of what is needed here. Worked out once per simulation rather than once per render. It reads an entry per sheet INSTANCE - tens of thousands on a design that expands - and the hierarchy it feeds is rebuilt on every keystroke in the selector's search boxes. A simulation is rebuilt rather than mutated, so a new one is exactly the signal that this is stale.
|
Full Usage:
nodeOf hierarchy sheet
Parameters:
SelectorHierarchy
sheet : SheetTree
Returns: SelectorNode option
|