@zaber/motion 2.15.0 → 2.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/all_axes.js +3 -3
  3. package/dist/lib/ascii/all_axes.js.map +1 -1
  4. package/dist/lib/ascii/axis.js +7 -7
  5. package/dist/lib/ascii/axis.js.map +1 -1
  6. package/dist/lib/ascii/connection.js +5 -5
  7. package/dist/lib/ascii/connection.js.map +1 -1
  8. package/dist/lib/ascii/device.js +10 -10
  9. package/dist/lib/ascii/device.js.map +1 -1
  10. package/dist/lib/ascii/lockstep.js +4 -4
  11. package/dist/lib/ascii/lockstep.js.map +1 -1
  12. package/dist/lib/ascii/oscilloscope.js +3 -3
  13. package/dist/lib/ascii/oscilloscope.js.map +1 -1
  14. package/dist/lib/ascii/oscilloscope_data.js +4 -4
  15. package/dist/lib/ascii/oscilloscope_data.js.map +1 -1
  16. package/dist/lib/ascii/servo_tuner.js +3 -3
  17. package/dist/lib/ascii/servo_tuner.js.map +1 -1
  18. package/dist/lib/ascii/setting_constants.d.ts +135 -71
  19. package/dist/lib/ascii/setting_constants.js +135 -71
  20. package/dist/lib/ascii/setting_constants.js.map +1 -1
  21. package/dist/lib/ascii/stream.js +4 -4
  22. package/dist/lib/ascii/stream.js.map +1 -1
  23. package/dist/lib/ascii/stream_buffer.js +4 -4
  24. package/dist/lib/ascii/stream_buffer.js.map +1 -1
  25. package/dist/lib/ascii/transport.js +3 -3
  26. package/dist/lib/ascii/transport.js.map +1 -1
  27. package/dist/lib/binary/binary_settings.d.ts +1 -2
  28. package/dist/lib/binary/binary_settings.js +1 -2
  29. package/dist/lib/binary/binary_settings.js.map +1 -1
  30. package/dist/lib/binary/command_code.d.ts +1 -2
  31. package/dist/lib/binary/command_code.js +0 -1
  32. package/dist/lib/binary/command_code.js.map +1 -1
  33. package/dist/lib/binary/connection.js +5 -5
  34. package/dist/lib/binary/connection.js.map +1 -1
  35. package/dist/lib/binary/device.js +5 -5
  36. package/dist/lib/binary/device.js.map +1 -1
  37. package/dist/lib/binary/reply_code.d.ts +0 -1
  38. package/dist/lib/binary/reply_code.js +0 -1
  39. package/dist/lib/binary/reply_code.js.map +1 -1
  40. package/dist/lib/exceptions/binary_command_failed_exception.js +6 -6
  41. package/dist/lib/exceptions/binary_command_failed_exception.js.map +1 -1
  42. package/dist/lib/exceptions/command_failed_exception.js +6 -6
  43. package/dist/lib/exceptions/command_failed_exception.js.map +1 -1
  44. package/dist/lib/exceptions/command_too_long_exception.js +6 -6
  45. package/dist/lib/exceptions/command_too_long_exception.js.map +1 -1
  46. package/dist/lib/exceptions/device_address_conflict_exception.js +6 -6
  47. package/dist/lib/exceptions/device_address_conflict_exception.js.map +1 -1
  48. package/dist/lib/exceptions/device_db_failed_exception.js +6 -6
  49. package/dist/lib/exceptions/device_db_failed_exception.js.map +1 -1
  50. package/dist/lib/exceptions/g_code_execution_exception.js +6 -6
  51. package/dist/lib/exceptions/g_code_execution_exception.js.map +1 -1
  52. package/dist/lib/exceptions/g_code_syntax_exception.js +6 -6
  53. package/dist/lib/exceptions/g_code_syntax_exception.js.map +1 -1
  54. package/dist/lib/exceptions/invalid_packet_exception.js +6 -6
  55. package/dist/lib/exceptions/invalid_packet_exception.js.map +1 -1
  56. package/dist/lib/exceptions/invalid_response_exception.js +6 -6
  57. package/dist/lib/exceptions/invalid_response_exception.js.map +1 -1
  58. package/dist/lib/exceptions/movement_failed_exception.js +6 -6
  59. package/dist/lib/exceptions/movement_failed_exception.js.map +1 -1
  60. package/dist/lib/exceptions/movement_interrupted_exception.js +6 -6
  61. package/dist/lib/exceptions/movement_interrupted_exception.js.map +1 -1
  62. package/dist/lib/exceptions/set_device_state_exception_data.d.ts +4 -0
  63. package/dist/lib/exceptions/set_device_state_exception_data.js +1 -0
  64. package/dist/lib/exceptions/set_device_state_exception_data.js.map +1 -1
  65. package/dist/lib/exceptions/set_device_state_failed_exception.js +6 -6
  66. package/dist/lib/exceptions/set_device_state_failed_exception.js.map +1 -1
  67. package/dist/lib/exceptions/set_peripheral_state_exception_data.d.ts +4 -0
  68. package/dist/lib/exceptions/set_peripheral_state_exception_data.js +1 -0
  69. package/dist/lib/exceptions/set_peripheral_state_exception_data.js.map +1 -1
  70. package/dist/lib/exceptions/set_peripheral_state_failed_exception.js +6 -6
  71. package/dist/lib/exceptions/set_peripheral_state_failed_exception.js.map +1 -1
  72. package/dist/lib/exceptions/stream_execution_exception.js +6 -6
  73. package/dist/lib/exceptions/stream_execution_exception.js.map +1 -1
  74. package/dist/lib/exceptions/stream_movement_failed_exception.js +6 -6
  75. package/dist/lib/exceptions/stream_movement_failed_exception.js.map +1 -1
  76. package/dist/lib/exceptions/stream_movement_interrupted_exception.js +6 -6
  77. package/dist/lib/exceptions/stream_movement_interrupted_exception.js.map +1 -1
  78. package/dist/lib/gateway/bindings.d.ts +1 -1
  79. package/dist/lib/gateway/wasm-exec.js +1 -1
  80. package/dist/lib/gateway/wasm-exec.js.map +1 -1
  81. package/dist/lib/gcode/offline_translator.js +4 -4
  82. package/dist/lib/gcode/offline_translator.js.map +1 -1
  83. package/dist/lib/gcode/translator.js +4 -4
  84. package/dist/lib/gcode/translator.js.map +1 -1
  85. package/dist/lib/protobufs/main_pb.d.ts +0 -4
  86. package/dist/lib/protobufs/main_pb.js +20 -50
  87. package/dist/lib/protobufs/main_pb.js.map +1 -1
  88. package/dist/lib/units.d.ts +2 -2
  89. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-exec.js","sourceRoot":"","sources":["../../../src/gateway/wasm-exec.js"],"names":[],"mappings":"AAAA;;;;EAIE;AAEF,sDAAsD;AACtD,qDAAqD;AACrD,iDAAiD;AAEjD,YAAY,CAAC;AAEb,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;IACtB,MAAM,MAAM,GAAG,GAAG,EAAE;QACnB,MAAM,GAAG,GAAG,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+B,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,MAAM,EAAE;gBAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;aAC3B;QACF,CAAC;QAED,gBAAgB,CAAC,EAAE;YAClB,MAAM,EAAE,GAAG,IAAI,CAAC;YAChB,OAAO;gBACN,MAAM,KAAK,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;gBACtD,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC;gBACzB,EAAE,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC,MAAM,CAAC;YACrB,CAAC,CAAC;QACH,CAAC;KACD,CAAA;AACF,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG;IAChB,QAAQ;CACR,CAAC","sourcesContent":["/*\nIMPORTANT\nThis file was copied from `https://github.com/golang/go/blob/release-branch.go1.15/misc/wasm/wasm_exec.js`.\nIt has been modified a bit to reduce webpack warnings about how the `require()` function is being used\n*/\n\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\"use strict\";\n\nconst wasmExec = (() => {\n\tconst enosys = () => {\n\t\tconst err = new Error(\"not implemented\");\n\t\terr.code = \"ENOSYS\";\n\t\treturn err;\n\t};\n\n\tif (!globalThis.fs) {\n\t\tlet outputBuf = \"\";\n\t\tglobalThis.fs = {\n\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\twriteSync(fd, buf) {\n\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\tif (nl != -1) {\n\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t}\n\t\t\t\treturn buf.length;\n\t\t\t},\n\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\tcallback(enosys());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\tcallback(null, n);\n\t\t\t},\n\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t};\n\t}\n\n\tif (!globalThis.process) {\n\t\tglobalThis.process = {\n\t\t\tgetuid() { return -1; },\n\t\t\tgetgid() { return -1; },\n\t\t\tgeteuid() { return -1; },\n\t\t\tgetegid() { return -1; },\n\t\t\tgetgroups() { throw enosys(); },\n\t\t\tpid: -1,\n\t\t\tppid: -1,\n\t\t\tumask() { throw enosys(); },\n\t\t\tcwd() { throw enosys(); },\n\t\t\tchdir() { throw enosys(); },\n\t\t}\n\t}\n\n\tif (!globalThis.crypto) {\n\t\tthrow new Error(\"globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)\");\n\t}\n\n\tif (!globalThis.performance) {\n\t\tthrow new Error(\"globalThis.performance is not available, polyfill required (performance.now only)\");\n\t}\n\n\tif (!globalThis.TextEncoder) {\n\t\tthrow new Error(\"globalThis.TextEncoder is not available, polyfill required\");\n\t}\n\n\tif (!globalThis.TextDecoder) {\n\t\tthrow new Error(\"globalThis.TextDecoder is not available, polyfill required\");\n\t}\n\n\tconst encoder = new TextEncoder(\"utf-8\");\n\tconst decoder = new TextDecoder(\"utf-8\");\n\n\tglobalThis.Go = class {\n\t\tconstructor() {\n\t\t\tthis.argv = [\"js\"];\n\t\t\tthis.env = {};\n\t\t\tthis.exit = (code) => {\n\t\t\t\tif (code !== 0) {\n\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t});\n\t\t\tthis._pendingEvent = null;\n\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\tthis._nextCallbackTimeoutID = 1;\n\n\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t}\n\n\t\t\tconst getInt64 = (addr) => {\n\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\treturn low + high * 4294967296;\n\t\t\t}\n\n\t\t\tconst loadValue = (addr) => {\n\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\tif (f === 0) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\treturn f;\n\t\t\t\t}\n\n\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\treturn this._values[id];\n\t\t\t}\n\n\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\tconst nanHead = 0x7FF80000;\n\n\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (v === undefined) {\n\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\tif (id === undefined) {\n\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t}\n\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t}\n\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\tlet typeFlag = 0;\n\t\t\t\tswitch (typeof v) {\n\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t}\n\n\t\t\tconst loadSlice = (addr) => {\n\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t}\n\n\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\tconst a = new Array(len);\n\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t}\n\t\t\t\treturn a;\n\t\t\t}\n\n\t\t\tconst loadString = (addr) => {\n\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t}\n\n\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\tthis.importObject = {\n\t\t\t\tgo: {\n\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\n\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func walltime() (sec int64, nsec int32)\n\t\t\t\t\t\"runtime.walltime\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t));\n\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t},\n\n\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t},\n\n\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t},\n\n\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t},\n\n\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tasync run(instance) {\n\t\t\tif (!(instance instanceof WebAssembly.Instance)) {\n\t\t\t\tthrow new Error(\"Go.run: WebAssembly.Instance expected\");\n\t\t\t}\n\t\t\tthis._inst = instance;\n\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\tNaN,\n\t\t\t\t0,\n\t\t\t\tnull,\n\t\t\t\ttrue,\n\t\t\t\tfalse,\n\t\t\t\tglobalThis,\n\t\t\t\tthis,\n\t\t\t];\n\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t[0, 1],\n\t\t\t\t[null, 2],\n\t\t\t\t[true, 3],\n\t\t\t\t[false, 4],\n\t\t\t\t[globalThis, 5],\n\t\t\t\t[this, 6],\n\t\t\t]);\n\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\tthis.exited = false; // whether the Go program has exited\n\n\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\tlet offset = 4096;\n\n\t\t\tconst strPtr = (str) => {\n\t\t\t\tconst ptr = offset;\n\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\toffset += bytes.length;\n\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t}\n\t\t\t\treturn ptr;\n\t\t\t};\n\n\t\t\tconst argc = this.argv.length;\n\n\t\t\tconst argvPtrs = [];\n\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t});\n\t\t\targvPtrs.push(0);\n\n\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\tkeys.forEach((key) => {\n\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t});\n\t\t\targvPtrs.push(0);\n\n\t\t\tconst argv = offset;\n\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\toffset += 8;\n\t\t\t});\n\n\t\t\t// The linker guarantees global data starts from at least wasmMinDataAddr.\n\t\t\t// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.\n\t\t\tconst wasmMinDataAddr = 4096 + 8192;\n\t\t\tif (offset >= wasmMinDataAddr) {\n\t\t\t\tthrow new Error(\"total length of command line and environment variables exceeds limit\");\n\t\t\t}\n\n\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\tif (this.exited) {\n\t\t\t\tthis._resolveExitPromise();\n\t\t\t}\n\t\t\tawait this._exitPromise;\n\t\t}\n\n\t\t_resume() {\n\t\t\tif (this.exited) {\n\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t}\n\t\t\tthis._inst.exports.resume();\n\t\t\tif (this.exited) {\n\t\t\t\tthis._resolveExitPromise();\n\t\t\t}\n\t\t}\n\n\t\t_makeFuncWrapper(id) {\n\t\t\tconst go = this;\n\t\t\treturn function () {\n\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\tgo._pendingEvent = event;\n\t\t\t\tgo._resume();\n\t\t\t\treturn event.result;\n\t\t\t};\n\t\t}\n\t}\n});\n\nmodule.exports = {\n\twasmExec,\n};\n"]}
