@zaber/motion 2.8.0 → 2.9.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.
Files changed (68) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/stream.d.ts +6 -0
  3. package/dist/lib/ascii/stream.js +13 -0
  4. package/dist/lib/ascii/stream.js.map +1 -1
  5. package/dist/lib/ascii/stream_axis_definition.d.ts +1 -1
  6. package/dist/lib/ascii/stream_axis_definition.js.map +1 -1
  7. package/dist/lib/ascii/stream_buffer.d.ts +1 -0
  8. package/dist/lib/ascii/stream_buffer.js +1 -0
  9. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  10. package/dist/lib/exceptions/g_code_execution_exception.d.ts +14 -0
  11. package/dist/lib/exceptions/g_code_execution_exception.js +32 -0
  12. package/dist/lib/exceptions/g_code_execution_exception.js.map +1 -0
  13. package/dist/lib/exceptions/g_code_execution_exception_data.d.ts +17 -0
  14. package/dist/lib/exceptions/g_code_execution_exception_data.js +18 -0
  15. package/dist/lib/exceptions/g_code_execution_exception_data.js.map +1 -0
  16. package/dist/lib/exceptions/g_code_syntax_exception.d.ts +14 -0
  17. package/dist/lib/exceptions/g_code_syntax_exception.js +32 -0
  18. package/dist/lib/exceptions/g_code_syntax_exception.js.map +1 -0
  19. package/dist/lib/exceptions/g_code_syntax_exception_data.d.ts +17 -0
  20. package/dist/lib/exceptions/g_code_syntax_exception_data.js +18 -0
  21. package/dist/lib/exceptions/g_code_syntax_exception_data.js.map +1 -0
  22. package/dist/lib/exceptions/index.d.ts +4 -0
  23. package/dist/lib/exceptions/index.js +10 -2
  24. package/dist/lib/exceptions/index.js.map +1 -1
  25. package/dist/lib/finalizer.d.ts +5 -0
  26. package/dist/lib/finalizer.js +21 -0
  27. package/dist/lib/finalizer.js.map +1 -0
  28. package/dist/lib/gateway/convert_exceptions.js +2 -0
  29. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  30. package/dist/lib/gcode/axis_mapping.d.ts +16 -0
  31. package/dist/lib/gcode/axis_mapping.js +38 -0
  32. package/dist/lib/gcode/axis_mapping.js.map +1 -0
  33. package/dist/lib/gcode/index.d.ts +8 -0
  34. package/dist/lib/gcode/index.js +20 -0
  35. package/dist/lib/gcode/index.js.map +1 -0
  36. package/dist/lib/gcode/translate_message.d.ts +21 -0
  37. package/dist/lib/gcode/translate_message.js +19 -0
  38. package/dist/lib/gcode/translate_message.js.map +1 -0
  39. package/dist/lib/gcode/translate_result.d.ts +17 -0
  40. package/dist/lib/gcode/translate_result.js +19 -0
  41. package/dist/lib/gcode/translate_result.js.map +1 -0
  42. package/dist/lib/gcode/translator.d.ts +68 -0
  43. package/dist/lib/gcode/translator.js +144 -0
  44. package/dist/lib/gcode/translator.js.map +1 -0
  45. package/dist/lib/gcode/translator_axis_definition.d.ts +20 -0
  46. package/dist/lib/gcode/translator_axis_definition.js +48 -0
  47. package/dist/lib/gcode/translator_axis_definition.js.map +1 -0
  48. package/dist/lib/gcode/translator_config.d.ts +18 -0
  49. package/dist/lib/gcode/translator_config.js +41 -0
  50. package/dist/lib/gcode/translator_config.js.map +1 -0
  51. package/dist/lib/gcode/translator_definition.d.ts +18 -0
  52. package/dist/lib/gcode/translator_definition.js +39 -0
  53. package/dist/lib/gcode/translator_definition.js.map +1 -0
  54. package/dist/lib/gcode/translator_live.d.ts +70 -0
  55. package/dist/lib/gcode/translator_live.js +147 -0
  56. package/dist/lib/gcode/translator_live.js.map +1 -0
  57. package/dist/lib/gcode_ns.d.ts +19 -0
  58. package/dist/lib/gcode_ns.js +35 -0
  59. package/dist/lib/gcode_ns.js.map +1 -0
  60. package/dist/lib/index.d.ts +1 -0
  61. package/dist/lib/index.js +1 -0
  62. package/dist/lib/index.js.map +1 -1
  63. package/dist/lib/measurement.d.ts +1 -1
  64. package/dist/lib/measurement.js.map +1 -1
  65. package/dist/lib/protobufs/main_pb.d.ts +478 -0
  66. package/dist/lib/protobufs/main_pb.js +3682 -1
  67. package/dist/lib/protobufs/main_pb.js.map +1 -1
  68. package/package.json +2 -2
