@zaber/motion 4.7.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/axis.d.ts +10 -0
- package/dist/lib/ascii/axis.js +22 -0
- package/dist/lib/ascii/axis.js.map +1 -1
- package/dist/lib/ascii/connection.d.ts +1 -0
- package/dist/lib/ascii/connection.js +1 -0
- package/dist/lib/ascii/connection.js.map +1 -1
- package/dist/lib/ascii/device.d.ts +7 -0
- package/dist/lib/ascii/device.js +9 -0
- package/dist/lib/ascii/device.js.map +1 -1
- package/dist/lib/ascii/index.d.ts +7 -0
- package/dist/lib/ascii/index.js +15 -1
- package/dist/lib/ascii/index.js.map +1 -1
- package/dist/lib/ascii/trigger.d.ts +134 -0
- package/dist/lib/ascii/trigger.js +302 -0
- package/dist/lib/ascii/trigger.js.map +1 -0
- package/dist/lib/ascii/trigger_action.d.ts +8 -0
- package/dist/lib/ascii/trigger_action.js +15 -0
- package/dist/lib/ascii/trigger_action.js.map +1 -0
- package/dist/lib/ascii/trigger_condition.d.ts +11 -0
- package/dist/lib/ascii/trigger_condition.js +18 -0
- package/dist/lib/ascii/trigger_condition.js.map +1 -0
- package/dist/lib/ascii/trigger_enabled_state.d.ts +19 -0
- package/dist/lib/ascii/trigger_enabled_state.js +18 -0
- package/dist/lib/ascii/trigger_enabled_state.js.map +1 -0
- package/dist/lib/ascii/trigger_operation.d.ts +8 -0
- package/dist/lib/ascii/trigger_operation.js +15 -0
- package/dist/lib/ascii/trigger_operation.js.map +1 -0
- package/dist/lib/ascii/trigger_state.d.ts +28 -0
- package/dist/lib/ascii/trigger_state.js +21 -0
- package/dist/lib/ascii/trigger_state.js.map +1 -0
- package/dist/lib/ascii/triggers.d.ts +43 -0
- package/dist/lib/ascii/triggers.js +107 -0
- package/dist/lib/ascii/triggers.js.map +1 -0
- package/dist/lib/ascii_ns.d.ts +14 -0
- package/dist/lib/ascii_ns.js +7 -0
- package/dist/lib/ascii_ns.js.map +1 -1
- package/dist/lib/microscopy/microscope.d.ts +2 -2
- package/dist/lib/microscopy/microscope.js +2 -2
- package/dist/lib/microscopy/microscope.js.map +1 -1
- package/dist/lib/protobufs/main_pb.d.ts +542 -0
- package/dist/lib/protobufs/main_pb.js +4136 -0
- package/dist/lib/protobufs/main_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../src/ascii/trigger.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,oCAA8D;AAE9D,mDAA+C;AAC/C,mEAA8D;AAG9D,qDAAiD;AAGjD;;;;;GAKG;AACH,MAAa,OAAO;IAClB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAGD,YAAY,MAAc,EAAE,aAAqB;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,MAAM,CACjB,QAAgB,CAAC;QAEjB,IAAI,KAAK,GAAG,CAAC,EAAE;YACb,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAC;SACpE;QACD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;QACnD,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,gBAAgB,CAA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aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,SAAS,CAAC,MAAa,CAAC,CAAC;QACjC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,CAAC,YAAY,CAAC,SAAgB,CAAC,CAAC;QACvC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAEpC,MAAM,OAAO,CAAC,SAAS,CAAC,gCAAgC,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,WAAW,CACtB,SAAwB,8BAAa,CAAC,GAAG;QAEzC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC;QACxD,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,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC7C,OAAO,CAAC,SAAS,CAAC,MAAa,CAAC,CAAC;QAEjC,MAAM,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAxVD,0BAwVC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Native, Units, Length, Angle, Time } from '../units';\nimport { Device } from './device';\nimport { TriggerState } from './trigger_state';\nimport { TriggerEnabledState } from './trigger_enabled_state';\nimport { IoPortType } from './io_port_type';\nimport { TriggerCondition } from './trigger_condition';\nimport { TriggerAction } from './trigger_action';\nimport { TriggerOperation } from './trigger_operation';\n\n/**\n * A handle for a trigger with this number on the device.\n * Triggers allow setting up actions that occur when a certain condition has been met or an event has occurred.\n * Please note that the Triggers API is currently an experimental feature.\n * Requires at least Firmware 7.06.\n */\nexport class Trigger {\n /**\n * Device that this trigger belongs to.\n */\n public get device(): Device {\n return this._device;\n }\n private _device: Device;\n\n /**\n * Number of this trigger.\n */\n public get triggerNumber(): number {\n return this._triggerNumber;\n }\n private _triggerNumber: number;\n\n constructor(device: Device, triggerNumber: number) {\n this._device = device;\n this._triggerNumber = triggerNumber;\n }\n\n /**\n * Enables the trigger.\n * Once a trigger is enabled, it will fire whenever its condition transitions from false to true.\n * If a trigger condition is true when a disabled trigger is enabled, the trigger will fire immediately.\n * @param [count=0] Number of times the trigger will fire before disabling itself.\n * If count is not specified, or 0, the trigger will fire indefinitely.\n */\n public async enable(\n count: number = 0\n ): Promise<void> {\n if (count < 0) {\n throw new TypeError('Invalid value; count must be 0 or positive.');\n }\n const request = new gateway.TriggerEnableRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setCount(count);\n\n await gateway.callAsync('trigger/enable', request);\n }\n\n /**\n * Disables the trigger.\n * Once disabled, the trigger will not fire and trigger actions will not run, even if trigger conditions are met.\n */\n public async disable(): Promise<void> {\n const request = new gateway.TriggerEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n\n await gateway.callAsync('trigger/disable', request);\n }\n\n /**\n * Gets the state of the trigger.\n * @returns Complete state of the trigger.\n */\n public async getState(): Promise<TriggerState> {\n const request = new gateway.TriggerEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n\n const response = await gateway.callAsync<gateway.TriggerState>(\n 'trigger/get_state',\n request,\n gateway.TriggerState);\n return TriggerState.fromProtobuf(response.toObject());\n }\n\n /**\n * Gets the enabled state of the trigger.\n * @returns Whether the trigger is enabled and the number of times it will fire.\n */\n public async getEnabledState(): Promise<TriggerEnabledState> {\n const request = new gateway.TriggerEmptyRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n\n const response = await gateway.callAsync<gateway.TriggerEnabledState>(\n 'trigger/get_enabled_state',\n request,\n gateway.TriggerEnabledState);\n return TriggerEnabledState.fromProtobuf(response.toObject());\n }\n\n /**\n * Set a generic trigger condition.\n * @param condition The condition to set for this trigger.\n */\n public async fireWhen(\n condition: string\n ): Promise<void> {\n const request = new gateway.TriggerFireWhenRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setCondition(condition);\n\n await gateway.callAsync('trigger/fire_when', request);\n }\n\n /**\n * Set a trigger condition for when an encoder position has changed by a specific distance.\n * @param axis The axis to monitor for this condition.\n * May be set to 0 on single-axis devices only.\n * @param dist The measured distance between trigger fires.\n * @param [unit=Units.NATIVE] Units of dist.\n */\n public async fireWhenEncoderDist(\n axis: number,\n dist: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n if (dist <= 0) {\n throw new TypeError('Invalid value; dist must be a positive value.');\n }\n const request = new gateway.TriggerFireWhenDistRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setAxis(axis);\n request.setDist(dist);\n request.setUnit(unit);\n\n await gateway.callAsync('trigger/fire_when_encoder_dist', request);\n }\n\n /**\n * Set a trigger condition for when an axis position has changed by a specific distance.\n * @param axis The axis to monitor for this condition.\n * May be set to 0 on single-axis devices only.\n * @param dist The measured distance between trigger fires.\n * @param [unit=Units.NATIVE] Units of dist.\n */\n public async fireWhenDist(\n axis: number,\n dist: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n if (dist <= 0) {\n throw new TypeError('Invalid value; dist must be a positive value.');\n }\n const request = new gateway.TriggerFireWhenDistRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setAxis(axis);\n request.setDist(dist);\n request.setUnit(unit);\n\n await gateway.callAsync('trigger/fire_when_dist', request);\n }\n\n /**\n * Set a trigger condition based on an IO channel value.\n * @param portType The type of IO channel to monitor.\n * @param channel The IO channel to monitor.\n * @param triggerCondition Comparison operator.\n * @param value Comparison value.\n */\n public async fireWhenIo(\n portType: IoPortType,\n channel: number,\n triggerCondition: TriggerCondition,\n value: number\n ): Promise<void> {\n if (channel <= 0) {\n throw new TypeError('Invalid value; channel must be a positive value.');\n }\n const request = new gateway.TriggerFireWhenIoRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setPortType(portType as any);\n request.setChannel(channel);\n request.setTriggerCondition(triggerCondition as any);\n request.setValue(value);\n\n await gateway.callAsync('trigger/fire_when_io', request);\n }\n\n /**\n * Set a trigger condition based on a setting value.\n * @param axis The axis to monitor for this condition.\n * Set to 0 for device-scope settings.\n * @param setting The setting to monitor.\n * @param triggerCondition Comparison operator.\n * @param value Comparison value.\n * @param [unit=Units.NATIVE] Units of value.\n */\n public async fireWhenSetting(\n axis: number,\n setting: string,\n triggerCondition: TriggerCondition,\n value: number,\n unit: Units = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.TriggerFireWhenSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setAxis(axis);\n request.setSetting(setting);\n request.setTriggerCondition(triggerCondition as any);\n request.setValue(value);\n request.setUnit(unit);\n\n await gateway.callAsync('trigger/fire_when_setting', request);\n }\n\n /**\n * Set a trigger condition based on a time interval.\n * @param interval The time interval between trigger fires.\n * @param [unit=Units.NATIVE] Units of time.\n */\n public async fireAtInterval(\n interval: number,\n unit: Time | Native = Units.NATIVE\n ): Promise<void> {\n if (interval <= 0) {\n throw new TypeError('Invalid value; interval must be a positive value.');\n }\n const request = new gateway.TriggerFireAtIntervalRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setInterval(interval);\n request.setUnit(unit);\n\n await gateway.callAsync('trigger/fire_at_interval', request);\n }\n\n /**\n * Set a command to be a trigger action.\n * @param action The action number to assign the command to.\n * @param axis The axis to on which to run this command.\n * Set to 0 for device-scope settings or to run command on all axes.\n * @param command The command to run when the action is triggered.\n */\n public async onFire(\n action: TriggerAction,\n axis: number,\n command: string\n ): Promise<void> {\n const request = new gateway.TriggerOnFireRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setAction(action as any);\n request.setAxis(axis);\n request.setCommand(command);\n\n await gateway.callAsync('trigger/on_fire', request);\n }\n\n /**\n * Set a trigger action to update a setting.\n * @param action The action number to assign the command to.\n * @param axis The axis on which to change the setting.\n * Set to 0 to change the setting for the device.\n * @param setting The name of the setting to change.\n * @param operation The operation to apply to the setting.\n * @param value Operation value.\n * @param [unit=Units.NATIVE] Units of value.\n */\n public async onFireSet(\n action: TriggerAction,\n axis: number,\n setting: string,\n operation: TriggerOperation,\n value: number,\n unit: Units = Units.NATIVE\n ): Promise<void> {\n const request = new gateway.TriggerOnFireSetRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setAction(action as any);\n request.setAxis(axis);\n request.setSetting(setting);\n request.setOperation(operation as any);\n request.setValue(value);\n request.setUnit(unit);\n\n await gateway.callAsync('trigger/on_fire_set', request);\n }\n\n /**\n * Set a trigger action to update a setting with the value of another setting.\n * @param action The action number to assign the command to.\n * @param axis The axis on which to change the setting.\n * Set to 0 to change the setting for the device.\n * @param setting The name of the setting to change.\n * Must have either integer or boolean type.\n * @param operation The operation to apply to the setting.\n * @param fromAxis The axis from which to read the setting.\n * Set to 0 to read the setting for the device.\n * @param fromSetting The name of the setting to read.\n * Must have either integer or boolean type.\n */\n public async onFireSetToSetting(\n action: TriggerAction,\n axis: number,\n setting: string,\n operation: TriggerOperation,\n fromAxis: number,\n fromSetting: string\n ): Promise<void> {\n const request = new gateway.TriggerOnFireSetToSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setAction(action as any);\n request.setAxis(axis);\n request.setSetting(setting);\n request.setOperation(operation as any);\n request.setFromAxis(fromAxis);\n request.setFromSetting(fromSetting);\n\n await gateway.callAsync('trigger/on_fire_set_to_setting', request);\n }\n\n /**\n * Clear a trigger action.\n * @param [action=TriggerAction.ALL] The action number to clear.\n * The default option is to clear all actions.\n */\n public async clearAction(\n action: TriggerAction = TriggerAction.ALL\n ): Promise<void> {\n const request = new gateway.TriggerClearActionRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setTriggerNumber(this.triggerNumber);\n request.setAction(action as any);\n\n await gateway.callAsync('trigger/clear_action', request);\n }\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TriggerAction = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Trigger action identifier.
|
|
8
|
+
*/
|
|
9
|
+
var TriggerAction;
|
|
10
|
+
(function (TriggerAction) {
|
|
11
|
+
TriggerAction[TriggerAction["ALL"] = 0] = "ALL";
|
|
12
|
+
TriggerAction[TriggerAction["A"] = 1] = "A";
|
|
13
|
+
TriggerAction[TriggerAction["B"] = 2] = "B";
|
|
14
|
+
})(TriggerAction = exports.TriggerAction || (exports.TriggerAction = {}));
|
|
15
|
+
//# sourceMappingURL=trigger_action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger_action.js","sourceRoot":"","sources":["../../../src/ascii/trigger_action.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD;;GAEG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,+CAAO,CAAA;IACP,2CAAK,CAAA;IACL,2CAAK,CAAA;AACP,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\n/**\n * Trigger action identifier.\n */\nexport enum TriggerAction {\n ALL = 0,\n A = 1,\n B = 2,\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TriggerCondition = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Comparison operator for trigger condition.
|
|
8
|
+
*/
|
|
9
|
+
var TriggerCondition;
|
|
10
|
+
(function (TriggerCondition) {
|
|
11
|
+
TriggerCondition[TriggerCondition["EQ"] = 0] = "EQ";
|
|
12
|
+
TriggerCondition[TriggerCondition["NE"] = 1] = "NE";
|
|
13
|
+
TriggerCondition[TriggerCondition["GT"] = 2] = "GT";
|
|
14
|
+
TriggerCondition[TriggerCondition["GE"] = 3] = "GE";
|
|
15
|
+
TriggerCondition[TriggerCondition["LT"] = 4] = "LT";
|
|
16
|
+
TriggerCondition[TriggerCondition["LE"] = 5] = "LE";
|
|
17
|
+
})(TriggerCondition = exports.TriggerCondition || (exports.TriggerCondition = {}));
|
|
18
|
+
//# sourceMappingURL=trigger_condition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger_condition.js","sourceRoot":"","sources":["../../../src/ascii/trigger_condition.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD;;GAEG;AACH,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,mDAAM,CAAA;IACN,mDAAM,CAAA;AACR,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\n/**\n * Comparison operator for trigger condition.\n */\nexport enum TriggerCondition {\n EQ = 0,\n NE = 1,\n GT = 2,\n GE = 3,\n LT = 4,\n LE = 5,\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The enabled state of a single trigger.
|
|
3
|
+
* Returns whether the given trigger is enabled and the number of times it will fire.
|
|
4
|
+
* This is a subset of the complete state, and is faster to query.
|
|
5
|
+
*/
|
|
6
|
+
export interface TriggerEnabledState {
|
|
7
|
+
/**
|
|
8
|
+
* The enabled state for a trigger.
|
|
9
|
+
*/
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The number of remaining fires for this trigger.
|
|
13
|
+
* If this is 0 and the trigger is enabled, there are unlimited remaining fires.
|
|
14
|
+
*/
|
|
15
|
+
firesRemaining: number;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace TriggerEnabledState {
|
|
18
|
+
const __type = "TriggerEnabledState";
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TriggerEnabledState = void 0;
|
|
6
|
+
var TriggerEnabledState;
|
|
7
|
+
(function (TriggerEnabledState) {
|
|
8
|
+
TriggerEnabledState.__type = 'TriggerEnabledState';
|
|
9
|
+
/** @internal */
|
|
10
|
+
function fromProtobuf(pbData) {
|
|
11
|
+
return {
|
|
12
|
+
enabled: pbData.enabled,
|
|
13
|
+
firesRemaining: pbData.firesRemaining,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
TriggerEnabledState.fromProtobuf = fromProtobuf;
|
|
17
|
+
})(TriggerEnabledState = exports.TriggerEnabledState || (exports.TriggerEnabledState = {}));
|
|
18
|
+
//# sourceMappingURL=trigger_enabled_state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger_enabled_state.js","sourceRoot":"","sources":["../../../src/ascii/trigger_enabled_state.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAuBtD,IAAiB,mBAAmB,CAUnC;AAVD,WAAiB,mBAAmB;IACrB,0BAAM,GAAG,qBAAqB,CAAC;IAE5C,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAA4C;QACvE,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,cAAc,EAAE,MAAM,CAAC,cAAc;SACtC,CAAC;IACJ,CAAC;IALe,gCAAY,eAK3B,CAAA;AACH,CAAC,EAVgB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAUnC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * The enabled state of a single trigger.\n * Returns whether the given trigger is enabled and the number of times it will fire.\n * This is a subset of the complete state, and is faster to query.\n */\nexport interface TriggerEnabledState {\n /**\n * The enabled state for a trigger.\n */\n enabled: boolean;\n\n /**\n * The number of remaining fires for this trigger.\n * If this is 0 and the trigger is enabled, there are unlimited remaining fires.\n */\n firesRemaining: number;\n\n}\n\nexport namespace TriggerEnabledState {\n export const __type = 'TriggerEnabledState';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.TriggerEnabledState.AsObject): TriggerEnabledState {\n return {\n enabled: pbData.enabled,\n firesRemaining: pbData.firesRemaining,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TriggerOperation = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Operation for trigger action.
|
|
8
|
+
*/
|
|
9
|
+
var TriggerOperation;
|
|
10
|
+
(function (TriggerOperation) {
|
|
11
|
+
TriggerOperation[TriggerOperation["SET_TO"] = 0] = "SET_TO";
|
|
12
|
+
TriggerOperation[TriggerOperation["INCREMENT_BY"] = 1] = "INCREMENT_BY";
|
|
13
|
+
TriggerOperation[TriggerOperation["DECREMENT_BY"] = 2] = "DECREMENT_BY";
|
|
14
|
+
})(TriggerOperation = exports.TriggerOperation || (exports.TriggerOperation = {}));
|
|
15
|
+
//# sourceMappingURL=trigger_operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger_operation.js","sourceRoot":"","sources":["../../../src/ascii/trigger_operation.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD;;GAEG;AACH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,2DAAU,CAAA;IACV,uEAAgB,CAAA;IAChB,uEAAgB,CAAA;AAClB,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\n/**\n * Operation for trigger action.\n */\nexport enum TriggerOperation {\n SET_TO = 0,\n INCREMENT_BY = 1,\n DECREMENT_BY = 2,\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The complete state of a trigger.
|
|
3
|
+
*/
|
|
4
|
+
export interface TriggerState {
|
|
5
|
+
/**
|
|
6
|
+
* The firing condition for a trigger.
|
|
7
|
+
*/
|
|
8
|
+
condition: string;
|
|
9
|
+
/**
|
|
10
|
+
* The actions for a trigger.
|
|
11
|
+
*/
|
|
12
|
+
actions: string[];
|
|
13
|
+
/**
|
|
14
|
+
* The enabled state for a trigger.
|
|
15
|
+
*/
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The number of total fires for this trigger.
|
|
19
|
+
*/
|
|
20
|
+
firesTotal: number;
|
|
21
|
+
/**
|
|
22
|
+
* The number of remaining fires for this trigger.
|
|
23
|
+
*/
|
|
24
|
+
firesRemaining: number;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace TriggerState {
|
|
27
|
+
const __type = "TriggerState";
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
|
|
3
|
+
// ============= DO NOT EDIT DIRECTLY ============= //
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TriggerState = void 0;
|
|
6
|
+
var TriggerState;
|
|
7
|
+
(function (TriggerState) {
|
|
8
|
+
TriggerState.__type = 'TriggerState';
|
|
9
|
+
/** @internal */
|
|
10
|
+
function fromProtobuf(pbData) {
|
|
11
|
+
return {
|
|
12
|
+
condition: pbData.condition,
|
|
13
|
+
actions: pbData.actionsList,
|
|
14
|
+
enabled: pbData.enabled,
|
|
15
|
+
firesTotal: pbData.firesTotal,
|
|
16
|
+
firesRemaining: pbData.firesRemaining,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
TriggerState.fromProtobuf = fromProtobuf;
|
|
20
|
+
})(TriggerState = exports.TriggerState || (exports.TriggerState = {}));
|
|
21
|
+
//# sourceMappingURL=trigger_state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger_state.js","sourceRoot":"","sources":["../../../src/ascii/trigger_state.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAmCtD,IAAiB,YAAY,CAa5B;AAbD,WAAiB,YAAY;IACd,mBAAM,GAAG,cAAc,CAAC;IAErC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAqC;QAChE,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,OAAO,EAAE,MAAM,CAAC,WAAW;YAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,cAAc,EAAE,MAAM,CAAC,cAAc;SACtC,CAAC;IACJ,CAAC;IARe,yBAAY,eAQ3B,CAAA;AACH,CAAC,EAbgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAa5B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * The complete state of a trigger.\n */\nexport interface TriggerState {\n /**\n * The firing condition for a trigger.\n */\n condition: string;\n\n /**\n * The actions for a trigger.\n */\n actions: string[];\n\n /**\n * The enabled state for a trigger.\n */\n enabled: boolean;\n\n /**\n * The number of total fires for this trigger.\n */\n firesTotal: number;\n\n /**\n * The number of remaining fires for this trigger.\n */\n firesRemaining: number;\n\n}\n\nexport namespace TriggerState {\n export const __type = 'TriggerState';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.TriggerState.AsObject): TriggerState {\n return {\n condition: pbData.condition,\n actions: pbData.actionsList,\n enabled: pbData.enabled,\n firesTotal: pbData.firesTotal,\n firesRemaining: pbData.firesRemaining,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Device } from './device';
|
|
2
|
+
import { Trigger } from './trigger';
|
|
3
|
+
import { TriggerState } from './trigger_state';
|
|
4
|
+
import { TriggerEnabledState } from './trigger_enabled_state';
|
|
5
|
+
/**
|
|
6
|
+
* Class providing access to device triggers.
|
|
7
|
+
* Please note that the Triggers API is currently an experimental feature.
|
|
8
|
+
* Requires at least Firmware 7.06.
|
|
9
|
+
*/
|
|
10
|
+
export declare class Triggers {
|
|
11
|
+
/**
|
|
12
|
+
* Device that these triggers belong to.
|
|
13
|
+
*/
|
|
14
|
+
get device(): Device;
|
|
15
|
+
private _device;
|
|
16
|
+
constructor(device: Device);
|
|
17
|
+
/**
|
|
18
|
+
* Get the number of triggers for this device.
|
|
19
|
+
* @returns Number of triggers for this device.
|
|
20
|
+
*/
|
|
21
|
+
getNumberOfTriggers(): Promise<number>;
|
|
22
|
+
/**
|
|
23
|
+
* Get the number of actions for each trigger for this device.
|
|
24
|
+
* @returns Number of actions for each trigger for this device.
|
|
25
|
+
*/
|
|
26
|
+
getNumberOfActions(): Promise<number>;
|
|
27
|
+
/**
|
|
28
|
+
* Get a specific trigger for this device.
|
|
29
|
+
* @param triggerNumber The number of the trigger to control. Trigger numbers start at 1.
|
|
30
|
+
* @returns Trigger instance.
|
|
31
|
+
*/
|
|
32
|
+
getTrigger(triggerNumber: number): Trigger;
|
|
33
|
+
/**
|
|
34
|
+
* Get the state for every trigger for this device.
|
|
35
|
+
* @returns Complete state for every trigger.
|
|
36
|
+
*/
|
|
37
|
+
getTriggerStates(): Promise<TriggerState[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the enabled state for every trigger for this device.
|
|
40
|
+
* @returns Whether triggers are enabled and the number of times they will fire.
|
|
41
|
+
*/
|
|
42
|
+
getEnabledStates(): Promise<TriggerEnabledState[]>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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.Triggers = void 0;
|
|
29
|
+
const gateway = __importStar(require("../gateway"));
|
|
30
|
+
const trigger_1 = require("./trigger");
|
|
31
|
+
const trigger_state_1 = require("./trigger_state");
|
|
32
|
+
const trigger_enabled_state_1 = require("./trigger_enabled_state");
|
|
33
|
+
/**
|
|
34
|
+
* Class providing access to device triggers.
|
|
35
|
+
* Please note that the Triggers API is currently an experimental feature.
|
|
36
|
+
* Requires at least Firmware 7.06.
|
|
37
|
+
*/
|
|
38
|
+
class Triggers {
|
|
39
|
+
/**
|
|
40
|
+
* Device that these triggers belong to.
|
|
41
|
+
*/
|
|
42
|
+
get device() {
|
|
43
|
+
return this._device;
|
|
44
|
+
}
|
|
45
|
+
constructor(device) {
|
|
46
|
+
this._device = device;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get the number of triggers for this device.
|
|
50
|
+
* @returns Number of triggers for this device.
|
|
51
|
+
*/
|
|
52
|
+
async getNumberOfTriggers() {
|
|
53
|
+
const request = new gateway.DeviceGetSettingRequest();
|
|
54
|
+
request.setInterfaceId(this.device.connection.interfaceId);
|
|
55
|
+
request.setDevice(this.device.deviceAddress);
|
|
56
|
+
request.setSetting('trigger.numtriggers');
|
|
57
|
+
const response = await gateway.callAsync('triggers/get_setting', request, gateway.IntResponse);
|
|
58
|
+
return response.getValue();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get the number of actions for each trigger for this device.
|
|
62
|
+
* @returns Number of actions for each trigger for this device.
|
|
63
|
+
*/
|
|
64
|
+
async getNumberOfActions() {
|
|
65
|
+
const request = new gateway.DeviceGetSettingRequest();
|
|
66
|
+
request.setInterfaceId(this.device.connection.interfaceId);
|
|
67
|
+
request.setDevice(this.device.deviceAddress);
|
|
68
|
+
request.setSetting('trigger.numactions');
|
|
69
|
+
const response = await gateway.callAsync('triggers/get_setting', request, gateway.IntResponse);
|
|
70
|
+
return response.getValue();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get a specific trigger for this device.
|
|
74
|
+
* @param triggerNumber The number of the trigger to control. Trigger numbers start at 1.
|
|
75
|
+
* @returns Trigger instance.
|
|
76
|
+
*/
|
|
77
|
+
getTrigger(triggerNumber) {
|
|
78
|
+
if (triggerNumber <= 0) {
|
|
79
|
+
throw new TypeError('Invalid value; triggers are numbered from 1.');
|
|
80
|
+
}
|
|
81
|
+
return new trigger_1.Trigger(this.device, triggerNumber);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get the state for every trigger for this device.
|
|
85
|
+
* @returns Complete state for every trigger.
|
|
86
|
+
*/
|
|
87
|
+
async getTriggerStates() {
|
|
88
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
89
|
+
request.setInterfaceId(this.device.connection.interfaceId);
|
|
90
|
+
request.setDevice(this.device.deviceAddress);
|
|
91
|
+
const response = await gateway.callAsync('triggers/get_trigger_states', request, gateway.TriggerStates);
|
|
92
|
+
return response.getStatesList().map(a => trigger_state_1.TriggerState.fromProtobuf(a.toObject()));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Gets the enabled state for every trigger for this device.
|
|
96
|
+
* @returns Whether triggers are enabled and the number of times they will fire.
|
|
97
|
+
*/
|
|
98
|
+
async getEnabledStates() {
|
|
99
|
+
const request = new gateway.DeviceEmptyRequest();
|
|
100
|
+
request.setInterfaceId(this.device.connection.interfaceId);
|
|
101
|
+
request.setDevice(this.device.deviceAddress);
|
|
102
|
+
const response = await gateway.callAsync('triggers/get_enabled_states', request, gateway.TriggerEnabledStates);
|
|
103
|
+
return response.getStatesList().map(a => trigger_enabled_state_1.TriggerEnabledState.fromProtobuf(a.toObject()));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.Triggers = Triggers;
|
|
107
|
+
//# sourceMappingURL=triggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../../src/ascii/triggers.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtD,oDAAsC;AACtC,uCAAoC;AACpC,mDAA+C;AAC/C,mEAA8D;AAE9D;;;;GAIG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD,YAAY,MA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C;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC3B,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,6BAA6B,EAC7B,OAAO,EACP,OAAO,CAAC,aAAa,CAAC,CAAC;QACzB,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,4BAAY,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACpF,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,gBAAgB;QAC3B,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,6BAA6B,EAC7B,OAAO,EACP,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,2CAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3F,CAAC;CACF;AA5FD,4BA4FC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { Device } from './device';\nimport * as gateway from '../gateway';\nimport { Trigger } from './trigger';\nimport { TriggerState } from './trigger_state';\nimport { TriggerEnabledState } from './trigger_enabled_state';\n\n/**\n * Class providing access to device triggers.\n * Please note that the Triggers API is currently an experimental feature.\n * Requires at least Firmware 7.06.\n */\nexport class Triggers {\n /**\n * Device that these triggers belong to.\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 * Get the number of triggers for this device.\n * @returns Number of triggers for this device.\n */\n public async getNumberOfTriggers(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('trigger.numtriggers');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'triggers/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get the number of actions for each trigger for this device.\n * @returns Number of actions for each trigger for this device.\n */\n public async getNumberOfActions(): Promise<number> {\n const request = new gateway.DeviceGetSettingRequest();\n request.setInterfaceId(this.device.connection.interfaceId);\n request.setDevice(this.device.deviceAddress);\n request.setSetting('trigger.numactions');\n\n const response = await gateway.callAsync<gateway.IntResponse>(\n 'triggers/get_setting',\n request,\n gateway.IntResponse);\n return response.getValue();\n }\n\n /**\n * Get a specific trigger for this device.\n * @param triggerNumber The number of the trigger to control. Trigger numbers start at 1.\n * @returns Trigger instance.\n */\n public getTrigger(\n triggerNumber: number\n ): Trigger {\n if (triggerNumber <= 0) {\n throw new TypeError('Invalid value; triggers are numbered from 1.');\n }\n return new Trigger(this.device, triggerNumber);\n }\n\n /**\n * Get the state for every trigger for this device.\n * @returns Complete state for every trigger.\n */\n public async getTriggerStates(): Promise<TriggerState[]> {\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.TriggerStates>(\n 'triggers/get_trigger_states',\n request,\n gateway.TriggerStates);\n return response.getStatesList().map(a => TriggerState.fromProtobuf(a.toObject()));\n }\n\n /**\n * Gets the enabled state for every trigger for this device.\n * @returns Whether triggers are enabled and the number of times they will fire.\n */\n public async getEnabledStates(): Promise<TriggerEnabledState[]> {\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.TriggerEnabledStates>(\n 'triggers/get_enabled_states',\n request,\n gateway.TriggerEnabledStates);\n return response.getStatesList().map(a => TriggerEnabledState.fromProtobuf(a.toObject()));\n }\n}\n"]}
|
package/dist/lib/ascii_ns.d.ts
CHANGED
|
@@ -104,4 +104,18 @@ export declare namespace ascii {
|
|
|
104
104
|
type PvtAxisType = asciiImport.PvtAxisType;
|
|
105
105
|
const AxisGroup: typeof asciiImport.AxisGroup;
|
|
106
106
|
type AxisGroup = asciiImport.AxisGroup;
|
|
107
|
+
const Trigger: typeof asciiImport.Trigger;
|
|
108
|
+
type Trigger = asciiImport.Trigger;
|
|
109
|
+
const Triggers: typeof asciiImport.Triggers;
|
|
110
|
+
type Triggers = asciiImport.Triggers;
|
|
111
|
+
const TriggerState: typeof asciiImport.TriggerState;
|
|
112
|
+
type TriggerState = asciiImport.TriggerState;
|
|
113
|
+
const TriggerEnabledState: typeof asciiImport.TriggerEnabledState;
|
|
114
|
+
type TriggerEnabledState = asciiImport.TriggerEnabledState;
|
|
115
|
+
const TriggerAction: typeof asciiImport.TriggerAction;
|
|
116
|
+
type TriggerAction = asciiImport.TriggerAction;
|
|
117
|
+
const TriggerCondition: typeof asciiImport.TriggerCondition;
|
|
118
|
+
type TriggerCondition = asciiImport.TriggerCondition;
|
|
119
|
+
const TriggerOperation: typeof asciiImport.TriggerOperation;
|
|
120
|
+
type TriggerOperation = asciiImport.TriggerOperation;
|
|
107
121
|
}
|
package/dist/lib/ascii_ns.js
CHANGED
|
@@ -79,5 +79,12 @@ var ascii;
|
|
|
79
79
|
ascii.PvtAxisDefinition = asciiImport.PvtAxisDefinition;
|
|
80
80
|
ascii.PvtAxisType = asciiImport.PvtAxisType;
|
|
81
81
|
ascii.AxisGroup = asciiImport.AxisGroup;
|
|
82
|
+
ascii.Trigger = asciiImport.Trigger;
|
|
83
|
+
ascii.Triggers = asciiImport.Triggers;
|
|
84
|
+
ascii.TriggerState = asciiImport.TriggerState;
|
|
85
|
+
ascii.TriggerEnabledState = asciiImport.TriggerEnabledState;
|
|
86
|
+
ascii.TriggerAction = asciiImport.TriggerAction;
|
|
87
|
+
ascii.TriggerCondition = asciiImport.TriggerCondition;
|
|
88
|
+
ascii.TriggerOperation = asciiImport.TriggerOperation;
|
|
82
89
|
})(ascii = exports.ascii || (exports.ascii = {}));
|
|
83
90
|
//# sourceMappingURL=ascii_ns.js.map
|
package/dist/lib/ascii_ns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ascii_ns.js","sourceRoot":"","sources":["../../src/ascii_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAEvC,IAAiB,KAAK,
|
|
1
|
+
{"version":3,"file":"ascii_ns.js","sourceRoot":"","sources":["../../src/ascii_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAEvC,IAAiB,KAAK,CAuHrB;AAvHD,WAAiB,KAAK;IACP,gBAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAEpC,aAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAE9B,UAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAExB,kBAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IAExC,kBAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IAExC,cAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IAEhC,gBAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAEpC,YAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAE5B,cAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IAEh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GAAG,WAAW,CAAC,mBAAmB,CAAC;IAEtD,kBAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IAExC,eAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IAElC,sBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAEhD,iCAA2B,GAAG,WAAW,CAAC,2BAA2B,CAAC;IAEtE,iBAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAEtC,mBAAa,GAAG,WAAW,CAAC,aAAa,CAAC;IAE1C,sBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAEhD,6BAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC;IAE9D,+BAAyB,GAAG,WAAW,CAAC,yBAAyB,CAAC;IAElE,iBAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAEtC,eAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IAElC,aAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAE9B,uBAAiB,GAAG,WAAW,CAAC,iBAAiB,CAAC;IAElD,iBAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAEtC,eAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IAElC,aAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAE9B,cAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IAEhC,kBAAY,GAAG,WAAW,CAAC,YAAY,CAAC;IAExC,yBAAmB,GAAG,WAAW,CAAC,mBAAmB,CAAC;IAEtD,mBAAa,GAAG,WAAW,CAAC,aAAa,CAAC;IAE1C,sBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAEhD,sBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;AAE/D,CAAC,EAvHgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAuHrB","sourcesContent":["import * as asciiImport from './ascii';\n\nexport namespace ascii {\n export const AlertEvent = asciiImport.AlertEvent;\n export type AlertEvent = asciiImport.AlertEvent;\n export const AllAxes = asciiImport.AllAxes;\n export type AllAxes = asciiImport.AllAxes;\n export const Axis = asciiImport.Axis;\n export type Axis = asciiImport.Axis;\n export const AxisIdentity = asciiImport.AxisIdentity;\n export type AxisIdentity = asciiImport.AxisIdentity;\n export const AxisSettings = asciiImport.AxisSettings;\n export type AxisSettings = asciiImport.AxisSettings;\n export const AxisType = asciiImport.AxisType;\n export type AxisType = asciiImport.AxisType;\n export const Connection = asciiImport.Connection;\n export type Connection = asciiImport.Connection;\n export const Device = asciiImport.Device;\n export type Device = asciiImport.Device;\n export const DeviceIO = asciiImport.DeviceIO;\n export type DeviceIO = asciiImport.DeviceIO;\n export const DeviceIOInfo = asciiImport.DeviceIOInfo;\n export type DeviceIOInfo = asciiImport.DeviceIOInfo;\n export const DeviceIdentity = asciiImport.DeviceIdentity;\n export type DeviceIdentity = asciiImport.DeviceIdentity;\n export const DeviceSettings = asciiImport.DeviceSettings;\n export type DeviceSettings = asciiImport.DeviceSettings;\n export const GetSetting = asciiImport.GetSetting;\n export type GetSetting = asciiImport.GetSetting;\n export const GetAxisSetting = asciiImport.GetAxisSetting;\n export type GetAxisSetting = asciiImport.GetAxisSetting;\n export const GetSettingResult = asciiImport.GetSettingResult;\n export type GetSettingResult = asciiImport.GetSettingResult;\n export const GetAxisSettingResult = asciiImport.GetAxisSettingResult;\n export type GetAxisSettingResult = asciiImport.GetAxisSettingResult;\n export const IoPortType = asciiImport.IoPortType;\n export type IoPortType = asciiImport.IoPortType;\n export const Lockstep = asciiImport.Lockstep;\n export type Lockstep = asciiImport.Lockstep;\n export const LockstepAxes = asciiImport.LockstepAxes;\n export type LockstepAxes = asciiImport.LockstepAxes;\n export const Oscilloscope = asciiImport.Oscilloscope;\n export type Oscilloscope = asciiImport.Oscilloscope;\n export const OscilloscopeData = asciiImport.OscilloscopeData;\n export type OscilloscopeData = asciiImport.OscilloscopeData;\n export const OscilloscopeDataSource = asciiImport.OscilloscopeDataSource;\n export type OscilloscopeDataSource = asciiImport.OscilloscopeDataSource;\n export const OscilloscopeCaptureProperties = asciiImport.OscilloscopeCaptureProperties;\n export type OscilloscopeCaptureProperties = asciiImport.OscilloscopeCaptureProperties;\n export const MessageType = asciiImport.MessageType;\n export type MessageType = asciiImport.MessageType;\n export const Response = asciiImport.Response;\n export type Response = asciiImport.Response;\n export const SettingConstants = asciiImport.SettingConstants;\n export type SettingConstants = asciiImport.SettingConstants;\n export const UnknownResponseEvent = asciiImport.UnknownResponseEvent;\n export type UnknownResponseEvent = asciiImport.UnknownResponseEvent;\n export const Warnings = asciiImport.Warnings;\n export type Warnings = asciiImport.Warnings;\n export const WarningFlags = asciiImport.WarningFlags;\n export type WarningFlags = asciiImport.WarningFlags;\n export const Stream = asciiImport.Stream;\n export type Stream = asciiImport.Stream;\n export const StreamBuffer = asciiImport.StreamBuffer;\n export type StreamBuffer = asciiImport.StreamBuffer;\n export const StreamMode = asciiImport.StreamMode;\n export type StreamMode = asciiImport.StreamMode;\n export const StreamAxisType = asciiImport.StreamAxisType;\n export type StreamAxisType = asciiImport.StreamAxisType;\n export const StreamAxisDefinition = asciiImport.StreamAxisDefinition;\n export type StreamAxisDefinition = asciiImport.StreamAxisDefinition;\n export const Transport = asciiImport.Transport;\n export type Transport = asciiImport.Transport;\n export const ServoTuner = asciiImport.ServoTuner;\n export type ServoTuner = asciiImport.ServoTuner;\n export const ServoTuningParamset = asciiImport.ServoTuningParamset;\n export type ServoTuningParamset = asciiImport.ServoTuningParamset;\n export const ParamsetInfo = asciiImport.ParamsetInfo;\n export type ParamsetInfo = asciiImport.ParamsetInfo;\n export const PidTuning = asciiImport.PidTuning;\n export type PidTuning = asciiImport.PidTuning;\n export const ServoTuningParam = asciiImport.ServoTuningParam;\n export type ServoTuningParam = asciiImport.ServoTuningParam;\n export const SimpleTuningParamDefinition = asciiImport.SimpleTuningParamDefinition;\n export type SimpleTuningParamDefinition = asciiImport.SimpleTuningParamDefinition;\n export const AxisStorage = asciiImport.AxisStorage;\n export type AxisStorage = asciiImport.AxisStorage;\n export const DeviceStorage = asciiImport.DeviceStorage;\n export type DeviceStorage = asciiImport.DeviceStorage;\n export const ConversionFactor = asciiImport.ConversionFactor;\n export type ConversionFactor = asciiImport.ConversionFactor;\n export const CanSetStateAxisResponse = asciiImport.CanSetStateAxisResponse;\n export type CanSetStateAxisResponse = asciiImport.CanSetStateAxisResponse;\n export const CanSetStateDeviceResponse = asciiImport.CanSetStateDeviceResponse;\n export type CanSetStateDeviceResponse = asciiImport.CanSetStateDeviceResponse;\n export const PvtSequence = asciiImport.PvtSequence;\n export type PvtSequence = asciiImport.PvtSequence;\n export const PvtBuffer = asciiImport.PvtBuffer;\n export type PvtBuffer = asciiImport.PvtBuffer;\n export const PvtMode = asciiImport.PvtMode;\n export type PvtMode = asciiImport.PvtMode;\n export const PvtAxisDefinition = asciiImport.PvtAxisDefinition;\n export type PvtAxisDefinition = asciiImport.PvtAxisDefinition;\n export const PvtAxisType = asciiImport.PvtAxisType;\n export type PvtAxisType = asciiImport.PvtAxisType;\n export const AxisGroup = asciiImport.AxisGroup;\n export type AxisGroup = asciiImport.AxisGroup;\n export const Trigger = asciiImport.Trigger;\n export type Trigger = asciiImport.Trigger;\n export const Triggers = asciiImport.Triggers;\n export type Triggers = asciiImport.Triggers;\n export const TriggerState = asciiImport.TriggerState;\n export type TriggerState = asciiImport.TriggerState;\n export const TriggerEnabledState = asciiImport.TriggerEnabledState;\n export type TriggerEnabledState = asciiImport.TriggerEnabledState;\n export const TriggerAction = asciiImport.TriggerAction;\n export type TriggerAction = asciiImport.TriggerAction;\n export const TriggerCondition = asciiImport.TriggerCondition;\n export type TriggerCondition = asciiImport.TriggerCondition;\n export const TriggerOperation = asciiImport.TriggerOperation;\n export type TriggerOperation = asciiImport.TriggerOperation;\n}\n"]}
|
|
@@ -70,8 +70,8 @@ export declare class Microscope {
|
|
|
70
70
|
*/
|
|
71
71
|
initialize(): Promise<void>;
|
|
72
72
|
/**
|
|
73
|
-
* Checks whether the microscope
|
|
74
|
-
* @returns True, when the microscope
|
|
73
|
+
* Checks whether the microscope is initialized.
|
|
74
|
+
* @returns True, when the microscope is initialized. False, otherwise.
|
|
75
75
|
*/
|
|
76
76
|
isInitialized(): Promise<boolean>;
|
|
77
77
|
/**
|
|
@@ -127,8 +127,8 @@ class Microscope {
|
|
|
127
127
|
await gateway.callAsync('microscope/initialize', request);
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
|
-
* Checks whether the microscope
|
|
131
|
-
* @returns True, when the microscope
|
|
130
|
+
* Checks whether the microscope is initialized.
|
|
131
|
+
* @returns True, when the microscope is initialized. False, otherwise.
|
|
132
132
|
*/
|
|
133
133
|
async isInitialized() {
|
|
134
134
|
const request = new gateway.MicroscopeEmptyRequest();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/microscopy/microscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,wCAAqC;AACrC,oDAAgD;AAChD,4CAAyC;AAEzC,+CAA4C;AAC5C,2DAAuD;AACvD,2DAAuD;AACvD,qDAAiD;AAEjD;;;;;GAKG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAKD;;OAEG;IACH,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAGD;;OAEG;IACH,IAAW,gBA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,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,OAAO,CAAC,SAAS,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,aAAa;QACxB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,2BAA2B,EAC3B,OAAO,EACP,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,sBAAsB,EACtB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAhJD,gCAgJC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Axis } from '../ascii/axis';\nimport { AxisGroup } from '../ascii/axis_group';\nimport { Device } from '../ascii/device';\nimport { Connection } from '../ascii/connection';\nimport { Illuminator } from './illuminator';\nimport { ObjectiveChanger } from './objective_changer';\nimport { MicroscopeConfig } from './microscope_config';\nimport { FilterChanger } from './filter_changer';\n\n/**\n * Represent a microscope.\n * It is subject to breaking changes without warning until further notice.\n * Parts of the microscope may or may not be instantiated depending on the configuration.\n * Requires at least Firmware 7.34.\n */\nexport class Microscope {\n /**\n * Connection of the microscope.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n private _config: MicroscopeConfig;\n\n /**\n * The illuminator.\n */\n public get illuminator(): Illuminator | undefined {\n return this._illuminator;\n }\n private _illuminator: Illuminator | undefined;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis | undefined {\n return this._focusAxis;\n }\n private _focusAxis: Axis | undefined;\n\n /**\n * The X axis.\n */\n public get xAxis(): Axis | undefined {\n return this._xAxis;\n }\n private _xAxis: Axis | undefined;\n\n /**\n * The Y axis.\n */\n public get yAxis(): Axis | undefined {\n return this._yAxis;\n }\n private _yAxis: Axis | undefined;\n\n /**\n * Axis group consisting of X and Y axes representing the plate of the microscope.\n */\n public get plate(): AxisGroup | undefined {\n return this._plate;\n }\n private _plate: AxisGroup | undefined;\n\n /**\n * The objective changer.\n */\n public get objectiveChanger(): ObjectiveChanger | undefined {\n return this._objectiveChanger;\n }\n private _objectiveChanger: ObjectiveChanger | undefined;\n\n /**\n * The filter changer.\n */\n public get filterChanger(): FilterChanger | undefined {\n return this._filterChanger;\n }\n private _filterChanger: FilterChanger | undefined;\n\n /**\n * Creates instance of `Microscope` from the given config.\n * Parts are instantiated depending on device addresses in the config.\n */\n constructor(connection: Connection, config: MicroscopeConfig) {\n this._connection = connection;\n this._config = MicroscopeConfig.fromProtobuf(MicroscopeConfig.toProtobuf(config).toObject());\n this._illuminator = config.illuminator ? new Illuminator(new Device(connection, config.illuminator)) : undefined;\n this._focusAxis = config.focusAxis?.device ? new Axis(new Device(connection, config.focusAxis.device), config.focusAxis.axis) : undefined;\n this._xAxis = config.xAxis?.device ? new Axis(new Device(connection, config.xAxis.device), config.xAxis.axis) : undefined;\n this._yAxis = config.yAxis?.device ? new Axis(new Device(connection, config.yAxis.device), config.yAxis.axis) : undefined;\n this._plate = this._xAxis && this._yAxis ? new AxisGroup([this._xAxis, this._yAxis]) : undefined;\n this._objectiveChanger = config.objectiveChanger && this._focusAxis ? new ObjectiveChanger(new Device(connection, config.objectiveChanger), this._focusAxis) : undefined;\n this._filterChanger = config.filterChanger ? new FilterChanger(new Device(connection, config.filterChanger)) : undefined;\n }\n\n /**\n * Finds a microscope on a connection.\n * @param connection Connection on which to detect the microscope.\n * @returns New instance of microscope.\n */\n public static async find(\n connection: Connection\n ): Promise<Microscope> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(connection.interfaceId);\n\n const response = await gateway.callAsync<gateway.MicroscopeConfig>(\n 'microscope/detect',\n request,\n gateway.MicroscopeConfig);\n return new Microscope(connection, MicroscopeConfig.fromProtobuf(response.toObject()));\n }\n\n /**\n * Initializes the microscope.\n * Homes all axes, filter changer, and objective changer.\n */\n public async initialize(): Promise<void> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n await gateway.callAsync('microscope/initialize', request);\n }\n\n /**\n * Checks whether the microscope
|
|
1
|
+
{"version":3,"file":"microscope.js","sourceRoot":"","sources":["../../../src/microscopy/microscope.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,wCAAqC;AACrC,oDAAgD;AAChD,4CAAyC;AAEzC,+CAA4C;AAC5C,2DAAuD;AACvD,2DAAuD;AACvD,qDAAiD;AAEjD;;;;;GAKG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B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AO,CAAC,SAAS,CAAC,oCAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,sBAAsB,EACtB,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAhJD,gCAgJC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Axis } from '../ascii/axis';\nimport { AxisGroup } from '../ascii/axis_group';\nimport { Device } from '../ascii/device';\nimport { Connection } from '../ascii/connection';\nimport { Illuminator } from './illuminator';\nimport { ObjectiveChanger } from './objective_changer';\nimport { MicroscopeConfig } from './microscope_config';\nimport { FilterChanger } from './filter_changer';\n\n/**\n * Represent a microscope.\n * It is subject to breaking changes without warning until further notice.\n * Parts of the microscope may or may not be instantiated depending on the configuration.\n * Requires at least Firmware 7.34.\n */\nexport class Microscope {\n /**\n * Connection of the microscope.\n */\n public get connection(): Connection {\n return this._connection;\n }\n private _connection: Connection;\n\n private _config: MicroscopeConfig;\n\n /**\n * The illuminator.\n */\n public get illuminator(): Illuminator | undefined {\n return this._illuminator;\n }\n private _illuminator: Illuminator | undefined;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis | undefined {\n return this._focusAxis;\n }\n private _focusAxis: Axis | undefined;\n\n /**\n * The X axis.\n */\n public get xAxis(): Axis | undefined {\n return this._xAxis;\n }\n private _xAxis: Axis | undefined;\n\n /**\n * The Y axis.\n */\n public get yAxis(): Axis | undefined {\n return this._yAxis;\n }\n private _yAxis: Axis | undefined;\n\n /**\n * Axis group consisting of X and Y axes representing the plate of the microscope.\n */\n public get plate(): AxisGroup | undefined {\n return this._plate;\n }\n private _plate: AxisGroup | undefined;\n\n /**\n * The objective changer.\n */\n public get objectiveChanger(): ObjectiveChanger | undefined {\n return this._objectiveChanger;\n }\n private _objectiveChanger: ObjectiveChanger | undefined;\n\n /**\n * The filter changer.\n */\n public get filterChanger(): FilterChanger | undefined {\n return this._filterChanger;\n }\n private _filterChanger: FilterChanger | undefined;\n\n /**\n * Creates instance of `Microscope` from the given config.\n * Parts are instantiated depending on device addresses in the config.\n */\n constructor(connection: Connection, config: MicroscopeConfig) {\n this._connection = connection;\n this._config = MicroscopeConfig.fromProtobuf(MicroscopeConfig.toProtobuf(config).toObject());\n this._illuminator = config.illuminator ? new Illuminator(new Device(connection, config.illuminator)) : undefined;\n this._focusAxis = config.focusAxis?.device ? new Axis(new Device(connection, config.focusAxis.device), config.focusAxis.axis) : undefined;\n this._xAxis = config.xAxis?.device ? new Axis(new Device(connection, config.xAxis.device), config.xAxis.axis) : undefined;\n this._yAxis = config.yAxis?.device ? new Axis(new Device(connection, config.yAxis.device), config.yAxis.axis) : undefined;\n this._plate = this._xAxis && this._yAxis ? new AxisGroup([this._xAxis, this._yAxis]) : undefined;\n this._objectiveChanger = config.objectiveChanger && this._focusAxis ? new ObjectiveChanger(new Device(connection, config.objectiveChanger), this._focusAxis) : undefined;\n this._filterChanger = config.filterChanger ? new FilterChanger(new Device(connection, config.filterChanger)) : undefined;\n }\n\n /**\n * Finds a microscope on a connection.\n * @param connection Connection on which to detect the microscope.\n * @returns New instance of microscope.\n */\n public static async find(\n connection: Connection\n ): Promise<Microscope> {\n const request = new gateway.InterfaceEmptyRequest();\n request.setInterfaceId(connection.interfaceId);\n\n const response = await gateway.callAsync<gateway.MicroscopeConfig>(\n 'microscope/detect',\n request,\n gateway.MicroscopeConfig);\n return new Microscope(connection, MicroscopeConfig.fromProtobuf(response.toObject()));\n }\n\n /**\n * Initializes the microscope.\n * Homes all axes, filter changer, and objective changer.\n */\n public async initialize(): Promise<void> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n await gateway.callAsync('microscope/initialize', request);\n }\n\n /**\n * Checks whether the microscope is initialized.\n * @returns True, when the microscope is initialized. False, otherwise.\n */\n public async isInitialized(): Promise<boolean> {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n const response = await gateway.callAsync<gateway.BoolResponse>(\n 'microscope/is_initialized',\n request,\n gateway.BoolResponse);\n return response.getValue();\n }\n\n /**\n * Returns a string that represents the microscope.\n * @returns A string that represents the microscope.\n */\n public toString(): string {\n const request = new gateway.MicroscopeEmptyRequest();\n request.setInterfaceId(this.connection.interfaceId);\n request.setConfig(MicroscopeConfig.toProtobuf(this._config));\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'microscope/to_string',\n request,\n gateway.StringResponse);\n return response.getValue();\n }\n}\n\nnamespace Microscope {\n}\n"]}
|