1
+ {"version":3,"file":"wasm-exec.js","sourceRoot":"","sources":["../../../src/gateway/wasm-exec.js"],"names":[],"mappings":"AAAA;;;;EAIE;AAEF,sDAAsD;AACtD,qDAAqD;AACrD,iDAAiD;AAEjD,YAAY,CAAC;AAEb,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE;IACtB,MAAM,MAAM,GAAG,GAAG,EAAE;QACnB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACzC,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC;QACpB,OAAO,GAAG,CAAC;IACZ,CAAC,CAAC;IAEF,IAAI,CAAC,UAAU,CAAC,EAAE,EA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B;QACF,CAAC;QAED,gBAAgB,CAAC,EAAE;YAClB,MAAM,EAAE,GAAG,IAAI,CAAC;YAChB,OAAO;gBACN,MAAM,KAAK,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;gBACtD,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC;gBACzB,EAAE,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC,MAAM,CAAC;YACrB,CAAC,CAAC;QACH,CAAC;KACD,CAAA;AACF,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG;IAChB,QAAQ;CACR,CAAC","sourcesContent":["/*\nIMPORTANT\nThis file was copied from `https://github.com/golang/go/blob/release-branch.go1.18/misc/wasm/wasm_exec.js`.\nIt has been modified a bit to reduce webpack warnings about how the `require()` function is being used\n*/\n\n// Copyright 2018 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n\"use strict\";\n\nconst wasmExec = (() => {\n\tconst enosys = () => {\n\t\tconst err = new Error(\"not implemented\");\n\t\terr.code = \"ENOSYS\";\n\t\treturn err;\n\t};\n\n\tif (!globalThis.fs) {\n\t\tlet outputBuf = \"\";\n\t\tglobalThis.fs = {\n\t\t\tconstants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused\n\t\t\twriteSync(fd, buf) {\n\t\t\t\toutputBuf += decoder.decode(buf);\n\t\t\t\tconst nl = outputBuf.lastIndexOf(\"\\n\");\n\t\t\t\tif (nl != -1) {\n\t\t\t\t\tconsole.log(outputBuf.substr(0, nl));\n\t\t\t\t\toutputBuf = outputBuf.substr(nl + 1);\n\t\t\t\t}\n\t\t\t\treturn buf.length;\n\t\t\t},\n\t\t\twrite(fd, buf, offset, length, position, callback) {\n\t\t\t\tif (offset !== 0 || length !== buf.length || position !== null) {\n\t\t\t\t\tcallback(enosys());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst n = this.writeSync(fd, buf);\n\t\t\t\tcallback(null, n);\n\t\t\t},\n\t\t\tchmod(path, mode, callback) { callback(enosys()); },\n\t\t\tchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\tclose(fd, callback) { callback(enosys()); },\n\t\t\tfchmod(fd, mode, callback) { callback(enosys()); },\n\t\t\tfchown(fd, uid, gid, callback) { callback(enosys()); },\n\t\t\tfstat(fd, callback) { callback(enosys()); },\n\t\t\tfsync(fd, callback) { callback(null); },\n\t\t\tftruncate(fd, length, callback) { callback(enosys()); },\n\t\t\tlchown(path, uid, gid, callback) { callback(enosys()); },\n\t\t\tlink(path, link, callback) { callback(enosys()); },\n\t\t\tlstat(path, callback) { callback(enosys()); },\n\t\t\tmkdir(path, perm, callback) { callback(enosys()); },\n\t\t\topen(path, flags, mode, callback) { callback(enosys()); },\n\t\t\tread(fd, buffer, offset, length, position, callback) { callback(enosys()); },\n\t\t\treaddir(path, callback) { callback(enosys()); },\n\t\t\treadlink(path, callback) { callback(enosys()); },\n\t\t\trename(from, to, callback) { callback(enosys()); },\n\t\t\trmdir(path, callback) { callback(enosys()); },\n\t\t\tstat(path, callback) { callback(enosys()); },\n\t\t\tsymlink(path, link, callback) { callback(enosys()); },\n\t\t\ttruncate(path, length, callback) { callback(enosys()); },\n\t\t\tunlink(path, callback) { callback(enosys()); },\n\t\t\tutimes(path, atime, mtime, callback) { callback(enosys()); },\n\t\t};\n\t}\n\n\tif (!globalThis.process) {\n\t\tglobalThis.process = {\n\t\t\tgetuid() { return -1; },\n\t\t\tgetgid() { return -1; },\n\t\t\tgeteuid() { return -1; },\n\t\t\tgetegid() { return -1; },\n\t\t\tgetgroups() { throw enosys(); },\n\t\t\tpid: -1,\n\t\t\tppid: -1,\n\t\t\tumask() { throw enosys(); },\n\t\t\tcwd() { throw enosys(); },\n\t\t\tchdir() { throw enosys(); },\n\t\t}\n\t}\n\n\tif (!globalThis.crypto) {\n\t\tthrow new Error(\"globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)\");\n\t}\n\n\tif (!globalThis.performance) {\n\t\tthrow new Error(\"globalThis.performance is not available, polyfill required (performance.now only)\");\n\t}\n\n\tif (!globalThis.TextEncoder) {\n\t\tthrow new Error(\"globalThis.TextEncoder is not available, polyfill required\");\n\t}\n\n\tif (!globalThis.TextDecoder) {\n\t\tthrow new Error(\"globalThis.TextDecoder is not available, polyfill required\");\n\t}\n\n\tconst encoder = new TextEncoder(\"utf-8\");\n\tconst decoder = new TextDecoder(\"utf-8\");\n\n\tglobalThis.Go = class {\n\t\tconstructor() {\n\t\t\tthis.argv = [\"js\"];\n\t\t\tthis.env = {};\n\t\t\tthis.exit = (code) => {\n\t\t\t\tif (code !== 0) {\n\t\t\t\t\tconsole.warn(\"exit code:\", code);\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._exitPromise = new Promise((resolve) => {\n\t\t\t\tthis._resolveExitPromise = resolve;\n\t\t\t});\n\t\t\tthis._pendingEvent = null;\n\t\t\tthis._scheduledTimeouts = new Map();\n\t\t\tthis._nextCallbackTimeoutID = 1;\n\n\t\t\tconst setInt64 = (addr, v) => {\n\t\t\t\tthis.mem.setUint32(addr + 0, v, true);\n\t\t\t\tthis.mem.setUint32(addr + 4, Math.floor(v / 4294967296), true);\n\t\t\t}\n\n\t\t\tconst getInt64 = (addr) => {\n\t\t\t\tconst low = this.mem.getUint32(addr + 0, true);\n\t\t\t\tconst high = this.mem.getInt32(addr + 4, true);\n\t\t\t\treturn low + high * 4294967296;\n\t\t\t}\n\n\t\t\tconst loadValue = (addr) => {\n\t\t\t\tconst f = this.mem.getFloat64(addr, true);\n\t\t\t\tif (f === 0) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tif (!isNaN(f)) {\n\t\t\t\t\treturn f;\n\t\t\t\t}\n\n\t\t\t\tconst id = this.mem.getUint32(addr, true);\n\t\t\t\treturn this._values[id];\n\t\t\t}\n\n\t\t\tconst storeValue = (addr, v) => {\n\t\t\t\tconst nanHead = 0x7FF80000;\n\n\t\t\t\tif (typeof v === \"number\" && v !== 0) {\n\t\t\t\t\tif (isNaN(v)) {\n\t\t\t\t\t\tthis.mem.setUint32(addr + 4, nanHead, true);\n\t\t\t\t\t\tthis.mem.setUint32(addr, 0, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tthis.mem.setFloat64(addr, v, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (v === undefined) {\n\t\t\t\t\tthis.mem.setFloat64(addr, 0, true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet id = this._ids.get(v);\n\t\t\t\tif (id === undefined) {\n\t\t\t\t\tid = this._idPool.pop();\n\t\t\t\t\tif (id === undefined) {\n\t\t\t\t\t\tid = this._values.length;\n\t\t\t\t\t}\n\t\t\t\t\tthis._values[id] = v;\n\t\t\t\t\tthis._goRefCounts[id] = 0;\n\t\t\t\t\tthis._ids.set(v, id);\n\t\t\t\t}\n\t\t\t\tthis._goRefCounts[id]++;\n\t\t\t\tlet typeFlag = 0;\n\t\t\t\tswitch (typeof v) {\n\t\t\t\t\tcase \"object\":\n\t\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\t\ttypeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\ttypeFlag = 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"symbol\":\n\t\t\t\t\t\ttypeFlag = 3;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\ttypeFlag = 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tthis.mem.setUint32(addr + 4, nanHead | typeFlag, true);\n\t\t\t\tthis.mem.setUint32(addr, id, true);\n\t\t\t}\n\n\t\t\tconst loadSlice = (addr) => {\n\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\treturn new Uint8Array(this._inst.exports.mem.buffer, array, len);\n\t\t\t}\n\n\t\t\tconst loadSliceOfValues = (addr) => {\n\t\t\t\tconst array = getInt64(addr + 0);\n\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\tconst a = new Array(len);\n\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\ta[i] = loadValue(array + i * 8);\n\t\t\t\t}\n\t\t\t\treturn a;\n\t\t\t}\n\n\t\t\tconst loadString = (addr) => {\n\t\t\t\tconst saddr = getInt64(addr + 0);\n\t\t\t\tconst len = getInt64(addr + 8);\n\t\t\t\treturn decoder.decode(new DataView(this._inst.exports.mem.buffer, saddr, len));\n\t\t\t}\n\n\t\t\tconst timeOrigin = Date.now() - performance.now();\n\t\t\tthis.importObject = {\n\t\t\t\tgo: {\n\t\t\t\t\t// Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters)\n\t\t\t\t\t// may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported\n\t\t\t\t\t// function. A goroutine can switch to a new stack if the current stack is too small (see morestack function).\n\t\t\t\t\t// This changes the SP, thus we have to update the SP used by the imported function.\n\n\t\t\t\t\t// func wasmExit(code int32)\n\t\t\t\t\t\"runtime.wasmExit\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst code = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\tthis.exited = true;\n\t\t\t\t\t\tdelete this._inst;\n\t\t\t\t\t\tdelete this._values;\n\t\t\t\t\t\tdelete this._goRefCounts;\n\t\t\t\t\t\tdelete this._ids;\n\t\t\t\t\t\tdelete this._idPool;\n\t\t\t\t\t\tthis.exit(code);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func wasmWrite(fd uintptr, p unsafe.Pointer, n int32)\n\t\t\t\t\t\"runtime.wasmWrite\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst fd = getInt64(sp + 8);\n\t\t\t\t\t\tconst p = getInt64(sp + 16);\n\t\t\t\t\t\tconst n = this.mem.getInt32(sp + 24, true);\n\t\t\t\t\t\tfs.writeSync(fd, new Uint8Array(this._inst.exports.mem.buffer, p, n));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func resetMemoryDataView()\n\t\t\t\t\t\"runtime.resetMemoryDataView\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func nanotime1() int64\n\t\t\t\t\t\"runtime.nanotime1\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tsetInt64(sp + 8, (timeOrigin + performance.now()) * 1000000);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func walltime() (sec int64, nsec int32)\n\t\t\t\t\t\"runtime.walltime\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst msec = (new Date).getTime();\n\t\t\t\t\t\tsetInt64(sp + 8, msec / 1000);\n\t\t\t\t\t\tthis.mem.setInt32(sp + 16, (msec % 1000) * 1000000, true);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func scheduleTimeoutEvent(delay int64) int32\n\t\t\t\t\t\"runtime.scheduleTimeoutEvent\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst id = this._nextCallbackTimeoutID;\n\t\t\t\t\t\tthis._nextCallbackTimeoutID++;\n\t\t\t\t\t\tthis._scheduledTimeouts.set(id, setTimeout(\n\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\twhile (this._scheduledTimeouts.has(id)) {\n\t\t\t\t\t\t\t\t\t// for some reason Go failed to register the timeout event, log and try again\n\t\t\t\t\t\t\t\t\t// (temporary workaround for https://github.com/golang/go/issues/28975)\n\t\t\t\t\t\t\t\t\tconsole.warn(\"scheduleTimeoutEvent: missed timeout event\");\n\t\t\t\t\t\t\t\t\tthis._resume();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgetInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early\n\t\t\t\t\t\t));\n\t\t\t\t\t\tthis.mem.setInt32(sp + 16, id, true);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func clearTimeoutEvent(id int32)\n\t\t\t\t\t\"runtime.clearTimeoutEvent\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst id = this.mem.getInt32(sp + 8, true);\n\t\t\t\t\t\tclearTimeout(this._scheduledTimeouts.get(id));\n\t\t\t\t\t\tthis._scheduledTimeouts.delete(id);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func getRandomData(r []byte)\n\t\t\t\t\t\"runtime.getRandomData\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tcrypto.getRandomValues(loadSlice(sp + 8));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func finalizeRef(v ref)\n\t\t\t\t\t\"syscall/js.finalizeRef\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst id = this.mem.getUint32(sp + 8, true);\n\t\t\t\t\t\tthis._goRefCounts[id]--;\n\t\t\t\t\t\tif (this._goRefCounts[id] === 0) {\n\t\t\t\t\t\t\tconst v = this._values[id];\n\t\t\t\t\t\t\tthis._values[id] = null;\n\t\t\t\t\t\t\tthis._ids.delete(v);\n\t\t\t\t\t\t\tthis._idPool.push(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func stringVal(value string) ref\n\t\t\t\t\t\"syscall/js.stringVal\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tstoreValue(sp + 24, loadString(sp + 8));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueGet(v ref, p string) ref\n\t\t\t\t\t\"syscall/js.valueGet\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst result = Reflect.get(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\tstoreValue(sp + 32, result);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueSet(v ref, p string, x ref)\n\t\t\t\t\t\"syscall/js.valueSet\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tReflect.set(loadValue(sp + 8), loadString(sp + 16), loadValue(sp + 32));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueDelete(v ref, p string)\n\t\t\t\t\t\"syscall/js.valueDelete\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tReflect.deleteProperty(loadValue(sp + 8), loadString(sp + 16));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueIndex(v ref, i int) ref\n\t\t\t\t\t\"syscall/js.valueIndex\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tstoreValue(sp + 24, Reflect.get(loadValue(sp + 8), getInt64(sp + 16)));\n\t\t\t\t\t},\n\n\t\t\t\t\t// valueSetIndex(v ref, i int, x ref)\n\t\t\t\t\t\"syscall/js.valueSetIndex\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tReflect.set(loadValue(sp + 8), getInt64(sp + 16), loadValue(sp + 24));\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueCall(v ref, m string, args []ref) (ref, bool)\n\t\t\t\t\t\"syscall/js.valueCall\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst m = Reflect.get(v, loadString(sp + 16));\n\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 32);\n\t\t\t\t\t\t\tconst result = Reflect.apply(m, v, args);\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 56, result);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 1);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 56, err);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 64, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueInvoke(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\"syscall/js.valueInvoke\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\tconst result = Reflect.apply(v, undefined, args);\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueNew(v ref, args []ref) (ref, bool)\n\t\t\t\t\t\"syscall/js.valueNew\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst v = loadValue(sp + 8);\n\t\t\t\t\t\t\tconst args = loadSliceOfValues(sp + 16);\n\t\t\t\t\t\t\tconst result = Reflect.construct(v, args);\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, result);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\tsp = this._inst.exports.getsp() >>> 0; // see comment above\n\t\t\t\t\t\t\tstoreValue(sp + 40, err);\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueLength(v ref) int\n\t\t\t\t\t\"syscall/js.valueLength\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tsetInt64(sp + 16, parseInt(loadValue(sp + 8).length));\n\t\t\t\t\t},\n\n\t\t\t\t\t// valuePrepareString(v ref) (ref, int)\n\t\t\t\t\t\"syscall/js.valuePrepareString\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst str = encoder.encode(String(loadValue(sp + 8)));\n\t\t\t\t\t\tstoreValue(sp + 16, str);\n\t\t\t\t\t\tsetInt64(sp + 24, str.length);\n\t\t\t\t\t},\n\n\t\t\t\t\t// valueLoadString(v ref, b []byte)\n\t\t\t\t\t\"syscall/js.valueLoadString\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst str = loadValue(sp + 8);\n\t\t\t\t\t\tloadSlice(sp + 16).set(str);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func valueInstanceOf(v ref, t ref) bool\n\t\t\t\t\t\"syscall/js.valueInstanceOf\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tthis.mem.setUint8(sp + 24, (loadValue(sp + 8) instanceof loadValue(sp + 16)) ? 1 : 0);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func copyBytesToGo(dst []byte, src ref) (int, bool)\n\t\t\t\t\t\"syscall/js.copyBytesToGo\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst dst = loadSlice(sp + 8);\n\t\t\t\t\t\tconst src = loadValue(sp + 32);\n\t\t\t\t\t\tif (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t},\n\n\t\t\t\t\t// func copyBytesToJS(dst ref, src []byte) (int, bool)\n\t\t\t\t\t\"syscall/js.copyBytesToJS\": (sp) => {\n\t\t\t\t\t\tsp >>>= 0;\n\t\t\t\t\t\tconst dst = loadValue(sp + 8);\n\t\t\t\t\t\tconst src = loadSlice(sp + 16);\n\t\t\t\t\t\tif (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {\n\t\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 0);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst toCopy = src.subarray(0, dst.length);\n\t\t\t\t\t\tdst.set(toCopy);\n\t\t\t\t\t\tsetInt64(sp + 40, toCopy.length);\n\t\t\t\t\t\tthis.mem.setUint8(sp + 48, 1);\n\t\t\t\t\t},\n\n\t\t\t\t\t\"debug\": (value) => {\n\t\t\t\t\t\tconsole.log(value);\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tasync run(instance) {\n\t\t\tif (!(instance instanceof WebAssembly.Instance)) {\n\t\t\t\tthrow new Error(\"Go.run: WebAssembly.Instance expected\");\n\t\t\t}\n\t\t\tthis._inst = instance;\n\t\t\tthis.mem = new DataView(this._inst.exports.mem.buffer);\n\t\t\tthis._values = [ // JS values that Go currently has references to, indexed by reference id\n\t\t\t\tNaN,\n\t\t\t\t0,\n\t\t\t\tnull,\n\t\t\t\ttrue,\n\t\t\t\tfalse,\n\t\t\t\tglobalThis,\n\t\t\t\tthis,\n\t\t\t];\n\t\t\tthis._goRefCounts = new Array(this._values.length).fill(Infinity); // number of references that Go has to a JS value, indexed by reference id\n\t\t\tthis._ids = new Map([ // mapping from JS values to reference ids\n\t\t\t\t[0, 1],\n\t\t\t\t[null, 2],\n\t\t\t\t[true, 3],\n\t\t\t\t[false, 4],\n\t\t\t\t[globalThis, 5],\n\t\t\t\t[this, 6],\n\t\t\t]);\n\t\t\tthis._idPool = []; // unused ids that have been garbage collected\n\t\t\tthis.exited = false; // whether the Go program has exited\n\n\t\t\t// Pass command line arguments and environment variables to WebAssembly by writing them to the linear memory.\n\t\t\tlet offset = 4096;\n\n\t\t\tconst strPtr = (str) => {\n\t\t\t\tconst ptr = offset;\n\t\t\t\tconst bytes = encoder.encode(str + \"\\0\");\n\t\t\t\tnew Uint8Array(this.mem.buffer, offset, bytes.length).set(bytes);\n\t\t\t\toffset += bytes.length;\n\t\t\t\tif (offset % 8 !== 0) {\n\t\t\t\t\toffset += 8 - (offset % 8);\n\t\t\t\t}\n\t\t\t\treturn ptr;\n\t\t\t};\n\n\t\t\tconst argc = this.argv.length;\n\n\t\t\tconst argvPtrs = [];\n\t\t\tthis.argv.forEach((arg) => {\n\t\t\t\targvPtrs.push(strPtr(arg));\n\t\t\t});\n\t\t\targvPtrs.push(0);\n\n\t\t\tconst keys = Object.keys(this.env).sort();\n\t\t\tkeys.forEach((key) => {\n\t\t\t\targvPtrs.push(strPtr(`${key}=${this.env[key]}`));\n\t\t\t});\n\t\t\targvPtrs.push(0);\n\n\t\t\tconst argv = offset;\n\t\t\targvPtrs.forEach((ptr) => {\n\t\t\t\tthis.mem.setUint32(offset, ptr, true);\n\t\t\t\tthis.mem.setUint32(offset + 4, 0, true);\n\t\t\t\toffset += 8;\n\t\t\t});\n\n\t\t\t// The linker guarantees global data starts from at least wasmMinDataAddr.\n\t\t\t// Keep in sync with cmd/link/internal/ld/data.go:wasmMinDataAddr.\n\t\t\tconst wasmMinDataAddr = 4096 + 8192;\n\t\t\tif (offset >= wasmMinDataAddr) {\n\t\t\t\tthrow new Error(\"total length of command line and environment variables exceeds limit\");\n\t\t\t}\n\n\t\t\tthis._inst.exports.run(argc, argv);\n\t\t\tif (this.exited) {\n\t\t\t\tthis._resolveExitPromise();\n\t\t\t}\n\t\t\tawait this._exitPromise;\n\t\t}\n\n\t\t_resume() {\n\t\t\tif (this.exited) {\n\t\t\t\tthrow new Error(\"Go program has already exited\");\n\t\t\t}\n\t\t\tthis._inst.exports.resume();\n\t\t\tif (this.exited) {\n\t\t\t\tthis._resolveExitPromise();\n\t\t\t}\n\t\t}\n\n\t\t_makeFuncWrapper(id) {\n\t\t\tconst go = this;\n\t\t\treturn function () {\n\t\t\t\tconst event = { id: id, this: this, args: arguments };\n\t\t\t\tgo._pendingEvent = event;\n\t\t\t\tgo._resume();\n\t\t\t\treturn event.result;\n\t\t\t};\n\t\t}\n\t}\n});\n\nmodule.exports = {\n\twasmExec,\n};\n"]}
@@ -37,10 +37,6 @@ const finalizer_1 = require("../finalizer");
37
37
  * This translator does not need a connected device to perform translation.
