@zaber/motion 4.0.0 → 4.2.1
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/axis.d.ts +1 -1
- package/dist/lib/ascii/axis.js +1 -1
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/device.d.ts +3 -3
- package/dist/lib/ascii/device.js +3 -3
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/ascii/device_settings.d.ts +7 -0
- package/dist/lib/ascii/device_settings.js +14 -0
- package/dist/lib/ascii/device_settings.js.map +1 -1
- package/dist/lib/ascii/index.d.ts +5 -0
- package/dist/lib/ascii/index.js +12 -1
- package/dist/lib/ascii/index.js.map +1 -1
- package/dist/lib/ascii/oscilloscope.d.ts +1 -0
- package/dist/lib/ascii/oscilloscope.js +1 -0
- package/dist/lib/ascii/oscilloscope.js.map +1 -1
- package/dist/lib/ascii/process.d.ts +138 -0
- package/dist/lib/ascii/process.js +278 -0
- package/dist/lib/ascii/process.js.map +1 -0
- package/dist/lib/ascii/process_controller.d.ts +39 -0
- package/dist/lib/ascii/process_controller.js +89 -0
- package/dist/lib/ascii/process_controller.js.map +1 -0
- package/dist/lib/ascii/process_controller_mode.d.ts +9 -0
- package/dist/lib/ascii/process_controller_mode.js +16 -0
- package/dist/lib/ascii/process_controller_mode.js.map +1 -0
- package/dist/lib/ascii/process_controller_source.d.ts +17 -0
- package/dist/lib/ascii/process_controller_source.js +53 -0
- package/dist/lib/ascii/process_controller_source.js.map +1 -0
- package/dist/lib/ascii/process_controller_source_sensor.d.ts +7 -0
- package/dist/lib/ascii/process_controller_source_sensor.js +14 -0
- package/dist/lib/ascii/process_controller_source_sensor.js.map +1 -0
- package/dist/lib/ascii/stream.d.ts +48 -16
- package/dist/lib/ascii/stream.js +76 -16
- package/dist/lib/ascii/stream.js.map +1 -1
- package/dist/lib/ascii_ns.d.ts +5 -0
- package/dist/lib/ascii_ns.js +5 -0
- package/dist/lib/ascii_ns.js.map +1 -1
- package/dist/lib/measurement.js +8 -0
- package/dist/lib/measurement.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +109 -0
- package/dist/lib/protobufs/main_pb.js +812 -3
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oscilloscope.js","sourceRoot":"","sources":["../../../src/ascii/oscilloscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAItD,2DAAuD;AACvD,oCAA+C;AAC/C,oDAAsC;AAEtC;;;;GAIG;AACH,MAAa,YAAY;IACvB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,UAAU,CACrB,IAAY,EACZ,OAAe;QAEf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,oCAAoC,EAAE,CAAC;QACnE,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE5B,MAAM,OAAO,CAAC,SAAS,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,YAAY,CACvB,MAAkB,EAClB,SAAiB;QAEjB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,+BAA+B,EAAE,CAAC;QAC9D,OAAO,CAAC,cA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3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,OAAO,CAAC,SAAS,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,IAAI;QACf,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;QACjD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,mBAAmB,EACnB,OAAO,EACP,OAAO,CAAC,wBAAwB,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,cAAc,EAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,oCAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CACF;AA5OD,oCA4OC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { IoPortType } from './io_port_type';\nimport { OscilloscopeData } from './oscilloscope_data';\nimport { Native, Time, Units } from '../units';\nimport * as gateway from '../gateway';\n\n/**\n * Provides a convenient way to control the oscilloscope data recording feature of some devices.\n * The oscilloscope can record the values of some settings over time at high resolution.\n * Requires at least Firmware 7.00.\n */\nexport class Oscilloscope {\n /**\n * Device that this Oscilloscope measures.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Select a setting to be recorded.\n * @param axis The 1-based index of the axis to record the value from.\n * @param setting The name of a setting to record.\n */\n public async addChannel(\n axis: number,\n setting: string\n ): Promise<void> {\n const request = new gateway.OscilloscopeAddSettingChannelRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(axis);\n request.setSetting(setting);\n\n await gateway.callAsync('oscilloscope/add_setting_channel', request);\n }\n\n /**\n * Select an I/O pin to be recorded.\n * @param ioType The I/O port type to read data from.\n * @param ioChannel The 1-based index of the I/O pin to read from.\n */\n public async addIoChannel(\n ioType: IoPortType,\n ioChannel: number\n ): Promise<void> {\n const request = new gateway.OscilloscopeAddIoChannelRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setIoType(ioType as any);\n request.setIoChannel(ioChannel);\n\n await gateway.callAsync('oscilloscope/add_io_channel', request);\n }\n\n /**\n * Clear the list of channels to record.\n */\n public async clear(): Promise<void> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n await gateway.callAsync('oscilloscope/clear_channels', request);\n }\n\n /**\n * Get the current sampling interval.\n * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.\n * @returns The current sampling interval in the selected time units.\n */\n public async getTimebase(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling interval.\n * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.\n * @param [unit=Units.NATIVE] Unit of measure the timebase is represented in.\n */\n public async setTimebase(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the delay before oscilloscope recording starts.\n * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.\n * @returns The current start delay in the selected time units.\n */\n public async getDelay(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling start delay.\n * @param interval Delay time between triggering a recording and the first data point being recorded.\n * @param [unit=Units.NATIVE] Unit of measure the delay is represented in.\n */\n public async setDelay(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the maximum number of channels that can be recorded.\n * @returns The maximum number of channels that can be added to an Oscilloscope recording.\n */\n public async getMaxChannels(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.numchannels');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the maximum number of samples that can be recorded per Oscilloscope channel.\n * @returns The maximum number of samples that can be recorded per Oscilloscope channel.\n */\n public async getMaxBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size.max');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the number of samples that can be recorded per channel given the current number of channels added.\n * @returns Number of samples that will be recorded per channel with the current channels. Zero if none have been added.\n */\n public async getBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Trigger data recording.\n * @param [captureLength=0] Optional number of samples to record per channel.\n * If left empty, the device records samples until the buffer fills.\n * Requires at least Firmware 7.29.\n */\n public async start(\n captureLength: number = 0\n ): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(true);\n request.setCaptureLength(captureLength);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * End data recording if currently in progress.\n */\n public async stop(): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(false);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.\n * @returns Array of recorded channel data arrays, in the order added.\n */\n public async read(): Promise<OscilloscopeData[]> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n const response = await gateway.callAsync<gateway.OscilloscopeReadResponse>(\n 'oscilloscope/read',\n request,\n gateway.OscilloscopeReadResponse);\n return response.getDataIdsList()!.map(id => new OscilloscopeData(id));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"oscilloscope.js","sourceRoot":"","sources":["../../../src/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,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,mBAAmB,EACnB,OAAO,EACP,OAAO,CAAC,wBAAwB,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,cAAc,EAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,oCAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC;CACF;AA7OD,oCA6OC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport { IoPortType } from './io_port_type';\nimport { OscilloscopeData } from './oscilloscope_data';\nimport { Native, Time, Units } from '../units';\nimport * as gateway from '../gateway';\n\n/**\n * Provides a convenient way to control the oscilloscope data recording feature of some devices.\n * The oscilloscope can record the values of some settings over time at high resolution.\n * Requires at least Firmware 7.00.\n */\nexport class Oscilloscope {\n /**\n * Device that this Oscilloscope measures.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n constructor(device: Device) {\n this._device = device;\n }\n\n /**\n * Select a setting to be recorded.\n * @param axis The 1-based index of the axis to record the value from.\n * @param setting The name of a setting to record.\n */\n public async addChannel(\n axis: number,\n setting: string\n ): Promise<void> {\n const request = new gateway.OscilloscopeAddSettingChannelRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setAxis(axis);\n request.setSetting(setting);\n\n await gateway.callAsync('oscilloscope/add_setting_channel', request);\n }\n\n /**\n * Select an I/O pin to be recorded.\n * Requires at least Firmware 7.33.\n * @param ioType The I/O port type to read data from.\n * @param ioChannel The 1-based index of the I/O pin to read from.\n */\n public async addIoChannel(\n ioType: IoPortType,\n ioChannel: number\n ): Promise<void> {\n const request = new gateway.OscilloscopeAddIoChannelRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setIoType(ioType as any);\n request.setIoChannel(ioChannel);\n\n await gateway.callAsync('oscilloscope/add_io_channel', request);\n }\n\n /**\n * Clear the list of channels to record.\n */\n public async clear(): Promise<void> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n await gateway.callAsync('oscilloscope/clear_channels', request);\n }\n\n /**\n * Get the current sampling interval.\n * @param [unit=Units.NATIVE] Unit of measure to represent the timebase in.\n * @returns The current sampling interval in the selected time units.\n */\n public async getTimebase(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling interval.\n * @param interval Sample interval for the next oscilloscope recording. Minimum value is 100µs.\n * @param [unit=Units.NATIVE] Unit of measure the timebase is represented in.\n */\n public async setTimebase(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.timebase');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the delay before oscilloscope recording starts.\n * @param [unit=Units.NATIVE] Unit of measure to represent the delay in.\n * @returns The current start delay in the selected time units.\n */\n public async getDelay(\n unit: Time | Native = Units.NATIVE\n ): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setUnit(unit);\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Set the sampling start delay.\n * @param interval Delay time between triggering a recording and the first data point being recorded.\n * @param [unit=Units.NATIVE] Unit of measure the delay is represented in.\n */\n public async setDelay(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.delay');\n request.setValue(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Get the maximum number of channels that can be recorded.\n * @returns The maximum number of channels that can be added to an Oscilloscope recording.\n */\n public async getMaxChannels(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.numchannels');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the maximum number of samples that can be recorded per Oscilloscope channel.\n * @returns The maximum number of samples that can be recorded per Oscilloscope channel.\n */\n public async getMaxBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size.max');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the number of samples that can be recorded per channel given the current number of channels added.\n * @returns Number of samples that will be recorded per channel with the current channels. Zero if none have been added.\n */\n public async getBufferSize(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('scope.channel.size');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'oscilloscope/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Trigger data recording.\n * @param [captureLength=0] Optional number of samples to record per channel.\n * If left empty, the device records samples until the buffer fills.\n * Requires at least Firmware 7.29.\n */\n public async start(\n captureLength: number = 0\n ): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(true);\n request.setCaptureLength(captureLength);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * End data recording if currently in progress.\n */\n public async stop(): Promise<void> {\n const request = new gateway.OscilloscopeStartStopRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setStart(false);\n\n await gateway.callAsync('oscilloscope/start_or_stop', request);\n }\n\n /**\n * Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.\n * @returns Array of recorded channel data arrays, in the order added.\n */\n public async read(): Promise<OscilloscopeData[]> {\n const request = new gateway.DeviceEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n\n const response = await gateway.callAsync<gateway.OscilloscopeReadResponse>(\n 'oscilloscope/read',\n request,\n gateway.OscilloscopeReadResponse);\n return response.getDataIdsList()!.map(id => new OscilloscopeData(id));\n }\n}\n"]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { ProcessController } from './process_controller';
|
|
2
|
+
import { Response } from './response';
|
|
3
|
+
import { AxisSettings } from './axis_settings';
|
|
4
|
+
import { AxisStorage } from './storage';
|
|
5
|
+
import { Warnings } from './warnings';
|
|
6
|
+
import { ProcessControllerMode } from './process_controller_mode';
|
|
7
|
+
import { ProcessControllerSource } from './process_controller_source';
|
|
8
|
+
import { Measurement } from '../measurement';
|
|
9
|
+
/**
|
|
10
|
+
* Use to drive voltage for a process such as a heater, valve, Peltier device, etc.
|
|
11
|
+
* WARNING: DO NOT USE. This API is for an as-yet unreleased product and firmware version.
|
|
12
|
+
* It is subject to breaking changes without warning until further notice.
|
|
13
|
+
* Requires at least Firmware 7.34.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Process {
|
|
16
|
+
/**
|
|
17
|
+
* Controller for this process.
|
|
18
|
+
*/
|
|
19
|
+
get controller(): ProcessController;
|
|
20
|
+
private _controller;
|
|
21
|
+
/**
|
|
22
|
+
* The process number identifies the process on the controller.
|
|
23
|
+
*/
|
|
24
|
+
get processNumber(): number;
|
|
25
|
+
private _processNumber;
|
|
26
|
+
private _axis;
|
|
27
|
+
/**
|
|
28
|
+
* Settings and properties of this process.
|
|
29
|
+
*/
|
|
30
|
+
get settings(): AxisSettings;
|
|
31
|
+
private _settings;
|
|
32
|
+
/**
|
|
33
|
+
* Key-value storage of this process.
|
|
34
|
+
*/
|
|
35
|
+
get storage(): AxisStorage;
|
|
36
|
+
private _storage;
|
|
37
|
+
/**
|
|
38
|
+
* Warnings and faults of this process.
|
|
39
|
+
*/
|
|
40
|
+
get warnings(): Warnings;
|
|
41
|
+
private _warnings;
|
|
42
|
+
constructor(controller: ProcessController, processNumber: number);
|
|
43
|
+
/**
|
|
44
|
+
* Sets the enabled state of the driver.
|
|
45
|
+
* @param [enabled=true] If true (default) enables drive. If false disables.
|
|
46
|
+
*/
|
|
47
|
+
enable(enabled?: boolean): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Turns this process on. In manual mode, this supplies voltage; in controlled mode, it starts the control loop.
|
|
50
|
+
* @param [duration=0] How long to leave the process on in milliseconds.
|
|
51
|
+
*/
|
|
52
|
+
on(duration?: number): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Turns this process off.
|
|
55
|
+
*/
|
|
56
|
+
off(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the control mode of this process.
|
|
59
|
+
* @param mode Mode to set this process to.
|
|
60
|
+
*/
|
|
61
|
+
setMode(mode: ProcessControllerMode): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Gets the control mode of this process.
|
|
64
|
+
* @returns Control mode.
|
|
65
|
+
*/
|
|
66
|
+
getMode(): Promise<ProcessControllerMode>;
|
|
67
|
+
/**
|
|
68
|
+
* Gets the source used to control this process.
|
|
69
|
+
* @returns The source providing feedback for this process.
|
|
70
|
+
*/
|
|
71
|
+
getSource(): Promise<ProcessControllerSource>;
|
|
72
|
+
/**
|
|
73
|
+
* Sets the source used to control this process.
|
|
74
|
+
* @param source Sets the source that should provide feedback for this process.
|
|
75
|
+
*/
|
|
76
|
+
setSource(source: ProcessControllerSource): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the current value of the source used to control this process.
|
|
79
|
+
* @returns The current value of this process's controlling source.
|
|
80
|
+
*/
|
|
81
|
+
getInput(): Promise<Measurement>;
|
|
82
|
+
/**
|
|
83
|
+
* Sends a generic ASCII command to this process' underlying axis.
|
|
84
|
+
* For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
85
|
+
* @param command Command and its parameters.
|
|
86
|
+
* @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.
|
|
87
|
+
* @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.
|
|
88
|
+
* Overrides the connection default request timeout.
|
|
89
|
+
* @returns A response to the command.
|
|
90
|
+
*/
|
|
91
|
+
genericCommand(command: string, options?: Process.GenericCommandOptions): Promise<Response>;
|
|
92
|
+
/**
|
|
93
|
+
* Sends a generic ASCII command to this process and expect multiple responses.
|
|
94
|
+
* Responses are returned in order of arrival.
|
|
95
|
+
* For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
96
|
+
* @param command Command and its parameters.
|
|
97
|
+
* @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.
|
|
98
|
+
* @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.
|
|
99
|
+
* Overrides the connection default request timeout.
|
|
100
|
+
* @returns All responses to the command.
|
|
101
|
+
*/
|
|
102
|
+
genericCommandMultiResponse(command: string, options?: Process.GenericCommandMultiResponseOptions): Promise<Response[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Sends a generic ASCII command to this process without expecting a response and without adding a message ID
|
|
105
|
+
* For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
106
|
+
* @param command Command and its parameters.
|
|
107
|
+
*/
|
|
108
|
+
genericCommandNoResponse(command: string): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Returns a serialization of the current process state that can be saved and reapplied.
|
|
111
|
+
* @returns A serialization of the current state of the process.
|
|
112
|
+
*/
|
|
113
|
+
getState(): Promise<string>;
|
|
114
|
+
/**
|
|
115
|
+
* Applies a saved state to this process.
|
|
116
|
+
* @param state The state object to apply to this process.
|
|
117
|
+
*/
|
|
118
|
+
setState(state: string): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Checks if a state can be applied to this process.
|
|
121
|
+
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
122
|
+
* the process of applying the state can still fail when running.
|
|
123
|
+
* @param state The state object to check against.
|
|
124
|
+
* @returns An explanation of why this state cannot be set to this process.
|
|
125
|
+
*/
|
|
126
|
+
canSetState(state: string): Promise<string>;
|
|
127
|
+
}
|
|
128
|
+
declare namespace Process {
|
|
129
|
+
interface GenericCommandOptions {
|
|
130
|
+
checkErrors?: boolean;
|
|
131
|
+
timeout?: number;
|
|
132
|
+
}
|
|
133
|
+
interface GenericCommandMultiResponseOptions {
|
|
134
|
+
checkErrors?: boolean;
|
|
135
|
+
timeout?: number;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
+
if (mod && mod.__esModule) return mod;
|
|
22
|
+
var result = {};
|
|
23
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
+
__setModuleDefault(result, mod);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Process = void 0;
|
|
29
|
+
const gateway = __importStar(require("../gateway"));
|
|
30
|
+
const axis_1 = require("./axis");
|
|
31
|
+
const response_1 = require("./response");
|
|
32
|
+
const axis_settings_1 = require("./axis_settings");
|
|
33
|
+
const storage_1 = require("./storage");
|
|
34
|
+
const warnings_1 = require("./warnings");
|
|
35
|
+
const process_controller_source_1 = require("./process_controller_source");
|
|
36
|
+
const measurement_1 = require("../measurement");
|
|
37
|
+
/**
|
|
38
|
+
* Use to drive voltage for a process such as a heater, valve, Peltier device, etc.
|
|
39
|
+
* WARNING: DO NOT USE. This API is for an as-yet unreleased product and firmware version.
|
|
40
|
+
* It is subject to breaking changes without warning until further notice.
|
|
41
|
+
* Requires at least Firmware 7.34.
|
|
42
|
+
*/
|
|
43
|
+
class Process {
|
|
44
|
+
/**
|
|
45
|
+
* Controller for this process.
|
|
46
|
+
*/
|
|
47
|
+
get controller() {
|
|
48
|
+
return this._controller;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The process number identifies the process on the controller.
|
|
52
|
+
*/
|
|
53
|
+
get processNumber() {
|
|
54
|
+
return this._processNumber;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Settings and properties of this process.
|
|
58
|
+
*/
|
|
59
|
+
get settings() {
|
|
60
|
+
return this._settings;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Key-value storage of this process.
|
|
64
|
+
*/
|
|
65
|
+
get storage() {
|
|
66
|
+
return this._storage;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Warnings and faults of this process.
|
|
70
|
+
*/
|
|
71
|
+
get warnings() {
|
|
72
|
+
return this._warnings;
|
|
73
|
+
}
|
|
74
|
+
constructor(controller, processNumber) {
|
|
75
|
+
this._controller = controller;
|
|
76
|
+
this._processNumber = processNumber;
|
|
77
|
+
this._axis = new axis_1.Axis(controller.device, processNumber);
|
|
78
|
+
this._settings = new axis_settings_1.AxisSettings(this._axis);
|
|
79
|
+
this._storage = new storage_1.AxisStorage(this._axis);
|
|
80
|
+
this._warnings = new warnings_1.Warnings(controller.device, processNumber);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Sets the enabled state of the driver.
|
|
84
|
+
* @param [enabled=true] If true (default) enables drive. If false disables.
|
|
85
|
+
*/
|
|
86
|
+
async enable(enabled = true) {
|
|
87
|
+
const request = new gateway.ProcessOn();
|
|
88
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
89
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
90
|
+
request.setAxis(this.processNumber);
|
|
91
|
+
request.setOn(enabled);
|
|
92
|
+
await gateway.callAsync('process-controller/enable', request);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Turns this process on. In manual mode, this supplies voltage; in controlled mode, it starts the control loop.
|
|
96
|
+
* @param [duration=0] How long to leave the process on in milliseconds.
|
|
97
|
+
*/
|
|
98
|
+
async on(duration = 0) {
|
|
99
|
+
const request = new gateway.ProcessOn();
|
|
100
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
101
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
102
|
+
request.setAxis(this.processNumber);
|
|
103
|
+
request.setOn(true);
|
|
104
|
+
request.setDuration(duration);
|
|
105
|
+
await gateway.callAsync('process-controller/on', request);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Turns this process off.
|
|
109
|
+
*/
|
|
110
|
+
async off() {
|
|
111
|
+
const request = new gateway.ProcessOn();
|
|
112
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
113
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
114
|
+
request.setAxis(this.processNumber);
|
|
115
|
+
request.setOn(false);
|
|
116
|
+
await gateway.callAsync('process-controller/on', request);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Sets the control mode of this process.
|
|
120
|
+
* @param mode Mode to set this process to.
|
|
121
|
+
*/
|
|
122
|
+
async setMode(mode) {
|
|
123
|
+
const request = new gateway.DeviceSetSettingRequest();
|
|
124
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
125
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
126
|
+
request.setAxis(this.processNumber);
|
|
127
|
+
request.setSetting('process.control.mode');
|
|
128
|
+
request.setValue(mode);
|
|
129
|
+
await gateway.callAsync('device/set_setting', request);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Gets the control mode of this process.
|
|
133
|
+
* @returns Control mode.
|
|
134
|
+
*/
|
|
135
|
+
async getMode() {
|
|
136
|
+
const request = new gateway.DeviceGetSettingRequest();
|
|
137
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
138
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
139
|
+
request.setAxis(this.processNumber);
|
|
140
|
+
request.setSetting('process.control.mode');
|
|
141
|
+
const response = await gateway.callAsync('device/get_setting', request, gateway.DoubleResponse);
|
|
142
|
+
return response.getValue();
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Gets the source used to control this process.
|
|
146
|
+
* @returns The source providing feedback for this process.
|
|
147
|
+
*/
|
|
148
|
+
async getSource() {
|
|
149
|
+
const request = new gateway.AxisEmptyRequest();
|
|
150
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
151
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
152
|
+
request.setAxis(this.processNumber);
|
|
153
|
+
const response = await gateway.callAsync('process_controller/get_source', request, gateway.ProcessControllerSource);
|
|
154
|
+
return process_controller_source_1.ProcessControllerSource.fromProtobuf(response.toObject());
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Sets the source used to control this process.
|
|
158
|
+
* @param source Sets the source that should provide feedback for this process.
|
|
159
|
+
*/
|
|
160
|
+
async setSource(source) {
|
|
161
|
+
const request = new gateway.SetProcessControllerSource();
|
|
162
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
163
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
164
|
+
request.setAxis(this.processNumber);
|
|
165
|
+
request.setSource(process_controller_source_1.ProcessControllerSource.toProtobuf(source));
|
|
166
|
+
await gateway.callAsync('process_controller/set_source', request);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Gets the current value of the source used to control this process.
|
|
170
|
+
* @returns The current value of this process's controlling source.
|
|
171
|
+
*/
|
|
172
|
+
async getInput() {
|
|
173
|
+
const request = new gateway.AxisEmptyRequest();
|
|
174
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
175
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
176
|
+
request.setAxis(this.processNumber);
|
|
177
|
+
const response = await gateway.callAsync('process_controller/get_input', request, gateway.Measurement);
|
|
178
|
+
return measurement_1.Measurement.fromProtobuf(response.toObject());
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Sends a generic ASCII command to this process' underlying axis.
|
|
182
|
+
* For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
183
|
+
* @param command Command and its parameters.
|
|
184
|
+
* @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.
|
|
185
|
+
* @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.
|
|
186
|
+
* Overrides the connection default request timeout.
|
|
187
|
+
* @returns A response to the command.
|
|
188
|
+
*/
|
|
189
|
+
async genericCommand(command, options = {}) {
|
|
190
|
+
const { checkErrors = true, timeout = 0, } = options;
|
|
191
|
+
const request = new gateway.GenericCommandRequest();
|
|
192
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
193
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
194
|
+
request.setAxis(this.processNumber);
|
|
195
|
+
request.setCommand(command);
|
|
196
|
+
request.setCheckErrors(checkErrors);
|
|
197
|
+
request.setTimeout(timeout);
|
|
198
|
+
const response = await gateway.callAsync('interface/generic_command', request, gateway.GenericCommandResponse);
|
|
199
|
+
return response_1.Response.fromProtobuf(response.toObject());
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Sends a generic ASCII command to this process and expect multiple responses.
|
|
203
|
+
* Responses are returned in order of arrival.
|
|
204
|
+
* For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
205
|
+
* @param command Command and its parameters.
|
|
206
|
+
* @param [options.checkErrors=true] Controls whether to throw an exception when a device rejects the command.
|
|
207
|
+
* @param [options.timeout=0] The timeout, in milliseconds, for a device to respond to the command.
|
|
208
|
+
* Overrides the connection default request timeout.
|
|
209
|
+
* @returns All responses to the command.
|
|
210
|
+
*/
|
|
211
|
+
async genericCommandMultiResponse(command, options = {}) {
|
|
212
|
+
const { checkErrors = true, timeout = 0, } = options;
|
|
213
|
+
const request = new gateway.GenericCommandRequest();
|
|
214
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
215
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
216
|
+
request.setAxis(this.processNumber);
|
|
217
|
+
request.setCommand(command);
|
|
218
|
+
request.setCheckErrors(checkErrors);
|
|
219
|
+
request.setTimeout(timeout);
|
|
220
|
+
const response = await gateway.callAsync('interface/generic_command_multi_response', request, gateway.GenericCommandResponseCollection);
|
|
221
|
+
return response.getResponsesList().map(a => response_1.Response.fromProtobuf(a.toObject()));
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Sends a generic ASCII command to this process without expecting a response and without adding a message ID
|
|
225
|
+
* For more information refer to: [ASCII Protocol Manual](https://www.zaber.com/protocol-manual#topic_commands).
|
|
226
|
+
* @param command Command and its parameters.
|
|
227
|
+
*/
|
|
228
|
+
async genericCommandNoResponse(command) {
|
|
229
|
+
const request = new gateway.GenericCommandRequest();
|
|
230
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
231
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
232
|
+
request.setAxis(this.processNumber);
|
|
233
|
+
request.setCommand(command);
|
|
234
|
+
await gateway.callAsync('interface/generic_command_no_response', request);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Returns a serialization of the current process state that can be saved and reapplied.
|
|
238
|
+
* @returns A serialization of the current state of the process.
|
|
239
|
+
*/
|
|
240
|
+
async getState() {
|
|
241
|
+
const request = new gateway.AxisEmptyRequest();
|
|
242
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
243
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
244
|
+
request.setAxis(this.processNumber);
|
|
245
|
+
const response = await gateway.callAsync('device/get_state', request, gateway.StringResponse);
|
|
246
|
+
return response.getValue();
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Applies a saved state to this process.
|
|
250
|
+
* @param state The state object to apply to this process.
|
|
251
|
+
*/
|
|
252
|
+
async setState(state) {
|
|
253
|
+
const request = new gateway.SetStateRequest();
|
|
254
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
255
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
256
|
+
request.setAxis(this.processNumber);
|
|
257
|
+
request.setState(state);
|
|
258
|
+
await gateway.callAsync('device/set_state', request);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Checks if a state can be applied to this process.
|
|
262
|
+
* This only covers exceptions that can be determined statically such as mismatches of ID or version,
|
|
263
|
+
* the process of applying the state can still fail when running.
|
|
264
|
+
* @param state The state object to check against.
|
|
265
|
+
* @returns An explanation of why this state cannot be set to this process.
|
|
266
|
+
*/
|
|
267
|
+
async canSetState(state) {
|
|
268
|
+
const request = new gateway.CanSetStateRequest();
|
|
269
|
+
request.setInterfaceId(this.controller.device.connection.interfaceId);
|
|
270
|
+
request.setDevice(this.controller.device.deviceAddress);
|
|
271
|
+
request.setAxis(this.processNumber);
|
|
272
|
+
request.setState(state);
|
|
273
|
+
const response = await gateway.callAsync('device/can_set_axis_state', request, gateway.CanSetStateAxisResponse);
|
|
274
|
+
return response.getError();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
exports.Process = Process;
|
|
278
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../src/ascii/process.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,iCAA8B;AAC9B,yCAAsC;AACtC,mDAA+C;AAC/C,uCAAwC;AACxC,yCAAsC;AAEtC,2EAAsE;AACtE,gDAA6C;AA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AAC;QACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAExB,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,uBAAuB,CAAC,CAAC;QACnC,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAhUD,0BAgUC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { ProcessController } from './process_controller';\nimport * as gateway from '../gateway';\nimport { Axis } from './axis';\nimport { Response } from './response';\nimport { AxisSettings } from './axis_settings';\nimport { AxisStorage } from './storage';\nimport { Warnings } from './warnings';\nimport { ProcessControllerMode } from './process_controller_mode';\nimport { ProcessControllerSource } from './process_controller_source';\nimport { Measurement } from '../measurement';\n\n/**\n * Use to drive voltage for a process such as a heater, valve, Peltier device, etc.\n * WARNING: DO NOT USE. This API is for an as-yet unreleased product and firmware version.\n * It is subject to breaking changes without warning until further notice.\n * Requires at least Firmware 7.34.\n */\nexport class Process {\n /**\n * Controller for this process.\n */\n public get controller(): ProcessController {\n return this._controller;\n }\n private _controller: ProcessController;\n\n /**\n * The process number identifies the process on the controller.\n */\n public get processNumber(): number {\n return this._processNumber;\n }\n private _processNumber: number;\n\n private _axis: Axis;\n\n /**\n * Settings and properties of this process.\n */\n public get settings(): AxisSettings {\n return this._settings;\n }\n private _settings: AxisSettings;\n\n /**\n * Key-value storage of this process.\n */\n public get storage(): AxisStorage {\n return this._storage;\n }\n private _storage: AxisStorage;\n\n /**\n * Warnings and faults of this process.\n */\n public get warnings(): Warnings {\n return this._warnings;\n }\n private _warnings: Warnings;\n\n constructor(controller: ProcessController, processNumber: number) {\n this._controller = controller;\n this._processNumber = processNumber;\n this._axis = new Axis(controller.device, processNumber);\n this._settings = new AxisSettings(this._axis);\n this._storage = new AxisStorage(this._axis);\n this._warnings = new Warnings(controller.device, processNumber);\n }\n\n /**\n * Sets the enabled state of the driver.\n * @param [enabled=true] If true (default) enables drive. If false disables.\n */\n public async enable(\n enabled: boolean = true\n ): Promise<void> {\n const request = new gateway.ProcessOn();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setOn(enabled);\n\n await gateway.callAsync('process-controller/enable', request);\n }\n\n /**\n * Turns this process on. In manual mode, this supplies voltage; in controlled mode, it starts the control loop.\n * @param [duration=0] How long to leave the process on in milliseconds.\n */\n public async on(\n duration: number = 0\n ): Promise<void> {\n const request = new gateway.ProcessOn();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setOn(true);\n request.setDuration(duration);\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Turns this process off.\n */\n public async off(): Promise<void> {\n const request = new gateway.ProcessOn();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setOn(false);\n\n await gateway.callAsync('process-controller/on', request);\n }\n\n /**\n * Sets the control mode of this process.\n * @param mode Mode to set this process to.\n */\n public async setMode(\n mode: ProcessControllerMode\n ): Promise<void> {\n const request = new gateway.DeviceSetSettingRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setSetting('process.control.mode');\n request.setValue(mode);\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Gets the control mode of this process.\n * @returns Control mode.\n */\n public async getMode(): Promise<ProcessControllerMode> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setSetting('process.control.mode');\n\n const response = await gateway.callAsync<gateway.DoubleResponse>(\n 'device/get_setting',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Gets the source used to control this process.\n * @returns The source providing feedback for this process.\n */\n public async getSource(): Promise<ProcessControllerSource> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n\n const response = await gateway.callAsync<gateway.ProcessControllerSource>(\n 'process_controller/get_source',\n request,\n gateway.ProcessControllerSource);\n return ProcessControllerSource.fromProtobuf(response.toObject());\n }\n\n /**\n * Sets the source used to control this process.\n * @param source Sets the source that should provide feedback for this process.\n */\n public async setSource(\n source: ProcessControllerSource\n ): Promise<void> {\n const request = new gateway.SetProcessControllerSource();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setSource(ProcessControllerSource.toProtobuf(source));\n\n await gateway.callAsync('process_controller/set_source', request);\n }\n\n /**\n * Gets the current value of the source used to control this process.\n * @returns The current value of this process's controlling source.\n */\n public async getInput(): Promise<Measurement> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n\n const response = await gateway.callAsync<gateway.Measurement>(\n 'process_controller/get_input',\n request,\n gateway.Measurement);\n return Measurement.fromProtobuf(response.toObject());\n }\n\n /**\n * Sends a generic ASCII command to this process' underlying axis.\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.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: Process.GenericCommandOptions = {}\n ): Promise<Response> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setCommand(command);\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 process 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.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: Process.GenericCommandMultiResponseOptions = {}\n ): Promise<Response[]> {\n const {\n checkErrors = true,\n timeout = 0,\n } = options;\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setCommand(command);\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 process 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 */\n public async genericCommandNoResponse(\n command: string\n ): Promise<void> {\n const request = new gateway.GenericCommandRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setCommand(command);\n\n await gateway.callAsync('interface/generic_command_no_response', request);\n }\n\n /**\n * Returns a serialization of the current process state that can be saved and reapplied.\n * @returns A serialization of the current state of the process.\n */\n public async getState(): Promise<string> {\n const request = new gateway.AxisEmptyRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\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 process.\n * @param state The state object to apply to this process.\n */\n public async setState(\n state: string\n ): Promise<void> {\n const request = new gateway.SetStateRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setState(state);\n\n await gateway.callAsync('device/set_state', request);\n }\n\n /**\n * Checks if a state can be applied to this process.\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 explanation of why this state cannot be set to this process.\n */\n public async canSetState(\n state: string\n ): Promise<string> {\n const request = new gateway.CanSetStateRequest();\n request.setInterfaceId(this.controller.device.connection.interfaceId);\n request.setDevice(this.controller.device.deviceAddress);\n request.setAxis(this.processNumber);\n request.setState(state);\n\n const response = await gateway.callAsync<gateway.CanSetStateAxisResponse>(\n 'device/can_set_axis_state',\n request,\n gateway.CanSetStateAxisResponse);\n return response.getError();\n }\n}\n\nnamespace Process {\n export interface GenericCommandOptions {\n checkErrors?: boolean;\n timeout?: number;\n }\n export interface GenericCommandMultiResponseOptions {\n checkErrors?: boolean;\n timeout?: number;\n }\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Connection } from './connection';
|
|
2
|
+
import { Device } from './device';
|
|
3
|
+
import { Process } from './process';
|
|
4
|
+
/**
|
|
5
|
+
* Use to manage a process controller.
|
|
6
|
+
* WARNING: DO NOT USE. This API is for an as-yet unreleased product and firmware version.
|
|
7
|
+
* It is subject to breaking changes without warning until further notice.
|
|
8
|
+
* Requires at least Firmware 7.34.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ProcessController {
|
|
11
|
+
/**
|
|
12
|
+
* The base device of this process controller.
|
|
13
|
+
*/
|
|
14
|
+
get device(): Device;
|
|
15
|
+
private _device;
|
|
16
|
+
/**
|
|
17
|
+
* Creates instance of `ProcessController` of the given device.
|
|
18
|
+
* If the device is identified, this constructor will ensure it is a process controller.
|
|
19
|
+
*/
|
|
20
|
+
constructor(device: Device);
|
|
21
|
+
/**
|
|
22
|
+
* Detects the process controllers on the connection.
|
|
23
|
+
* @param connection The connection to detect process controllers on.
|
|
24
|
+
* @param [identify=true] If the Process Controllers should be identified upon detection.
|
|
25
|
+
* @returns A list of all `ProcessController`s on the connection.
|
|
26
|
+
*/
|
|
27
|
+
static detect(connection: Connection, identify?: boolean): Promise<ProcessController[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Gets an Process class instance which allows you to control a particular voltage source.
|
|
30
|
+
* Axes are numbered from 1.
|
|
31
|
+
* @param processNumber Number of process to control.
|
|
32
|
+
* @returns Process instance.
|
|
33
|
+
*/
|
|
34
|
+
getProcess(processNumber: number): Process;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if this is a process controller or some other type of device and throws a detect error if it is not.
|
|
37
|
+
*/
|
|
38
|
+
private _verifyIsProcessController;
|
|
39
|
+
}
|