@zaber/motion 2.7.0-save-load → 2.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.
Files changed (80) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/connection.js +3 -3
  3. package/dist/lib/ascii/connection.js.map +1 -1
  4. package/dist/lib/ascii/stream.d.ts +0 -6
  5. package/dist/lib/ascii/stream.js +0 -13
  6. package/dist/lib/ascii/stream.js.map +1 -1
  7. package/dist/lib/ascii/stream_axis_definition.d.ts +1 -1
  8. package/dist/lib/ascii/stream_axis_definition.js.map +1 -1
  9. package/dist/lib/ascii/stream_buffer.d.ts +0 -1
  10. package/dist/lib/ascii/stream_buffer.js +0 -1
  11. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  12. package/dist/lib/binary/connection.js +3 -3
  13. package/dist/lib/binary/connection.js.map +1 -1
  14. package/dist/lib/exceptions/index.d.ts +0 -4
  15. package/dist/lib/exceptions/index.js +2 -10
  16. package/dist/lib/exceptions/index.js.map +1 -1
  17. package/dist/lib/gateway/call.js +7 -7
  18. package/dist/lib/gateway/call.js.map +1 -1
  19. package/dist/lib/gateway/convert_exceptions.js +0 -2
  20. package/dist/lib/gateway/convert_exceptions.js.map +1 -1
  21. package/dist/lib/gateway/events.js +5 -5
  22. package/dist/lib/gateway/events.js.map +1 -1
  23. package/dist/lib/gateway/wasm.js +1 -1
  24. package/dist/lib/gateway/wasm.js.map +1 -1
  25. package/dist/lib/index.d.ts +0 -1
  26. package/dist/lib/index.js +0 -1
  27. package/dist/lib/index.js.map +1 -1
  28. package/dist/lib/measurement.d.ts +1 -1
  29. package/dist/lib/measurement.js.map +1 -1
  30. package/dist/lib/protobufs/main_pb.d.ts +0 -478
  31. package/dist/lib/protobufs/main_pb.js +1 -3682
  32. package/dist/lib/protobufs/main_pb.js.map +1 -1
  33. package/dist/lib/wasm.js +3 -3
  34. package/dist/lib/wasm.js.map +1 -1
  35. package/package.json +3 -3
  36. package/dist/lib/exceptions/g_code_execution_exception.d.ts +0 -14
  37. package/dist/lib/exceptions/g_code_execution_exception.js +0 -32
  38. package/dist/lib/exceptions/g_code_execution_exception.js.map +0 -1
  39. package/dist/lib/exceptions/g_code_execution_exception_data.d.ts +0 -17
  40. package/dist/lib/exceptions/g_code_execution_exception_data.js +0 -18
  41. package/dist/lib/exceptions/g_code_execution_exception_data.js.map +0 -1
  42. package/dist/lib/exceptions/g_code_syntax_exception.d.ts +0 -14
  43. package/dist/lib/exceptions/g_code_syntax_exception.js +0 -32
  44. package/dist/lib/exceptions/g_code_syntax_exception.js.map +0 -1
  45. package/dist/lib/exceptions/g_code_syntax_exception_data.d.ts +0 -17
  46. package/dist/lib/exceptions/g_code_syntax_exception_data.js +0 -18
  47. package/dist/lib/exceptions/g_code_syntax_exception_data.js.map +0 -1
  48. package/dist/lib/finalizer.d.ts +0 -5
  49. package/dist/lib/finalizer.js +0 -21
  50. package/dist/lib/finalizer.js.map +0 -1
  51. package/dist/lib/gcode/axis_mapping.d.ts +0 -16
  52. package/dist/lib/gcode/axis_mapping.js +0 -38
  53. package/dist/lib/gcode/axis_mapping.js.map +0 -1
  54. package/dist/lib/gcode/index.d.ts +0 -8
  55. package/dist/lib/gcode/index.js +0 -20
  56. package/dist/lib/gcode/index.js.map +0 -1
  57. package/dist/lib/gcode/translate_message.d.ts +0 -21
  58. package/dist/lib/gcode/translate_message.js +0 -19
  59. package/dist/lib/gcode/translate_message.js.map +0 -1
  60. package/dist/lib/gcode/translate_result.d.ts +0 -17
  61. package/dist/lib/gcode/translate_result.js +0 -19
  62. package/dist/lib/gcode/translate_result.js.map +0 -1
  63. package/dist/lib/gcode/translator.d.ts +0 -68
  64. package/dist/lib/gcode/translator.js +0 -144
  65. package/dist/lib/gcode/translator.js.map +0 -1
  66. package/dist/lib/gcode/translator_axis_definition.d.ts +0 -20
  67. package/dist/lib/gcode/translator_axis_definition.js +0 -48
  68. package/dist/lib/gcode/translator_axis_definition.js.map +0 -1
  69. package/dist/lib/gcode/translator_config.d.ts +0 -18
  70. package/dist/lib/gcode/translator_config.js +0 -41
  71. package/dist/lib/gcode/translator_config.js.map +0 -1
  72. package/dist/lib/gcode/translator_definition.d.ts +0 -18
  73. package/dist/lib/gcode/translator_definition.js +0 -39
  74. package/dist/lib/gcode/translator_definition.js.map +0 -1
  75. package/dist/lib/gcode/translator_live.d.ts +0 -70
  76. package/dist/lib/gcode/translator_live.js +0 -147
  77. package/dist/lib/gcode/translator_live.js.map +0 -1
  78. package/dist/lib/gcode_ns.d.ts +0 -19
  79. package/dist/lib/gcode_ns.js +0 -35
  80. package/dist/lib/gcode_ns.js.map +0 -1
