ComponentLibraries Module
Types and nested modules
Functions and values
| Function or value | Description |
Full Usage:
componentPath libPath name
Parameters:
string
name : string
Returns: string
|
|
Full Usage:
copySheetWithNewIds sourcePath newPath
Parameters:
string
newPath : string
|
Copy a sheet from some source path to a destination path, giving every component, port and connection in it a fresh id so that it cannot clash with the sheet it was copied from. Either path may be a library component or an ordinary sheet, so this is also how a component is copied out of a library into a project and back. Falls back to a plain file copy if the source cannot be read as a sheet.
|
|
|
|
|
Full Usage:
exportLibraryTo destRoot library
Parameters:
string
library : ComponentLibrary
Returns: Result<ExportResult, string>
|
Copy a library into `destRoot`, in a subdirectory named after the library - created if it is not there, brought up to date if it is. What lands is a LIBRARY and not a heap of files: the destination ends up holding exactly the components this one holds. A component renamed or deleted since a previous export would otherwise stay behind in the copy and go on being offered from it, which is a library that exists nowhere. Only .ldgm files are touched, and only inside the subdirectory named after the library, so nothing else in the folder the user chose is at risk. The files are copied verbatim rather than read and written back. An .ldgm is a header and the exact text of a .dgm; an export that re-encoded them could differ from its source for reasons that have nothing to do with the components in it. Names are compared case-insensitively when deciding what is stale. On Windows "Adder.ldgm" and "adder.ldgm" ARE the same file, so an exact comparison would delete the one just written; on systems where they differ this errs towards leaving a file alone, which is the safe direction.
|
|
The libraries available: those shipped with Issie, and those the user has made or imported. Directory names only - no file is opened - so this is cheap enough for startup, which it has to be: the catalogue is a pure render function and cannot read the disk itself. Everything about a component is read later, when its library is opened. A user library with the same name as a shipped one wins, so a library can be overridden.
|
Full Usage:
isLibraryComponentFile filePath
Parameters:
string
Returns: bool
|
|
|
|
|
|
Full Usage:
isManagedLibrary libPath
Parameters:
string
Returns: bool
|
Whether a library is one Issie manages rather than one the user wrote. Two directories are Issie's own. The shipped libraries under the installation are what comes with the program. The user library directory is the store: it is where a library ARRIVES - the copy made when a component is saved into a library from a sheet, and the copy an import will leave - and a copy is not the thing to edit. A library the user is actually working on lives wherever they keep their work, the way a project does.
|
Full Usage:
libraryIndexFor ldcs libraryName
Parameters:
LoadedComponent list
libraryName : string
Returns: int
|
The index to use for a library in this project: the one it already has if any of its sheets are present, otherwise the lowest free index. An index is free when no other library holds it and NO existing sheet begins with its prefix - not merely none of the names this library would produce. User sheet names may themselves contain underscores, so a project can already hold a sheet called L1_Anything, and letting a library share a prefix with an unrelated sheet would be confusing even where nothing actually collides. A prefix in use is skipped rather than anything being renamed or refused.
|
|
|
|
|
Full Usage:
libraryPathIsEditable libPath
Parameters:
string
Returns: bool
|
Whether the library in this directory may be opened as a project and saved again. Not the standard libraries, and not the imported ones: what is in Issie's own directories arrived from somewhere else, and editing a copy in the form it arrived in produces a version that agrees with nothing. A library kept anywhere else is the user's own work and is theirs to change - including one somebody handed them, which they have to put somewhere first. A development run may edit anything, the shipped libraries above all: that is where they are maintained, and the checkout is writable there (see Main/Bridge.fs). Nothing here is prominent, and that is deliberate. Writing a library component is sheet -> save into a library -> place it and try it -> change it, and the last step must not need a second, non-library copy of the sheet kept in step by hand. But it is a thing to go and do rather than a thing to fall into: the catalogue only offers it where it applies, and otherwise a library is opened by navigating to the folder it is in.
|
|
|
Full Usage:
prefixFor libraryIndex
Parameters:
int
Returns: string
|
|
Full Usage:
readComponentAndDependencies libPath name
Parameters:
string
name : string
Returns: Result<LibraryFile list, string>
|
A component and everything it needs, dependencies first - the order they must be written in. Dependencies are named rather than embedded, so they are read from the same library here. A name that is not there is an error rather than a silent omission: the component would otherwise be placed holding a custom component that refers to a sheet which does not exist.
|
Full Usage:
reservedPrefixOf ldcs sheetName
Parameters:
LoadedComponent list
sheetName : string
Returns: string option
|
|
|
|
|
|
Full Usage:
sheetFilePath project sheetName
Parameters:
Project
sheetName : string
Returns: string
|
|
Full Usage:
sheetNameFor libraryIndex compName
Parameters:
int
compName : string
Returns: string
|
|
Full Usage:
shippedLibrariesDirectory ()
Parameters:
unit
Returns: string
|
|
Full Usage:
tryLoadLibraryProject libPath
Parameters:
string
Returns: Result<LoadStatus list, string>
|
Load a library directory as a project: every component in it becomes a sheet, and the file it came from is where it is saved back to. The sheets come back as User whatever the .ldgm says. A library sheet materialised INTO a project is marked Library so that it is hidden and held read-only - it is one thing the user placed, not a sheet of their own design. Here the sheets ARE the design, and marking them that way would open the library into an editor that refuses to edit it. Nor is any of them the top: which component of a library is "the" design is not a question a library answers, and a flag left over from the project a component was authored in would make one of them the answer at random.
|
Full Usage:
tryLoadSheetFile filePath
Parameters:
string
Returns: Result<LoadedComponent, string>
|
|
Full Usage:
tryReadComponentFile path
Parameters:
string
Returns: Result<LibraryFile, string>
|
|
Full Usage:
tryReadComponentShape libPath name
Parameters:
string
name : string
Returns: Result<ComponentShape, string>
|
|
|
|
|
|
|
|
Full Usage:
unusedLibrarySheets ldcs
Parameters:
LoadedComponent list
Returns: LoadedComponent list
|
Library sheets no sheet instantiates any more, and so which should be dropped from the project. A library sheet used only by another library sheet of the same component is kept, since that one is reachable; the calculation is repeated until it settles so that a multi-sheet component goes in one piece. Deliberately NOT run when the instance is deleted: undo restores model snapshots, so deleting the sheet there would leave undo unable to bring it back. Sweeping when the project is saved or closed keeps deletion undoable.
|
|
|
Full Usage:
writeComponentFile libPath header body
Parameters:
string
header : LibraryHeader
body : string
Returns: Result<unit, string>
|
|
Full Usage:
writeComponentFileAt path header body
Parameters:
string
header : LibraryHeader
body : string
Returns: Result<unit, string>
|
|
Full Usage:
writeSheetFile filePath (arg2, arg3, arg4)
Parameters:
string
arg1 : CanvasState
arg2 : SavedWaveInfo option
arg3 : SheetInfo option
Returns: Result<unit, string>
|
|
Full Usage:
writeSheetFileAt timeStamp filePath (arg3, arg4, arg5)
Parameters:
DateTime
filePath : string
arg2 : CanvasState
arg3 : SavedWaveInfo option
arg4 : SheetInfo option
Returns: Result<unit, string>
|
|