PhysicalTrafficLightSelector

selectors. PhysicalTrafficLightSelector

Selects a physical traffic light to use.

Constructor

(package) new PhysicalTrafficLightSelector(optionsopt)

Description:
  • Selects a physical traffic light to use. Checks-out and uses a specific traffic light or the first available one to issue commands.

Source:
See:
Parameters:
Name Type Attributes Description
options object <optional>

Options.

Properties
Name Type Attributes Description
manager physical.DeviceManager <optional>

The Device Manager to use.

serialNum string | number <optional>

The serial number of the traffic light to use, if available. Cleware USB traffic lights have a numeric serial number.

Extends

  • EventEmitter

Methods

close()

Description:
  • Called to close this instance and to stop monitoring for devices. Should be done as the last operation before exiting the process.

Source:
See:

logInfo(loggeropt)

Description:
  • Logs information about known devices.

Source:
Parameters:
Name Type Attributes Default Description
logger object <optional>
console

A Console-like object for logging.

resolveTrafficLight() → {physical.PhysicalTrafficLight}

Description:
  • Retrieves a traffic light for exclusive usage of the caller, or null if one could not be found or checked-out. Traffic lights are released (checked-in) when disconnected.

Source:
Returns:
  • A traffic light, or null.
Type
physical.PhysicalTrafficLight

Events

disabled

Description:
  • Traffic light disabled event. Only fired if the specific traffic light that was checked-out was disconnected.

Source:

enabled

Description:
  • Traffic light enabled event. Only fired if there's currently no checked-out traffic light.

Source: