@zaber/motion 7.2.0 → 7.2.2
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-core.wasm +0 -0
- package/dist/lib/ascii/servo_tuner.d.ts +3 -1
- package/dist/lib/ascii/servo_tuner.d.ts.map +1 -1
- package/dist/lib/ascii/servo_tuner.js +4 -1
- package/dist/lib/ascii/servo_tuner.js.map +1 -1
- package/dist/lib/binary/device.d.ts +7 -1
- package/dist/lib/binary/device.d.ts.map +1 -1
- package/dist/lib/binary/device.js +8 -3
- package/dist/lib/binary/device.js.map +1 -1
- package/dist/lib/library.js +1 -1
- package/dist/lib/library.js.map +1 -1
- package/dist/lib/requests/set_servo_tuning_request.d.ts +1 -0
- package/dist/lib/requests/set_servo_tuning_request.d.ts.map +1 -1
- package/dist/lib/requests/set_servo_tuning_request.js +2 -0
- package/dist/lib/requests/set_servo_tuning_request.js.map +1 -1
- package/package.json +1 -1
|
Binary file
|
|
@@ -46,8 +46,10 @@ export declare class ServoTuner {
|
|
|
46
46
|
* Only use this method if you have a strong understanding of Zaber specific tuning parameters.
|
|
47
47
|
* @param paramset The paramset to set tuning of.
|
|
48
48
|
* @param tuningParams The params to set.
|
|
49
|
+
* @param [setUnspecifiedToDefault=false] If true, any tuning parameters not included in TuningParams
|
|
50
|
+
* are reset to their default values.
|
|
49
51
|
*/
|
|
50
|
-
setTuning(paramset: ServoTuningParamset, tuningParams: ServoTuningParam[]): Promise<void>;
|
|
52
|
+
setTuning(paramset: ServoTuningParamset, tuningParams: ServoTuningParam[], setUnspecifiedToDefault?: boolean): Promise<void>;
|
|
51
53
|
/**
|
|
52
54
|
* Sets the tuning of a paramset using the PID method.
|
|
53
55
|
* @param paramset The paramset to get tuning for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servo_tuner.d.ts","sourceRoot":"","sources":["../../../src/ascii/servo_tuner.ts"],"names":[],"mappings":"AAGA,O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B,GAC9C,OAAO,CAAC,IAAI,CAAC;IAqBhB;;;;OAIG;IACU,eAAe,CAC1B,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAAC,YAAY,CAAC;IAmBxB;;;;;;;;;;;OAWG;IACU,mBAAmB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,YAAY,EAAE,gBAAgB,EAAE,EAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,UAAU,CAAC,0BAA+B,GAClD,OAAO,CAAC,OAAO,CAAC;CAwBpB;AAED,kBAAU,UAAU,CAAC;IACnB,UAAiB,sBAAsB;QACnC,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;IACD,UAAiB,0BAA0B;QACvC,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;CACF"}
|
|
@@ -125,8 +125,10 @@ class ServoTuner {
|
|
|
125
125
|
* Only use this method if you have a strong understanding of Zaber specific tuning parameters.
|
|
126
126
|
* @param paramset The paramset to set tuning of.
|
|
127
127
|
* @param tuningParams The params to set.
|
|
128
|
+
* @param [setUnspecifiedToDefault=false] If true, any tuning parameters not included in TuningParams
|
|
129
|
+
* are reset to their default values.
|
|
128
130
|
*/
|
|
129
|
-
async setTuning(paramset, tuningParams) {
|
|
131
|
+
async setTuning(paramset, tuningParams, setUnspecifiedToDefault = false) {
|
|
130
132
|
const request = {
|
|
131
133
|
...requests.SetServoTuningRequest.DEFAULT,
|
|
132
134
|
interfaceId: this.axis.device.connection.interfaceId,
|
|
@@ -134,6 +136,7 @@ class ServoTuner {
|
|
|
134
136
|
axis: this.axis.axisNumber,
|
|
135
137
|
paramset: paramset,
|
|
136
138
|
tuningParams: tuningParams,
|
|
139
|
+
setUnspecifiedToDefault: setUnspecifiedToDefault,
|
|
137
140
|
toBinary() {
|
|
138
141
|
return requests.SetServoTuningRequest.toBinary(this);
|
|
139
142
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servo_tuner.js","sourceRoot":"","sources":["../../../src/ascii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CAAC,IAAI,CAAC,CAAC;YACpD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,+BAA+B,EAC/B,OAAO,EACP,4BAAY,CAAC,UAAU,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,mBAAmB,CAC9B,QAA6B,EAC7B,YAAgC,EAChC,QAAgB,EAChB,UAAiD,EAAE;QAEnD,MAAM,EACJ,YAAY,GAAG,IAAI,GACpB,GAAG,OAAO,CAAC;QACZ,MAAM,OAAO,GAA+C;YAC1D,GAAG,QAAQ,CAAC,eAAe,CAAC,OAAO;YACnC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YACpD,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;YACtC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;YAC1B,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,YAAY;YAC1B,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,YAAY;YAC1B,QAAQ;gBACN,OAAO,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,oCAAoC,EACpC,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAlUD,gCAkUC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Axis } from './axis';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { ServoTuningParamset } from './servo_tuning_paramset';\nimport { ParamsetInfo } from './paramset_info';\nimport { ServoTuningParam } from './servo_tuning_param';\nimport { PidTuning } from './pid_tuning';\nimport { SimpleTuningParamDefinition } from './simple_tuning_param_definition';\nimport { SimpleTuning } from './simple_tuning';\n\n/**\n * Exposes the capabilities to inspect and edit an axis' servo tuning.\n * Requires at least Firmware 6.25 or 7.00.\n */\nexport class ServoTuner {\n /**\n * The axis that will be tuned.\n */\n public get axis(): Axis {\n return this._axis;\n }\n private _axis: Axis;\n\n /**\n * Creates instance of ServoTuner for the given axis.\n */\n constructor(axis: Axis) {\n this._axis = axis;\n }\n\n /**\n * Get the paramset that this device uses by default when it starts up.\n * @returns The paramset used when the device restarts.\n */\n public async getStartupParamset(): Promise<ServoTuningParamset> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.ServoTuningParamsetResponse>(\n 'servotuning/get_startup_set',\n request,\n requests.ServoTuningParamsetResponse.fromBinary);\n return response.paramset;\n }\n\n /**\n * Set the paramset that this device uses by default when it starts up.\n * @param paramset The paramset to use at startup.\n */\n public async setStartupParamset(\n paramset: ServoTuningParamset\n ): Promise<void> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/set_startup_set', request);\n }\n\n /**\n * Load the values from one paramset into another.\n * @param toParamset The paramset to load into.\n * @param fromParamset The paramset to load from.\n */\n public async loadParamset(\n toParamset: ServoTuningParamset,\n fromParamset: ServoTuningParamset\n ): Promise<void> {\n const request: requests.LoadParamset & gateway.Message = {\n ...requests.LoadParamset.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n toParamset: toParamset,\n fromParamset: fromParamset,\n toBinary() {\n return requests.LoadParamset.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/load_paramset', request);\n }\n\n /**\n * Get the full set of tuning parameters used by the firmware driving this axis.\n * @param paramset The paramset to get tuning for.\n * @returns The raw representation of the current tuning.\n */\n public async getTuning(\n paramset: ServoTuningParamset\n ): Promise<ParamsetInfo> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<ParamsetInfo>(\n 'servotuning/get_raw',\n request,\n ParamsetInfo.fromBinary);\n return response;\n }\n\n /**\n * Set individual tuning parameters.\n * Only use this method if you have a strong understanding of Zaber specific tuning parameters.\n * @param paramset The paramset to set tuning of.\n * @param tuningParams The params to set.\n */\n public async setTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[]\n ): Promise<void> {\n const request: requests.SetServoTuningRequest & gateway.Message = {\n ...requests.SetServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n tuningParams: tuningParams,\n toBinary() {\n return requests.SetServoTuningRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/set_raw', request);\n }\n\n /**\n * Sets the tuning of a paramset using the PID method.\n * @param paramset The paramset to get tuning for.\n * @param p The proportional gain. Must be in units of N/m.\n * @param i The integral gain. Must be in units of N/m⋅s.\n * @param d The derivative gain. Must be in units of N⋅s/m.\n * @param fc The cutoff frequency. Must be in units of Hz.\n * @returns The PID representation of the current tuning after your changes have been applied.\n */\n public async setPidTuning(\n paramset: ServoTuningParamset,\n p: number,\n i: number,\n d: number,\n fc: number\n ): Promise<PidTuning> {\n const request: requests.SetServoTuningPIDRequest & gateway.Message = {\n ...requests.SetServoTuningPIDRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n p: p,\n i: i,\n d: d,\n fc: fc,\n toBinary() {\n return requests.SetServoTuningPIDRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<PidTuning>(\n 'servotuning/set_pid',\n request,\n PidTuning.fromBinary);\n return response;\n }\n\n /**\n * Gets the PID representation of this paramset's servo tuning.\n * @param paramset The paramset to get tuning for.\n * @returns The PID representation of the current tuning.\n */\n public async getPidTuning(\n paramset: ServoTuningParamset\n ): Promise<PidTuning> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<PidTuning>(\n 'servotuning/get_pid',\n request,\n PidTuning.fromBinary);\n return response;\n }\n\n /**\n * Gets the parameters that are required to tune this device.\n * @returns The tuning parameters.\n */\n public async getSimpleTuningParamDefinitions(): Promise<SimpleTuningParamDefinition[]> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GetSimpleTuningParamDefinitionResponse>(\n 'servotuning/get_simple_params_definition',\n request,\n requests.GetSimpleTuningParamDefinitionResponse.fromBinary);\n return response.params;\n }\n\n /**\n * Set the tuning of this device using the simple input method.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param [options.carriageMass=null] The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n */\n public async setSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n options: ServoTuner.SetSimpleTuningOptions = {}\n ): Promise<void> {\n const {\n carriageMass = null,\n } = options;\n const request: requests.SetSimpleTuning & gateway.Message = {\n ...requests.SetSimpleTuning.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n tuningParams: tuningParams,\n loadMass: loadMass,\n carriageMass: carriageMass,\n toBinary() {\n return requests.SetSimpleTuning.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/set_simple_tuning', request);\n }\n\n /**\n * Get the simple tuning parameters for this device.\n * @param paramset The paramset to get tuning for.\n * @returns The simple tuning parameters.\n */\n public async getSimpleTuning(\n paramset: ServoTuningParamset\n ): Promise<SimpleTuning> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SimpleTuning>(\n 'servotuning/get_simple_tuning',\n request,\n SimpleTuning.fromBinary);\n return response;\n }\n\n /**\n * @deprecated Use GetSimpleTuning instead.\n *\n * Checks if the provided simple tuning is being stored by this paramset.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param [options.carriageMass=null] The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n * @returns True if the provided simple tuning is currently stored in this paramset.\n */\n public async isUsingSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n options: ServoTuner.IsUsingSimpleTuningOptions = {}\n ): Promise<boolean> {\n const {\n carriageMass = null,\n } = options;\n const request: requests.SetSimpleTuning & gateway.Message = {\n ...requests.SetSimpleTuning.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n tuningParams: tuningParams,\n loadMass: loadMass,\n carriageMass: carriageMass,\n toBinary() {\n return requests.SetSimpleTuning.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'servotuning/is_using_simple_tuning',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace ServoTuner {\n export interface SetSimpleTuningOptions {\n carriageMass?: number;\n }\n export interface IsUsingSimpleTuningOptions {\n carriageMass?: number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"servo_tuner.js","sourceRoot":"","sources":["../../../src/ascii/servo_tuner.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,sDAAwC;AAExC,mDAA+C;AAE/C,6CAAyC;AAEzC,mDAA+C;AAE/C;;;GAGG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAGD;;OAEG;IACH,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,kBAAkB;QAC7B,MAAM,OAAO,GAAgD;YAC3D,GAAG,QAAQ,CAAC,gBAAgB,CAAC,OAAO;YACpC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;Y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C,UAAU,CAAC,WAAW;YACpD,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;YACtC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;YAC1B,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,YAAY;YAC1B,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,YAAY;YAC1B,QAAQ;gBACN,OAAO,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,oCAAoC,EACpC,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AAtUD,gCAsUC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Axis } from './axis';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { ServoTuningParamset } from './servo_tuning_paramset';\nimport { ParamsetInfo } from './paramset_info';\nimport { ServoTuningParam } from './servo_tuning_param';\nimport { PidTuning } from './pid_tuning';\nimport { SimpleTuningParamDefinition } from './simple_tuning_param_definition';\nimport { SimpleTuning } from './simple_tuning';\n\n/**\n * Exposes the capabilities to inspect and edit an axis' servo tuning.\n * Requires at least Firmware 6.25 or 7.00.\n */\nexport class ServoTuner {\n /**\n * The axis that will be tuned.\n */\n public get axis(): Axis {\n return this._axis;\n }\n private _axis: Axis;\n\n /**\n * Creates instance of ServoTuner for the given axis.\n */\n constructor(axis: Axis) {\n this._axis = axis;\n }\n\n /**\n * Get the paramset that this device uses by default when it starts up.\n * @returns The paramset used when the device restarts.\n */\n public async getStartupParamset(): Promise<ServoTuningParamset> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.ServoTuningParamsetResponse>(\n 'servotuning/get_startup_set',\n request,\n requests.ServoTuningParamsetResponse.fromBinary);\n return response.paramset;\n }\n\n /**\n * Set the paramset that this device uses by default when it starts up.\n * @param paramset The paramset to use at startup.\n */\n public async setStartupParamset(\n paramset: ServoTuningParamset\n ): Promise<void> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/set_startup_set', request);\n }\n\n /**\n * Load the values from one paramset into another.\n * @param toParamset The paramset to load into.\n * @param fromParamset The paramset to load from.\n */\n public async loadParamset(\n toParamset: ServoTuningParamset,\n fromParamset: ServoTuningParamset\n ): Promise<void> {\n const request: requests.LoadParamset & gateway.Message = {\n ...requests.LoadParamset.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n toParamset: toParamset,\n fromParamset: fromParamset,\n toBinary() {\n return requests.LoadParamset.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/load_paramset', request);\n }\n\n /**\n * Get the full set of tuning parameters used by the firmware driving this axis.\n * @param paramset The paramset to get tuning for.\n * @returns The raw representation of the current tuning.\n */\n public async getTuning(\n paramset: ServoTuningParamset\n ): Promise<ParamsetInfo> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<ParamsetInfo>(\n 'servotuning/get_raw',\n request,\n ParamsetInfo.fromBinary);\n return response;\n }\n\n /**\n * Set individual tuning parameters.\n * Only use this method if you have a strong understanding of Zaber specific tuning parameters.\n * @param paramset The paramset to set tuning of.\n * @param tuningParams The params to set.\n * @param [setUnspecifiedToDefault=false] If true, any tuning parameters not included in TuningParams\n * are reset to their default values.\n */\n public async setTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n setUnspecifiedToDefault: boolean = false\n ): Promise<void> {\n const request: requests.SetServoTuningRequest & gateway.Message = {\n ...requests.SetServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n tuningParams: tuningParams,\n setUnspecifiedToDefault: setUnspecifiedToDefault,\n toBinary() {\n return requests.SetServoTuningRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/set_raw', request);\n }\n\n /**\n * Sets the tuning of a paramset using the PID method.\n * @param paramset The paramset to get tuning for.\n * @param p The proportional gain. Must be in units of N/m.\n * @param i The integral gain. Must be in units of N/m⋅s.\n * @param d The derivative gain. Must be in units of N⋅s/m.\n * @param fc The cutoff frequency. Must be in units of Hz.\n * @returns The PID representation of the current tuning after your changes have been applied.\n */\n public async setPidTuning(\n paramset: ServoTuningParamset,\n p: number,\n i: number,\n d: number,\n fc: number\n ): Promise<PidTuning> {\n const request: requests.SetServoTuningPIDRequest & gateway.Message = {\n ...requests.SetServoTuningPIDRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n p: p,\n i: i,\n d: d,\n fc: fc,\n toBinary() {\n return requests.SetServoTuningPIDRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<PidTuning>(\n 'servotuning/set_pid',\n request,\n PidTuning.fromBinary);\n return response;\n }\n\n /**\n * Gets the PID representation of this paramset's servo tuning.\n * @param paramset The paramset to get tuning for.\n * @returns The PID representation of the current tuning.\n */\n public async getPidTuning(\n paramset: ServoTuningParamset\n ): Promise<PidTuning> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<PidTuning>(\n 'servotuning/get_pid',\n request,\n PidTuning.fromBinary);\n return response;\n }\n\n /**\n * Gets the parameters that are required to tune this device.\n * @returns The tuning parameters.\n */\n public async getSimpleTuningParamDefinitions(): Promise<SimpleTuningParamDefinition[]> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.GetSimpleTuningParamDefinitionResponse>(\n 'servotuning/get_simple_params_definition',\n request,\n requests.GetSimpleTuningParamDefinitionResponse.fromBinary);\n return response.params;\n }\n\n /**\n * Set the tuning of this device using the simple input method.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param [options.carriageMass=null] The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n */\n public async setSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n options: ServoTuner.SetSimpleTuningOptions = {}\n ): Promise<void> {\n const {\n carriageMass = null,\n } = options;\n const request: requests.SetSimpleTuning & gateway.Message = {\n ...requests.SetSimpleTuning.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n tuningParams: tuningParams,\n loadMass: loadMass,\n carriageMass: carriageMass,\n toBinary() {\n return requests.SetSimpleTuning.toBinary(this);\n },\n };\n\n await gateway.callAsync('servotuning/set_simple_tuning', request);\n }\n\n /**\n * Get the simple tuning parameters for this device.\n * @param paramset The paramset to get tuning for.\n * @returns The simple tuning parameters.\n */\n public async getSimpleTuning(\n paramset: ServoTuningParamset\n ): Promise<SimpleTuning> {\n const request: requests.ServoTuningRequest & gateway.Message = {\n ...requests.ServoTuningRequest.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n toBinary() {\n return requests.ServoTuningRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<SimpleTuning>(\n 'servotuning/get_simple_tuning',\n request,\n SimpleTuning.fromBinary);\n return response;\n }\n\n /**\n * @deprecated Use GetSimpleTuning instead.\n *\n * Checks if the provided simple tuning is being stored by this paramset.\n * @param paramset The paramset to set tuning for.\n * @param tuningParams The params used to tune this device.\n * To get what parameters are expected, call GetSimpleTuningParamList.\n * All values must be between 0 and 1.\n * @param loadMass The mass loaded on the stage (excluding the mass of the carriage itself) in kg.\n * @param [options.carriageMass=null] The mass of the carriage in kg. If this value is not set the default carriage mass is used.\n * @returns True if the provided simple tuning is currently stored in this paramset.\n */\n public async isUsingSimpleTuning(\n paramset: ServoTuningParamset,\n tuningParams: ServoTuningParam[],\n loadMass: number,\n options: ServoTuner.IsUsingSimpleTuningOptions = {}\n ): Promise<boolean> {\n const {\n carriageMass = null,\n } = options;\n const request: requests.SetSimpleTuning & gateway.Message = {\n ...requests.SetSimpleTuning.DEFAULT,\n interfaceId: this.axis.device.connection.interfaceId,\n device: this.axis.device.deviceAddress,\n axis: this.axis.axisNumber,\n paramset: paramset,\n tuningParams: tuningParams,\n loadMass: loadMass,\n carriageMass: carriageMass,\n toBinary() {\n return requests.SetSimpleTuning.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'servotuning/is_using_simple_tuning',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace ServoTuner {\n export interface SetSimpleTuningOptions {\n carriageMass?: number;\n }\n export interface IsUsingSimpleTuningOptions {\n carriageMass?: number;\n }\n}\n"]}
|
|
@@ -151,9 +151,12 @@ export declare class Device {
|
|
|
151
151
|
* Queries the device and the database, gathering information about the product.
|
|
152
152
|
* Without this information features such as unit conversions will not work.
|
|
153
153
|
* Usually, called automatically by detect devices method.
|
|
154
|
+
* @param options.assumeVersion The identification assumes the specified firmware version
|
|
155
|
+
* instead of the version queried from the device.
|
|
156
|
+
* Providing this argument can lead to unexpected compatibility issues.
|
|
154
157
|
* @returns Device identification data.
|
|
155
158
|
*/
|
|
156
|
-
identify(): Promise<DeviceIdentity>;
|
|
159
|
+
identify(options?: Device.IdentifyOptions): Promise<DeviceIdentity>;
|
|
157
160
|
/**
|
|
158
161
|
* Parks the axis.
|
|
159
162
|
* Motor drivers remain enabled and hold current continues to be applied until the device is powered off.
|
|
@@ -216,6 +219,9 @@ declare namespace Device {
|
|
|
216
219
|
interface MoveRelativeOptions {
|
|
217
220
|
timeout?: number;
|
|
218
221
|
}
|
|
222
|
+
interface IdentifyOptions {
|
|
223
|
+
assumeVersion?: FirmwareVersion;
|
|
224
|
+
}
|
|
219
225
|
}
|
|
220
226
|
export {};
|
|
221
227
|
//# sourceMappingURL=device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../src/binary/device.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE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eAAe;QAC5B,aAAa,CAAC,EAAE,eAAe,CAAC;KACnC;CACF"}
|
|
@@ -341,15 +341,20 @@ class Device {
|
|
|
341
341
|
* Queries the device and the database, gathering information about the product.
|
|
342
342
|
* Without this information features such as unit conversions will not work.
|
|
343
343
|
* Usually, called automatically by detect devices method.
|
|
344
|
+
* @param options.assumeVersion The identification assumes the specified firmware version
|
|
345
|
+
* instead of the version queried from the device.
|
|
346
|
+
* Providing this argument can lead to unexpected compatibility issues.
|
|
344
347
|
* @returns Device identification data.
|
|
345
348
|
*/
|
|
346
|
-
async identify() {
|
|
349
|
+
async identify(options = {}) {
|
|
350
|
+
const { assumeVersion, } = options;
|
|
347
351
|
const request = {
|
|
348
|
-
...requests.
|
|
352
|
+
...requests.DeviceIdentifyRequest.DEFAULT,
|
|
349
353
|
interfaceId: this.connection.interfaceId,
|
|
350
354
|
device: this.deviceAddress,
|
|
355
|
+
assumeVersion: assumeVersion,
|
|
351
356
|
toBinary() {
|
|
352
|
-
return requests.
|
|
357
|
+
return requests.DeviceIdentifyRequest.toBinary(this);
|
|
353
358
|
},
|
|
354
359
|
};
|
|
355
360
|
const response = await gateway.callAsync('binary/device/identify', request, device_identity_1.DeviceIdentity.fromBinary);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/binary/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,uDAAmD;AAEnD,uDAAmD;AACnD,uDAAmD;AACnD,oDAAsC;AACtC,sDAAwC;AAExC,uCAAoC;AACpC,oCAAmF;AAInF;;GAEG;AACH,MAAa,MAAM;IAMjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAGD;;;OAGG;IACH,IAAW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//\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { BinarySettings } from './binary_settings';\nimport { Connection } from './connection';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceSettings } from './device_settings';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Units } from '../units';\nimport { DeviceType } from './device_type';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Represents a device using the binary protocol.\n */\nexport class Device {\n /**\n * Default timeout for move commands in seconds.\n */\n public static readonly DEFAULT_MOVEMENT_TIMEOUT: number = 60;\n\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\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 * 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 * 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 * Requires at least Firmware 6.15 for devices or 6.24 for peripherals.\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 * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * Indicates whether the device is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral hardware.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Determines the type of an device and units it accepts.\n */\n public get deviceType(): DeviceType {\n return this.identity.deviceType;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._settings = new DeviceSettings(this);\n this._deviceAddress = deviceAddress;\n }\n\n /**\n * Sends a generic Binary command to this device.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: CommandCode,\n data: number = 0,\n options: Device.GenericCommandOptions = {}\n ): Promise<Message> {\n const {\n timeout = 0.0,\n checkErrors = true,\n } = options;\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n timeout: timeout,\n checkErrors: checkErrors,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Message>(\n 'binary/interface/generic_command',\n request,\n Message.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic Binary command to this device without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this device with unit conversions for both sent data and retrieved data.\n * @param command Command to send.\n * @param [data=0] Data argument to the command. Defaults to zero.\n * @param [fromUnit=Units.NATIVE] Unit to convert sent data from.\n * @param [toUnit=Units.NATIVE] Unit to convert retrieved data to.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @returns Data that has been converted to the provided unit.\n */\n public async genericCommandWithUnits(\n command: CommandCode,\n data: number = 0,\n fromUnit: Units = Units.NATIVE,\n toUnit: Units = Units.NATIVE,\n options: Device.GenericCommandWithUnitsOptions = {}\n ): Promise<number> {\n const {\n timeout = 0.0,\n } = options;\n const request: requests.BinaryGenericWithUnitsRequest & gateway.Message = {\n ...requests.BinaryGenericWithUnitsRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n fromUnit: fromUnit,\n toUnit: toUnit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryGenericWithUnitsRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/generic_command_with_units',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Homes device. Device returns to its homing position.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async home(\n options: Device.HomeOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceHomeRequest & gateway.Message = {\n ...requests.BinaryDeviceHomeRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceHomeRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/home',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Stops ongoing device movement. Decelerates until zero speed.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async stop(\n options: Device.StopOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceStopRequest & gateway.Message = {\n ...requests.BinaryDeviceStopRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceStopRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/stop',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveAbsoluteOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.ABS,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveRelativeOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.REL,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Begins to move device at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Unit to convert returned velocity to.\n * @returns Device velocity that has been converted to the provided unit.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.VEL,\n arg: velocity,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Waits until device stops moving.\n */\n public async waitUntilIdle(): Promise<void> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/device/wait_until_idle', request);\n }\n\n /**\n * Check whether the device is moving.\n * @returns True if the device is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_busy',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\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 * @returns Device identification data.\n */\n public async identify(): Promise<DeviceIdentity> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'binary/device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Parks the axis.\n * Motor drivers remain enabled and hold current continues to be applied until the device is powered off.\n * It can later be unparked and moved without first having to home it.\n * Requires at least Firmware 6.06.\n */\n public async park(): Promise<void> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n * Requires at least Firmware 6.06.\n */\n public async unpark(): Promise<void> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * Requires at least Firmware 6.06.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_parked',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns current device position.\n * @param [unit=Units.NATIVE] Units of position.\n * @returns Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.BinaryDeviceGetSettingRequest & gateway.Message = {\n ...requests.BinaryDeviceGetSettingRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n setting: BinarySettings.CURRENT_POSITION,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\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: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'binary/device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'binary/device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\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: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'binary/device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface GenericCommandOptions {\n timeout?: number;\n checkErrors?: boolean;\n }\n export interface GenericCommandWithUnitsOptions {\n timeout?: number;\n }\n export interface HomeOptions {\n unit?: Length | Angle | Native;\n timeout?: number;\n }\n export interface StopOptions {\n unit?: Length | Angle | Native;\n timeout?: number;\n }\n export interface MoveAbsoluteOptions {\n timeout?: number;\n }\n export interface MoveRelativeOptions {\n timeout?: number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/binary/device.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,uDAAmD;AAEnD,uDAAmD;AACnD,uDAAmD;AACnD,oDAAsC;AACtC,sDAAwC;AAExC,uCAAoC;AACpC,oCAAmF;AAInF;;GAEG;AACH,MAAa,MAAM;IAMjB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,QAA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,CAAC;QACpC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;;AA3kBH,wBA4kBC;AA3kBC;;GAEG;AACoB,+BAAwB,GAAW,EAAE,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { BinarySettings } from './binary_settings';\nimport { Connection } from './connection';\nimport { DeviceIdentity } from './device_identity';\nimport { DeviceSettings } from './device_settings';\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { CommandCode } from './command_code';\nimport { Message } from './message';\nimport { Angle, Length, Native, AngularVelocity, Velocity, Units } from '../units';\nimport { DeviceType } from './device_type';\nimport { FirmwareVersion } from '../firmware_version';\n\n/**\n * Represents a device using the binary protocol.\n */\nexport class Device {\n /**\n * Default timeout for move commands in seconds.\n */\n public static readonly DEFAULT_MOVEMENT_TIMEOUT: number = 60;\n\n /**\n * Connection of this device.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n /**\n * Settings and properties of this axis.\n */\n public get settings(): DeviceSettings {\n return this._settings;\n }\n private _settings: DeviceSettings;\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 * 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 * 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 * Requires at least Firmware 6.15 for devices or 6.24 for peripherals.\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 * Version of the firmware.\n */\n public get firmwareVersion(): FirmwareVersion {\n return this.identity.firmwareVersion;\n }\n\n /**\n * Indicates whether the device is a peripheral or part of an integrated device.\n */\n public get isPeripheral(): boolean {\n return this.identity.isPeripheral;\n }\n\n /**\n * Unique ID of the peripheral hardware.\n */\n public get peripheralId(): number {\n return this.identity.peripheralId;\n }\n\n /**\n * Name of the peripheral hardware.\n */\n public get peripheralName(): string {\n return this.identity.peripheralName;\n }\n\n /**\n * Determines the type of an device and units it accepts.\n */\n public get deviceType(): DeviceType {\n return this.identity.deviceType;\n }\n\n constructor(connection: Connection, deviceAddress: number) {\n this._connection = connection;\n this._settings = new DeviceSettings(this);\n this._deviceAddress = deviceAddress;\n }\n\n /**\n * Sends a generic Binary command to this device.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @param [options.checkErrors=true] Controls whether to throw an exception when the device rejects the command.\n * @returns A response to the command.\n */\n public async genericCommand(\n command: CommandCode,\n data: number = 0,\n options: Device.GenericCommandOptions = {}\n ): Promise<Message> {\n const {\n timeout = 0.0,\n checkErrors = true,\n } = options;\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n timeout: timeout,\n checkErrors: checkErrors,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<Message>(\n 'binary/interface/generic_command',\n request,\n Message.fromBinary);\n return response;\n }\n\n /**\n * Sends a generic Binary command to this device without expecting a response.\n * For more information please refer to the\n * [Binary Protocol Manual](https://www.zaber.com/protocol-manual?protocol=Binary#topic_quick_command_reference).\n * @param command Command to send.\n * @param [data=0] Optional data argument to the command. Defaults to zero.\n */\n public async genericCommandNoResponse(\n command: CommandCode,\n data: number = 0\n ): Promise<void> {\n const request: requests.GenericBinaryRequest & gateway.Message = {\n ...requests.GenericBinaryRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n toBinary() {\n return requests.GenericBinaryRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/interface/generic_command_no_response', request);\n }\n\n /**\n * Sends a generic Binary command to this device with unit conversions for both sent data and retrieved data.\n * @param command Command to send.\n * @param [data=0] Data argument to the command. Defaults to zero.\n * @param [fromUnit=Units.NATIVE] Unit to convert sent data from.\n * @param [toUnit=Units.NATIVE] Unit to convert retrieved data to.\n * @param [options.timeout=0.0] Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s.\n * @returns Data that has been converted to the provided unit.\n */\n public async genericCommandWithUnits(\n command: CommandCode,\n data: number = 0,\n fromUnit: Units = Units.NATIVE,\n toUnit: Units = Units.NATIVE,\n options: Device.GenericCommandWithUnitsOptions = {}\n ): Promise<number> {\n const {\n timeout = 0.0,\n } = options;\n const request: requests.BinaryGenericWithUnitsRequest & gateway.Message = {\n ...requests.BinaryGenericWithUnitsRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n command: command,\n data: data,\n fromUnit: fromUnit,\n toUnit: toUnit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryGenericWithUnitsRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/generic_command_with_units',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Homes device. Device returns to its homing position.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async home(\n options: Device.HomeOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceHomeRequest & gateway.Message = {\n ...requests.BinaryDeviceHomeRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceHomeRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/home',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Stops ongoing device movement. Decelerates until zero speed.\n * @param [options.unit=Units.NATIVE] Unit to convert returned position to.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async stop(\n options: Device.StopOptions = {}\n ): Promise<number> {\n const {\n unit = Units.NATIVE,\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceStopRequest & gateway.Message = {\n ...requests.BinaryDeviceStopRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceStopRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/stop',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to absolute position.\n * @param position Absolute position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveAbsolute(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveAbsoluteOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.ABS,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Move device to position relative to current position.\n * @param position Relative position.\n * @param [unit=Units.NATIVE] Unit for the provided position as well as position returned by the device.\n * @param [options.timeout=Device.DEFAULT_MOVEMENT_TIMEOUT] Number of seconds to wait for response from the device chain (defaults to 60s).\n * @returns Current position that has been converted to the provided unit.\n */\n public async moveRelative(\n position: number,\n unit: Length | Angle | Native = Units.NATIVE,\n options: Device.MoveRelativeOptions = {}\n ): Promise<number> {\n const {\n timeout = Device.DEFAULT_MOVEMENT_TIMEOUT,\n } = options;\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.REL,\n arg: position,\n unit: unit,\n timeout: timeout,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Begins to move device at specified speed.\n * @param velocity Movement velocity.\n * @param [unit=Units.NATIVE] Unit to convert returned velocity to.\n * @returns Device velocity that has been converted to the provided unit.\n */\n public async moveVelocity(\n velocity: number,\n unit: Velocity | AngularVelocity | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.BinaryDeviceMoveRequest & gateway.Message = {\n ...requests.BinaryDeviceMoveRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n type: requests.AxisMoveType.VEL,\n arg: velocity,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceMoveRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/move',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Waits until device stops moving.\n */\n public async waitUntilIdle(): Promise<void> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/device/wait_until_idle', request);\n }\n\n /**\n * Check whether the device is moving.\n * @returns True if the device is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_busy',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\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: requests.DeviceIdentifyRequest & gateway.Message = {\n ...requests.DeviceIdentifyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n assumeVersion: assumeVersion,\n toBinary() {\n return requests.DeviceIdentifyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<DeviceIdentity>(\n 'binary/device/identify',\n request,\n DeviceIdentity.fromBinary);\n return response;\n }\n\n /**\n * Parks the axis.\n * Motor drivers remain enabled and hold current continues to be applied until the device is powered off.\n * It can later be unparked and moved without first having to home it.\n * Requires at least Firmware 6.06.\n */\n public async park(): Promise<void> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/device/park', request);\n }\n\n /**\n * Unparks axis. Axis will now be able to move.\n * Requires at least Firmware 6.06.\n */\n public async unpark(): Promise<void> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('binary/device/unpark', request);\n }\n\n /**\n * Returns bool indicating whether the axis is parked or not.\n * Requires at least Firmware 6.06.\n * @returns True if the axis is currently parked. False otherwise.\n */\n public async isParked(): Promise<boolean> {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'binary/device/is_parked',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns current device position.\n * @param [unit=Units.NATIVE] Units of position.\n * @returns Axis position.\n */\n public async getPosition(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.BinaryDeviceGetSettingRequest & gateway.Message = {\n ...requests.BinaryDeviceGetSettingRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n setting: BinarySettings.CURRENT_POSITION,\n unit: unit,\n toBinary() {\n return requests.BinaryDeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'binary/device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\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: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'binary/device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Returns identity.\n * @returns Device identity.\n */\n private _retrieveIdentity(): DeviceIdentity {\n const request: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<DeviceIdentity>(\n 'binary/device/get_identity',\n request,\n DeviceIdentity.fromBinary);\n return response;\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: requests.DeviceEmptyRequest & gateway.Message = {\n ...requests.DeviceEmptyRequest.DEFAULT,\n interfaceId: this.connection.interfaceId,\n device: this.deviceAddress,\n toBinary() {\n return requests.DeviceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'binary/device/get_is_identified',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Device {\n export interface GenericCommandOptions {\n timeout?: number;\n checkErrors?: boolean;\n }\n export interface GenericCommandWithUnitsOptions {\n timeout?: number;\n }\n export interface HomeOptions {\n unit?: Length | Angle | Native;\n timeout?: number;\n }\n export interface StopOptions {\n unit?: Length | Angle | Native;\n timeout?: number;\n }\n export interface MoveAbsoluteOptions {\n timeout?: number;\n }\n export interface MoveRelativeOptions {\n timeout?: number;\n }\n export interface IdentifyOptions {\n assumeVersion?: FirmwareVersion;\n }\n}\n"]}
|
package/dist/lib/library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N,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAtID,0BAsIC;AAED,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport * as requests from './requests';\nimport { LogOutputMode } from './log_output_mode';\nimport { DeviceDbSourceType } from './device_db_source_type';\n\nexport class Library {\n /**\n * Sets library logging output.\n * @param mode Logging output mode.\n * @param filePath Path of the file to open.\n */\n public static setLogOutput(\n mode: LogOutputMode,\n filePath?: string\n ): void {\n const request: requests.SetLogOutputRequest & gateway.Message = {\n ...requests.SetLogOutputRequest.DEFAULT,\n mode: mode,\n filePath: filePath,\n toBinary() {\n return requests.SetLogOutputRequest.toBinary(this);\n },\n };\n\n gateway.callSync('logging/set_output', request);\n }\n\n /**\n * Sets source of Device DB data. Allows selection of a web service or a local file.\n * @param sourceType Source type.\n * @param urlOrFilePath URL of the web service or path to the local file.\n * Leave empty for the default URL of Zaber web service.\n */\n public static setDeviceDbSource(\n sourceType: DeviceDbSourceType,\n urlOrFilePath?: string\n ): void {\n const request: requests.SetDeviceDbSourceRequest & gateway.Message = {\n ...requests.SetDeviceDbSourceRequest.DEFAULT,\n sourceType: sourceType,\n urlOrFilePath: urlOrFilePath,\n toBinary() {\n return requests.SetDeviceDbSourceRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/set_source', request);\n }\n\n /**\n * Enables Device DB store.\n * The store uses filesystem to save information obtained from the Device DB.\n * The stored data are later used instead of the Device DB.\n * @param storeLocation Specifies relative or absolute path of the folder used by the store.\n * If left empty defaults to a folder in user home directory.\n * Must be accessible by the process.\n */\n public static enableDeviceDbStore(\n storeLocation?: string\n ): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toggleOn: true,\n storeLocation: storeLocation,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables Device DB store.\n */\n public static disableDeviceDbStore(): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables certain customer checks (like FF flag).\n * @param mode Whether to turn internal mode on or off.\n */\n public static setInternalMode(\n mode: boolean\n ): void {\n const request: requests.SetInternalModeRequest & gateway.Message = {\n ...requests.SetInternalModeRequest.DEFAULT,\n mode: mode,\n toBinary() {\n return requests.SetInternalModeRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_internal_mode', request);\n }\n\n /**\n * Sets the period between polling for IDLE during movements.\n * Caution: Setting the period too low may cause performance issues.\n * @param period Period in milliseconds.\n * Negative value restores the default period.\n */\n public static setIdlePollingPeriod(\n period: number\n ): void {\n const request: requests.IntRequest & gateway.Message = {\n ...requests.IntRequest.DEFAULT,\n value: period,\n toBinary() {\n return requests.IntRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_idle_polling_period', request);\n }\n\n /**\n * Throws an error if the version of the loaded shared library does not match the caller's version.\n */\n public static checkVersion(): void {\n const request: requests.CheckVersionRequest & gateway.Message = {\n ...requests.CheckVersionRequest.DEFAULT,\n host: 'js',\n version: '7.2.
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/library.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AACrC,qDAAuC;AAIvC,MAAa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,YAAY,CAAC,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport * as requests from './requests';\nimport { LogOutputMode } from './log_output_mode';\nimport { DeviceDbSourceType } from './device_db_source_type';\n\nexport class Library {\n /**\n * Sets library logging output.\n * @param mode Logging output mode.\n * @param filePath Path of the file to open.\n */\n public static setLogOutput(\n mode: LogOutputMode,\n filePath?: string\n ): void {\n const request: requests.SetLogOutputRequest & gateway.Message = {\n ...requests.SetLogOutputRequest.DEFAULT,\n mode: mode,\n filePath: filePath,\n toBinary() {\n return requests.SetLogOutputRequest.toBinary(this);\n },\n };\n\n gateway.callSync('logging/set_output', request);\n }\n\n /**\n * Sets source of Device DB data. Allows selection of a web service or a local file.\n * @param sourceType Source type.\n * @param urlOrFilePath URL of the web service or path to the local file.\n * Leave empty for the default URL of Zaber web service.\n */\n public static setDeviceDbSource(\n sourceType: DeviceDbSourceType,\n urlOrFilePath?: string\n ): void {\n const request: requests.SetDeviceDbSourceRequest & gateway.Message = {\n ...requests.SetDeviceDbSourceRequest.DEFAULT,\n sourceType: sourceType,\n urlOrFilePath: urlOrFilePath,\n toBinary() {\n return requests.SetDeviceDbSourceRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/set_source', request);\n }\n\n /**\n * Enables Device DB store.\n * The store uses filesystem to save information obtained from the Device DB.\n * The stored data are later used instead of the Device DB.\n * @param storeLocation Specifies relative or absolute path of the folder used by the store.\n * If left empty defaults to a folder in user home directory.\n * Must be accessible by the process.\n */\n public static enableDeviceDbStore(\n storeLocation?: string\n ): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toggleOn: true,\n storeLocation: storeLocation,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables Device DB store.\n */\n public static disableDeviceDbStore(): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables certain customer checks (like FF flag).\n * @param mode Whether to turn internal mode on or off.\n */\n public static setInternalMode(\n mode: boolean\n ): void {\n const request: requests.SetInternalModeRequest & gateway.Message = {\n ...requests.SetInternalModeRequest.DEFAULT,\n mode: mode,\n toBinary() {\n return requests.SetInternalModeRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_internal_mode', request);\n }\n\n /**\n * Sets the period between polling for IDLE during movements.\n * Caution: Setting the period too low may cause performance issues.\n * @param period Period in milliseconds.\n * Negative value restores the default period.\n */\n public static setIdlePollingPeriod(\n period: number\n ): void {\n const request: requests.IntRequest & gateway.Message = {\n ...requests.IntRequest.DEFAULT,\n value: period,\n toBinary() {\n return requests.IntRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_idle_polling_period', request);\n }\n\n /**\n * Throws an error if the version of the loaded shared library does not match the caller's version.\n */\n public static checkVersion(): void {\n const request: requests.CheckVersionRequest & gateway.Message = {\n ...requests.CheckVersionRequest.DEFAULT,\n host: 'js',\n version: '7.2.2',\n toBinary() {\n return requests.CheckVersionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/check_version', request);\n }\n}\n\ngateway.addInitCallback(Library.checkVersion);\n"]}
|
|
@@ -6,6 +6,7 @@ export interface SetServoTuningRequest {
|
|
|
6
6
|
axis: number;
|
|
7
7
|
paramset: ServoTuningParamset;
|
|
8
8
|
tuningParams: ServoTuningParam[];
|
|
9
|
+
setUnspecifiedToDefault: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const SetServoTuningRequest: {
|
|
11
12
|
fromBinary: (buffer: Uint8Array) => SetServoTuningRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_servo_tuning_request.d.ts","sourceRoot":"","sources":["../../../src/requests/set_servo_tuning_request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAElC;AAED,eAAO,MAAM,qBAAqB;yBACX,UAAU,KAAG,qBAAqB;sBACrC,qBAAqB,KAAG,UAAU;;
|
|
1
|
+
{"version":3,"file":"set_servo_tuning_request.d.ts","sourceRoot":"","sources":["../../../src/requests/set_servo_tuning_request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IAEjC,uBAAuB,EAAE,OAAO,CAAC;CAElC;AAED,eAAO,MAAM,qBAAqB;yBACX,UAAU,KAAG,qBAAqB;sBACrC,qBAAqB,KAAG,UAAU;;sBASlC,qBAAqB,KAAG,qBAAqB;CAYhE,CAAC"}
|
|
@@ -15,6 +15,7 @@ exports.SetServoTuningRequest = {
|
|
|
15
15
|
axis: 0,
|
|
16
16
|
paramset: 0,
|
|
17
17
|
tuningParams: [],
|
|
18
|
+
setUnspecifiedToDefault: false,
|
|
18
19
|
}),
|
|
19
20
|
sanitize: (value) => {
|
|
20
21
|
var _a;
|
|
@@ -30,6 +31,7 @@ exports.SetServoTuningRequest = {
|
|
|
30
31
|
axis: sanitizer_1.sanitizer.sanitizeInt(value.axis, 'axis'),
|
|
31
32
|
paramset: sanitizer_1.sanitizer.sanitizeEnum(value.paramset, 'ServoTuningParamset', servo_tuning_paramset_1.ServoTuningParamset, 'paramset'),
|
|
32
33
|
tuningParams: Array.from((_a = value.tuningParams) !== null && _a !== void 0 ? _a : [], item => servo_tuning_param_1.ServoTuningParam.sanitize(item)),
|
|
34
|
+
setUnspecifiedToDefault: sanitizer_1.sanitizer.sanitizeBool(value.setUnspecifiedToDefault, 'setUnspecifiedToDefault'),
|
|
33
35
|
};
|
|
34
36
|
},
|
|
35
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_servo_tuning_request.js","sourceRoot":"","sources":["../../../src/requests/set_servo_tuning_request.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AACjD,0EAAqE;AACrE,oEAA+D;
|
|
1
|
+
{"version":3,"file":"set_servo_tuning_request.js","sourceRoot":"","sources":["../../../src/requests/set_servo_tuning_request.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AACjD,0EAAqE;AACrE,oEAA+D;AAiBlD,QAAA,qBAAqB,GAAG;IACnC,UAAU,EAAE,CAAC,MAAkB,EAAyB,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAA0B;IAC5G,QAAQ,EAAE,CAAC,KAA4B,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,6BAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7G,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,WAAW,EAAE,CAAC;QACd,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,CAAwB;QAClC,YAAY,EAAE,EAAE;QAChB,uBAAuB,EAAE,KAAK;KAC/B,CAAoC;IACrC,QAAQ,EAAE,CAAC,KAA4B,EAAyB,EAAE;;QAChE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,kEAAkE,CAAC,CAAA;QAAC,CAAC;QAC9G,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,iDAAiD,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QACxH,OAAO;YACL,WAAW,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC;YACpE,MAAM,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC;YACrD,IAAI,EAAE,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;YAC/C,QAAQ,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,qBAAqB,EAAE,2CAAmB,EAAE,UAAU,CAAC;YACxG,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,YAAY,mCAAI,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,qCAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC3F,uBAAuB,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,uBAAuB,EAAE,yBAAyB,CAAC;SAC1G,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\nimport { ServoTuningParamset } from '../ascii/servo_tuning_paramset';\nimport { ServoTuningParam } from '../ascii/servo_tuning_param';\n\nexport interface SetServoTuningRequest {\n interfaceId: number;\n\n device: number;\n\n axis: number;\n\n paramset: ServoTuningParamset;\n\n tuningParams: ServoTuningParam[];\n\n setUnspecifiedToDefault: boolean;\n\n}\n\nexport const SetServoTuningRequest = {\n fromBinary: (buffer: Uint8Array): SetServoTuningRequest => BSON.deserialize(buffer) as SetServoTuningRequest,\n toBinary: (value: SetServoTuningRequest): Uint8Array => BSON.serialize(SetServoTuningRequest.sanitize(value)),\n DEFAULT: Object.freeze({\n interfaceId: 0,\n device: 0,\n axis: 0,\n paramset: 0 as ServoTuningParamset,\n tuningParams: [],\n setUnspecifiedToDefault: false,\n }) as Readonly<SetServoTuningRequest>,\n sanitize: (value: SetServoTuningRequest): SetServoTuningRequest => {\n if (value == null) { throw new TypeError('Expected SetServoTuningRequest object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected SetServoTuningRequest object but got ${typeof value}.`) }\n return {\n interfaceId: sanitizer.sanitizeInt(value.interfaceId, 'interfaceId'),\n device: sanitizer.sanitizeInt(value.device, 'device'),\n axis: sanitizer.sanitizeInt(value.axis, 'axis'),\n paramset: sanitizer.sanitizeEnum(value.paramset, 'ServoTuningParamset', ServoTuningParamset, 'paramset'),\n tuningParams: Array.from(value.tuningParams ?? [], item => ServoTuningParam.sanitize(item)),\n setUnspecifiedToDefault: sanitizer.sanitizeBool(value.setUnspecifiedToDefault, 'setUnspecifiedToDefault'),\n };\n },\n};\n"]}
|