Header menu logo issie

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

SelectorHierarchy

What the two panes of the wave selector draw, worked out together.

SelectorNode

One node of the collapsed hierarchy, resolved against the simulation. The field names are prefixed because F# resolves an unannotated record field to the last type declaring it, and every file compiled after this one is full of trees, keys and instances.

Functions and values

Function or value Description

emptyHierarchy

Full Usage: emptyHierarchy

Returns: SelectorHierarchy

The hierarchy of a design with no project open: nothing to draw, and nothing to look up.

Returns: SelectorHierarchy

getSelectorHierarchy fs ws

Full Usage: getSelectorHierarchy fs ws

Parameters:
Returns: SelectorHierarchy

The hierarchy to draw: the sheets of the simulated design below its top sheet, collapsed so that several instances of one sheet inside one parent are one node, cut off below any node the user has not opened, and resolved against `fs` so each node names the instance it is showing.

fs : FastSimulation
ws : WaveSimModel
Returns: SelectorHierarchy

instanceLabels

Full Usage: instanceLabels

Returns: FastSimulation -> Map<string, string>

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.

Returns: FastSimulation -> Map<string, string>

instancesInside

Full Usage: instancesInside

Returns: FastSimulation -> Map<(string * string), string list>

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.

Returns: FastSimulation -> Map<(string * string), string list>

nodeOf hierarchy sheet

Full Usage: nodeOf hierarchy sheet

Parameters:
Returns: SelectorNode option

The node a SheetTree node is drawn as, for the pills - which are handed SheetTree nodes by the breadcrumb renderer and need what was worked out about them here.

hierarchy : SelectorHierarchy
sheet : SheetTree
Returns: SelectorNode option

Type something to start searching.