@@ -0,0 +1,48 @@
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
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7
+ }) : (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ o[k2] = m[k];
10
+ }));
11
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
12
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
13
+ }) : function(o, v) {
14
+ o["default"] = v;
15
+ });
16
+ var __importStar = (this && this.__importStar) || function (mod) {
17
+ if (mod && mod.__esModule) return mod;
18
+ var result = {};
19
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
20
+ __setModuleDefault(result, mod);
21
+ return result;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.TranslatorAxisDefinition = void 0;
25
+ const gateway = __importStar(require("../gateway"));
26
+ var TranslatorAxisDefinition;
27
+ (function (TranslatorAxisDefinition) {
28
+ TranslatorAxisDefinition.__type = 'TranslatorAxisDefinition';
29
+ /** @internal */
30
+ function fromProtobuf(pbData) {
31
+ return {
32
+ axisLetter: pbData.axisLetter,
33
+ peripheralId: pbData.peripheralId,
34
+ microstepResolution: pbData.microstepResolution,
35
+ };
36
+ }
37
+ TranslatorAxisDefinition.fromProtobuf = fromProtobuf;
38
+ /** @internal */
39
+ function toProtobuf(source) {
40
+ const pbData = new gateway.TranslatorAxisDefinition();
41
+ pbData.setAxisLetter(source.axisLetter);
42
+ pbData.setPeripheralId(source.peripheralId);
43
+ pbData.setMicrostepResolution(source.microstepResolution);
44
+ return pbData;
45
+ }
46
+ TranslatorAxisDefinition.toProtobuf = toProtobuf;
47
+ })(TranslatorAxisDefinition = exports.TranslatorAxisDefinition || (exports.TranslatorAxisDefinition = {}));
48
+ //# sourceMappingURL=translator_axis_definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translator_axis_definition.js","sourceRoot":"","sources":["../../../src/gcode/translator_axis_definition.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAuBtC,IAAiB,wBAAwB,CAmBxC;AAnBD,WAAiB,wBAAwB;IAC1B,+BAAM,GAAG,0BAA0B,CAAC;IAEjD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAiD;QAC5E,OAAO;YACL,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;SAChD,CAAC;IACJ,CAAC;IANe,qCAAY,eAM3B,CAAA;IACD,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAgC;QACzD,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QACtD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC;IAChB,CAAC;IANe,mCAAU,aAMzB,CAAA;AACH,CAAC,EAnBgB,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAmBxC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Defines an axis of the translator.\n */\nexport interface TranslatorAxisDefinition {\n /**\n * Letter of the axis (X,Y,Z,A,B,C,E).\n */\n axisLetter: string;\n\n /**\n * ID of the peripheral.\n */\n peripheralId: number;\n\n /**\n * Microstep resolution of the axis.\n */\n microstepResolution: number;\n\n}\n\nexport namespace TranslatorAxisDefinition {\n export const __type = 'TranslatorAxisDefinition';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.TranslatorAxisDefinition.AsObject): TranslatorAxisDefinition {\n return {\n axisLetter: pbData.axisLetter,\n peripheralId: pbData.peripheralId,\n microstepResolution: pbData.microstepResolution,\n };\n }\n /** @internal */\n export function toProtobuf(source: TranslatorAxisDefinition): gateway.TranslatorAxisDefinition {\n const pbData = new gateway.TranslatorAxisDefinition();\n pbData.setAxisLetter(source.axisLetter);\n pbData.setPeripheralId(source.peripheralId);\n pbData.setMicrostepResolution(source.microstepResolution);\n return pbData;\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { Measurement } from '../measurement';
2
+ import { AxisMapping } from './axis_mapping';
3
+ /**
4
+ * Configuration of translator.
5
+ */
6
+ export interface TranslatorConfig {
7
+ /**
8
+ * Speed at which the device moves when traversing (G0).
9
+ */
10
+ traverseRate: Measurement;
11
+ /**
12
+ * Optional custom mapping of translator axes to stream axes.
13
+ */
14
+ axesMapping?: AxisMapping[];
15
+ }
16
+ export declare namespace TranslatorConfig {
17
+ const __type = "TranslatorConfig";
18
+ }
@@ -0,0 +1,41 @@
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
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7
+ }) : (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ o[k2] = m[k];
10
+ }));
11
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
12
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
13
+ }) : function(o, v) {
14
+ o["default"] = v;
15
+ });
16
+ var __importStar = (this && this.__importStar) || function (mod) {
17
+ if (mod && mod.__esModule) return mod;
18
+ var result = {};
19
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
20
+ __setModuleDefault(result, mod);
21
+ return result;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.TranslatorConfig = void 0;
25
+ const gateway = __importStar(require("../gateway"));
26
+ const measurement_1 = require("../measurement");
27
+ const axis_mapping_1 = require("./axis_mapping");
28
+ var TranslatorConfig;
29
+ (function (TranslatorConfig) {
30
+ TranslatorConfig.__type = 'TranslatorConfig';
31
+ /** @internal */
32
+ function toProtobuf(source) {
33
+ var _a, _b;
34
+ const pbData = new gateway.TranslatorConfig();
35
+ pbData.setTraverseRate(measurement_1.Measurement.toProtobuf(source.traverseRate));
36
+ pbData.setAxesMappingList((_b = (_a = source.axesMapping) === null || _a === void 0 ? void 0 : _a.map(item => axis_mapping_1.AxisMapping.toProtobuf(item))) !== null && _b !== void 0 ? _b : []);
37
+ return pbData;
38
+ }
39
+ TranslatorConfig.toProtobuf = toProtobuf;
40
+ })(TranslatorConfig = exports.TranslatorConfig || (exports.TranslatorConfig = {}));
41
+ //# sourceMappingURL=translator_config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translator_config.js","sourceRoot":"","sources":["../../../src/gcode/translator_config.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,gDAA6C;AAC7C,iDAA6C;AAkB7C,IAAiB,gBAAgB,CAUhC;AAVD,WAAiB,gBAAgB;IAClB,uBAAM,GAAG,kBAAkB,CAAC;IAEzC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAwB;;QACjD,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC9C,MAAM,CAAC,eAAe,CAAC,yBAAW,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;QACpE,MAAM,CAAC,kBAAkB,CAAC,MAAA,MAAA,MAAM,CAAC,WAAW,0CAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,0BAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC;QAC/F,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,2BAAU,aAKzB,CAAA;AACH,CAAC,EAVgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAUhC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Measurement } from '../measurement';\nimport { AxisMapping } from './axis_mapping';\n\n/**\n * Configuration of translator.\n */\nexport interface TranslatorConfig {\n /**\n * Speed at which the device moves when traversing (G0).\n */\n traverseRate: Measurement;\n\n /**\n * Optional custom mapping of translator axes to stream axes.\n */\n axesMapping?: AxisMapping[];\n\n}\n\nexport namespace TranslatorConfig {\n export const __type = 'TranslatorConfig';\n\n /** @internal */\n export function toProtobuf(source: TranslatorConfig): gateway.TranslatorConfig {\n const pbData = new gateway.TranslatorConfig();\n pbData.setTraverseRate(Measurement.toProtobuf(source.traverseRate));\n pbData.setAxesMappingList(source.axesMapping?.map(item => AxisMapping.toProtobuf(item)) ?? []);\n return pbData;\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { TranslatorAxisDefinition } from './translator_axis_definition';
2
+ /**
3
+ * Defines an axis of the translator.
4
+ */
5
+ export interface TranslatorDefinition {
6
+ /**
7
+ * Device ID of the controller.
8
+ * Can be obtained from device settings.
9
+ */
10
+ deviceId: number;
11
+ /**
12
+ * Axes of translator.
13
+ */
14
+ axes: TranslatorAxisDefinition[];
15
+ }
16
+ export declare namespace TranslatorDefinition {
17
+ const __type = "TranslatorDefinition";
18
+ }
@@ -0,0 +1,39 @@
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
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7
+ }) : (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ o[k2] = m[k];
10
+ }));
11
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
12
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
13
+ }) : function(o, v) {
14
+ o["default"] = v;
15
+ });
16
+ var __importStar = (this && this.__importStar) || function (mod) {
17
+ if (mod && mod.__esModule) return mod;
18
+ var result = {};
19
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
20
+ __setModuleDefault(result, mod);
21
+ return result;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.TranslatorDefinition = void 0;
25
+ const gateway = __importStar(require("../gateway"));
26
+ const translator_axis_definition_1 = require("./translator_axis_definition");
27
+ var TranslatorDefinition;
28
+ (function (TranslatorDefinition) {
29
+ TranslatorDefinition.__type = 'TranslatorDefinition';
30
+ /** @internal */
31
+ function toProtobuf(source) {
32
+ const pbData = new gateway.TranslatorDefinition();
33
+ pbData.setDeviceId(source.deviceId);
34
+ pbData.setAxesList(source.axes.map(item => translator_axis_definition_1.TranslatorAxisDefinition.toProtobuf(item)));
35
+ return pbData;
36
+ }
37
+ TranslatorDefinition.toProtobuf = toProtobuf;
38
+ })(TranslatorDefinition = exports.TranslatorDefinition || (exports.TranslatorDefinition = {}));
39
+ //# sourceMappingURL=translator_definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translator_definition.js","sourceRoot":"","sources":["../../../src/gcode/translator_definition.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,6EAAwE;AAmBxE,IAAiB,oBAAoB,CAUpC;AAVD,WAAiB,oBAAoB;IACtB,2BAAM,GAAG,sBAAsB,CAAC;IAE7C,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAA4B;QACrD,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;QAClD,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,qDAAwB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvF,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,+BAAU,aAKzB,CAAA;AACH,CAAC,EAVgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAUpC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { TranslatorAxisDefinition } from './translator_axis_definition';\n\n/**\n * Defines an axis of the translator.\n */\nexport interface TranslatorDefinition {\n /**\n * Device ID of the controller.\n * Can be obtained from device settings.\n */\n deviceId: number;\n\n /**\n * Axes of translator.\n */\n axes: TranslatorAxisDefinition[];\n\n}\n\nexport namespace TranslatorDefinition {\n export const __type = 'TranslatorDefinition';\n\n /** @internal */\n export function toProtobuf(source: TranslatorDefinition): gateway.TranslatorDefinition {\n const pbData = new gateway.TranslatorDefinition();\n pbData.setDeviceId(source.deviceId);\n pbData.setAxesList(source.axes.map(item => TranslatorAxisDefinition.toProtobuf(item)));\n return pbData;\n }\n}\n"]}
@@ -0,0 +1,70 @@
1
+ import { TranslateResult } from './translate_result';
2
+ import { TranslatorConfig } from './translator_config';
3
+ import { Stream } from '../ascii/stream';
4
+ import { Angle, Length, Native, AngularVelocity, Velocity } from '../units';
5
+ export declare class TranslatorLive {
6
+ /**
7
+ * The ID of the translator that serves to identify native resources.
8
+ */
9
+ get translatorId(): number;
10
+ private _translatorId;
11
+ constructor(translatorId: number);
12
+ /**
13
+ * Sets up the translator on top of a provided stream.
14
+ * @param stream The stream to setup the translator on.
15
+ * The stream must be already setup in a live or a store mode.
16
+ * @param config Configuration of the translator.
17
+ * @return New instance of translator.
18
+ */
19
+ static setup(stream: Stream, config: TranslatorConfig): TranslatorLive;
20
+ /**
21
+ * Translates a single block (line) of G-code.
22
+ * The commands are queued in the underlying stream to ensure smooth continues movement.
23
+ * Returning of this method indicates that the commands are queued (not necessarily executed).
24
+ * @param block Block (line) of G-code.
25
+ * @return Result of translation containing the commands sent to the device.
26
+ */
27
+ translate(block: string): Promise<TranslateResult>;
28
+ /**
29
+ * Sets the speed at which the device moves when traversing (G0).
30
+ * @param traverseRate The traverse rate.
31
+ * @param unit Units of the traverse rate.
32
+ */
33
+ setTraverseRate(traverseRate: number, unit: Velocity | AngularVelocity | Native): void;
34
+ /**
35
+ * Sets position of translator's axis.
36
+ * Use this method to set position after performing movement outside of the translator.
37
+ * This method does not cause any movement.
38
+ * @param axis Letter of the axis.
39
+ * @param position The position.
40
+ * @param unit Units of position.
41
+ */
42
+ setAxisPosition(axis: string, position: number, unit: Length | Angle | Native): void;
43
+ /**
44
+ * Gets position of translator's axis.
45
+ * This method does not query device but returns value from translator's state.
46
+ * @param axis Letter of the axis.
47
+ * @param unit Units of position.
48
+ * @return Position of translator's axis.
49
+ */
50
+ getAxisPosition(axis: string, unit: Length | Angle | Native): number;
51
+ /**
52
+ * Sets default position of translator's axis.
53
+ * This position is used by G28.
54
+ * @param axis Letter of the axis.
55
+ * @param position The default position.
56
+ * @param unit Units of position.
57
+ */
58
+ setAxisDefaultPosition(axis: string, position: number, unit: Length | Angle | Native): void;
59
+ /**
60
+ * Releases native resources of a translator.
61
+ * @param translatorId The ID of the translator.
62
+ */
63
+ private static _free;
64
+ /**
65
+ * Releases the native resources of the translator.
66
+ * Should only be called if your environment does not support FinalizationRegistry.
67
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
68
+ */
69
+ free(): void;
70
+ }
@@ -0,0 +1,147 @@
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
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
7
+ }) : (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ o[k2] = m[k];
10
+ }));
11
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
12
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
13
+ }) : function(o, v) {
14
+ o["default"] = v;
15
+ });
16
+ var __importStar = (this && this.__importStar) || function (mod) {
17
+ if (mod && mod.__esModule) return mod;
18
+ var result = {};
19
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
20
+ __setModuleDefault(result, mod);
21
+ return result;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.TranslatorLive = void 0;
25
+ const gateway = __importStar(require("../gateway"));
26
+ const translate_result_1 = require("./translate_result");
27
+ const translator_config_1 = require("./translator_config");
28
+ const finalizer_1 = require("../finalizer");
29
+ class TranslatorLive {
30
+ constructor(translatorId) {
31
+ this._translatorId = translatorId;
32
+ (0, finalizer_1.registerForFinalization)(this, TranslatorLive._free.bind(null, translatorId));
33
+ }
34
+ /**
35
+ * The ID of the translator that serves to identify native resources.
36
+ */
37
+ get translatorId() {
38
+ return this._translatorId;
39
+ }
40
+ /**
41
+ * Sets up the translator on top of a provided stream.
42
+ * @param stream The stream to setup the translator on.
43
+ * The stream must be already setup in a live or a store mode.
44
+ * @param config Configuration of the translator.
45
+ * @return New instance of translator.
46
+ */
47
+ static setup(stream, config) {
48
+ const request = new gateway.TranslatorCreateLiveRequest();
49
+ request.setDevice(stream.device.deviceAddress);
50
+ request.setInterfaceId(stream.device.connection.interfaceId);
51
+ request.setStreamId(stream.streamId);
52
+ request.setConfig(translator_config_1.TranslatorConfig.toProtobuf(config));
53
+ const response = gateway.callSync('gcode/create_live', request, gateway.TranslatorCreateResponse);
54
+ return new TranslatorLive(response.getTranslatorId());
55
+ }
56
+ /**
57
+ * Translates a single block (line) of G-code.
58
+ * The commands are queued in the underlying stream to ensure smooth continues movement.
59
+ * Returning of this method indicates that the commands are queued (not necessarily executed).
60
+ * @param block Block (line) of G-code.
61
+ * @return Result of translation containing the commands sent to the device.
62
+ */
63
+ async translate(block) {
64
+ const request = new gateway.TranslatorTranslateRequest();
65
+ request.setTranslatorId(this.translatorId);
66
+ request.setBlock(block);
67
+ const response = await gateway.callAsync('gcode/translate_live', request, gateway.TranslatorTranslateResponse);
68
+ return translate_result_1.TranslateResult.fromProtobuf(response.toObject());
69
+ }
70
+ /**
71
+ * Sets the speed at which the device moves when traversing (G0).
72
+ * @param traverseRate The traverse rate.
73
+ * @param unit Units of the traverse rate.
74
+ */
75
+ setTraverseRate(traverseRate, unit) {
76
+ const request = new gateway.TranslatorSetTraverseRateRequest();
77
+ request.setTranslatorId(this.translatorId);
78
+ request.setTraverseRate(traverseRate);
79
+ request.setUnit(unit);
80
+ gateway.callSync('gcode/set_traverse_rate', request);
81
+ }
82
+ /**
83
+ * Sets position of translator's axis.
84
+ * Use this method to set position after performing movement outside of the translator.
85
+ * This method does not cause any movement.
86
+ * @param axis Letter of the axis.
87
+ * @param position The position.
88
+ * @param unit Units of position.
89
+ */
90
+ setAxisPosition(axis, position, unit) {
91
+ const request = new gateway.TranslatorSetAxisPositionRequest();
92
+ request.setTranslatorId(this.translatorId);
93
+ request.setAxis(axis);
94
+ request.setPosition(position);
95
+ request.setUnit(unit);
96
+ gateway.callSync('gcode/set_axis_position', request);
97
+ }
98
+ /**
99
+ * Gets position of translator's axis.
100
+ * This method does not query device but returns value from translator's state.
101
+ * @param axis Letter of the axis.
102
+ * @param unit Units of position.
103
+ * @return Position of translator's axis.
104
+ */
105
+ getAxisPosition(axis, unit) {
106
+ const request = new gateway.TranslatorGetAxisPositionRequest();
107
+ request.setTranslatorId(this.translatorId);
108
+ request.setAxis(axis);
109
+ request.setUnit(unit);
110
+ const response = gateway.callSync('gcode/get_axis_position', request, gateway.TranslatorGetAxisPositionResponse);
111
+ return response.getValue();
112
+ }
113
+ /**
114
+ * Sets default position of translator's axis.
115
+ * This position is used by G28.
116
+ * @param axis Letter of the axis.
117
+ * @param position The default position.
118
+ * @param unit Units of position.
119
+ */
120
+ setAxisDefaultPosition(axis, position, unit) {
121
+ const request = new gateway.TranslatorSetAxisPositionRequest();
122
+ request.setTranslatorId(this.translatorId);
123
+ request.setAxis(axis);
124
+ request.setPosition(position);
125
+ request.setUnit(unit);
126
+ gateway.callSync('gcode/set_axis_default', request);
127
+ }
128
+ /**
129
+ * Releases native resources of a translator.
130
+ * @param translatorId The ID of the translator.
131
+ */
132
+ static _free(translatorId) {
133
+ const request = new gateway.TranslatorEmptyRequest();
134
+ request.setTranslatorId(translatorId);
135
+ gateway.callSync('gcode/free', request);
136
+ }
137
+ /**
138
+ * Releases the native resources of the translator.
139
+ * Should only be called if your environment does not support FinalizationRegistry.
140
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
141
+ */
142
+ free() {
143
+ TranslatorLive._free(this.translatorId);
144
+ }
145
+ }
146
+ exports.TranslatorLive = TranslatorLive;
147
+ //# sourceMappingURL=translator_live.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translator_live.js","sourceRoot":"","sources":["../../../src/gcode/translator_live.ts"],"names":[],"mappings":"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","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { TranslateResult } from './translate_result';\nimport { TranslatorConfig } from './translator_config';\nimport { Stream } from '../ascii/stream';\nimport { Angle, Length, Native, AngularVelocity, Velocity } from '../units';\nimport { registerForFinalization } from '../finalizer';\n\nexport class TranslatorLive {\n /**\n * The ID of the translator that serves to identify native resources.\n */\n public get translatorId(): number {\n return this._translatorId;\n }\n private _translatorId: number;\n\n constructor(translatorId: number) {\n this._translatorId = translatorId;\n registerForFinalization(this, TranslatorLive._free.bind(null, translatorId));\n }\n\n /**\n * Sets up the translator on top of a provided stream.\n * @param stream The stream to setup the translator on.\n * The stream must be already setup in a live or a store mode.\n * @param config Configuration of the translator.\n * @return New instance of translator.\n */\n public static setup(\n stream: Stream,\n config: TranslatorConfig\n ): TranslatorLive {\n const request = new gateway.TranslatorCreateLiveRequest();\n request.setDevice(stream.device.deviceAddress);\n request.setInterfaceId(stream.device.connection.interfaceId);\n request.setStreamId(stream.streamId);\n request.setConfig(TranslatorConfig.toProtobuf(config));\n\n const response = gateway.callSync<gateway.TranslatorCreateResponse>(\n 'gcode/create_live',\n request,\n gateway.TranslatorCreateResponse);\n return new TranslatorLive(response.getTranslatorId());\n }\n\n /**\n * Translates a single block (line) of G-code.\n * The commands are queued in the underlying stream to ensure smooth continues movement.\n * Returning of this method indicates that the commands are queued (not necessarily executed).\n * @param block Block (line) of G-code.\n * @return Result of translation containing the commands sent to the device.\n */\n public async translate(\n block: string\n ): Promise<TranslateResult> {\n const request = new gateway.TranslatorTranslateRequest();\n request.setTranslatorId(this.translatorId);\n request.setBlock(block);\n\n const response = await gateway.callAsync<gateway.TranslatorTranslateResponse>(\n 'gcode/translate_live',\n request,\n gateway.TranslatorTranslateResponse);\n return TranslateResult.fromProtobuf(response.toObject());\n }\n\n /**\n * Sets the speed at which the device moves when traversing (G0).\n * @param traverseRate The traverse rate.\n * @param unit Units of the traverse rate.\n */\n public setTraverseRate(\n traverseRate: number,\n unit: Velocity | AngularVelocity | Native\n ): void {\n const request = new gateway.TranslatorSetTraverseRateRequest();\n request.setTranslatorId(this.translatorId);\n request.setTraverseRate(traverseRate);\n request.setUnit(unit);\n\n gateway.callSync('gcode/set_traverse_rate', request);\n }\n\n /**\n * Sets position of translator's axis.\n * Use this method to set position after performing movement outside of the translator.\n * This method does not cause any movement.\n * @param axis Letter of the axis.\n * @param position The position.\n * @param unit Units of position.\n */\n public setAxisPosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request = new gateway.TranslatorSetAxisPositionRequest();\n request.setTranslatorId(this.translatorId);\n request.setAxis(axis);\n request.setPosition(position);\n request.setUnit(unit);\n\n gateway.callSync('gcode/set_axis_position', request);\n }\n\n /**\n * Gets position of translator's axis.\n * This method does not query device but returns value from translator's state.\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @return Position of translator's axis.\n */\n public getAxisPosition(\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request = new gateway.TranslatorGetAxisPositionRequest();\n request.setTranslatorId(this.translatorId);\n request.setAxis(axis);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.TranslatorGetAxisPositionResponse>(\n 'gcode/get_axis_position',\n request,\n gateway.TranslatorGetAxisPositionResponse);\n return response.getValue();\n }\n\n /**\n * Sets default position of translator's axis.\n * This position is used by G28.\n * @param axis Letter of the axis.\n * @param position The default position.\n * @param unit Units of position.\n */\n public setAxisDefaultPosition(\n axis: string,\n position: number,\n unit: Length | Angle | Native\n ): void {\n const request = new gateway.TranslatorSetAxisPositionRequest();\n request.setTranslatorId(this.translatorId);\n request.setAxis(axis);\n request.setPosition(position);\n request.setUnit(unit);\n\n gateway.callSync('gcode/set_axis_default', request);\n }\n\n /**\n * Releases native resources of a translator.\n * @param translatorId The ID of the translator.\n */\n private static _free(\n translatorId: number\n ): void {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(translatorId);\n\n gateway.callSync('gcode/free', request);\n }\n\n /**\n * Releases the native resources of the translator.\n * Should only be called if your environment does not support FinalizationRegistry.\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\n */\n public free(): void {\n TranslatorLive._free(this.translatorId);\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import * as gcodeImport from './gcode';
2
+ export declare namespace gcode {
3
+ const TranslateMessage: typeof gcodeImport.TranslateMessage;
4
+ type TranslateMessage = gcodeImport.TranslateMessage;
5
+ const TranslateResult: typeof gcodeImport.TranslateResult;
6
+ type TranslateResult = gcodeImport.TranslateResult;
7
+ const TranslatorAxisDefinition: typeof gcodeImport.TranslatorAxisDefinition;
8
+ type TranslatorAxisDefinition = gcodeImport.TranslatorAxisDefinition;
9
+ const TranslatorDefinition: typeof gcodeImport.TranslatorDefinition;
10
+ type TranslatorDefinition = gcodeImport.TranslatorDefinition;
11
+ const TranslatorConfig: typeof gcodeImport.TranslatorConfig;
12
+ type TranslatorConfig = gcodeImport.TranslatorConfig;
13
+ const AxisMapping: typeof gcodeImport.AxisMapping;
14
+ type AxisMapping = gcodeImport.AxisMapping;
15
+ const Translator: typeof gcodeImport.Translator;
16
+ type Translator = gcodeImport.Translator;
17
+ const TranslatorLive: typeof gcodeImport.TranslatorLive;
18
+ type TranslatorLive = gcodeImport.TranslatorLive;
19
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.gcode = void 0;
23
+ const gcodeImport = __importStar(require("./gcode"));
24
+ var gcode;
25
+ (function (gcode) {
26
+ gcode.TranslateMessage = gcodeImport.TranslateMessage;
27
+ gcode.TranslateResult = gcodeImport.TranslateResult;
28
+ gcode.TranslatorAxisDefinition = gcodeImport.TranslatorAxisDefinition;
29
+ gcode.TranslatorDefinition = gcodeImport.TranslatorDefinition;
30
+ gcode.TranslatorConfig = gcodeImport.TranslatorConfig;
31
+ gcode.AxisMapping = gcodeImport.AxisMapping;
32
+ gcode.Translator = gcodeImport.Translator;
33
+ gcode.TranslatorLive = gcodeImport.TranslatorLive;
34
+ })(gcode = exports.gcode || (exports.gcode = {}));
35
+ //# sourceMappingURL=gcode_ns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gcode_ns.js","sourceRoot":"","sources":["../../src/gcode_ns.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAEvC,IAAiB,KAAK,CAiBrB;AAjBD,WAAiB,KAAK;IACP,sBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAEhD,qBAAe,GAAG,WAAW,CAAC,eAAe,CAAC;IAE9C,8BAAwB,GAAG,WAAW,CAAC,wBAAwB,CAAC;IAEhE,0BAAoB,GAAG,WAAW,CAAC,oBAAoB,CAAC;IAExD,sBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAC;IAEhD,iBAAW,GAAG,WAAW,CAAC,WAAW,CAAC;IAEtC,gBAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAEpC,oBAAc,GAAG,WAAW,CAAC,cAAc,CAAC;AAE3D,CAAC,EAjBgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAiBrB","sourcesContent":["import * as gcodeImport from './gcode';\n\nexport namespace gcode {\n export const TranslateMessage = gcodeImport.TranslateMessage;\n export type TranslateMessage = gcodeImport.TranslateMessage;\n export const TranslateResult = gcodeImport.TranslateResult;\n export type TranslateResult = gcodeImport.TranslateResult;\n export const TranslatorAxisDefinition = gcodeImport.TranslatorAxisDefinition;\n export type TranslatorAxisDefinition = gcodeImport.TranslatorAxisDefinition;\n export const TranslatorDefinition = gcodeImport.TranslatorDefinition;\n export type TranslatorDefinition = gcodeImport.TranslatorDefinition;\n export const TranslatorConfig = gcodeImport.TranslatorConfig;\n export type TranslatorConfig = gcodeImport.TranslatorConfig;\n export const AxisMapping = gcodeImport.AxisMapping;\n export type AxisMapping = gcodeImport.AxisMapping;\n export const Translator = gcodeImport.Translator;\n export type Translator = gcodeImport.Translator;\n export const TranslatorLive = gcodeImport.TranslatorLive;\n export type TranslatorLive = gcodeImport.TranslatorLive;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  export * from './ascii_ns';
2
2
  export * from './binary_ns';
3
+ export * from './gcode_ns';
3
4
  export * from './exceptions';
4
5
  export { DeviceDbSourceType } from './device_db_source_type';
5
6
  export { FirmwareVersion } from './firmware_version';
package/dist/lib/index.js CHANGED
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Tools = exports.CanSetStateDeviceResponse = exports.CanSetStateAxisResponse = exports.RotationDirection = exports.Measurement = exports.LogOutputMode = exports.Library = exports.FirmwareVersion = exports.DeviceDbSourceType = void 0;
14
14
  __exportStar(require("./ascii_ns"), exports);
15
15
  __exportStar(require("./binary_ns"), exports);
16
+ __exportStar(require("./gcode_ns"), exports);
16
17
  __exportStar(require("./exceptions"), exports);
17
18
  var device_db_source_type_1 = require("./device_db_source_type");
18
19
  Object.defineProperty(exports, "DeviceDbSourceType", { enumerable: true, get: function () { return device_db_source_type_1.DeviceDbSourceType; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,+CAA6B;AAC7B,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,0CAAwB","sourcesContent":["export * from './ascii_ns';\nexport * from './binary_ns';\nexport * from './exceptions';\nexport { DeviceDbSourceType } from './device_db_source_type';\nexport { FirmwareVersion } from './firmware_version';\nexport { Library } from './library';\nexport { LogOutputMode } from './log_output_mode';\nexport { Measurement } from './measurement';\nexport { RotationDirection } from './rotation_direction';\nexport { CanSetStateAxisResponse } from './can_set_state_axis_response';\nexport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nexport { Tools } from './tools';\nexport * from './units';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,8CAA4B;AAC5B,6CAA2B;AAC3B,+CAA6B;AAC7B,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,6EAAwE;AAA/D,sIAAA,uBAAuB,OAAA;AAChC,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,0CAAwB","sourcesContent":["export * from './ascii_ns';\nexport * from './binary_ns';\nexport * from './gcode_ns';\nexport * from './exceptions';\nexport { DeviceDbSourceType } from './device_db_source_type';\nexport { FirmwareVersion } from './firmware_version';\nexport { Library } from './library';\nexport { LogOutputMode } from './log_output_mode';\nexport { Measurement } from './measurement';\nexport { RotationDirection } from './rotation_direction';\nexport { CanSetStateAxisResponse } from './can_set_state_axis_response';\nexport { CanSetStateDeviceResponse } from './can_set_state_device_response';\nexport { Tools } from './tools';\nexport * from './units';\n"]}
@@ -10,7 +10,7 @@ export interface Measurement {
10
10
  /**
11
11
  * Optional units of the measurement.
12
12
  */
13
- unit?: Units | null;
13
+ unit?: Units;
14
14
  }
15
15
  export declare namespace Measurement {
16
16
  const __type = "Measurement";
@@ -1 +1 @@
1
- {"version":3,"file":"measurement.js","sourceRoot":"","sources":["../../src/measurement.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AAmBrC,IAAiB,WAAW,CAU3B;AAVD,WAAiB,WAAW;IACb,kBAAM,GAAG,aAAa,CAAC;IAEpC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAmB;QAC5C,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACzC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAK,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,sBAAU,aAKzB,CAAA;AACH,CAAC,EAVgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAU3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport { Units } from './units';\n\n/**\n * Represents a numerical value with optional units specified.\n */\nexport interface Measurement {\n /**\n * Value of the measurement.\n */\n value: number;\n\n /**\n * Optional units of the measurement.\n */\n unit?: Units | null;\n\n}\n\nexport namespace Measurement {\n export const __type = 'Measurement';\n\n /** @internal */\n export function toProtobuf(source: Measurement): gateway.Measurement {\n const pbData = new gateway.Measurement();\n pbData.setValue(source.value);\n pbData.setUnit(source.unit!);\n return pbData;\n }\n}\n"]}
1
+ {"version":3,"file":"measurement.js","sourceRoot":"","sources":["../../src/measurement.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AAmBrC,IAAiB,WAAW,CAU3B;AAVD,WAAiB,WAAW;IACb,kBAAM,GAAG,aAAa,CAAC;IAEpC,gBAAgB;IAChB,SAAgB,UAAU,CAAC,MAAmB;QAC5C,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACzC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAK,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,sBAAU,aAKzB,CAAA;AACH,CAAC,EAVgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAU3B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from './gateway';\nimport { Units } from './units';\n\n/**\n * Represents a numerical value with optional units specified.\n */\nexport interface Measurement {\n /**\n * Value of the measurement.\n */\n value: number;\n\n /**\n * Optional units of the measurement.\n */\n unit?: Units;\n\n}\n\nexport namespace Measurement {\n export const __type = 'Measurement';\n\n /** @internal */\n export function toProtobuf(source: Measurement): gateway.Measurement {\n const pbData = new gateway.Measurement();\n pbData.setValue(source.value);\n pbData.setUnit(source.unit!);\n return pbData;\n }\n}\n"]}