package/dist/lib/wasm.js CHANGED
@@ -10,13 +10,13 @@ const isRunning = () => {
10
10
  };
11
11
  exports.isRunning = isRunning;
12
12
  const init = async (fetchResponse) => {
13
- if (exports.isRunning() || initializing) {
13
+ if ((0, exports.isRunning)() || initializing) {
14
14
  throw new Error('Zaber motion library already running or is initializing.');
15
15
  }
16
- bindings_1.setEnv('wasm');
16
+ (0, bindings_1.setEnv)('wasm');
17
17
  try {
18
18
  initializing = true;
19
- runningWasm = await wasm_1.runWasm(fetchResponse);
19
+ runningWasm = await (0, wasm_1.runWasm)(fetchResponse);
20
20
  runningWasm.runPromise.then(() => runningWasm = null, () => runningWasm = null);
21
21
  }
22
22
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"wasm.js","sourceRoot":"","sources":["../../src/wasm.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,yCAAwD;AAExD,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,WAAW,GAAyB,IAAI,CAAC;AAEtC,MAAM,SAAS,GAAG,GAAY,EAAE;IACrC,OAAO,WAAW,KAAK,IAAI,CAAC;AAC9B,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,IAAI,GAAG,KAAK,EAAE,aAA2B,EAA0B,EAAE;IAChF,IAAI,iBAAS,EAAE,IAAI,YAAY,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;KAC7E;IAED,iBAAM,CAAC,MAAM,CAAC,CAAC;IAEf,IAAI;QACF,YAAY,GAAG,IAAI,CAAC;QAEpB,WAAW,GAAG,MAAM,cAAO,CAAC,aAAa,CAAC,CAAC;QAC3C,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;KAEjF;YAAS;QACR,YAAY,GAAG,KAAK,CAAC;KACtB;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAlBW,QAAA,IAAI,QAkBf;AAEK,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;IACjC,MAAM,WAAW,GAAG,WAAW,CAAC;IAChC,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO;KACR;IAED,MAAM,CAAC,aAAa,EAAE,CAAC;IACvB,MAAM,WAAW,CAAC,UAAU,CAAC;AAC/B,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB","sourcesContent":["import { setEnv } from './gateway/bindings';\nimport { runWasm, RunWasmResult } from './gateway/wasm';\n\nlet initializing = false;\nlet runningWasm: RunWasmResult | null = null;\n\nexport const isRunning = (): boolean => {\n return runningWasm !== null;\n};\n\nexport const init = async (fetchResponse: Promise<any>): Promise<RunWasmResult> => {\n if (isRunning() || initializing) {\n throw new Error('Zaber motion library already running or is initializing.');\n }\n\n setEnv('wasm');\n\n try {\n initializing = true;\n\n runningWasm = await runWasm(fetchResponse);\n runningWasm.runPromise.then(() => runningWasm = null, () => runningWasm = null);\n\n } finally {\n initializing = false;\n }\n\n return runningWasm;\n};\n\nexport const shutdown = async () => {\n const currentWasm = runningWasm;\n if (!currentWasm) {\n return;\n }\n\n window.__zmlShutdown();\n await currentWasm.runPromise;\n};\n"]}
1
+ {"version":3,"file":"wasm.js","sourceRoot":"","sources":["../../src/wasm.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,yCAAwD;AAExD,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,IAAI,WAAW,GAAyB,IAAI,CAAC;AAEtC,MAAM,SAAS,GAAG,GAAY,EAAE;IACrC,OAAO,WAAW,KAAK,IAAI,CAAC;AAC9B,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,IAAI,GAAG,KAAK,EAAE,aAA2B,EAA0B,EAAE;IAChF,IAAI,IAAA,iBAAS,GAAE,IAAI,YAAY,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;KAC7E;IAED,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC;IAEf,IAAI;QACF,YAAY,GAAG,IAAI,CAAC;QAEpB,WAAW,GAAG,MAAM,IAAA,cAAO,EAAC,aAAa,CAAC,CAAC;QAC3C,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;KAEjF;YAAS;QACR,YAAY,GAAG,KAAK,CAAC;KACtB;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAlBW,QAAA,IAAI,QAkBf;AAEK,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;IACjC,MAAM,WAAW,GAAG,WAAW,CAAC;IAChC,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO;KACR;IAED,MAAM,CAAC,aAAa,EAAE,CAAC;IACvB,MAAM,WAAW,CAAC,UAAU,CAAC;AAC/B,CAAC,CAAC;AARW,QAAA,QAAQ,YAQnB","sourcesContent":["import { setEnv } from './gateway/bindings';\nimport { runWasm, RunWasmResult } from './gateway/wasm';\n\nlet initializing = false;\nlet runningWasm: RunWasmResult | null = null;\n\nexport const isRunning = (): boolean => {\n return runningWasm !== null;\n};\n\nexport const init = async (fetchResponse: Promise<any>): Promise<RunWasmResult> => {\n if (isRunning() || initializing) {\n throw new Error('Zaber motion library already running or is initializing.');\n }\n\n setEnv('wasm');\n\n try {\n initializing = true;\n\n runningWasm = await runWasm(fetchResponse);\n runningWasm.runPromise.then(() => runningWasm = null, () => runningWasm = null);\n\n } finally {\n initializing = false;\n }\n\n return runningWasm;\n};\n\nexport const shutdown = async () => {\n const currentWasm = runningWasm;\n if (!currentWasm) {\n return;\n }\n\n window.__zmlShutdown();\n await currentWasm.runPromise;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaber/motion",
3
- "version": "2.7.0-save-load",
3
+ "version": "2.8.0",
4
4
  "description": "Zaber Motion Library is a multi-platform library used to operate Zaber devices.",
5
5
  "keywords": [],
6
6
  "main": "dist/lib/index.js",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@mapbox/node-pre-gyp": "^1.0.5",
83
- "google-protobuf": "3.17.3",
83
+ "google-protobuf": "3.19.1",
84
84
  "node-addon-api": "^4.0.0",
85
85
  "pkg-up": "^3.1.0",
86
86
  "rxjs": "^7.2.0"
@@ -96,7 +96,7 @@
96
96
  "@types/lodash": "^4.14.171",
97
97
  "@types/mocha": "^8.2.3",
98
98
  "@types/mqtt": "2.5.0",
99
- "@types/node": "^16.11.6",
99
+ "@types/node": "^16.3.0",
100
100
  "@types/pkg-up": "^3.1.0",
101
101
  "@types/split2": "^3.2.1",
102
102
  "@types/uuid": "^8.3.1",
@@ -1,14 +0,0 @@
1
- /// <reference types="node" />
2
- import { MotionLibException } from './motion_lib_exception';
3
- import { GCodeExecutionExceptionData } from './g_code_execution_exception_data';
4
- /**
5
- * Thrown when a block of G-Code cannot be executed.
6
- */
7
- export declare class GCodeExecutionException extends MotionLibException {
8
- /**
9
- * Additional data for GCodeExecutionException
10
- */
11
- get details(): GCodeExecutionExceptionData;
12
- private _details;
13
- constructor(message: string, customData: Buffer | GCodeExecutionExceptionData);
14
- }
@@ -1,32 +0,0 @@
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.GCodeExecutionException = void 0;
6
- const motion_lib_exception_1 = require("./motion_lib_exception");
7
- const main_pb_1 = require("../protobufs/main_pb");
8
- const g_code_execution_exception_data_1 = require("./g_code_execution_exception_data");
9
- /**
10
- * Thrown when a block of G-Code cannot be executed.
11
- */
12
- class GCodeExecutionException extends motion_lib_exception_1.MotionLibException {
13
- constructor(message, customData) {
14
- super(message);
15
- Object.setPrototypeOf(this, GCodeExecutionException.prototype);
16
- if (Buffer.isBuffer(customData)) {
17
- const protobufObj = main_pb_1.GCodeExecutionExceptionData.deserializeBinary(customData);
18
- this._details = g_code_execution_exception_data_1.GCodeExecutionExceptionData.fromProtobuf(protobufObj.toObject());
19
- }
20
- else {
21
- this._details = customData;
22
- }
23
- }
24
- /**
25
- * Additional data for GCodeExecutionException
26
- */
27
- get details() {
28
- return this._details;
29
- }
30
- }
31
- exports.GCodeExecutionException = GCodeExecutionException;
32
- //# sourceMappingURL=g_code_execution_exception.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"g_code_execution_exception.js","sourceRoot":"","sources":["../../../src/exceptions/g_code_execution_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,iEAA4D;AAC5D,kDAAyF;AACzF,uFAAgF;AAEhF;;GAEG;AACH,MAAa,uBAAwB,SAAQ,yCAAkB;IAS7D,YACE,OAAe,EACf,UAAgD;QAEhD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;QAE/D,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YAC/B,MAAM,WAAW,GAAG,qCAAkB,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,GAAG,6DAA2B,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;SAClF;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC5B;IACH,CAAC;IArBD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CAiBF;AAvBD,0DAuBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { MotionLibException } from './motion_lib_exception';\nimport { GCodeExecutionExceptionData as CustomDataProtobuf } from '../protobufs/main_pb';\nimport { GCodeExecutionExceptionData } from './g_code_execution_exception_data';\n\n/**\n * Thrown when a block of G-Code cannot be executed.\n */\nexport class GCodeExecutionException extends MotionLibException {\n /**\n * Additional data for GCodeExecutionException\n */\n public get details(): GCodeExecutionExceptionData {\n return this._details;\n }\n private _details: GCodeExecutionExceptionData;\n\n constructor(\n message: string,\n customData: Buffer | GCodeExecutionExceptionData\n ) {\n super(message);\n Object.setPrototypeOf(this, GCodeExecutionException.prototype);\n\n if (Buffer.isBuffer(customData)) {\n const protobufObj = CustomDataProtobuf.deserializeBinary(customData);\n this._details = GCodeExecutionExceptionData.fromProtobuf(protobufObj.toObject());\n } else {\n this._details = customData;\n }\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- /**
2
- * Contains additional data for GCodeExecutionException.
3
- */
4
- export interface GCodeExecutionExceptionData {
5
- /**
6
- * The index in the block string that caused the exception.
7
- */
8
- fromBlock: number;
9
- /**
10
- * The end index in the block string that caused the exception.
11
- * The end index is exclusive.
12
- */
13
- toBlock: number;
14
- }
15
- export declare namespace GCodeExecutionExceptionData {
16
- const __type = "GCodeExecutionExceptionData";
17
- }
@@ -1,18 +0,0 @@
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.GCodeExecutionExceptionData = void 0;
6
- var GCodeExecutionExceptionData;
7
- (function (GCodeExecutionExceptionData) {
8
- GCodeExecutionExceptionData.__type = 'GCodeExecutionExceptionData';
9
- /** @internal */
10
- function fromProtobuf(pbData) {
11
- return {
12
- fromBlock: pbData.fromBlock,
13
- toBlock: pbData.toBlock,
14
- };
15
- }
16
- GCodeExecutionExceptionData.fromProtobuf = fromProtobuf;
17
- })(GCodeExecutionExceptionData = exports.GCodeExecutionExceptionData || (exports.GCodeExecutionExceptionData = {}));
18
- //# sourceMappingURL=g_code_execution_exception_data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"g_code_execution_exception_data.js","sourceRoot":"","sources":["../../../src/exceptions/g_code_execution_exception_data.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAqBtD,IAAiB,2BAA2B,CAU3C;AAVD,WAAiB,2BAA2B;IAC7B,kCAAM,GAAG,6BAA6B,CAAC;IAEpD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAoD;QAC/E,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;IALe,wCAAY,eAK3B,CAAA;AACH,CAAC,EAVgB,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAU3C","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Contains additional data for GCodeExecutionException.\n */\nexport interface GCodeExecutionExceptionData {\n /**\n * The index in the block string that caused the exception.\n */\n fromBlock: number;\n\n /**\n * The end index in the block string that caused the exception.\n * The end index is exclusive.\n */\n toBlock: number;\n\n}\n\nexport namespace GCodeExecutionExceptionData {\n export const __type = 'GCodeExecutionExceptionData';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.GCodeExecutionExceptionData.AsObject): GCodeExecutionExceptionData {\n return {\n fromBlock: pbData.fromBlock,\n toBlock: pbData.toBlock,\n };\n }\n}\n"]}
@@ -1,14 +0,0 @@
1
- /// <reference types="node" />
2
- import { MotionLibException } from './motion_lib_exception';
3
- import { GCodeSyntaxExceptionData } from './g_code_syntax_exception_data';
4
- /**
5
- * Thrown when a block of G-Code cannot be parsed.
6
- */
7
- export declare class GCodeSyntaxException extends MotionLibException {
8
- /**
9
- * Additional data for GCodeSyntaxException
10
- */
11
- get details(): GCodeSyntaxExceptionData;
12
- private _details;
13
- constructor(message: string, customData: Buffer | GCodeSyntaxExceptionData);
14
- }
@@ -1,32 +0,0 @@
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.GCodeSyntaxException = void 0;
6
- const motion_lib_exception_1 = require("./motion_lib_exception");
7
- const main_pb_1 = require("../protobufs/main_pb");
8
- const g_code_syntax_exception_data_1 = require("./g_code_syntax_exception_data");
9
- /**
10
- * Thrown when a block of G-Code cannot be parsed.
11
- */
12
- class GCodeSyntaxException extends motion_lib_exception_1.MotionLibException {
13
- constructor(message, customData) {
14
- super(message);
15
- Object.setPrototypeOf(this, GCodeSyntaxException.prototype);
16
- if (Buffer.isBuffer(customData)) {
17
- const protobufObj = main_pb_1.GCodeSyntaxExceptionData.deserializeBinary(customData);
18
- this._details = g_code_syntax_exception_data_1.GCodeSyntaxExceptionData.fromProtobuf(protobufObj.toObject());
19
- }
20
- else {
21
- this._details = customData;
22
- }
23
- }
24
- /**
25
- * Additional data for GCodeSyntaxException
26
- */
27
- get details() {
28
- return this._details;
29
- }
30
- }
31
- exports.GCodeSyntaxException = GCodeSyntaxException;
32
- //# sourceMappingURL=g_code_syntax_exception.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"g_code_syntax_exception.js","sourceRoot":"","sources":["../../../src/exceptions/g_code_syntax_exception.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAEtD,iEAA4D;AAC5D,kDAAsF;AACtF,iFAA0E;AAE1E;;GAEG;AACH,MAAa,oBAAqB,SAAQ,yCAAkB;IAS1D,YACE,OAAe,EACf,UAA6C;QAE7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAE5D,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YAC/B,MAAM,WAAW,GAAG,kCAAkB,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;YACrE,IAAI,CAAC,QAAQ,GAAG,uDAAwB,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC/E;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC5B;IACH,CAAC;IArBD;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CAiBF;AAvBD,oDAuBC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport { MotionLibException } from './motion_lib_exception';\nimport { GCodeSyntaxExceptionData as CustomDataProtobuf } from '../protobufs/main_pb';\nimport { GCodeSyntaxExceptionData } from './g_code_syntax_exception_data';\n\n/**\n * Thrown when a block of G-Code cannot be parsed.\n */\nexport class GCodeSyntaxException extends MotionLibException {\n /**\n * Additional data for GCodeSyntaxException\n */\n public get details(): GCodeSyntaxExceptionData {\n return this._details;\n }\n private _details: GCodeSyntaxExceptionData;\n\n constructor(\n message: string,\n customData: Buffer | GCodeSyntaxExceptionData\n ) {\n super(message);\n Object.setPrototypeOf(this, GCodeSyntaxException.prototype);\n\n if (Buffer.isBuffer(customData)) {\n const protobufObj = CustomDataProtobuf.deserializeBinary(customData);\n this._details = GCodeSyntaxExceptionData.fromProtobuf(protobufObj.toObject());\n } else {\n this._details = customData;\n }\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- /**
2
- * Contains additional data for GCodeSyntaxException.
3
- */
4
- export interface GCodeSyntaxExceptionData {
5
- /**
6
- * The index in the block string that caused the exception.
7
- */
8
- fromBlock: number;
9
- /**
10
- * The end index in the block string that caused the exception.
11
- * The end index is exclusive.
12
- */
13
- toBlock: number;
14
- }
15
- export declare namespace GCodeSyntaxExceptionData {
16
- const __type = "GCodeSyntaxExceptionData";
17
- }
@@ -1,18 +0,0 @@
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.GCodeSyntaxExceptionData = void 0;
6
- var GCodeSyntaxExceptionData;
7
- (function (GCodeSyntaxExceptionData) {
8
- GCodeSyntaxExceptionData.__type = 'GCodeSyntaxExceptionData';
9
- /** @internal */
10
- function fromProtobuf(pbData) {
11
- return {
12
- fromBlock: pbData.fromBlock,
13
- toBlock: pbData.toBlock,
14
- };
15
- }
16
- GCodeSyntaxExceptionData.fromProtobuf = fromProtobuf;
17
- })(GCodeSyntaxExceptionData = exports.GCodeSyntaxExceptionData || (exports.GCodeSyntaxExceptionData = {}));
18
- //# sourceMappingURL=g_code_syntax_exception_data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"g_code_syntax_exception_data.js","sourceRoot":"","sources":["../../../src/exceptions/g_code_syntax_exception_data.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAqBtD,IAAiB,wBAAwB,CAUxC;AAVD,WAAiB,wBAAwB;IAC1B,+BAAM,GAAG,0BAA0B,CAAC;IAEjD,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAiD;QAC5E,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;IALe,qCAAY,eAK3B,CAAA;AACH,CAAC,EAVgB,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAUxC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Contains additional data for GCodeSyntaxException.\n */\nexport interface GCodeSyntaxExceptionData {\n /**\n * The index in the block string that caused the exception.\n */\n fromBlock: number;\n\n /**\n * The end index in the block string that caused the exception.\n * The end index is exclusive.\n */\n toBlock: number;\n\n}\n\nexport namespace GCodeSyntaxExceptionData {\n export const __type = 'GCodeSyntaxExceptionData';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.GCodeSyntaxExceptionData.AsObject): GCodeSyntaxExceptionData {\n return {\n fromBlock: pbData.fromBlock,\n toBlock: pbData.toBlock,\n };\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- /**
2
- * @param instance what to finalize
3
- * @param cleanup callback performing the finalization (MUST NOT hold reference to instance)
4
- */
5
- export declare const registerForFinalization: (instance: object, cleanup: () => void) => void;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerForFinalization = void 0;
4
- let finalizationRegistry;
5
- if (typeof FinalizationRegistry !== 'undefined') {
6
- finalizationRegistry = new FinalizationRegistry(cleanup => cleanup());
7
- }
8
- /**
9
- * @param instance what to finalize
10
- * @param cleanup callback performing the finalization (MUST NOT hold reference to instance)
11
- */
12
- const registerForFinalization = (instance, cleanup) => {
13
- if (finalizationRegistry == null) {
14
- // eslint-disable-next-line no-console
15
- console.warn(`FinalizationRegistry is not supported by your environment, instances of ${instance.constructor.name} must be freed manually.`);
16
- return;
17
- }
18
- finalizationRegistry.register(instance, cleanup);
19
- };
20
- exports.registerForFinalization = registerForFinalization;
21
- //# sourceMappingURL=finalizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"finalizer.js","sourceRoot":"","sources":["../../src/finalizer.ts"],"names":[],"mappings":";;;AAAA,IAAI,oBAAkE,CAAC;AAEvE,IAAI,OAAO,oBAAoB,KAAK,WAAW,EAAE;IAC/C,oBAAoB,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;CACvE;AAED;;;GAGG;AACI,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,OAAmB,EAAE,EAAE;IAC/E,IAAI,oBAAoB,IAAI,IAAI,EAAE;QAChC,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,2EAA2E,QAAQ,CAAC,WAAW,CAAC,IAAI,0BAA0B,CAAC,CAAC;QAC7I,OAAO;KACR;IACD,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC","sourcesContent":["let finalizationRegistry: FinalizationRegistry<() => void> | undefined;\n\nif (typeof FinalizationRegistry !== 'undefined') {\n finalizationRegistry = new FinalizationRegistry(cleanup => cleanup());\n}\n\n/**\n * @param instance what to finalize\n * @param cleanup callback performing the finalization (MUST NOT hold reference to instance)\n */\nexport const registerForFinalization = (instance: object, cleanup: () => void) => { // eslint-disable-line @typescript-eslint/ban-types\n if (finalizationRegistry == null) {\n // eslint-disable-next-line no-console\n console.warn(`FinalizationRegistry is not supported by your environment, instances of ${instance.constructor.name} must be freed manually.`);\n return;\n }\n finalizationRegistry.register(instance, cleanup);\n};\n"]}
@@ -1,16 +0,0 @@
1
- /**
2
- * Maps a translator axis to a Zaber stream axis.
3
- */
4
- export interface AxisMapping {
5
- /**
6
- * Letter of the translator axis (X,Y,Z,A,B,C,E).
7
- */
8
- axisLetter: string;
9
- /**
10
- * Index of the stream axis.
11
- */
12
- axisIndex: number;
13
- }
14
- export declare namespace AxisMapping {
15
- const __type = "AxisMapping";
16
- }
@@ -1,38 +0,0 @@
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.AxisMapping = void 0;
25
- const gateway = __importStar(require("../gateway"));
26
- var AxisMapping;
27
- (function (AxisMapping) {
28
- AxisMapping.__type = 'AxisMapping';
29
- /** @internal */
30
- function toProtobuf(source) {
31
- const pbData = new gateway.TranslatorAxisMapping();
32
- pbData.setAxisLetter(source.axisLetter);
33
- pbData.setAxisIndex(source.axisIndex);
34
- return pbData;
35
- }
36
- AxisMapping.toProtobuf = toProtobuf;
37
- })(AxisMapping = exports.AxisMapping || (exports.AxisMapping = {}));
38
- //# sourceMappingURL=axis_mapping.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"axis_mapping.js","sourceRoot":"","sources":["../../../src/gcode/axis_mapping.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAkBtC,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,qBAAqB,EAAE,CAAC;QACnD,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtC,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';\n\n/**\n * Maps a translator axis to a Zaber stream axis.\n */\nexport interface AxisMapping {\n /**\n * Letter of the translator axis (X,Y,Z,A,B,C,E).\n */\n axisLetter: string;\n\n /**\n * Index of the stream axis.\n */\n axisIndex: number;\n\n}\n\nexport namespace AxisMapping {\n export const __type = 'AxisMapping';\n\n /** @internal */\n export function toProtobuf(source: AxisMapping): gateway.TranslatorAxisMapping {\n const pbData = new gateway.TranslatorAxisMapping();\n pbData.setAxisLetter(source.axisLetter);\n pbData.setAxisIndex(source.axisIndex);\n return pbData;\n }\n}\n"]}
@@ -1,8 +0,0 @@
1
- export { TranslateMessage } from './translate_message';
2
- export { TranslateResult } from './translate_result';
3
- export { TranslatorConfig } from './translator_config';
4
- export { TranslatorAxisDefinition } from './translator_axis_definition';
5
- export { TranslatorDefinition } from './translator_definition';
6
- export { AxisMapping } from './axis_mapping';
7
- export { Translator } from './translator';
8
- export { TranslatorLive } from './translator_live';
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TranslatorLive = exports.Translator = exports.AxisMapping = exports.TranslatorDefinition = exports.TranslatorAxisDefinition = exports.TranslatorConfig = exports.TranslateResult = exports.TranslateMessage = void 0;
4
- var translate_message_1 = require("./translate_message");
5
- Object.defineProperty(exports, "TranslateMessage", { enumerable: true, get: function () { return translate_message_1.TranslateMessage; } });
6
- var translate_result_1 = require("./translate_result");
7
- Object.defineProperty(exports, "TranslateResult", { enumerable: true, get: function () { return translate_result_1.TranslateResult; } });
8
- var translator_config_1 = require("./translator_config");
9
- Object.defineProperty(exports, "TranslatorConfig", { enumerable: true, get: function () { return translator_config_1.TranslatorConfig; } });
10
- var translator_axis_definition_1 = require("./translator_axis_definition");
11
- Object.defineProperty(exports, "TranslatorAxisDefinition", { enumerable: true, get: function () { return translator_axis_definition_1.TranslatorAxisDefinition; } });
12
- var translator_definition_1 = require("./translator_definition");
13
- Object.defineProperty(exports, "TranslatorDefinition", { enumerable: true, get: function () { return translator_definition_1.TranslatorDefinition; } });
14
- var axis_mapping_1 = require("./axis_mapping");
15
- Object.defineProperty(exports, "AxisMapping", { enumerable: true, get: function () { return axis_mapping_1.AxisMapping; } });
16
- var translator_1 = require("./translator");
17
- Object.defineProperty(exports, "Translator", { enumerable: true, get: function () { return translator_1.Translator; } });
18
- var translator_live_1 = require("./translator_live");
19
- Object.defineProperty(exports, "TranslatorLive", { enumerable: true, get: function () { return translator_live_1.TranslatorLive; } });
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gcode/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,uDAAqD;AAA5C,mHAAA,eAAe,OAAA;AACxB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,2EAAwE;AAA/D,sIAAA,wBAAwB,OAAA;AACjC,iEAA+D;AAAtD,6HAAA,oBAAoB,OAAA;AAC7B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA","sourcesContent":["export { TranslateMessage } from './translate_message';\nexport { TranslateResult } from './translate_result';\nexport { TranslatorConfig } from './translator_config';\nexport { TranslatorAxisDefinition } from './translator_axis_definition';\nexport { TranslatorDefinition } from './translator_definition';\nexport { AxisMapping } from './axis_mapping';\nexport { Translator } from './translator';\nexport { TranslatorLive } from './translator_live';\n"]}
@@ -1,21 +0,0 @@
1
- /**
2
- * Represents a message from translator regarding a block translation.
3
- */
4
- export interface TranslateMessage {
5
- /**
6
- * The message describing an occurrence.
7
- */
8
- message: string;
9
- /**
10
- * The index in the block string that the message regards to.
11
- */
12
- fromBlock: number;
13
- /**
14
- * The end index in the block string that the message regards to.
15
- * The end index is exclusive.
16
- */
17
- toBlock: number;
18
- }
19
- export declare namespace TranslateMessage {
20
- const __type = "TranslateMessage";
21
- }
@@ -1,19 +0,0 @@
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.TranslateMessage = void 0;
6
- var TranslateMessage;
7
- (function (TranslateMessage) {
8
- TranslateMessage.__type = 'TranslateMessage';
9
- /** @internal */
10
- function fromProtobuf(pbData) {
11
- return {
12
- message: pbData.message,
13
- fromBlock: pbData.fromBlock,
14
- toBlock: pbData.toBlock,
15
- };
16
- }
17
- TranslateMessage.fromProtobuf = fromProtobuf;
18
- })(TranslateMessage = exports.TranslateMessage || (exports.TranslateMessage = {}));
19
- //# sourceMappingURL=translate_message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translate_message.js","sourceRoot":"","sources":["../../../src/gcode/translate_message.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AA0BtD,IAAiB,gBAAgB,CAWhC;AAXD,WAAiB,gBAAgB;IAClB,uBAAM,GAAG,kBAAkB,CAAC;IAEzC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAyC;QACpE,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;IANe,6BAAY,eAM3B,CAAA;AACH,CAAC,EAXgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAWhC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\n\n/**\n * Represents a message from translator regarding a block translation.\n */\nexport interface TranslateMessage {\n /**\n * The message describing an occurrence.\n */\n message: string;\n\n /**\n * The index in the block string that the message regards to.\n */\n fromBlock: number;\n\n /**\n * The end index in the block string that the message regards to.\n * The end index is exclusive.\n */\n toBlock: number;\n\n}\n\nexport namespace TranslateMessage {\n export const __type = 'TranslateMessage';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.TranslateMessage.AsObject): TranslateMessage {\n return {\n message: pbData.message,\n fromBlock: pbData.fromBlock,\n toBlock: pbData.toBlock,\n };\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- import { TranslateMessage } from './translate_message';
2
- /**
3
- * Represents a result of a G-code block translation.
4
- */
5
- export interface TranslateResult {
6
- /**
7
- * Stream commands resulting from the block.
8
- */
9
- commands: string[];
10
- /**
11
- * Messages informing about unsupported codes and features.
12
- */
13
- warnings: TranslateMessage[];
14
- }
15
- export declare namespace TranslateResult {
16
- const __type = "TranslateResult";
17
- }
@@ -1,19 +0,0 @@
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.TranslateResult = void 0;
6
- const translate_message_1 = require("./translate_message");
7
- var TranslateResult;
8
- (function (TranslateResult) {
9
- TranslateResult.__type = 'TranslateResult';
10
- /** @internal */
11
- function fromProtobuf(pbData) {
12
- return {
13
- commands: pbData.commandsList,
14
- warnings: pbData.warningsList.map(item => translate_message_1.TranslateMessage.fromProtobuf(item)),
15
- };
16
- }
17
- TranslateResult.fromProtobuf = fromProtobuf;
18
- })(TranslateResult = exports.TranslateResult || (exports.TranslateResult = {}));
19
- //# sourceMappingURL=translate_result.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"translate_result.js","sourceRoot":"","sources":["../../../src/gcode/translate_result.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;AAGtD,2DAAuD;AAkBvD,IAAiB,eAAe,CAU/B;AAVD,WAAiB,eAAe;IACjB,sBAAM,GAAG,iBAAiB,CAAC;IAExC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,MAAoD;QAC/E,OAAO;YACL,QAAQ,EAAE,MAAM,CAAC,YAAY;YAC7B,QAAQ,EAAE,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,oCAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAC/E,CAAC;IACJ,CAAC;IALe,4BAAY,eAK3B,CAAA;AACH,CAAC,EAVgB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAU/B","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { TranslateMessage } from './translate_message';\n\n/**\n * Represents a result of a G-code block translation.\n */\nexport interface TranslateResult {\n /**\n * Stream commands resulting from the block.\n */\n commands: string[];\n\n /**\n * Messages informing about unsupported codes and features.\n */\n warnings: TranslateMessage[];\n\n}\n\nexport namespace TranslateResult {\n export const __type = 'TranslateResult';\n\n /** @internal */\n export function fromProtobuf(pbData: gateway.TranslatorTranslateResponse.AsObject): TranslateResult {\n return {\n commands: pbData.commandsList,\n warnings: pbData.warningsList.map(item => TranslateMessage.fromProtobuf(item)),\n };\n }\n}\n"]}
@@ -1,68 +0,0 @@
1
- import { TranslatorDefinition } from './translator_definition';
2
- import { TranslatorConfig } from './translator_config';
3
- import { TranslateResult } from './translate_result';
4
- import { Angle, Length, Native, AngularVelocity, Velocity } from '../units';
5
- export declare class Translator {
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 translator from provided device definition and configuration.
14
- * @param definition Definition of device and its peripherals.
15
- * The definition must match a device that later performs the commands.
16
- * @param config Configuration of the translator.
17
- * @return New instance of translator.
18
- */
19
- static setup(definition: TranslatorDefinition, config: TranslatorConfig): Promise<Translator>;
20
- /**
21
- * Translates a single block (line) of G-code.
22
- * @param block Block (line) of G-code.
23
- * @return Result of translation containing the stream commands.
24
- */
25
- translate(block: string): TranslateResult;
26
- /**
27
- * Sets the speed at which the device moves when traversing (G0).
28
- * @param traverseRate The traverse rate.
29
- * @param unit Units of the traverse rate.
30
- */
31
- setTraverseRate(traverseRate: number, unit: Velocity | AngularVelocity | Native): void;
32
- /**
33
- * Sets position of translator's axis.
34
- * Use this method to set position after performing movement outside of the translator.
35
- * This method does not cause any movement.
36
- * @param axis Letter of the axis.
37
- * @param position The position.
38
- * @param unit Units of position.
39
- */
40
- setAxisPosition(axis: string, position: number, unit: Length | Angle | Native): void;
41
- /**
42
- * Gets position of translator's axis.
43
- * This method does not query device but returns value from translator's state.
44
- * @param axis Letter of the axis.
45
- * @param unit Units of position.
46
- * @return Position of translator's axis.
47
- */
48
- getAxisPosition(axis: string, unit: Length | Angle | Native): number;
49
- /**
50
- * Sets default position of translator's axis.
51
- * This position is used by G28.
52
- * @param axis Letter of the axis.
53
- * @param position The default position.
54
- * @param unit Units of position.
55
- */
56
- setAxisDefaultPosition(axis: string, position: number, unit: Length | Angle | Native): void;
57
- /**
58
- * Releases native resources of a translator.
59
- * @param translatorId The ID of the translator.
60
- */
61
- private static _free;
62
- /**
63
- * Releases the native resources of the translator.
64
- * Should only be called if your environment does not support FinalizationRegistry.
65
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
66
- */
67
- free(): void;
68
- }