Skip to main content

Connect

ConnectionAction

ConnectionAction represents the action of connecting two ports with a wire.


Constructor

public ConnectionAction

new ConnectionAction(designer, w)

Initializes a ConnectionAction given the CircuitDesigner and a Wire.

Parameters

  •  designer: CircuitDesigner – The CircuitDesigner this action is being done on.

  •  w: Wire – The Wire being connected.

new ConnectionAction(designer, p1, p2)

Initializes a ConnectionAction given the CircuitDesigner and two Ports.

Parameters

  •  designer: CircuitDesigner – The CircuitDesigner this action is being done on.

  •  p1: Port – The first Port being connected.

  •  p2: Port – The second Port being connected.


Properties

No publicly accessible properties on ConnectionAction

private designer: CircuitDesigner

Description needed

private wire: Wire

Description needed

private p1: Port

Description needed

private p2: Port

Description needed


Methods

public normalExecute

normalExecute() => Action

Executes the ConnectionAction by creating the Wire and connecting it to the proper Ports.

Returns

  •   Action – 'this' ConnectionAction after execution.

public normalUndo

normalUndo() => Action

Undoes the ConnectionAction by removing the Wire and disconnecting it from the two Ports.

Returns

  •   Action – 'this' ConnectionAction after undoing.

public getWire

getWire() => Wire

Gets the Wire associated with this ConnectionAction.

Returns

  •   Wire – The Wire in this connection.

public getName

getName() => string

Description needed

Returns

  •   stringDescription needed

Static Methods

No static methods for ConnectionAction


Functions

Connect

Connect(designer, p1, p2) => ConnectionAction

Description needed

Parameters

  •  designer: CircuitDesignerDescription needed

  •  p1: PortDescription needed

  •  p2: PortDescription needed

Returns

  •   ConnectionActionDescription needed

Disconnect

Disconnect(designer, wire) => ConnectionAction

Description needed

Parameters

Returns

  •   ConnectionActionDescription needed

CreateGroupDisconnectAction

CreateGroupDisconnectAction(designer, wires) => GroupAction

Creates a GroupAction of DisconnectActions.

Parameters

  •  designer: CircuitDesigner – The CircuitDesigner the actions are done on.

  •  wires: Wire[] – The Wires being disconnected.

Returns

  •   GroupAction – A GroupAction representing the DisconnectActions of each Wire.