Class

Node

Node(x, y, type, parent, bitWidthnullable, labelopt)

This class is responsible for all the Nodes.Nodes are connected using Wires Nodes are of 3 types; NODE_INPUT = 0; NODE_OUTPUT = 1; NODE_INTERMEDIATE = 2; Input and output nodes belong to some CircuitElement(it's parent)
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

View Source node.js, line 126

Members

# cleanDelete

backward comaptibilty?

View Source node.js, line 837

boolean

# isValueUpstream

Only relevant for NODE_OUTPUTwhether the value to the output nodewas given to it by its parent

View Source node.js, line 166

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

View Source node.js, line 180

# propagationDelay

delay in simulation of the node.

View Source node.js, line 831

Methods

# absX()

gives absolute x position of the node

View Source node.js, line 282

# absY()

gives absolute y position of the node

View Source node.js, line 289

# checkDeleted()

checks if a node has been deleted

View Source node.js, line 555

# checkHover()

this function checks if hover over the node

View Source node.js, line 465

# connect()

function to connect two nodes.

View Source node.js, line 320

# connectWireLess()

connects but doesnt draw the wire between nodes

View Source node.js, line 337

# converToIntermediate()

function to convert a node to intermediate node

View Source node.js, line 209

# delete()

function delete a node

View Source node.js, line 743

# disconnectWireLess()

disconnecting two nodes connected wirelessly

View Source node.js, line 353

# drag()

Helper fuction to move a node.

View Source node.js, line 228

# draw()

this function draw a node

View Source node.js, line 490

# isResolvable()

return true if node is connected or not connected but false if undefined.

View Source node.js, line 304

# nodeConnect()

if input nodde: it resolves the parent else: it adds all the nodes onto the stack and they are processed to generate verilog

View Source node.js, line 777

# refresh()

Refreshes a node after roation of parent

View Source node.js, line 270

# reset()

function used to reset the nodes

View Source node.js, line 311

# resolve()

function to resolve a node

View Source node.js, line 363

# saveObject()

Function for saving a node

View Source node.js, line 236

# setLabel(label)

Parameters:
Name Type Description
label string new label Function to set label

View Source node.js, line 202

# setOutputsUpstream()

This function is only intended for CircuitElements. Therfore should stay empty in Node.

View Source node.js, line 458

# startDragging()

Helper fuction to move a node. Sets up some variable which help in changing node.

View Source node.js, line 220

# 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.

View Source node.js, line 564

# updateRotation()

helper function to help rotating parent

View Source node.js, line 259

# updateScope()

update the scope of a node

View Source node.js, line 296