Header menu logo issie

RegenerateIds Module

Give every component, port and connection on one sheet a fresh uuid, rewriting every reference to the old ones. Used when a sheet is copied (Import / Duplicate Sheet), and to repair projects in which two sheets were given the same ids by an earlier copy. Ids are unique within a sheet only, but a few places (waveform sheet labels, wire highlighting) assume they are unique across the whole project.

Functions and values

Function or value Description

correctDuplicateIds ldcs

Full Usage: correctDuplicateIds ldcs

Parameters:
Returns: LoadedComponent list * string list

Scan sheets in order. Any sheet reusing a component or connection id already seen on an earlier sheet has all of its ids regenerated and is marked as needing saving. Returns the sheets, and the names of those that were changed.

ldcs : LoadedComponent list
Returns: LoadedComponent list * string list

makeIdMap (arg1, arg2)

Full Usage: makeIdMap (arg1, arg2)

Parameters:
Returns: Map<string, string>

old id -> fresh uuid, for every component id, port id and connection id on the sheet. One map serves all three: uuids are globally unique so the kinds cannot collide.

arg0 : Component list
arg1 : Connection list
Returns: Map<string, string>

regenerateSheetIds ldc

Full Usage: regenerateSheetIds ldc

Parameters:
Returns: LoadedComponent

Regenerate every id on a sheet, including the parameter slots and saved waveform selection which live on the LoadedComponent rather than in its CanvasState.

ldc : LoadedComponent
Returns: LoadedComponent

remapCanvasState idMap (arg2, arg3)

Full Usage: remapCanvasState idMap (arg2, arg3)

Parameters:
Returns: CanvasState

Apply an id map to a canvas: component ids, port ids and host ids, symbol layout maps, parameter slots, connection ids and endpoints. Geometry and labels are untouched.

idMap : Map<string, string>
arg1 : Component list
arg2 : Connection list
Returns: CanvasState

Type something to start searching.