Class: HLAIM

HLAIM

Provides methods for creating and destroying connections to headlamp aim equipment via a serial port.


Example
var hlaim = $wat.load('hlaim')[0];

Methods


createDevice(port [, name])

Create a new instance of a hlaim.HLAIMDevice using the supplied serial port.

The object created will be cleaned up automatically, but only when the page reloads. If these objects are re-created without reloading the page, then they must be deleted using deleteDevice, otherwise a memory leak will occur.

Parameters:
Name Type Argument Default Description
port wat.SerialPort

The serial port to use for communications.

name string <optional>
""

If specified, the object returned will also be accessible as a property of this object, with the same name as the new device.

Since:
  • 1.0 (WAT 1.2)
Returns:
Type
hlaim.HLAIMDevice

deleteDevice(dev)

Delete a previously created device.

Parameters:
Name Type Description
dev hlaim.HLAIMDevice

The device to delete.

Since:
  • 1.0 (WAT 1.2)

judgementString(judgment)

Converts a judgement result from hlaim.HLAIMDevice#event:resultData to a string.

Parameters:
Name Type Description
judgment number

Judgment value from the result data.

Since:
  • 1.0 (WAT 1.2)
Returns:

A string representation of the result.

Type
string