MenuHelpers Module
Types and nested modules
Functions and values
| Function or value | Description |
Full Usage:
addToRecents path recents
Parameters:
string
recents : string list option
Returns: string list option
|
|
|
|
|
|
|
|
|
|
Full Usage:
displayFileErrorNotification err dispatch
Parameters:
string
dispatch : Msg -> 'a
Returns: 'a
|
|
Full Usage:
extractLabelBase text
Parameters:
string
Returns: string
|
|
Full Usage:
fileEntryBox files fName dialog dispatch
Parameters:
string list
fName : string
dialog : PopupDialogData
dispatch : Msg -> unit
Returns: ReactElement
|
|
|
|
|
|
|
|
Full Usage:
formatLabelAsBus width text
Parameters:
int
text : string
Returns: string
|
|
Full Usage:
formatLabelFromType compType text
Parameters:
ComponentType
text : string
Returns: string
|
|
Full Usage:
getFileInProject name project
Parameters:
string
project : Project
Returns: LoadedComponent option
|
|
|
|
|
|
Full Usage:
getSheetShapes showLibrarySheet ldcs
Parameters:
string -> bool
ldcs : LoadedComponent list
Returns: SheetShapes
|
What is directly inside each sheet of the project: one pass over each canvas, and so a cost that is the design's own size whatever that design expands to. showLibrarySheet: a library sheet it answers false for is left out, and so are the instances that would put it inside someone else - a library component is one thing, not a sheet with innards. It has to be decided here rather than by filtering the project first: the shapes are read off each sheet's canvas, so a sheet removed from LoadedComponents still leaves its instance naming it, with nothing to find under that name. A predicate rather than one flag for the lot, because a library component the user has asked to look inside appears in the Sheets menu while the rest of the library stays hidden. The sheets are given as a list rather than as a project, because not every hierarchy is drawn from the project: the wave selector draws the design that was SIMULATED, which the simulation carries as a list of exactly the sheets it needed.
|
|
|
|
|
|
|
|
|
Full Usage:
loadComponentWithRAMChanges (arg1, arg2) savedWaveSim ldc model
Parameters:
Component list
arg1 : Connection list
savedWaveSim : SavedWaveInfo option
ldc : LoadedComponent
model : Model
Returns: Model
|
|
Full Usage:
makeSourceMenu model updateMem cid dispatch modelCurrent
Parameters:
Model
updateMem : ComponentId -> (Memory1 -> Memory1) -> Unit
cid : ComponentId
dispatch : Msg -> Unit
modelCurrent : Model
Returns: ReactElement
|
|
Full Usage:
materialiseTree expand allInstances shapes root
Parameters:
string list -> bool
allInstances : bool
shapes : SheetShapes
root : string
Returns: SheetTree
|
Build the part of a hierarchy that is going to be looked at. `expand` is asked of each node's SheetPath: a node it says false to comes back as a leaf and nothing below it is built at all. That is what lets a design many routes reach one sheet in be drawn without being walked, since the drawn tree is then the only tree there is. `fun _ -> true` builds the whole thing, which is what the Sheets menu asks for. allInstances = false collapses several instances of one sheet inside one parent into one node, dropping the others BEFORE their subtrees are built rather than after. Instances of a sheet expand identically - same children, same depth - so this is the same tree; what it is not is the same amount of work. A sheet reached from inside itself is not descended into. The guard is on the ancestor path, so the shapes may name each other in a cycle and this still terminates.
|
Full Usage:
multiPathSheets shapes root
Parameters:
SheetShapes
root : string
Returns: Set<string>
|
The sheets that more than one route from the root reaches, and which therefore appear more than once in its hierarchy. Worked out from the design graph - each sheet's parents are counted, not its occurrences - so a design whose expansion is astronomical still costs its own size. Everything below such a sheet is one too: a sheet inside a sheet that appears twice appears twice itself, however singular its own parent is.
|
|
|
|
|
|
|
|
|
Full Usage:
quantifyChanges ldc1 ldc2
Parameters:
LoadedComponent
ldc2 : LoadedComponent
Returns: int * int
|
|
Full Usage:
raiseFileNotification dispatch msg
Parameters:
Msg -> unit
msg : string option
|
|
Full Usage:
readLastBackup comp
Parameters:
LoadedComponent
Returns: (int * string * string) option
|
|
Full Usage:
recentProjectItem path label openIt model dispatch
Parameters:
string
label : ReactElement
openIt : string -> unit
model : Model
dispatch : Msg -> unit
Returns: ReactElement
|
One row of a recent-projects list: the project, which opens on a click, and a cross that takes it off the list. Only opening a project ever put one here, and only opening four others ever took it away - so a project opened once by mistake, or one whose folder has since been moved or deleted, sat at the top of the list of five for as long as it took to open five more. The cross is worded and coloured as removal from a list rather than deletion, because that is all it is: nothing on disk changes.
|
|
|
Full Usage:
removeAllCustomComps name project
Parameters:
string
project : Project
Returns: LoadedComponent list
|
|
|
|
Full Usage:
resolveComponentOpenPopup pPath components resolves model dispatch
Parameters:
string
components : LoadedComponent list
resolves : LoadStatus list
model : Model
dispatch : Msg -> Unit
|
|
Full Usage:
saveDirtyClosedSheets openSheet ldcs
Parameters:
string
ldcs : LoadedComponent list
Returns: LoadedComponent list
|
Write every sheet that differs from its file, except the open one, and clear its flag. ONLY THE OPEN SHEET MAY BE UNSAVED. A change to one sheet routinely reaches others - binding a parameter writes it on every instance, reconciling ports rewrites the sheets that hold them, setting the top sheet rewrites the flag on all of them - and a closed sheet left waiting for a save is a sheet the user cannot see, did not knowingly edit, and has no reason to save. Several places used to mark such sheets and leave them, so the state existed and had to be handled at project close. A library component's sheet belongs to its library and is never written back, whatever asks; it is left alone here and not called unsaved either.
|
Full Usage:
saveOpenFileAction isAuto model dispatch
Parameters: Returns: (LoadedComponent * (Component list * Connection list)) option
|
|
Full Usage:
saveOpenFileActionWithModelUpdate model dispatch
Parameters: Returns: (LoadedComponent * (Component list * Connection list)) option
|
|
|
|
|
|
|
|
|
|
Full Usage:
setupProjectFromComponents finishUI sheetName ldComps model dispatch
Parameters:
bool
sheetName : string
ldComps : LoadedComponent list
model : Model
dispatch : Msg -> Unit
Returns: Unit
|
|
|
|
|
|
Full Usage:
updateLoadedComponents name setFun lcLst dispatch
Parameters:
string
setFun : LoadedComponent -> LoadedComponent
lcLst : LoadedComponent list
dispatch : Msg -> Unit
Returns: LoadedComponent list
|
|
|
|
|
|
|
|
Full Usage:
writeComponentToBackupFile numCircuitChanges numHours comp dispatch
Parameters:
int
numHours : float
comp : LoadedComponent
dispatch : Msg -> Unit
|
|
Full Usage:
writeComponentToBackupFileNow numCircuitChanges numHours comp
Parameters:
int
numHours : float
comp : LoadedComponent
|
|
Full Usage:
writeComponentToFile comp
Parameters:
LoadedComponent
Returns: Result<unit, string>
|
|