CanvasExtractor Module
Types
| Type | Description |
Functions and values
| Function or value | Description |
Full Usage:
addStateToLoadedComponents openFileName (arg2, arg3) loadedComponents
Parameters:
string
arg1 : Component list
arg2 : Connection list
loadedComponents : LoadedComponent list
Returns: LoadedComponent list
|
|
Full Usage:
compareCanvas tolerance (arg2, arg3) (arg4, arg5)
Parameters:
float
arg1 : Component list
arg2 : Connection list
arg3 : Component list
arg4 : Connection list
Returns: bool
|
|
|
|
Full Usage:
compareConns tolerance conns1 conns2
Parameters:
float
conns1 : List<Connection>
conns2 : List<Connection>
Returns: bool
|
|
Full Usage:
compareIOs ldc1 ldc2
Parameters:
LoadedComponent
ldc2 : LoadedComponent
Returns: bool
|
|
|
|
|
|
Full Usage:
connsAreEqual conn1 conn2
Parameters:
Connection
conn2 : Connection
Returns: bool
Modifiers: inline |
|
|
|
Full Usage:
effectiveInstanceBindings childDefaults parentBindings instanceBindings
Parameters:
ParamBindings
parentBindings : ParamBindings
instanceBindings : ParamBindings
Returns: ParamBindings
|
The bindings a sheet is resolved with inside one instance of it. An instance binding is an expression in the parameters of the sheet the instance SITS ON, so it is evaluated there first and reaches the child sheet as a plain value; every parameter the instance does not bind takes the child's own declared default. This is the same merge GraphMerger.effectiveBindings makes for elaboration, so what is drawn and what is simulated agree. A binding that cannot be evaluated falls back to the default rather than to nothing.
|
Full Usage:
extractLoadedSimulatorComponent (arg1, arg2) name
Parameters:
Component list
arg1 : Connection list
name : string
Returns: LoadedComponent
|
|
Full Usage:
extractReducedState (arg1, arg2)
Parameters:
Component list
arg1 : Connection list
Returns: ReducedCanvasState
|
|
Full Usage:
getOrderedCompLabels compType (arg2, arg3)
Parameters:
ComponentType
arg1 : Component list
arg2 : Connection list
Returns: (string * int) list
|
|
Full Usage:
getStateAndDependencies diagramName ldcs
Parameters:
string
ldcs : LoadedComponent list
Returns: Result<(string * CanvasState * LoadedComponent list), string>
|
the inverse of addStateToLoadedConponents The loadedComponent list in the result does NOT include diagramName A sheet that is not there is an Error rather than an exception because one of the callers runs while rendering: the waveform viewer's buttons ask whether the sheet being simulated still builds, and the sheet named by Model.WaveSimSheet can belong to a project that has since been closed. Raising there threw out of the React render, which unmounted the UI and left every later render throwing the same way - nothing short of reloading the app recovered.
|
Full Usage:
loadedComponentIsEqual ldc1 ldc2
Parameters:
LoadedComponent
ldc2 : LoadedComponent
Returns: bool
|
|
Full Usage:
loadedComponentIsEqualExInputDefault ldc1 ldc2
Parameters:
LoadedComponent
ldc2 : LoadedComponent
Returns: bool
|
|
Full Usage:
loadedComponentIsSameAsProject (arg1, arg2) ldc p
Parameters:
Component list
arg1 : Connection list
ldc : LoadedComponent
p : Project option
Returns: bool
|
|
|
|
Full Usage:
parseDiagramSignature (arg1, arg2)
Parameters:
Component list
arg1 : Connection list
Returns: (string * int) list * (string * int) list
|
|
Full Usage:
signatureOfInstance ldcs parentBindings childSheet instanceBindings
Parameters:
LoadedComponent list
parentBindings : ParamBindings
childSheet : string
instanceBindings : ParamBindings
Returns: Signature option
|
|
Full Usage:
signatureOfInstanceWithCertainty ldcs parentBindings childSheet instanceBindings
Parameters:
LoadedComponent list
parentBindings : ParamBindings
childSheet : string
instanceBindings : ParamBindings
Returns: (Signature * bool) option
|
The signature an instance of `childSheet` has when it binds its parameters as given, and whether its widths are exact. The bindings are read as expressions in `parentBindings` - the parameters of the sheet the instance sits on. Not exact (see signatureIsExact) means some width could not be worked out here, and only the port NAMES may be relied on; the widths are then those the child sheet was saved with. None when the child sheet is not in the project.
|
Full Usage:
sortQBy byFun ids
Parameters:
'a -> 'b
ids : 'a list
Returns: 'a list
|
|
Full Usage:
stateIsEqual (arg1, arg2) (arg3, arg4)
Parameters:
Component list
arg1 : Connection list
arg2 : Component list
arg3 : Connection list
Returns: bool
|
|
Full Usage:
stateIsEqualExInputDefault (arg1, arg2) (arg3, arg4)
Parameters:
Component list
arg1 : Connection list
arg2 : Component list
arg3 : Connection list
Returns: bool
|
|
Full Usage:
syncInstancePorts ldcs
Parameters:
LoadedComponent list
Returns: LoadedComponent list
|
Every custom component instance in the project sized at its OWN bindings. Resolving a sheet's parameterised slots does not do this. ComponentSlots.setSlotValue writes a CustomCompParam slot into the instance's ParameterBindings, which is all it can reach: the port widths follow from that binding by way of the CHILD sheet, and only signatureOfInstance knows how. So a sheet whose parameter values changed came out of ParameterAnalysis.propagateParameterValues holding instances whose bindings said one width and whose ports still said another. The open sheet never showed it, because ParameterView.updateComponents pushes its slots through ChangeCustom, which recomputes ports on the way. A CLOSED sheet was written to its file as it stood, and opening it raised the instance-out-of-date error that the whole per-instance signature apparatus exists to avoid. Pure, and idempotent: it asks what each instance's ports should be and writes that, so running it again finds nothing to change. A sheet whose canvas it rewrites is flagged as needing saving.
|
Full Usage:
tidyParamSlots (arg1, arg2) paramDefs
Parameters:
Component list
arg1 : Connection list
paramDefs : ParameterDefs option
Returns: ParameterDefs option
|
Put a sheet's parameter slots in order against its canvas, ready to be saved:
- drop slots naming components that are no longer on the sheet. Every parameter slot must
name a live component: a slot outliving its component cannot be displayed or edited, and
pushing a value into it would throw;
- re-point the label an `IO` slot carries at its component's current label. Nothing rewrites
that label when the component is renamed, and while no reader depends on it (see
ParameterTypes.sameSlotName) it is what the properties pane and the slot table print, so a
stale one describes the sheet wrongly.
|
Full Usage:
verticesAreSame fixedOffset tolerance conns1 conns2
Parameters:
XYPos
tolerance : float
conns1 : (float * float * bool) list
conns2 : (float * float * bool) list
Returns: bool
|
Are two lists of vertices are very similar. The lengths are compared FIRST, and not after the fold, because two wires of different lengths are not similar however their common prefix compares - and folding them together first was how this came to raise under .NET, where `List.iter2` is defined only for equal lengths, while returning the right answer in the app, where Fable's stopped at the shorter list. `ListPairs` has since settled that difference in favour of stopping, so the order here is about the answer rather than about raising. Two versions of one connection differ in vertex count whenever the wire has been rerouted, which is the ordinary case for a sheet being edited.
|
Full Usage:
withPortWidths labelToWidth cc
Parameters:
Map<string, int>
cc : CustomComponentType
Returns: CustomComponentType
|
A custom component instance holding the given port widths, matched to its ports by LABEL. Widths only. The ORDER of an instance's ports, and which ports it has, are deliberately left alone: an instance whose ports are in a different order from its sheet's is a correct instance (see CustomCompPorts.instanceIsOutOfDate), and a port added to or removed from the sheet is a change the user is asked to confirm rather than one to make behind them. A label the signature says nothing about therefore keeps the width it had.
|