Skip to main content

ComponentUtils

GetInvertedGate

GetInvertedGate(oldGate) => string

Gets the string id of the inverted version of the supplied gate.

Parameters

  •  oldGate: Gate – The gate to get the inverted version of.

Returns

  •   stringNANDGate when supplied with an ANDGate, NORGate when supplied with an ORGate, etc.

PortsToDecimal

PortsToDecimal(ports) => number

Description needed

Parameters

  •  ports: any[]Description needed

Returns

  •   numberDescription needed

LazyConnect

LazyConnect(source, destination) => DigitalWire

Connects two components together. Source must have an output and destination must have an available input. The first available port of destination will be used as the input port.

Parameters

  •  source: DigitalComponent – The source component to connect.

  •  destination: DigitalComponent – The destination component to connect.

Returns

  •   DigitalWire – The wire used to connect the components together.

IsICDataInUse

IsICDataInUse(designer, data) => false | true

Check if the given ICData is currently being used by an IC within the given DigitalCircuitDesigner.

Parameters

  •  designer: DigitalCircuitDesigner – The designer to check for usage in.

  •  data: ICData – The ICData to check for usage for.

Returns

  •   false | true – True if the ICData is being used somewhere, false otherwise.