Skip to main content

Unit

The Unit object represents a unit in the MES service. It defines various methods for interacting with unit properties, results, and captures.

Constructors

new Unit(): Unit;
new Unit(serial: string): Unit;
new Unit(capture: Capture): Unit;

Methods

setSerial()

Sets the serial number of the unit.

setSerial(serial: string): void;

getSerial()

Gets the serial number of the unit.

getSerial(): string;

setModel()

Sets the model of the unit.

setModel(model: string): void;

getModel()

Gets the model of the unit.

getModel(): string;

setBatch()

Sets the batch of the unit.

setBatch(batch: string): void;

getBatch()

Gets the batch of the unit.

getBatch(): string;

getProject()

Gets the project of the unit.

getProject(): string;

setUserId()

Sets the user ID of the unit.

setUserId(userId: string): void;

getUserId()

Gets the user ID of the unit.

getUserId(): string;

getCreationDate()

Gets the creation date of the unit.

getCreationDate(): number;

getModificationDate()

Gets the last modification date of the unit.

getModificationDate(): number;

Static Methods

Unit.createAutoSerial()

Creates a new serial number for a unit.

Unit.createAutoSerial(): string;

Result Methods

addResult()

Adds a result to the unit.

addResult(resultName: string, value: any): void;

getResult()

Gets the value of a result from the unit.

getResult(resultName: string): any;

hasResult()

Checks if the unit has a specific result.

hasResult(resultName: string): boolean;

removeResult()

Removes a result from the unit.

removeResult(resultName: string): void;

listResults()

Lists all results of the unit.

listResults(): string[];

Capture Methods

Each unit represents one or more Captures. With these methods, you can manage and manipulate unit captures effectively.

addCapture()

Adds a capture to the unit.

addCapture(capture: Capture): void;

getCapture()

Gets a capture from the unit.

getCapture(captureName: string): Capture;

hasCapture()

Checks if the unit has a specific capture.

hasCapture(captureName: string): boolean;

removeCapture()

Removes a capture from the unit.

removeCapture(captureName: string): void;

listCaptures()

Lists all captures of the unit.

listCaptures(): string[];