38
38
  */
39
39
  class OfflineTranslator {
40
- constructor(translatorId) {
41
- this._translatorId = translatorId;
42
- (0, finalizer_1.registerForFinalization)(this, OfflineTranslator._free.bind(null, translatorId));
43
- }
44
40
  /**
45
41
  * The ID of the translator that serves to identify native resources.
46
42
  */
@@ -53,6 +49,10 @@ class OfflineTranslator {
53
49
  get coordinateSystem() {
54
50
  return this._getCurrentCoordinateSystem();
55
51
  }
52
+ constructor(translatorId) {
53
+ this._translatorId = translatorId;
54
+ (0, finalizer_1.registerForFinalization)(this, OfflineTranslator._free.bind(null, translatorId));
55
+ }
56
56
  /**
57
57
  * Sets up translator from provided device definition and configuration.
58
58
  * @param definition Definition of device and its peripherals.
@@ -1 +1 @@
1
- {"version":3,"file":"offline_translator.js","sourceRoot":"","sources":["../../../src/gcode/offline_translator.ts"],"names":[],"mappings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LATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { DeviceDefinition } from './device_definition';\nimport { TranslatorConfig } from './translator_config';\nimport { TranslateResult } from './translate_result';\nimport { Device } from '../ascii/device';\nimport { Angle, Length, Native, AngularVelocity, Velocity } from '../units';\nimport { registerForFinalization } from '../finalizer';\n\n/**\n * Represents an offline G-Code translator.\n * It allows to translate G-Code blocks to Zaber ASCII protocol stream commands.\n * This translator does not need a connected device to perform translation.\n */\nexport class OfflineTranslator {\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 /**\n * Current coordinate system.\n */\n public get coordinateSystem(): string {\n return this._getCurrentCoordinateSystem();\n }\n\n constructor(translatorId: number) {\n this._translatorId = translatorId;\n registerForFinalization(this, OfflineTranslator._free.bind(null, translatorId));\n }\n\n /**\n * Sets up translator from provided device definition and configuration.\n * @param definition Definition of device and its peripherals.\n * The definition must match a device that later performs the commands.\n * @param config? Configuration of the translator.\n * @return New instance of translator.\n */\n public static async setup(\n definition: DeviceDefinition,\n config?: TranslatorConfig\n ): Promise<OfflineTranslator> {\n const request = new gateway.TranslatorCreateRequest();\n request.setDefinition(DeviceDefinition.toProtobuf(definition));\n request.setConfig(TranslatorConfig.toProtobuf(config));\n\n const response = await gateway.callAsync<gateway.TranslatorCreateResponse>(\n 'gcode/create',\n request,\n gateway.TranslatorCreateResponse);\n return new OfflineTranslator(response.getTranslatorId());\n }\n\n /**\n * Sets up an offline translator from provided device, axes, and configuration.\n * @param device Device that later performs the command streaming.\n * @param axes Axis numbers that are later used to setup the stream.\n * For a lockstep group specify only the first axis of the group.\n * @param config? Configuration of the translator.\n * @return New instance of translator.\n */\n public static async setupFromDevice(\n device: Device,\n axes: number[],\n config?: TranslatorConfig\n ): Promise<OfflineTranslator> {\n const request = new gateway.TranslatorCreateFromDeviceRequest();\n request.setInterfaceId(device.connection.interfaceId);\n request.setDevice(device.deviceAddress);\n request.setAxesList(axes);\n request.setConfig(TranslatorConfig.toProtobuf(config));\n\n const response = await gateway.callAsync<gateway.TranslatorCreateResponse>(\n 'gcode/create_from_device',\n request,\n gateway.TranslatorCreateResponse);\n return new OfflineTranslator(response.getTranslatorId());\n }\n\n /**\n * Translates a single block (line) of G-code.\n * @param block Block (line) of G-code.\n * @return Result of translation containing the stream commands.\n */\n public translate(\n block: string\n ): TranslateResult {\n const request = new gateway.TranslatorTranslateRequest();\n request.setTranslatorId(this.translatorId);\n request.setBlock(block);\n\n const response = gateway.callSync<gateway.TranslatorTranslateResponse>(\n 'gcode/translate',\n request,\n gateway.TranslatorTranslateResponse);\n return TranslateResult.fromProtobuf(response.toObject());\n }\n\n /**\n * Flushes the remaining stream commands waiting in optimization buffer.\n * The flush is also performed by M2 and M30 codes.\n * @return The remaining stream commands.\n */\n public flush(): string[] {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n const response = gateway.callSync<gateway.TranslatorFlushResponse>(\n 'gcode/flush',\n request,\n gateway.TranslatorFlushResponse);\n return response.getCommandsList();\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.DoubleResponse>(\n 'gcode/get_axis_position',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets the home position of translator's axis.\n * This position is used by G28.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisHomePosition(\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_home', request);\n }\n\n /**\n * Sets the secondary home position of translator's axis.\n * This position is used by G30.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisSecondaryHomePosition(\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_secondary_home', request);\n }\n\n /**\n * Gets offset of an axis in a given coordinate system.\n * @param coordinateSystem Coordinate system (e.g. G54).\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @return Offset in translator units of the axis.\n */\n public getAxisCoordinateSystemOffset(\n coordinateSystem: string,\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request = new gateway.TranslatorGetAxisOffsetRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoordinateSystem(coordinateSystem);\n request.setAxis(axis);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'gcode/get_axis_offset',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Resets internal state after device rejected generated command.\n * Axis positions become uninitialized.\n */\n public resetAfterStreamError(): void {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n gateway.callSync('gcode/reset_after_stream_error', request);\n }\n\n /**\n * Allows to scale feed rate of the translated code by a coefficient.\n * @param coefficient Coefficient of the original feed rate.\n */\n public setFeedRateOverride(\n coefficient: number\n ): void {\n const request = new gateway.TranslatorSetFeedRateOverrideRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoefficient(coefficient);\n\n gateway.callSync('gcode/set_feed_rate_override', 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 * Gets current coordinate system (e.g. G54).\n * @return Current coordinate system.\n */\n private _getCurrentCoordinateSystem(): string {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'gcode/get_current_coordinate_system',\n request,\n gateway.StringResponse);\n return response.getValue();\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 OfflineTranslator._free(this.translatorId);\n }\n}\n"]}
1
+ {"version":3,"file":"offline_translator.js","sourceRoot":"","sources":["../../../src/gcode/offline_translator.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,2DAAuD;AACvD,2DAAuD;AACvD,yDAAqD;AAGrD,4CAAuD;AAEvD;;;;GAIG;AACH,MAAa,iBAAiB;IAC5B;;OAEG;IACH,I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AAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACI,mBAAmB,CACxB,WAAmB;QAEnB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,oCAAoC,EAAE,CAAC;QACnE,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAEpC,OAAO,CAAC,QAAQ,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,KAAK,CAClB,YAAoB;QAEpB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAEtC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACK,2BAA2B;QACjC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,qCAAqC,EACrC,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,IAAI;QACT,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;CACF;AAtSD,8CAsSC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { DeviceDefinition } from './device_definition';\nimport { TranslatorConfig } from './translator_config';\nimport { TranslateResult } from './translate_result';\nimport { Device } from '../ascii/device';\nimport { Angle, Length, Native, AngularVelocity, Velocity } from '../units';\nimport { registerForFinalization } from '../finalizer';\n\n/**\n * Represents an offline G-Code translator.\n * It allows to translate G-Code blocks to Zaber ASCII protocol stream commands.\n * This translator does not need a connected device to perform translation.\n */\nexport class OfflineTranslator {\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 /**\n * Current coordinate system.\n */\n public get coordinateSystem(): string {\n return this._getCurrentCoordinateSystem();\n }\n\n constructor(translatorId: number) {\n this._translatorId = translatorId;\n registerForFinalization(this, OfflineTranslator._free.bind(null, translatorId));\n }\n\n /**\n * Sets up translator from provided device definition and configuration.\n * @param definition Definition of device and its peripherals.\n * The definition must match a device that later performs the commands.\n * @param config? Configuration of the translator.\n * @return New instance of translator.\n */\n public static async setup(\n definition: DeviceDefinition,\n config?: TranslatorConfig\n ): Promise<OfflineTranslator> {\n const request = new gateway.TranslatorCreateRequest();\n request.setDefinition(DeviceDefinition.toProtobuf(definition));\n request.setConfig(TranslatorConfig.toProtobuf(config));\n\n const response = await gateway.callAsync<gateway.TranslatorCreateResponse>(\n 'gcode/create',\n request,\n gateway.TranslatorCreateResponse);\n return new OfflineTranslator(response.getTranslatorId());\n }\n\n /**\n * Sets up an offline translator from provided device, axes, and configuration.\n * @param device Device that later performs the command streaming.\n * @param axes Axis numbers that are later used to setup the stream.\n * For a lockstep group specify only the first axis of the group.\n * @param config? Configuration of the translator.\n * @return New instance of translator.\n */\n public static async setupFromDevice(\n device: Device,\n axes: number[],\n config?: TranslatorConfig\n ): Promise<OfflineTranslator> {\n const request = new gateway.TranslatorCreateFromDeviceRequest();\n request.setInterfaceId(device.connection.interfaceId);\n request.setDevice(device.deviceAddress);\n request.setAxesList(axes);\n request.setConfig(TranslatorConfig.toProtobuf(config));\n\n const response = await gateway.callAsync<gateway.TranslatorCreateResponse>(\n 'gcode/create_from_device',\n request,\n gateway.TranslatorCreateResponse);\n return new OfflineTranslator(response.getTranslatorId());\n }\n\n /**\n * Translates a single block (line) of G-code.\n * @param block Block (line) of G-code.\n * @return Result of translation containing the stream commands.\n */\n public translate(\n block: string\n ): TranslateResult {\n const request = new gateway.TranslatorTranslateRequest();\n request.setTranslatorId(this.translatorId);\n request.setBlock(block);\n\n const response = gateway.callSync<gateway.TranslatorTranslateResponse>(\n 'gcode/translate',\n request,\n gateway.TranslatorTranslateResponse);\n return TranslateResult.fromProtobuf(response.toObject());\n }\n\n /**\n * Flushes the remaining stream commands waiting in optimization buffer.\n * The flush is also performed by M2 and M30 codes.\n * @return The remaining stream commands.\n */\n public flush(): string[] {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n const response = gateway.callSync<gateway.TranslatorFlushResponse>(\n 'gcode/flush',\n request,\n gateway.TranslatorFlushResponse);\n return response.getCommandsList();\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.DoubleResponse>(\n 'gcode/get_axis_position',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets the home position of translator's axis.\n * This position is used by G28.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisHomePosition(\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_home', request);\n }\n\n /**\n * Sets the secondary home position of translator's axis.\n * This position is used by G30.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisSecondaryHomePosition(\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_secondary_home', request);\n }\n\n /**\n * Gets offset of an axis in a given coordinate system.\n * @param coordinateSystem Coordinate system (e.g. G54).\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @return Offset in translator units of the axis.\n */\n public getAxisCoordinateSystemOffset(\n coordinateSystem: string,\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request = new gateway.TranslatorGetAxisOffsetRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoordinateSystem(coordinateSystem);\n request.setAxis(axis);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'gcode/get_axis_offset',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Resets internal state after device rejected generated command.\n * Axis positions become uninitialized.\n */\n public resetAfterStreamError(): void {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n gateway.callSync('gcode/reset_after_stream_error', request);\n }\n\n /**\n * Allows to scale feed rate of the translated code by a coefficient.\n * @param coefficient Coefficient of the original feed rate.\n */\n public setFeedRateOverride(\n coefficient: number\n ): void {\n const request = new gateway.TranslatorSetFeedRateOverrideRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoefficient(coefficient);\n\n gateway.callSync('gcode/set_feed_rate_override', 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 * Gets current coordinate system (e.g. G54).\n * @return Current coordinate system.\n */\n private _getCurrentCoordinateSystem(): string {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'gcode/get_current_coordinate_system',\n request,\n gateway.StringResponse);\n return response.getValue();\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 OfflineTranslator._free(this.translatorId);\n }\n}\n"]}
@@ -36,10 +36,6 @@ const finalizer_1 = require("../finalizer");
36
36
  * It requires a stream to be setup on the device.
37
37
  */
38
38
  class Translator {
39
- constructor(translatorId) {
40
- this._translatorId = translatorId;
41
- (0, finalizer_1.registerForFinalization)(this, Translator._free.bind(null, translatorId));
42
- }
43
39
  /**
44
40
  * The ID of the translator that serves to identify native resources.
45
41
  */
@@ -52,6 +48,10 @@ class Translator {
52
48
  get coordinateSystem() {
53
49
  return this._getCurrentCoordinateSystem();
54
50
  }
51
+ constructor(translatorId) {
52
+ this._translatorId = translatorId;
53
+ (0, finalizer_1.registerForFinalization)(this, Translator._free.bind(null, translatorId));
54
+ }
55
55
  /**
56
56
  * Sets up the translator on top of a provided stream.
57
57
  * @param stream The stream to setup the translator on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';\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\n/**\n * Represents a live G-Code translator.\n * It allows to stream G-Code blocks to a connected device.\n * It requires a stream to be setup on the device.\n */\nexport class Translator {\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 /**\n * Current coordinate system.\n */\n public get coordinateSystem(): string {\n return this._getCurrentCoordinateSystem();\n }\n\n constructor(translatorId: number) {\n this._translatorId = translatorId;\n registerForFinalization(this, Translator._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 async setup(\n stream: Stream,\n config?: TranslatorConfig\n ): Promise<Translator> {\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 = await gateway.callAsync<gateway.TranslatorCreateResponse>(\n 'gcode/create_live',\n request,\n gateway.TranslatorCreateResponse);\n return new Translator(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 * Flushes the remaining stream commands waiting in optimization buffer into the underlying stream.\n * The flush is also performed by M2 and M30 codes.\n * @param waitUntilIdle Determines whether to wait for the stream to finish all the movements.\n * @return The remaining stream commands.\n */\n public async flush(\n waitUntilIdle: boolean = true\n ): Promise<string[]> {\n const request = new gateway.TranslatorFlushLiveRequest();\n request.setTranslatorId(this.translatorId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.TranslatorFlushResponse>(\n 'gcode/flush_live',\n request,\n gateway.TranslatorFlushResponse);\n return response.getCommandsList();\n }\n\n /**\n * Resets position of the translator from the underlying stream.\n * Call this method after performing a movement outside of translator.\n */\n public async resetPosition(): Promise<void> {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n await gateway.callAsync('gcode/reset_position_from_stream', request);\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.DoubleResponse>(\n 'gcode/get_axis_position',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets the home position of translator's axis.\n * This position is used by G28.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisHomePosition(\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_home', request);\n }\n\n /**\n * Sets the secondary home position of translator's axis.\n * This position is used by G30.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisSecondaryHomePosition(\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_secondary_home', request);\n }\n\n /**\n * Gets offset of an axis in a given coordinate system.\n * @param coordinateSystem Coordinate system (e.g. G54).\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @return Offset in translator units of the axis.\n */\n public getAxisCoordinateSystemOffset(\n coordinateSystem: string,\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request = new gateway.TranslatorGetAxisOffsetRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoordinateSystem(coordinateSystem);\n request.setAxis(axis);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'gcode/get_axis_offset',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Resets internal state after device rejected generated command.\n * Axis positions become uninitialized.\n */\n public resetAfterStreamError(): void {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n gateway.callSync('gcode/reset_after_stream_error', request);\n }\n\n /**\n * Allows to scale feed rate of the translated code by a coefficient.\n * @param coefficient Coefficient of the original feed rate.\n */\n public setFeedRateOverride(\n coefficient: number\n ): void {\n const request = new gateway.TranslatorSetFeedRateOverrideRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoefficient(coefficient);\n\n gateway.callSync('gcode/set_feed_rate_override', 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 * Gets current coordinate system (e.g. G54).\n * @return Current coordinate system.\n */\n private _getCurrentCoordinateSystem(): string {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'gcode/get_current_coordinate_system',\n request,\n gateway.StringResponse);\n return response.getValue();\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 Translator._free(this.translatorId);\n }\n}\n"]}
1
+ {"version":3,"file":"translator.js","sourceRoot":"","sources":["../../../src/gcode/translator.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,yDAAqD;AACrD,2DAAuD;AAGvD,4CAAuD;AAEvD;;;;GAIG;AACH,MAAa,UAAU;IACrB;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAGD;;OAEG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,2BAA2B,EAAE,CAAC;IAC5C,CAAC;IAED,YAAY,YAAoB;QAC9B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QACl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MAAM,CAAC,KAAK,CAClB,YAAoB;QAEpB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAEtC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACK,2BAA2B;QACjC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,qCAAqC,EACrC,OAAO,EACP,OAAO,CAAC,cAAc,CAAC,CAAC;QAC1B,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,IAAI;QACT,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;CACF;AA/RD,gCA+RC","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\n/**\n * Represents a live G-Code translator.\n * It allows to stream G-Code blocks to a connected device.\n * It requires a stream to be setup on the device.\n */\nexport class Translator {\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 /**\n * Current coordinate system.\n */\n public get coordinateSystem(): string {\n return this._getCurrentCoordinateSystem();\n }\n\n constructor(translatorId: number) {\n this._translatorId = translatorId;\n registerForFinalization(this, Translator._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 async setup(\n stream: Stream,\n config?: TranslatorConfig\n ): Promise<Translator> {\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 = await gateway.callAsync<gateway.TranslatorCreateResponse>(\n 'gcode/create_live',\n request,\n gateway.TranslatorCreateResponse);\n return new Translator(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 * Flushes the remaining stream commands waiting in optimization buffer into the underlying stream.\n * The flush is also performed by M2 and M30 codes.\n * @param waitUntilIdle Determines whether to wait for the stream to finish all the movements.\n * @return The remaining stream commands.\n */\n public async flush(\n waitUntilIdle: boolean = true\n ): Promise<string[]> {\n const request = new gateway.TranslatorFlushLiveRequest();\n request.setTranslatorId(this.translatorId);\n request.setWaitUntilIdle(waitUntilIdle);\n\n const response = await gateway.callAsync<gateway.TranslatorFlushResponse>(\n 'gcode/flush_live',\n request,\n gateway.TranslatorFlushResponse);\n return response.getCommandsList();\n }\n\n /**\n * Resets position of the translator from the underlying stream.\n * Call this method after performing a movement outside of translator.\n */\n public async resetPosition(): Promise<void> {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n await gateway.callAsync('gcode/reset_position_from_stream', request);\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.DoubleResponse>(\n 'gcode/get_axis_position',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Sets the home position of translator's axis.\n * This position is used by G28.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisHomePosition(\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_home', request);\n }\n\n /**\n * Sets the secondary home position of translator's axis.\n * This position is used by G30.\n * @param axis Letter of the axis.\n * @param position The home position.\n * @param unit Units of position.\n */\n public setAxisSecondaryHomePosition(\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_secondary_home', request);\n }\n\n /**\n * Gets offset of an axis in a given coordinate system.\n * @param coordinateSystem Coordinate system (e.g. G54).\n * @param axis Letter of the axis.\n * @param unit Units of position.\n * @return Offset in translator units of the axis.\n */\n public getAxisCoordinateSystemOffset(\n coordinateSystem: string,\n axis: string,\n unit: Length | Angle | Native\n ): number {\n const request = new gateway.TranslatorGetAxisOffsetRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoordinateSystem(coordinateSystem);\n request.setAxis(axis);\n request.setUnit(unit);\n\n const response = gateway.callSync<gateway.DoubleResponse>(\n 'gcode/get_axis_offset',\n request,\n gateway.DoubleResponse);\n return response.getValue();\n }\n\n /**\n * Resets internal state after device rejected generated command.\n * Axis positions become uninitialized.\n */\n public resetAfterStreamError(): void {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n gateway.callSync('gcode/reset_after_stream_error', request);\n }\n\n /**\n * Allows to scale feed rate of the translated code by a coefficient.\n * @param coefficient Coefficient of the original feed rate.\n */\n public setFeedRateOverride(\n coefficient: number\n ): void {\n const request = new gateway.TranslatorSetFeedRateOverrideRequest();\n request.setTranslatorId(this.translatorId);\n request.setCoefficient(coefficient);\n\n gateway.callSync('gcode/set_feed_rate_override', 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 * Gets current coordinate system (e.g. G54).\n * @return Current coordinate system.\n */\n private _getCurrentCoordinateSystem(): string {\n const request = new gateway.TranslatorEmptyRequest();\n request.setTranslatorId(this.translatorId);\n\n const response = gateway.callSync<gateway.StringResponse>(\n 'gcode/get_current_coordinate_system',\n request,\n gateway.StringResponse);\n return response.getValue();\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 Translator._free(this.translatorId);\n }\n}\n"]}
@@ -699,9 +699,6 @@ export class SetDeviceStateExceptionData extends jspb.Message {
699
699
  setTriggersList(value: Array<string>): void;
700
700
  addTriggers(value: string, index?: number): string;
701
701
 
702
- getIpConfig(): string;
703
- setIpConfig(value: string): void;
704
-
705
702
  getServoTuning(): string;
706
703
  setServoTuning(value: string): void;
707
704
 
@@ -731,7 +728,6 @@ export namespace SetDeviceStateExceptionData {
731
728
  settingsList: Array<string>,
732
729
  streamBuffersList: Array<string>,
733
730
  triggersList: Array<string>,
734
- ipConfig: string,
735
731
  servoTuning: string,
736
732
  storageList: Array<string>,
737
733
  storedPositionsList: Array<string>,
@@ -8828,7 +8828,7 @@ proto.zaber.motion.protobufs.SetPeripheralStateExceptionData.prototype.clearStor
8828
8828
  * @private {!Array<number>}
8829
8829
  * @const
8830
8830
  */
8831
- proto.zaber.motion.protobufs.SetDeviceStateExceptionData.repeatedFields_ = [2,3,4,5,8,9];
8831
+ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.repeatedFields_ = [2,3,4,5,7,8];
8832
8832
 
8833
8833
 
8834
8834
 
@@ -8866,10 +8866,9 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.toObject = function(inc
8866
8866
  settingsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
8867
8867
  streamBuffersList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f,
8868
8868
  triggersList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f,
8869
- ipConfig: jspb.Message.getFieldWithDefault(msg, 6, ""),
8870
- servoTuning: jspb.Message.getFieldWithDefault(msg, 7, ""),
8871
- storageList: (f = jspb.Message.getRepeatedField(msg, 8)) == null ? undefined : f,
8872
- storedPositionsList: (f = jspb.Message.getRepeatedField(msg, 9)) == null ? undefined : f
8869
+ servoTuning: jspb.Message.getFieldWithDefault(msg, 6, ""),
8870
+ storageList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f,
8871
+ storedPositionsList: (f = jspb.Message.getRepeatedField(msg, 8)) == null ? undefined : f
8873
8872
  };
8874
8873
 
8875
8874
  if (includeInstance) {
@@ -8924,18 +8923,14 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.deserializeBinaryFromRe
8924
8923
  msg.addTriggers(value);
8925
8924
  break;
8926
8925
  case 6:
8927
- var value = /** @type {string} */ (reader.readString());
8928
- msg.setIpConfig(value);
8929
- break;
8930
- case 7:
8931
8926
  var value = /** @type {string} */ (reader.readString());
8932
8927
  msg.setServoTuning(value);
8933
8928
  break;
8934
- case 8:
8929
+ case 7:
8935
8930
  var value = /** @type {string} */ (reader.readString());
8936
8931
  msg.addStorage(value);
8937
8932
  break;
8938
- case 9:
8933
+ case 8:
8939
8934
  var value = /** @type {string} */ (reader.readString());
8940
8935
  msg.addStoredPositions(value);
8941
8936
  break;
@@ -8997,31 +8992,24 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.serializeBinaryToWriter
8997
8992
  f
8998
8993
  );
8999
8994
  }
9000
- f = message.getIpConfig();
9001
- if (f.length > 0) {
9002
- writer.writeString(
9003
- 6,
9004
- f
9005
- );
9006
- }
9007
8995
  f = message.getServoTuning();
9008
8996
  if (f.length > 0) {
9009
8997
  writer.writeString(
9010
- 7,
8998
+ 6,
9011
8999
  f
9012
9000
  );
9013
9001
  }
9014
9002
  f = message.getStorageList();
9015
9003
  if (f.length > 0) {
9016
9004
  writer.writeRepeatedString(
9017
- 8,
9005
+ 7,
9018
9006
  f
9019
9007
  );
9020
9008
  }
9021
9009
  f = message.getStoredPositionsList();
9022
9010
  if (f.length > 0) {
9023
9011
  writer.writeRepeatedString(
9024
- 9,
9012
+ 8,
9025
9013
  f
9026
9014
  );
9027
9015
  }
@@ -9178,29 +9166,11 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.clearTriggers
9178
9166
 
9179
9167
 
9180
9168
  /**
9181
- * optional string ip_config = 6;
9182
- * @return {string}
9183
- */
9184
- proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.getIpConfig = function() {
9185
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
9186
- };
9187
-
9188
-
9189
- /**
9190
- * @param {string} value
9191
- * @return {!proto.zaber.motion.protobufs.SetDeviceStateExceptionData} returns this
9192
- */
9193
- proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.setIpConfig = function(value) {
9194
- return jspb.Message.setProto3StringField(this, 6, value);
9195
- };
9196
-
9197
-
9198
- /**
9199
- * optional string servo_tuning = 7;
9169
+ * optional string servo_tuning = 6;
9200
9170
  * @return {string}
9201
9171
  */
9202
9172
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.getServoTuning = function() {
9203
- return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
9173
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
9204
9174
  };
9205
9175
 
9206
9176
 
@@ -9209,16 +9179,16 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.getServoTunin
9209
9179
  * @return {!proto.zaber.motion.protobufs.SetDeviceStateExceptionData} returns this
9210
9180
  */
9211
9181
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.setServoTuning = function(value) {
9212
- return jspb.Message.setProto3StringField(this, 7, value);
9182
+ return jspb.Message.setProto3StringField(this, 6, value);
9213
9183
  };
9214
9184
 
9215
9185
 
9216
9186
  /**
9217
- * repeated string storage = 8;
9187
+ * repeated string storage = 7;
9218
9188
  * @return {!Array<string>}
9219
9189
  */
9220
9190
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.getStorageList = function() {
9221
- return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 8));
9191
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 7));
9222
9192
  };
9223
9193
 
9224
9194
 
@@ -9227,7 +9197,7 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.getStorageLis
9227
9197
  * @return {!proto.zaber.motion.protobufs.SetDeviceStateExceptionData} returns this
9228
9198
  */
9229
9199
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.setStorageList = function(value) {
9230
- return jspb.Message.setField(this, 8, value || []);
9200
+ return jspb.Message.setField(this, 7, value || []);
9231
9201
  };
9232
9202
 
9233
9203
 
@@ -9237,7 +9207,7 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.setStorageLis
9237
9207
  * @return {!proto.zaber.motion.protobufs.SetDeviceStateExceptionData} returns this
9238
9208
  */
9239
9209
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.addStorage = function(value, opt_index) {
9240
- return jspb.Message.addToRepeatedField(this, 8, value, opt_index);
9210
+ return jspb.Message.addToRepeatedField(this, 7, value, opt_index);
9241
9211
  };
9242
9212
 
9243
9213
 
@@ -9251,11 +9221,11 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.clearStorageL
9251
9221
 
9252
9222
 
9253
9223
  /**
9254
- * repeated string stored_positions = 9;
9224
+ * repeated string stored_positions = 8;
9255
9225
  * @return {!Array<string>}
9256
9226
  */
9257
9227
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.getStoredPositionsList = function() {
9258
- return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 9));
9228
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 8));
9259
9229
  };
9260
9230
 
9261
9231
 
@@ -9264,7 +9234,7 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.getStoredPosi
9264
9234
  * @return {!proto.zaber.motion.protobufs.SetDeviceStateExceptionData} returns this
9265
9235
  */
9266
9236
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.setStoredPositionsList = function(value) {
9267
- return jspb.Message.setField(this, 9, value || []);
9237
+ return jspb.Message.setField(this, 8, value || []);
9268
9238
  };
9269
9239
 
9270
9240
 
@@ -9274,7 +9244,7 @@ proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.setStoredPosi
9274
9244
  * @return {!proto.zaber.motion.protobufs.SetDeviceStateExceptionData} returns this
9275
9245
  */
9276
9246
  proto.zaber.motion.protobufs.SetDeviceStateExceptionData.prototype.addStoredPositions = function(value, opt_index) {
9277
- return jspb.Message.addToRepeatedField(this, 9, value, opt_index);
9247
+ return jspb.Message.addToRepeatedField(this, 8, value, opt_index);
9278
9248
  };
9279
9249
 
9280
9250