Constructor
# new Node(x, y, type, parent, bitWidthnullable, labelopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
x |
number
|
x coord of Node | |
y |
number
|
y coord of Node | |
type |
number
|
type of node | |
parent |
CircuitElement
|
parent element | |
bitWidth |
number
|
<nullable> |
the bits of node in input and output nodes |
label |
string
|
<optional> |
label for a node |
Members
boolean
# isValueUpstream
Only relevant for NODE_OUTPUTwhether the value to the output nodewas given to it by its parent
string
# prev
value of this.prev is'a' : whenever a node is not being dragged this.prev is 'a''x' : when node is being dragged horizontally'y' : when node is being dragged vertically
Methods
# converToIntermediate()
function to convert a node to intermediate node
# isResolvable()
return true if node is connected or not connected but false if undefined.
# nodeConnect()
if input nodde: it resolves the parent
else: it adds all the nodes onto the stack
and they are processed to generate verilog
# setOutputsUpstream()
This function is only intended for CircuitElements.
Therfore should stay empty in Node.
# startDragging()
Helper fuction to move a node. Sets up some variable which help in changing node.
# update()
used to update nodes if there is a event like click or hover on the node.
many booleans are used to check if certain properties are to be updated.