Issie 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

labelPathOf fs instance

Full Usage: labelPathOf fs instance

Parameters:
Returns: string

An instance path as a person reads it - see `SimulatedDesign.LabelPathOfInstance`, which is where this and the instance queries it is built from now live. Kept as a function here because the selector calls it in several places and a `fs.Design.` prefix at each says nothing.

fs : FastSimulation
instance : InstancePath
Returns: string

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

pathKey arg1

Full Usage: pathKey arg1

Parameters:
Returns: string

An instance path written as one string, for a place that can carry only one - the value behind a DOM option. Ids, dot separated. NOT for showing anyone: see labelPathOf for that.

arg0 : InstancePath
Returns: string

pathOfKey key

Full Usage: pathOfKey key

Parameters:
    key : string

Returns: InstancePath

The inverse, for reading a DOM option's value back.

key : string
Returns: InstancePath

selectorInstances fs ws

Full Usage: selectorInstances fs ws

Parameters:
Returns: InstancePath list

The slice the selector takes through the design's instances: the instance each sheet is showing, top sheet first, every sheet of the design and one entry per place in the tree it appears. Which instance that is, is the user's choice wherever they have made one - the same SelectedSheetInstance chain the pills resolve, validated the same way - and the alphabetically first otherwise. A node the user has not opened is included: it is showing an instance like any other, it is simply not drawn until they open it. This is what "everything the selector is currently pointed at" means for a question asked of the whole design rather than of one node, such as which Viewers to select when nothing has been chosen. It is a fact about the SHEETS - one instance each - so it costs the design and not the expansion.

fs : FastSimulation
ws : WaveSimModel
Returns: InstancePath list

Type something to start searching.