@zaber/motion 4.7.1 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/device.d.ts +7 -0
- package/dist/lib/ascii/device.js +9 -0
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/ascii/index.d.ts +7 -0
- package/dist/lib/ascii/index.js +15 -1
- package/dist/lib/ascii/index.js.map +1 -1
- package/dist/lib/ascii/trigger.d.ts +134 -0
- package/dist/lib/ascii/trigger.js +302 -0
- package/dist/lib/ascii/trigger.js.map +1 -0
- package/dist/lib/ascii/trigger_action.d.ts +8 -0
- package/dist/lib/ascii/trigger_action.js +15 -0
- package/dist/lib/ascii/trigger_action.js.map +1 -0
- package/dist/lib/ascii/trigger_condition.d.ts +11 -0
- package/dist/lib/ascii/trigger_condition.js +18 -0
- package/dist/lib/ascii/trigger_condition.js.map +1 -0
- package/dist/lib/ascii/trigger_enabled_state.d.ts +19 -0
- package/dist/lib/ascii/trigger_enabled_state.js +18 -0
- package/dist/lib/ascii/trigger_enabled_state.js.map +1 -0
- package/dist/lib/ascii/trigger_operation.d.ts +8 -0
- package/dist/lib/ascii/trigger_operation.js +15 -0
- package/dist/lib/ascii/trigger_operation.js.map +1 -0
- package/dist/lib/ascii/trigger_state.d.ts +28 -0
- package/dist/lib/ascii/trigger_state.js +21 -0
- package/dist/lib/ascii/trigger_state.js.map +1 -0
- package/dist/lib/ascii/triggers.d.ts +43 -0
- package/dist/lib/ascii/triggers.js +107 -0
- package/dist/lib/ascii/triggers.js.map +1 -0
- package/dist/lib/ascii_ns.d.ts +14 -0
- package/dist/lib/ascii_ns.js +7 -0
- package/dist/lib/ascii_ns.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +542 -0
- package/dist/lib/protobufs/main_pb.js +4136 -0
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/package.json +1 -1
|
Binary file
|
|
@@ -16,6 +16,7 @@ import { PvtBuffer } from './pvt_buffer';
|
|
|
16
16
|
import { Measurement } from '../measurement';
|
|
17
17
|
import { FirmwareVersion } from '../firmware_version';
|
|
18
18
|
import { DeviceStorage } from './storage';
|
|
19
|
+
import { Triggers } from './triggers';
|
|
19
20
|
/**
|
|
20
21
|
* Represents the controller part of one device - may be either a standalone controller or an integrated controller.
|
|
21
22
|
*/
|
|
@@ -98,6 +99,12 @@ export declare class Device {
|
|
|
98
99
|
* User-assigned label of the device.
|
|
99
100
|
*/
|
|
100
101
|
get label(): string;
|
|
102
|
+
/**
|
|
103
|
+
* Triggers for this device.
|
|
104
|
+
* Requires at least Firmware 7.06.
|
|
105
|
+
*/
|
|
106
|
+
get triggers(): Triggers;
|
|
107
|
+
private _triggers;
|
|
101
108
|
constructor(connection: Connection, deviceAddress: number);
|
|
102
109
|
/**
|
|
103
110
|
* Queries the device and the database, gathering information about the product.
|
package/dist/lib/ascii/device.js
CHANGED
|
@@ -44,6 +44,7 @@ const measurement_1 = require("../measurement");
|
|
|
44
44
|
const firmware_version_1 = require("../firmware_version");
|
|
45
45
|
const gateway = __importStar(require("../gateway"));
|
|
46
46
|
const storage_1 = require("./storage");
|
|
47
|
+
const triggers_1 = require("./triggers");
|
|
47
48
|
/**
|
|
48
49
|
* Represents the controller part of one device - may be either a standalone controller or an integrated controller.
|
|
49
50
|
*/
|
|
@@ -152,6 +153,13 @@ class Device {
|
|
|
152
153
|
get label() {
|
|
153
154
|
return this._retrieveLabel();
|
|
154
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Triggers for this device.
|
|
158
|
+
* Requires at least Firmware 7.06.
|
|
159
|
+
*/
|
|
160
|
+
get triggers() {
|
|
161
|
+
return this._triggers;
|
|
162
|
+
}
|
|
155
163
|
constructor(connection, deviceAddress) {
|
|
156
164
|
this._connection = connection;
|
|
157
165
|
this._deviceAddress = deviceAddress;
|
|
@@ -161,6 +169,7 @@ class Device {
|
|
|
161
169
|
this._allAxes = new all_axes_1.AllAxes(this);
|
|
162
170
|
this._warnings = new warnings_1.Warnings(this, 0);
|
|
163
171
|
this._oscilloscope = new oscilloscope_1.Oscilloscope(this);
|
|
172
|
+
this._triggers = new triggers_1.Triggers(this);
|
|
164
173
|
}
|
|
165
174
|
/**
|
|
166
175
|
* Queries the device and the database, gathering information about the product.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,uDAAmD;AACnD,iCAA8B;AAC9B,yCAAqC;AACrC,yCAAsC;AACtC,uDAAmD;AACnD,2CAAuC;AACvC,yCAAsC;AACtC,yCAAsC;AACtC,iDAA8C;AAC9C,qCAAkC;AAClC,mDAA+C;AAC/C,mFAA4E;AAC5E,iDAA6C;AAC7C,6CAAyC;AACzC,gDAA6C;AAC7C,0DAAsD;AACtD,oDAAsC;AACtC,uCAA0C;AAE1C;;GAEG;AACH,MAAa,MAAM;IACjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;;OAGG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAGD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;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C;QACnD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACtC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE5B,MAAM,OAAO,CAAC,SAAS,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,gCAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACK,qBAAqB;QAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,0BAA0B,EAC1B,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AA/gBD,wBA+gBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { Stream } from './stream';\nimport { StreamBuffer } from './stream_buffer';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { PvtSequence } from './pvt_sequence';\nimport { PvtBuffer } from './pvt_buffer';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport { DeviceStorage } from './storage';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request = new gateway.DeviceIdentifyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setAssumeVersion(FirmwareVersion.toProtobuf(assumeVersion));\n\n const response = await gateway.callAsync<gateway.DeviceIdentity>(\n 'device/identify',\n request,\n gateway.DeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponse>(\n 'interface/generic_command',\n request,\n gateway.GenericCommandResponse);\n return Response.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n gateway.GenericCommandResponseCollection);\n return response.getResponsesList().map(a => Response.fromProtobuf(a.toObject()));\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request = new gateway.PrepareCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommandTemplate(commandTemplate);\n request.setParametersList(parameters.map(Measurement.toProtobuf));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/prepare_command',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request = new gateway.DeviceSetStorageRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setValue(label);\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/get_label',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request = new gateway.AxisToStringRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/device_to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Gets a Stream class instance which allows you to control a particular stream on the device.\n * @param streamId The ID of the stream to control. Stream IDs start at one.\n * @returns Stream instance.\n */\n public getStream(\n streamId: number\n ): Stream {\n if (streamId <= 0) {\n throw new TypeError('Invalid value; streams are numbered from 1.');\n }\n return new Stream(this, streamId);\n }\n\n /**\n * Gets a StreamBuffer class instance which is a handle for a stream buffer on the device.\n * @param streamBufferId The ID of the stream buffer to control. Stream buffer IDs start at one.\n * @returns StreamBuffer instance.\n */\n public getStreamBuffer(\n streamBufferId: number\n ): StreamBuffer {\n if (streamBufferId <= 0) {\n throw new TypeError('Invalid value; stream buffers are numbered from 1.');\n }\n return new StreamBuffer(this, streamBufferId);\n }\n\n /**\n * Gets a PvtSequence class instance which allows you to control a particular PVT sequence on the device.\n * @param pvtId The ID of the PVT sequence to control. The IDs start at 1.\n * @returns PvtSequence instance.\n */\n public getPvt(\n pvtId: number\n ): PvtSequence {\n if (pvtId <= 0) {\n throw new TypeError('Invalid value; PVT sequences are numbered from 1.');\n }\n return new PvtSequence(this, pvtId);\n }\n\n /**\n * Gets a PvtBuffer class instance which is a handle for a PVT buffer on the device.\n * @param pvtBufferId The ID of the PVT buffer to control. PVT buffer IDs start at one.\n * @returns PvtBuffer instance.\n */\n public getPvtBuffer(\n pvtBufferId: number\n ): PvtBuffer {\n if (pvtBufferId <= 0) {\n throw new TypeError('Invalid value; PVT buffers are numbered from 1.');\n }\n return new PvtBuffer(this, pvtBufferId);\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.StringResponse>(\n 'device/get_state',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<void> {\n const {\n deviceOnly = false,\n } = options;\n const request = new gateway.SetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n request.setDeviceOnly(deviceOnly);\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request = new gateway.CanSetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n\n const response = await gateway.callAsync<gateway.CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n gateway.CanSetStateDeviceResponse);\n return CanSetStateDeviceResponse.fromProtobuf(response.toObject());\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request = new gateway.WaitToRespondRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setTimeout(timeout);\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.DeviceIdentity>(\n 'device/get_identity',\n request,\n gateway.DeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.BoolResponse>(\n 'device/get_is_identified',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n axis?: number;\n }\n export interface SetStateOptions {\n deviceOnly?: boolean;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/ascii/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,uDAAmD;AACn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E,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACK,iBAAiB;QACvB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,qBAAqB,EACrB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,gCAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACK,qBAAqB;QAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,0BAA0B,EAC1B,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAzhBD,wBAyhBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Connection } from './connection';\nimport { DeviceSettings } from './device_settings';\nimport { Axis } from './axis';\nimport { AllAxes } from './all_axes';\nimport { Warnings } from './warnings';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceIO } from './device_io';\nimport { Response } from './response';\nimport { Lockstep } from './lockstep';\nimport { Oscilloscope } from './oscilloscope';\nimport { Stream } from './stream';\nimport { StreamBuffer } from './stream_buffer';\nimport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nimport { PvtSequence } from './pvt_sequence';\nimport { PvtBuffer } from './pvt_buffer';\nimport { Measurement } from '../measurement';\nimport { FirmwareVersion } from '../firmware_version';\nimport * as gateway from '../gateway';\nimport { DeviceStorage } from './storage';\nimport { Triggers } from './triggers';\n\n/**\n * Represents the controller part of one device - may be either a standalone controller or an integrated controller.\n */\nexport class Device {\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * The device address uniquely identifies the device on the connection.\n * It can be configured or automatically assigned by the renumber command.\n */\n public get deviceAddress(): number {\n return this._deviceAddress;\n }\n private _deviceAddress: number;\n\n /**\n * Settings and properties of this device.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\n\n /**\n * Key-value storage of this device.\n */\n public get storage(): DeviceStorage {\n return this._storage;\n }\n private _storage: DeviceStorage;\n\n /**\n * I/O channels of this device.\n */\n public get io(): DeviceIO {\n return this._io;\n }\n private _io: DeviceIO;\n\n /**\n * Virtual axis which allows you to target all axes of this device.\n */\n public get allAxes(): AllAxes {\n return this._allAxes;\n }\n private _allAxes: AllAxes;\n\n /**\n * Warnings and faults of this device and all its axes.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n /**\n * Identity of the device.\n */\n public get identity(): DeviceIdentity {\n return this._retrieveIdentity();\n }\n\n /**\n * Indicates whether or not the device has been identified.\n */\n public get isIdentified(): boolean {\n return this._retrieveIsIdentified();\n }\n\n /**\n * Oscilloscope recording helper for this device.\n * Requires at least Firmware 7.00.\n */\n public get oscilloscope(): Oscilloscope {\n return this._oscilloscope;\n }\n private _oscilloscope: Oscilloscope;\n\n /**\n * Unique ID of the device hardware.\n */\n public get deviceId(): number {\n return this.identity.deviceId;\n }\n\n /**\n * Serial number of the device.\n */\n public get serialNumber(): number {\n return this.identity.serialNumber;\n }\n\n /**\n * Name of the product.\n */\n public get name(): string {\n return this.identity.name;\n }\n\n /**\n * Number of axes this device has.\n */\n public get axisCount(): number {\n return this.identity.axisCount;\n }\n\n /**\n * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * The device is an integrated product.\n */\n public get isIntegrated(): boolean {\n return this.identity.isIntegrated;\n }\n\n /**\n * User-assigned label of the device.\n */\n public get label(): string {\n return this._retrieveLabel();\n }\n\n /**\n * Triggers for this device.\n * Requires at least Firmware 7.06.\n */\n public get triggers(): Triggers {\n return this._triggers;\n }\n private _triggers: Triggers;\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._deviceAddress = deviceAddress;\n this._settings = new DeviceSettings(this);\n this._storage = new DeviceStorage(this);\n this._io = new DeviceIO(this);\n this._allAxes = new AllAxes(this);\n this._warnings = new Warnings(this, 0);\n this._oscilloscope = new Oscilloscope(this);\n this._triggers = new Triggers(this);\n }\n\n /**\n * Queries the device and the database, gathering information about the product.\n * Without this information features such as unit conversions will not work.\n * Usually, called automatically by detect devices method.\n * @param options.assumeVersion The identification assumes the specified firmware version\n * instead of the version queried from the device.\n * Providing this argument can lead to unexpected compatibility issues.\n * @returns Device identification data.\n */\n public async identify(\n options: Device.IdentifyOptions = {}\n ): Promise<DeviceIdentity> {\n const {\n assumeVersion,\n } = options;\n const request = new gateway.DeviceIdentifyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setAssumeVersion(FirmwareVersion.toProtobuf(assumeVersion));\n\n const response = await gateway.callAsync<gateway.DeviceIdentity>(\n 'device/identify',\n request,\n gateway.DeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: string,\n options: Device.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponse>(\n 'interface/generic_command',\n request,\n gateway.GenericCommandResponse);\n return Response.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this device and expect multiple responses.\n * Responses are returned in order of arrival.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.\n * @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.\n * Overrides the connection default request timeout.\n * @returns All responses to the command.\n */\n public async genericCommandMultiResponse(\n command: string,\n options: Device.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n axis = 0,\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n request.setCheckErrors(checkErrors);\n request.setTimeout(timeout);\n\n const response = await gateway.callAsync<gateway.GenericCommandResponseCollection>(\n 'interface/generic_command_multi_response',\n request,\n gateway.GenericCommandResponseCollection);\n return response.getResponsesList().map(a => Response.fromProtobuf(a.toObject()));\n }\n\n /**\n * Sends a generic ASCII command to this device without expecting a response and without adding a message ID\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param command Command and its parameters.\n * @param [options.axis=0] Optional axis number to send the command to.\n * Specifying -1 omits the number completely.\n */\n public async genericCommandNoResponse(\n command: string,\n options: Device.GenericCommandNoResponseOptions = {}\n ): Promise<void> {\n const {\n axis = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommand(command);\n request.setAxis(axis);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Gets an Axis class instance which allows you to control a particular axis on this device.\n * Axes are numbered from 1.\n * @param axisNumber Number of axis intended to control.\n * @returns Axis instance.\n */\n public getAxis(\n axisNumber: number\n ): Axis {\n if (axisNumber <= 0) {\n throw new TypeError('Invalid value; physical axes are numbered from 1.');\n }\n return new Axis(this, axisNumber);\n }\n\n /**\n * Gets a Lockstep class instance which allows you to control a particular lockstep group on the device.\n * Requires at least Firmware 6.15 or 7.11.\n * @param lockstepGroupId The ID of the lockstep group to control. Lockstep group IDs start at one.\n * @returns Lockstep instance.\n */\n public getLockstep(\n lockstepGroupId: number\n ): Lockstep {\n if (lockstepGroupId <= 0) {\n throw new TypeError('Invalid value; lockstep groups are numbered from 1.');\n }\n return new Lockstep(this, lockstepGroupId);\n }\n\n /**\n * Formats parameters into a command and performs unit conversions.\n * Parameters in the command template are denoted by a question mark.\n * Command returned is only valid for this device.\n * For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).\n * @param commandTemplate Template of a command to prepare. Parameters are denoted by question marks.\n * @param parameters Variable number of command parameters.\n * @returns Command with converted parameters.\n */\n public prepareCommand(\n commandTemplate: string,\n ...parameters: Measurement[]\n ): string {\n const request = new gateway.PrepareCommandRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setCommandTemplate(commandTemplate);\n request.setParametersList(parameters.map(Measurement.toProtobuf));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/prepare_command',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Sets the user-assigned device label.\n * The label is stored on the controller and recognized by other software.\n * @param label Label to set.\n */\n public async setLabel(\n label: string\n ): Promise<void> {\n const request = new gateway.DeviceSetStorageRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setValue(label);\n\n await gateway.callAsync('device/set_label', request);\n }\n\n /**\n * Gets the device name.\n * @returns The label.\n */\n private _retrieveLabel(): string {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/get_label',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request = new gateway.AxisToStringRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'device/device_to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Gets a Stream class instance which allows you to control a particular stream on the device.\n * @param streamId The ID of the stream to control. Stream IDs start at one.\n * @returns Stream instance.\n */\n public getStream(\n streamId: number\n ): Stream {\n if (streamId <= 0) {\n throw new TypeError('Invalid value; streams are numbered from 1.');\n }\n return new Stream(this, streamId);\n }\n\n /**\n * Gets a StreamBuffer class instance which is a handle for a stream buffer on the device.\n * @param streamBufferId The ID of the stream buffer to control. Stream buffer IDs start at one.\n * @returns StreamBuffer instance.\n */\n public getStreamBuffer(\n streamBufferId: number\n ): StreamBuffer {\n if (streamBufferId <= 0) {\n throw new TypeError('Invalid value; stream buffers are numbered from 1.');\n }\n return new StreamBuffer(this, streamBufferId);\n }\n\n /**\n * Gets a PvtSequence class instance which allows you to control a particular PVT sequence on the device.\n * @param pvtId The ID of the PVT sequence to control. The IDs start at 1.\n * @returns PvtSequence instance.\n */\n public getPvt(\n pvtId: number\n ): PvtSequence {\n if (pvtId <= 0) {\n throw new TypeError('Invalid value; PVT sequences are numbered from 1.');\n }\n return new PvtSequence(this, pvtId);\n }\n\n /**\n * Gets a PvtBuffer class instance which is a handle for a PVT buffer on the device.\n * @param pvtBufferId The ID of the PVT buffer to control. PVT buffer IDs start at one.\n * @returns PvtBuffer instance.\n */\n public getPvtBuffer(\n pvtBufferId: number\n ): PvtBuffer {\n if (pvtBufferId <= 0) {\n throw new TypeError('Invalid value; PVT buffers are numbered from 1.');\n }\n return new PvtBuffer(this, pvtBufferId);\n }\n\n /**\n * Returns a serialization of the current device state that can be saved and reapplied.\n * @returns A serialization of the current state of the device.\n */\n public async getState(): Promise<string> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = await gateway.callAsync<gateway.StringResponse>(\n 'device/get_state',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n\n /**\n * Applies a saved state to this device.\n * @param state The state object to apply to this device.\n * @param [options.deviceOnly=false] If true, only device scope settings and features will be set.\n */\n public async setState(\n state: string,\n options: Device.SetStateOptions = {}\n ): Promise<void> {\n const {\n deviceOnly = false,\n } = options;\n const request = new gateway.SetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n request.setDeviceOnly(deviceOnly);\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this device.\n * This only covers exceptions that can be determined statically such as mismatches of ID or version,\n * the process of applying the state can still fail when running.\n * @param state The state object to check against.\n * @returns An object listing errors that come up when trying to set the state.\n */\n public async canSetState(\n state: string\n ): Promise<CanSetStateDeviceResponse> {\n const request = new gateway.CanSetStateRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setState(state);\n\n const response = await gateway.callAsync<gateway.CanSetStateDeviceResponse>(\n 'device/can_set_state',\n request,\n gateway.CanSetStateDeviceResponse);\n return CanSetStateDeviceResponse.fromProtobuf(response.toObject());\n }\n\n /**\n * Waits for the device to start responding to messages.\n * Useful to call after resetting the device.\n * Throws RequestTimeoutException upon timeout.\n * @param timeout For how long to wait in milliseconds for the device to start responding.\n */\n public async waitToRespond(\n timeout: number\n ): Promise<void> {\n const request = new gateway.WaitToRespondRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n request.setTimeout(timeout);\n\n await gateway.callAsync('device/wait_to_respond', request);\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.DeviceIdentity>(\n 'device/get_identity',\n request,\n gateway.DeviceIdentity);\n return DeviceIdentity.fromProtobuf(response.toObject());\n }\n\n /**\n * Returns whether or not the device have been identified.\n * @returns True if the device has already been identified. False otherwise.\n */\n private _retrieveIsIdentified(): boolean {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setDevice(this.deviceAddress);\n\n const response = gateway.callSync<gateway.BoolResponse>(\n 'device/get_is_identified',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n}\n\nnamespace Device {\n export interface IdentifyOptions {\n assumeVersion?: FirmwareVersion;\n }\n export interface GenericCommandOptions {\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n axis?: number;\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandNoResponseOptions {\n axis?: number;\n }\n export interface SetStateOptions {\n deviceOnly?: boolean;\n }\n}\n"]}
|
|
@@ -49,3 +49,10 @@ export { CanSetStateDeviceResponse } from './can_set_state_device_response';
|
|
|
49
49
|
export { PvtAxisDefinition } from './pvt_axis_definition';
|
|
50
50
|
export { PvtAxisType } from './pvt_axis_type';
|
|
51
51
|
export { AxisGroup } from './axis_group';
|
|
52
|
+
export { Triggers } from './triggers';
|
|
53
|
+
export { Trigger } from './trigger';
|
|
54
|
+
export { TriggerState } from './trigger_state';
|
|
55
|
+
export { TriggerEnabledState } from './trigger_enabled_state';
|
|
56
|
+
export { TriggerAction } from './trigger_action';
|
|
57
|
+
export { TriggerCondition } from './trigger_condition';
|
|
58
|
+
export { TriggerOperation } from './trigger_operation';
|
package/dist/lib/ascii/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PvtAxisDefinition = exports.CanSetStateDeviceResponse = exports.CanSetStateAxisResponse = exports.ConversionFactor = exports.DeviceStorage = exports.AxisStorage = exports.SimpleTuningParamDefinition = exports.ServoTuningParam = exports.PidTuning = exports.ParamsetInfo = exports.ServoTuningParamset = exports.ServoTuner = exports.Transport = exports.PvtMode = exports.PvtBuffer = exports.PvtSequence = exports.StreamAxisDefinition = exports.StreamAxisType = exports.StreamMode = exports.StreamBuffer = exports.Stream = exports.OscilloscopeDataSource = exports.OscilloscopeData = exports.OscilloscopeCaptureProperties = exports.Oscilloscope = exports.LockstepAxes = exports.Lockstep = exports.Warnings = exports.WarningFlags = exports.UnknownResponseEvent = exports.SettingConstants = exports.Response = exports.MessageType = exports.IoPortType = exports.DeviceIOInfo = exports.DeviceIO = exports.Device = exports.GetAxisSettingResult = exports.GetSettingResult = exports.GetAxisSetting = exports.GetSetting = exports.DeviceSettings = exports.DeviceIdentity = exports.Connection = exports.Axis = exports.AxisType = exports.AxisSettings = exports.AxisIdentity = exports.AllAxes = exports.AlertEvent = void 0;
|
|
4
|
-
exports.AxisGroup = exports.PvtAxisType = void 0;
|
|
4
|
+
exports.TriggerOperation = exports.TriggerCondition = exports.TriggerAction = exports.TriggerEnabledState = exports.TriggerState = exports.Trigger = exports.Triggers = exports.AxisGroup = exports.PvtAxisType = void 0;
|
|
5
5
|
var alert_event_1 = require("./alert_event");
|
|
6
6
|
Object.defineProperty(exports, "AlertEvent", { enumerable: true, get: function () { return alert_event_1.AlertEvent; } });
|
|
7
7
|
var all_axes_1 = require("./all_axes");
|
|
@@ -105,4 +105,18 @@ var pvt_axis_type_1 = require("./pvt_axis_type");
|
|
|
105
105
|
Object.defineProperty(exports, "PvtAxisType", { enumerable: true, get: function () { return pvt_axis_type_1.PvtAxisType; } });
|
|
106
106
|
var axis_group_1 = require("./axis_group");
|
|
107
107
|
Object.defineProperty(exports, "AxisGroup", { enumerable: true, get: function () { return axis_group_1.AxisGroup; } });
|
|
108
|
+
var triggers_1 = require("./triggers");
|
|
109
|
+
Object.defineProperty(exports, "Triggers", { enumerable: true, get: function () { return triggers_1.Triggers; } });
|
|
110
|
+
var trigger_1 = require("./trigger");
|
|
111
|
+
Object.defineProperty(exports, "Trigger", { enumerable: true, get: function () { return trigger_1.Trigger; } });
|
|
112
|
+
var trigger_state_1 = require("./trigger_state");
|
|
113
|
+
Object.defineProperty(exports, "TriggerState", { enumerable: true, get: function () { return trigger_state_1.TriggerState; } });
|
|
114
|
+
var trigger_enabled_state_1 = require("./trigger_enabled_state");
|
|
115
|
+
Object.defineProperty(exports, "TriggerEnabledState", { enumerable: true, get: function () { return trigger_enabled_state_1.TriggerEnabledState; } });
|
|
116
|
+
var trigger_action_1 = require("./trigger_action");
|
|
117
|
+
Object.defineProperty(exports, "TriggerAction", { enumerable: true, get: function () { return trigger_action_1.TriggerAction; } });
|
|
118
|
+
var trigger_condition_1 = require("./trigger_condition");
|
|
119
|
+
Object.defineProperty(exports, "TriggerCondition", { enumerable: true, get: function () { return trigger_condition_1.TriggerCondition; } });
|
|
120
|
+
var trigger_operation_1 = require("./trigger_operation");
|
|
121
|
+
Object.defineProperty(exports, "TriggerOperation", { enumerable: true, get: function () { return trigger_operation_1.TriggerOperation; } });
|
|
108
122
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;;AAAA,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uCA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AAA;AACrB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,qCAAuD;AAA9C,sGAAA,WAAW,OAAA;AAAE,wGAAA,aAAa,OAAA;AACnC,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA","sourcesContent":["export { AlertEvent } from './alert_event';\nexport { AllAxes } from './all_axes';\nexport { AxisIdentity } from './axis_identity';\nexport { AxisSettings } from './axis_settings';\nexport { AxisType } from './axis_type';\nexport { Axis } from './axis';\nexport { Connection } from './connection';\nexport { DeviceIdentity } from './device_identity';\nexport { DeviceSettings } from './device_settings';\nexport { GetSetting } from './get_setting';\nexport { GetAxisSetting } from './get_axis_setting';\nexport { GetSettingResult } from './get_setting_result';\nexport { GetAxisSettingResult } from './get_axis_setting_result';\nexport { Device } from './device';\nexport { DeviceIO } from './device_io';\nexport { DeviceIOInfo } from './device_io_info';\nexport { IoPortType } from './io_port_type';\nexport { MessageType } from './message_type';\nexport { Response } from './response';\nexport { SettingConstants } from './setting_constants';\nexport { UnknownResponseEvent } from './unknown_response_event';\nexport { WarningFlags } from './warning_flags';\nexport { Warnings } from './warnings';\nexport { Lockstep } from './lockstep';\nexport { LockstepAxes } from './lockstep_axes';\nexport { Oscilloscope } from './oscilloscope';\nexport { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';\nexport { OscilloscopeData } from './oscilloscope_data';\nexport { OscilloscopeDataSource } from './oscilloscope_data_source';\nexport { Stream } from './stream';\nexport { StreamBuffer } from './stream_buffer';\nexport { StreamMode } from './stream_mode';\nexport { StreamAxisType } from './stream_axis_type';\nexport { StreamAxisDefinition } from './stream_axis_definition';\nexport { PvtSequence } from './pvt_sequence';\nexport { PvtBuffer } from './pvt_buffer';\nexport { PvtMode } from './pvt_mode';\nexport { Transport } from './transport';\nexport { ServoTuner } from './servo_tuner';\nexport { ServoTuningParamset } from './servo_tuning_paramset';\nexport { ParamsetInfo } from './paramset_info';\nexport { PidTuning } from './pid_tuning';\nexport { ServoTuningParam } from './servo_tuning_param';\nexport { SimpleTuningParamDefinition } from './simple_tuning_param_definition';\nexport { AxisStorage, DeviceStorage } from './storage';\nexport { ConversionFactor } from './conversion_factor';\nexport { CanSetStateAxisResponse } from './can_set_state_axis_response';\nexport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nexport { PvtAxisDefinition } from './pvt_axis_definition';\nexport { PvtAxisType } from './pvt_axis_type';\nexport { AxisGroup } from './axis_group';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ascii/index.ts"],"names":[],"mappings":";;;;AAAA,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,yCAAu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AAA;AAC7B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA;AACnB,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,mFAA+E;AAAtE,6IAAA,2BAA2B,OAAA;AACpC,qCAAuD;AAA9C,sGAAA,WAAW,OAAA;AAAE,wGAAA,aAAa,OAAA;AACnC,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,2CAAyC;AAAhC,uGAAA,SAAS,OAAA;AAClB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA","sourcesContent":["export { AlertEvent } from './alert_event';\nexport { AllAxes } from './all_axes';\nexport { AxisIdentity } from './axis_identity';\nexport { AxisSettings } from './axis_settings';\nexport { AxisType } from './axis_type';\nexport { Axis } from './axis';\nexport { Connection } from './connection';\nexport { DeviceIdentity } from './device_identity';\nexport { DeviceSettings } from './device_settings';\nexport { GetSetting } from './get_setting';\nexport { GetAxisSetting } from './get_axis_setting';\nexport { GetSettingResult } from './get_setting_result';\nexport { GetAxisSettingResult } from './get_axis_setting_result';\nexport { Device } from './device';\nexport { DeviceIO } from './device_io';\nexport { DeviceIOInfo } from './device_io_info';\nexport { IoPortType } from './io_port_type';\nexport { MessageType } from './message_type';\nexport { Response } from './response';\nexport { SettingConstants } from './setting_constants';\nexport { UnknownResponseEvent } from './unknown_response_event';\nexport { WarningFlags } from './warning_flags';\nexport { Warnings } from './warnings';\nexport { Lockstep } from './lockstep';\nexport { LockstepAxes } from './lockstep_axes';\nexport { Oscilloscope } from './oscilloscope';\nexport { OscilloscopeCaptureProperties } from './oscilloscope_capture_properties';\nexport { OscilloscopeData } from './oscilloscope_data';\nexport { OscilloscopeDataSource } from './oscilloscope_data_source';\nexport { Stream } from './stream';\nexport { StreamBuffer } from './stream_buffer';\nexport { StreamMode } from './stream_mode';\nexport { StreamAxisType } from './stream_axis_type';\nexport { StreamAxisDefinition } from './stream_axis_definition';\nexport { PvtSequence } from './pvt_sequence';\nexport { PvtBuffer } from './pvt_buffer';\nexport { PvtMode } from './pvt_mode';\nexport { Transport } from './transport';\nexport { ServoTuner } from './servo_tuner';\nexport { ServoTuningParamset } from './servo_tuning_paramset';\nexport { ParamsetInfo } from './paramset_info';\nexport { PidTuning } from './pid_tuning';\nexport { ServoTuningParam } from './servo_tuning_param';\nexport { SimpleTuningParamDefinition } from './simple_tuning_param_definition';\nexport { AxisStorage, DeviceStorage } from './storage';\nexport { ConversionFactor } from './conversion_factor';\nexport { CanSetStateAxisResponse } from './can_set_state_axis_response';\nexport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nexport { PvtAxisDefinition } from './pvt_axis_definition';\nexport { PvtAxisType } from './pvt_axis_type';\nexport { AxisGroup } from './axis_group';\nexport { Triggers } from './triggers';\nexport { Trigger } from './trigger';\nexport { TriggerState } from './trigger_state';\nexport { TriggerEnabledState } from './trigger_enabled_state';\nexport { TriggerAction } from './trigger_action';\nexport { TriggerCondition } from './trigger_condition';\nexport { TriggerOperation } from './trigger_operation';\n"]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Native, Units, Length, Angle, Time } from '../units';
|
|
2
|
+
import { Device } from './device';
|
|
3
|
+
import { TriggerState } from './trigger_state';
|
|
4
|
+
import { TriggerEnabledState } from './trigger_enabled_state';
|
|
5
|
+
import { IoPortType } from './io_port_type';
|
|
6
|
+
import { TriggerCondition } from './trigger_condition';
|
|
7
|
+
import { TriggerAction } from './trigger_action';
|
|
8
|
+
import { TriggerOperation } from './trigger_operation';
|
|
9
|
+
/**
|
|
10
|
+
* A handle for a trigger with this number on the device.
|
|
11
|
+
* Triggers allow setting up actions that occur when a certain condition has been met or an event has occurred.
|
|
12
|
+
* Please note that the Triggers API is currently an experimental feature.
|
|
13
|
+
* Requires at least Firmware 7.06.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Trigger {
|
|
16
|
+
/**
|
|
17
|
+
* Device that this trigger belongs to.
|
|
18
|
+
*/
|
|
19
|
+
get device(): Device;
|
|
20
|
+
private _device;
|
|
21
|
+
/**
|
|
22
|
+
* Number of this trigger.
|
|
23
|
+
*/
|
|
24
|
+
get triggerNumber(): number;
|
|
25
|
+
private _triggerNumber;
|
|
26
|
+
constructor(device: Device, triggerNumber: number);
|
|
27
|
+
/**
|
|
28
|
+
* Enables the trigger.
|
|
29
|
+
* Once a trigger is enabled, it will fire whenever its condition transitions from false to true.
|
|
30
|
+
* If a trigger condition is true when a disabled trigger is enabled, the trigger will fire immediately.
|
|
31
|
+
* @param [count=0] Number of times the trigger will fire before disabling itself.
|
|
32
|
+
* If count is not specified, or 0, the trigger will fire indefinitely.
|
|
33
|
+
*/
|
|
34
|
+
enable(count?: number): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Disables the trigger.
|
|
37
|
+
* Once disabled, the trigger will not fire and trigger actions will not run, even if trigger conditions are met.
|
|
38
|
+
*/
|
|
39
|
+
disable(): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the state of the trigger.
|
|
42
|
+
* @returns Complete state of the trigger.
|
|
43
|
+
*/
|
|
44
|
+
getState(): Promise<TriggerState>;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the enabled state of the trigger.
|
|
47
|
+
* @returns Whether the trigger is enabled and the number of times it will fire.
|
|
48
|
+
*/
|
|
49
|
+
getEnabledState(): Promise<TriggerEnabledState>;
|
|
50
|
+
/**
|
|
51
|
+
* Set a generic trigger condition.
|
|
52
|
+
* @param condition The condition to set for this trigger.
|
|
53
|
+
*/
|
|
54
|
+
fireWhen(condition: string): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Set a trigger condition for when an encoder position has changed by a specific distance.
|
|
57
|
+
* @param axis The axis to monitor for this condition.
|
|
58
|
+
* May be set to 0 on single-axis devices only.
|
|
59
|
+
* @param dist The measured distance between trigger fires.
|
|
60
|
+
* @param [unit=Units.NATIVE] Units of dist.
|
|
61
|
+
*/
|
|
62
|
+
fireWhenEncoderDist(axis: number, dist: number, unit?: Length | Angle | Native): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Set a trigger condition for when an axis position has changed by a specific distance.
|
|
65
|
+
* @param axis The axis to monitor for this condition.
|
|
66
|
+
* May be set to 0 on single-axis devices only.
|
|
67
|
+
* @param dist The measured distance between trigger fires.
|
|
68
|
+
* @param [unit=Units.NATIVE] Units of dist.
|
|
69
|
+
*/
|
|
70
|
+
fireWhenDist(axis: number, dist: number, unit?: Length | Angle | Native): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Set a trigger condition based on an IO channel value.
|
|
73
|
+
* @param portType The type of IO channel to monitor.
|
|
74
|
+
* @param channel The IO channel to monitor.
|
|
75
|
+
* @param triggerCondition Comparison operator.
|
|
76
|
+
* @param value Comparison value.
|
|
77
|
+
*/
|
|
78
|
+
fireWhenIo(portType: IoPortType, channel: number, triggerCondition: TriggerCondition, value: number): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Set a trigger condition based on a setting value.
|
|
81
|
+
* @param axis The axis to monitor for this condition.
|
|
82
|
+
* Set to 0 for device-scope settings.
|
|
83
|
+
* @param setting The setting to monitor.
|
|
84
|
+
* @param triggerCondition Comparison operator.
|
|
85
|
+
* @param value Comparison value.
|
|
86
|
+
* @param [unit=Units.NATIVE] Units of value.
|
|
87
|
+
*/
|
|
88
|
+
fireWhenSetting(axis: number, setting: string, triggerCondition: TriggerCondition, value: number, unit?: Units): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Set a trigger condition based on a time interval.
|
|
91
|
+
* @param interval The time interval between trigger fires.
|
|
92
|
+
* @param [unit=Units.NATIVE] Units of time.
|
|
93
|
+
*/
|
|
94
|
+
fireAtInterval(interval: number, unit?: Time | Native): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Set a command to be a trigger action.
|
|
97
|
+
* @param action The action number to assign the command to.
|
|
98
|
+
* @param axis The axis to on which to run this command.
|
|
99
|
+
* Set to 0 for device-scope settings or to run command on all axes.
|
|
100
|
+
* @param command The command to run when the action is triggered.
|
|
101
|
+
*/
|
|
102
|
+
onFire(action: TriggerAction, axis: number, command: string): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Set a trigger action to update a setting.
|
|
105
|
+
* @param action The action number to assign the command to.
|
|
106
|
+
* @param axis The axis on which to change the setting.
|
|
107
|
+
* Set to 0 to change the setting for the device.
|
|
108
|
+
* @param setting The name of the setting to change.
|
|
109
|
+
* @param operation The operation to apply to the setting.
|
|
110
|
+
* @param value Operation value.
|
|
111
|
+
* @param [unit=Units.NATIVE] Units of value.
|
|
112
|
+
*/
|
|
113
|
+
onFireSet(action: TriggerAction, axis: number, setting: string, operation: TriggerOperation, value: number, unit?: Units): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Set a trigger action to update a setting with the value of another setting.
|
|
116
|
+
* @param action The action number to assign the command to.
|
|
117
|
+
* @param axis The axis on which to change the setting.
|
|
118
|
+
* Set to 0 to change the setting for the device.
|
|
119
|
+
* @param setting The name of the setting to change.
|
|
120
|
+
* Must have either integer or boolean type.
|
|
121
|
+
* @param operation The operation to apply to the setting.
|
|
122
|
+
* @param fromAxis The axis from which to read the setting.
|
|
123
|
+
* Set to 0 to read the setting for the device.
|
|
124
|
+
* @param fromSetting The name of the setting to read.
|
|
125
|
+
* Must have either integer or boolean type.
|
|
126
|
+
*/
|
|
127
|
+
onFireSetToSetting(action: TriggerAction, axis: number, setting: string, operation: TriggerOperation, fromAxis: number, fromSetting: string): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Clear a trigger action.
|
|
130
|
+
* @param [action=TriggerAction.ALL] The action number to clear.
|
|
131
|
+
* The default option is to clear all actions.
|
|
132
|
+
*/
|
|
133
|
+
clearAction(action?: TriggerAction): Promise<void>;
|
|
134
|
+
}
|