module:Wire(appInstance, fromId, toId, refreshopt)

Wire represents connection of two Connectors.

new module:Wire(appInstance, fromId, toId, refreshopt)

Parameters:
Name Type Attributes Default Description
appInstance App

instance of App

fromId string

id of the first connector this wire will be connected to

toId string

id of the second connector this wire will be connected to

refresh Boolean <optional>
true

if true, the App will refresh after creating this wire

Extends

  • NetworkElement

Members

exportData

get data of this wire as a JSON-ready object

state

get the current Logic.state of this wire

Methods

findRoute(start, end) → {PolyLinePoints}

find a nice route for the wire

Parameters:
Name Type Description
start Object

object containing numeric attributes x and y that represent the first endpoint of the wire in grid pixel

end Object

object containing numeric attributes x and y that represent the second endpoint of the wire in grid pixels

Returns:
PolyLinePoints -

[description]

generateInconvenientNodes() → {Set}

generate a set of nodes, that are inconvenient for wiring, but can be used, just are not preferred

Returns:
Set -

set of nodes (objects containing x and y coordinates) that are not preferred for wiring

get() → {jQuery.element}

get the jQuery element for this wire

Returns:
jQuery.element

getTemporaryWirePoints() → {PolyLinePoints}

get the PolyLine points for a temporary wire placement connecting the two connectors

Returns:
PolyLinePoints -

new instance of PolyLinePoints

routeWire()

route the wire using the modified A* wire routing algorithm

setState(state)

set the state of this wire to match the state of the input connector it is connected to

Parameters:
Name Type Description
state Logic.state

[description]

setWirePath(points)

set the wire to follow the specified points

Parameters:
Name Type Description
points PolyLinePoints

instance of PolyLinePoints

temporaryWire()

route the wire using the temporary wire points

updateWireState()

update the state of this wire