Constructor
# new Scope(name, idopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string
|
name of the circuit | |
id |
number
|
<optional> |
a random id for the circuit |
Methods
# centerFocus()
Function which centers the circuit to the correct zoom level
# checkDependency()
Checks if this circuit contains directly or indirectly scope with id
Recursive nature
# clockTick()
Ticks clocks recursively -- needs to be deprecated and synchronize all clocks with a global clock
# detectCycle()
Function to detect the nodes that are creating cyclic paths in the circuit
# findNodeIndexById(nodeId)
Function to find the index of a node in globalScope.allNodes
Parameters:
Name | Type | Description |
---|---|---|
nodeId |
string
|
id of a node |
# getAllSelectedComponents()
Function to find the currently selected components (when multiple components are selected) on the canvas
# getCurrentlySelectedComponent()
Function to find the currently selected component on the canvas
# getDependencies()
Get dependency list - list of all circuits, this circuit depends on
# highlightNodes(array)
Function to highlight the nodes in the currently selected circuit
Parameters:
Name | Type | Description |
---|---|---|
array |
Array.<Array>
|
id's of the nodes, that we want to highlight |
# modifyCurrentlySelectedComponent()
Function to modify the currently selected component's object in the globalScope
takes the property which needs to modify
and the modified value as parameters
# previous()
Function to retrieve the previous stable state of the circuit