@zaber/motion 6.4.1 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
  2. package/dist/lib/ascii/device_io.d.ts +3 -3
  3. package/dist/lib/ascii/device_io.js +3 -3
  4. package/dist/lib/ascii/device_io.js.map +1 -1
  5. package/dist/lib/ascii/oscilloscope_data.d.ts +3 -1
  6. package/dist/lib/ascii/oscilloscope_data.d.ts.map +1 -1
  7. package/dist/lib/ascii/oscilloscope_data.js +3 -1
  8. package/dist/lib/ascii/oscilloscope_data.js.map +1 -1
  9. package/dist/lib/index.d.ts +1 -0
  10. package/dist/lib/index.d.ts.map +1 -1
  11. package/dist/lib/index.js +1 -0
  12. package/dist/lib/index.js.map +1 -1
  13. package/dist/lib/library.js +1 -1
  14. package/dist/lib/library.js.map +1 -1
  15. package/dist/lib/microscopy/autofocus.d.ts +95 -0
  16. package/dist/lib/microscopy/autofocus.d.ts.map +1 -0
  17. package/dist/lib/microscopy/autofocus.js +291 -0
  18. package/dist/lib/microscopy/autofocus.js.map +1 -0
  19. package/dist/lib/microscopy/autofocus_status.d.ts +20 -0
  20. package/dist/lib/microscopy/autofocus_status.d.ts.map +1 -0
  21. package/dist/lib/microscopy/autofocus_status.js +27 -0
  22. package/dist/lib/microscopy/autofocus_status.js.map +1 -0
  23. package/dist/lib/microscopy/index.d.ts +5 -0
  24. package/dist/lib/microscopy/index.d.ts.map +1 -1
  25. package/dist/lib/microscopy/index.js +5 -0
  26. package/dist/lib/microscopy/index.js.map +1 -1
  27. package/dist/lib/microscopy/microscope.d.ts +9 -1
  28. package/dist/lib/microscopy/microscope.d.ts.map +1 -1
  29. package/dist/lib/microscopy/microscope.js +14 -4
  30. package/dist/lib/microscopy/microscope.js.map +1 -1
  31. package/dist/lib/microscopy/microscope_config.d.ts +4 -0
  32. package/dist/lib/microscopy/microscope_config.d.ts.map +1 -1
  33. package/dist/lib/microscopy/microscope_config.js +2 -0
  34. package/dist/lib/microscopy/microscope_config.js.map +1 -1
  35. package/dist/lib/microscopy/objective_changer.d.ts +2 -0
  36. package/dist/lib/microscopy/objective_changer.d.ts.map +1 -1
  37. package/dist/lib/microscopy/objective_changer.js +2 -0
  38. package/dist/lib/microscopy/objective_changer.js.map +1 -1
  39. package/dist/lib/microscopy/third_party_components.d.ts +16 -0
  40. package/dist/lib/microscopy/third_party_components.d.ts.map +1 -0
  41. package/dist/lib/microscopy/third_party_components.js +25 -0
  42. package/dist/lib/microscopy/third_party_components.js.map +1 -0
  43. package/dist/lib/microscopy/wdi_autofocus_provider.d.ts +77 -0
  44. package/dist/lib/microscopy/wdi_autofocus_provider.d.ts.map +1 -0
  45. package/dist/lib/microscopy/wdi_autofocus_provider.js +190 -0
  46. package/dist/lib/microscopy/wdi_autofocus_provider.js.map +1 -0
  47. package/dist/lib/microscopy/wdi_autofocus_provider_status.d.ts +20 -0
  48. package/dist/lib/microscopy/wdi_autofocus_provider_status.d.ts.map +1 -0
  49. package/dist/lib/microscopy/wdi_autofocus_provider_status.js +27 -0
  50. package/dist/lib/microscopy/wdi_autofocus_provider_status.js.map +1 -0
  51. package/dist/lib/named_parameter.d.ts +20 -0
  52. package/dist/lib/named_parameter.d.ts.map +1 -0
  53. package/dist/lib/named_parameter.js +27 -0
  54. package/dist/lib/named_parameter.js.map +1 -0
  55. package/dist/lib/requests/autofocus_focus_request.d.ts +16 -0
  56. package/dist/lib/requests/autofocus_focus_request.d.ts.map +1 -0
  57. package/dist/lib/requests/autofocus_focus_request.js +37 -0
  58. package/dist/lib/requests/autofocus_focus_request.js.map +1 -0
  59. package/dist/lib/requests/autofocus_get_objective_params_request.d.ts +15 -0
  60. package/dist/lib/requests/autofocus_get_objective_params_request.d.ts.map +1 -0
  61. package/dist/lib/requests/autofocus_get_objective_params_request.js +35 -0
  62. package/dist/lib/requests/autofocus_get_objective_params_request.js.map +1 -0
  63. package/dist/lib/requests/autofocus_get_objective_params_response.d.ts +11 -0
  64. package/dist/lib/requests/autofocus_get_objective_params_response.d.ts.map +1 -0
  65. package/dist/lib/requests/autofocus_get_objective_params_response.js +26 -0
  66. package/dist/lib/requests/autofocus_get_objective_params_response.js.map +1 -0
  67. package/dist/lib/requests/autofocus_get_status_response.d.ts +11 -0
  68. package/dist/lib/requests/autofocus_get_status_response.d.ts.map +1 -0
  69. package/dist/lib/requests/autofocus_get_status_response.js +25 -0
  70. package/dist/lib/requests/autofocus_get_status_response.js.map +1 -0
  71. package/dist/lib/requests/autofocus_set_objective_params_request.d.ts +17 -0
  72. package/dist/lib/requests/autofocus_set_objective_params_request.d.ts.map +1 -0
  73. package/dist/lib/requests/autofocus_set_objective_params_request.js +39 -0
  74. package/dist/lib/requests/autofocus_set_objective_params_request.js.map +1 -0
  75. package/dist/lib/requests/empty_autofocus_request.d.ts +14 -0
  76. package/dist/lib/requests/empty_autofocus_request.d.ts.map +1 -0
  77. package/dist/lib/requests/empty_autofocus_request.js +33 -0
  78. package/dist/lib/requests/empty_autofocus_request.js.map +1 -0
  79. package/dist/lib/requests/index.d.ts +9 -0
  80. package/dist/lib/requests/index.d.ts.map +1 -1
  81. package/dist/lib/requests/index.js +9 -0
  82. package/dist/lib/requests/index.js.map +1 -1
  83. package/dist/lib/requests/microscope_find_request.d.ts +12 -0
  84. package/dist/lib/requests/microscope_find_request.d.ts.map +1 -0
  85. package/dist/lib/requests/microscope_find_request.js +28 -0
  86. package/dist/lib/requests/microscope_find_request.js.map +1 -0
  87. package/dist/lib/requests/microscope_init_request.d.ts +2 -0
  88. package/dist/lib/requests/microscope_init_request.d.ts.map +1 -1
  89. package/dist/lib/requests/microscope_init_request.js +3 -0
  90. package/dist/lib/requests/microscope_init_request.js.map +1 -1
  91. package/dist/lib/requests/wdi_generic_request.d.ts +16 -0
  92. package/dist/lib/requests/wdi_generic_request.d.ts.map +1 -0
  93. package/dist/lib/requests/wdi_generic_request.js +38 -0
  94. package/dist/lib/requests/wdi_generic_request.js.map +1 -0
  95. package/dist/lib/requests/wdi_get_status_response.d.ts +11 -0
  96. package/dist/lib/requests/wdi_get_status_response.d.ts.map +1 -0
  97. package/dist/lib/requests/wdi_get_status_response.js +25 -0
  98. package/dist/lib/requests/wdi_get_status_response.js.map +1 -0
  99. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"microscope_config.js","sourceRoot":"","sources":["../../../src/microscopy/microscope_config.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AACjD,kDAA8C;AAuCjC,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,CAAC,MAAkB,EAAoB,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAAqB;IAClG,QAAQ,EAAE,CAAC,KAAuB,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,wBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnG,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,IAAI;KACvB,CAA+B;IAChC,QAAQ,EAAE,CAAC,KAAuB,EAAoB,EAAE;QACtD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,6DAA6D,CAAC,CAAA;QAAC,CAAC;QACzG,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,4CAA4C,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QACnH,OAAO;YACL,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,0BAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;YACjF,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,0BAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YACrE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,0BAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YACrE,WAAW,EAAE,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI;YACvG,aAAa,EAAE,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,CAAC,CAAC,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;YAC/G,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI;SAC5H,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\nimport { AxisAddress } from '../axis_address';\n\n/**\n * Configuration representing a microscope setup.\n * Device address of value 0 means that the part is not present.\n */\nexport interface MicroscopeConfig {\n /**\n * Focus axis of the microscope.\n */\n focusAxis?: (AxisAddress | null);\n\n /**\n * X axis of the microscope.\n */\n xAxis?: (AxisAddress | null);\n\n /**\n * Y axis of the microscope.\n */\n yAxis?: (AxisAddress | null);\n\n /**\n * Illuminator device address.\n */\n illuminator?: (number | null);\n\n /**\n * Filter changer device address.\n */\n filterChanger?: (number | null);\n\n /**\n * Objective changer device address.\n */\n objectiveChanger?: (number | null);\n\n}\n\nexport const MicroscopeConfig = {\n fromBinary: (buffer: Uint8Array): MicroscopeConfig => BSON.deserialize(buffer) as MicroscopeConfig,\n toBinary: (value: MicroscopeConfig): Uint8Array => BSON.serialize(MicroscopeConfig.sanitize(value)),\n DEFAULT: Object.freeze({\n focusAxis: null,\n xAxis: null,\n yAxis: null,\n illuminator: null,\n filterChanger: null,\n objectiveChanger: null,\n }) as Readonly<MicroscopeConfig>,\n sanitize: (value: MicroscopeConfig): MicroscopeConfig => {\n if (value == null) { throw new TypeError('Expected MicroscopeConfig object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected MicroscopeConfig object but got ${typeof value}.`) }\n return {\n focusAxis: value.focusAxis != null ? AxisAddress.sanitize(value.focusAxis) : null,\n xAxis: value.xAxis != null ? AxisAddress.sanitize(value.xAxis) : null,\n yAxis: value.yAxis != null ? AxisAddress.sanitize(value.yAxis) : null,\n illuminator: value.illuminator != null ? sanitizer.sanitizeInt(value.illuminator, 'illuminator') : null,\n filterChanger: value.filterChanger != null ? sanitizer.sanitizeInt(value.filterChanger, 'filterChanger') : null,\n objectiveChanger: value.objectiveChanger != null ? sanitizer.sanitizeInt(value.objectiveChanger, 'objectiveChanger') : null,\n };\n },\n};\n"]}
1
+ {"version":3,"file":"microscope_config.js","sourceRoot":"","sources":["../../../src/microscopy/microscope_config.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AACjD,kDAA8C;AA4CjC,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,CAAC,MAAkB,EAAoB,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAAqB;IAClG,QAAQ,EAAE,CAAC,KAAuB,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,wBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnG,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,I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S,CAAC,WAAW,CAAC,KAAK,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI;YAC3H,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;SAChG,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\nimport { AxisAddress } from '../axis_address';\n\n/**\n * Configuration representing a microscope setup.\n * Device address of value 0 means that the part is not present.\n */\nexport interface MicroscopeConfig {\n /**\n * Focus axis of the microscope.\n */\n focusAxis?: (AxisAddress | null);\n\n /**\n * X axis of the microscope.\n */\n xAxis?: (AxisAddress | null);\n\n /**\n * Y axis of the microscope.\n */\n yAxis?: (AxisAddress | null);\n\n /**\n * Illuminator device address.\n */\n illuminator?: (number | null);\n\n /**\n * Filter changer device address.\n */\n filterChanger?: (number | null);\n\n /**\n * Objective changer device address.\n */\n objectiveChanger?: (number | null);\n\n /**\n * Autofocus identifier.\n */\n autofocus?: (number | null);\n\n}\n\nexport const MicroscopeConfig = {\n fromBinary: (buffer: Uint8Array): MicroscopeConfig => BSON.deserialize(buffer) as MicroscopeConfig,\n toBinary: (value: MicroscopeConfig): Uint8Array => BSON.serialize(MicroscopeConfig.sanitize(value)),\n DEFAULT: Object.freeze({\n focusAxis: null,\n xAxis: null,\n yAxis: null,\n illuminator: null,\n filterChanger: null,\n objectiveChanger: null,\n autofocus: null,\n }) as Readonly<MicroscopeConfig>,\n sanitize: (value: MicroscopeConfig): MicroscopeConfig => {\n if (value == null) { throw new TypeError('Expected MicroscopeConfig object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected MicroscopeConfig object but got ${typeof value}.`) }\n return {\n focusAxis: value.focusAxis != null ? AxisAddress.sanitize(value.focusAxis) : null,\n xAxis: value.xAxis != null ? AxisAddress.sanitize(value.xAxis) : null,\n yAxis: value.yAxis != null ? AxisAddress.sanitize(value.yAxis) : null,\n illuminator: value.illuminator != null ? sanitizer.sanitizeInt(value.illuminator, 'illuminator') : null,\n filterChanger: value.filterChanger != null ? sanitizer.sanitizeInt(value.filterChanger, 'filterChanger') : null,\n objectiveChanger: value.objectiveChanger != null ? sanitizer.sanitizeInt(value.objectiveChanger, 'objectiveChanger') : null,\n autofocus: value.autofocus != null ? sanitizer.sanitizeInt(value.autofocus, 'autofocus') : null,\n };\n },\n};\n"]}
@@ -25,6 +25,8 @@ export declare class ObjectiveChanger {
25
25
  */
26
26
  constructor(turret: Device, focusAxis: Axis);
27
27
  /**
28
+ * @deprecated Use microscope's `Find` method instead or instantiate manually.
29
+ *
28
30
  * Finds an objective changer on a connection.
29
31
  * In case of conflict, specify the optional device addresses.
30
32
  * Devices on the connection must be identified.
@@ -1 +1 @@
1
- {"version":3,"file":"objective_changer.d.ts","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAS,MAAM,UAAU,CAAC;AAExD;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM,IAAI,MAAM,CAE1B;IACD,OAAO,CAAC,OAAO,CAAS;IAExB;;OAEG;IACH,IAAW,SAAS,IAAI,IAAI,CAE3B;IACD,OAAO,CAAC,UAAU,CAAO;IAEzB;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI;IAM3C;;;;;;;;OAQG;WACiB,IAAI,CACtB,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,gBAAgB,CAAC,WAAgB,GACzC,OAAO,CAAC,gBAAgB,CAAC;IAsB5B;;;;;;OAMG;IACU,MAAM,CACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,gBAAgB,CAAC,aAAkB,GAC3C,OAAO,CAAC,IAAI,CAAC;IAoBhB;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAerC;;;;OAIG;IACU,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBnD;;;OAGG;IACU,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;IAkBrD;;;;;;OAMG;IACU,aAAa,CACxB,IAAI,GAAE,MAAM,GAAG,KAAK,GAAG,MAAqB,GAC3C,OAAO,CAAC,MAAM,CAAC;IAoBlB;;;;;;OAMG;IACU,aAAa,CACxB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,MAAM,GAAG,KAAK,GAAG,MAAqB,GAC3C,OAAO,CAAC,IAAI,CAAC;IAiBhB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAexB;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAgB1B;AAED,kBAAU,gBAAgB,CAAC;IACzB,UAAiB,WAAW;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;IACD,UAAiB,aAAa;QAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"objective_changer.d.ts","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAA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WAAW,CAAC,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -59,6 +59,8 @@ class ObjectiveChanger {
59
59
  this._verifyIsChanger();
60
60
  }
61
61
  /**
62
+ * @deprecated Use microscope's `Find` method instead or instantiate manually.
63
+ *
62
64
  * Finds an objective changer on a connection.
63
65
  * In case of conflict, specify the optional device addresses.
64
66
  * Devices on the connection must be identified.
@@ -1 +1 @@
1
- {"version":3,"file":"objective_changer.js","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAEtC,4CAAyC;AACzC,wCAAqC;AAErC,sDAAwC;AACxC,oCAAwD;AAExD;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;;OAGG;IACH,YAAY,MAAc,EAAE,SAAe;QACzC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,IAAI,CACtB,UAAsB,EACtB,UAAwC,EAAE;QAE1C,MAAM,EACJ,aAAa,GAAG,CAAC,EACjB,YAAY,GAAG,CAAC,GACjB,GAAG,OAAO,CAAC;QACZ,MAAM,OAAO,GAAuD;YAClE,GAAG,QAAQ,CAAC,uBAAuB,CAAC,OAAO;YAC3C,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,aAAa,EAAE,aAAa;YAC5B,YAAY,EAAE,YAAY;YAC1B,QAAQ;gBACN,OAAO,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC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== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Connection } from '../ascii/connection';\nimport { Device } from '../ascii/device';\nimport { Axis } from '../ascii/axis';\nimport { Measurement } from '../measurement';\nimport * as requests from '../requests';\nimport { Angle, Length, Native, Units } from '../units';\n\n/**\n * Represents an objective changer of a microscope.\n * Unstable. Expect breaking changes in future releases.\n * Requires at least Firmware 7.32.\n */\nexport class ObjectiveChanger {\n /**\n * Device address of the turret.\n */\n public get turret(): Device {\n return this._turret;\n }\n private _turret: Device;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n /**\n * Creates instance of `ObjectiveChanger` based on the given device.\n * If the device is identified, this constructor will ensure it is an objective changer.\n */\n constructor(turret: Device, focusAxis: Axis) {\n this._turret = turret;\n this._focusAxis = focusAxis;\n this._verifyIsChanger();\n }\n\n /**\n * Finds an objective changer on a connection.\n * In case of conflict, specify the optional device addresses.\n * Devices on the connection must be identified.\n * @param connection Connection on which to detect the objective changer.\n * @param [options.turretAddress=0] Optional device address of the turret device (X-MOR).\n * @param [options.focusAddress=0] Optional device address of the focus device (X-LDA).\n * @returns New instance of objective changer.\n */\n public static async find(\n connection: Connection,\n options: ObjectiveChanger.FindOptions = {}\n ): Promise<ObjectiveChanger> {\n const {\n turretAddress = 0,\n focusAddress = 0,\n } = options;\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n turretAddress: turretAddress,\n focusAddress: focusAddress,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.ObjectiveChangerCreateResponse>(\n 'objective_changer/detect',\n request,\n requests.ObjectiveChangerCreateResponse.fromBinary);\n return new ObjectiveChanger(new Device(connection, response.turret), new Axis(new Device(connection, response.focusAddress), response.focusAxis));\n }\n\n /**\n * Changes the objective.\n * Runs a sequence of movements switching from the current objective to the new one.\n * The focus stage moves to the focus datum after the objective change.\n * @param objective Objective number starting from 1.\n * @param options.focusOffset Optional offset from the focus datum.\n */\n public async change(\n objective: number,\n options: ObjectiveChanger.ChangeOptions = {}\n ): Promise<void> {\n const {\n focusOffset,\n } = options;\n const request: requests.ObjectiveChangerChangeRequest & gateway.Message = {\n ...requests.ObjectiveChangerChangeRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n objective: objective,\n focusOffset: focusOffset,\n toBinary() {\n return requests.ObjectiveChangerChangeRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/change', request);\n }\n\n /**\n * Moves the focus stage out of the turret releasing the current objective.\n */\n public async release(): Promise<void> {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/release', request);\n }\n\n /**\n * Returns current objective number starting from 1.\n * The value of 0 indicates that the position is either unknown or between two objectives.\n * @returns Current objective number starting from 1 or 0 if not applicable.\n */\n public async getCurrentObjective(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_position',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets number of objectives that the turret can accommodate.\n * @returns Number of positions.\n */\n public async getNumberOfObjectives(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_count',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param [unit=Units.NATIVE] Units of datum.\n * @returns The datum.\n */\n public async getFocusDatum(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'objective_changer/get_datum',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param datum Value of datum.\n * @param [unit=Units.NATIVE] Units of datum.\n */\n public async setFocusDatum(\n datum: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n value: datum,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/set_datum', request);\n }\n\n /**\n * Checks if this is a objective changer and throws an error if it is not.\n */\n private _verifyIsChanger(): void {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n gateway.callSync('objective_changer/verify', request);\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace ObjectiveChanger {\n export interface FindOptions {\n turretAddress?: number;\n focusAddress?: number;\n }\n export interface ChangeOptions {\n focusOffset?: Measurement;\n }\n}\n"]}
1
+ {"version":3,"file":"objective_changer.js","sourceRoot":"","sources":["../../../src/microscopy/objective_changer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AAEtC,4CAAyC;AACzC,wCAAqC;AAErC,sDAAwC;AACxC,oCAAwD;AAExD;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;;OAGG;IACH,YAAY,MAAc,EAAE,SAAe;QACzC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,SA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C,OAAO;YACvC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa;YACjC,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,yBAAyB,EACzB,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;CACF;AA1PD,4CA0PC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport { Connection } from '../ascii/connection';\nimport { Device } from '../ascii/device';\nimport { Axis } from '../ascii/axis';\nimport { Measurement } from '../measurement';\nimport * as requests from '../requests';\nimport { Angle, Length, Native, Units } from '../units';\n\n/**\n * Represents an objective changer of a microscope.\n * Unstable. Expect breaking changes in future releases.\n * Requires at least Firmware 7.32.\n */\nexport class ObjectiveChanger {\n /**\n * Device address of the turret.\n */\n public get turret(): Device {\n return this._turret;\n }\n private _turret: Device;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n /**\n * Creates instance of `ObjectiveChanger` based on the given device.\n * If the device is identified, this constructor will ensure it is an objective changer.\n */\n constructor(turret: Device, focusAxis: Axis) {\n this._turret = turret;\n this._focusAxis = focusAxis;\n this._verifyIsChanger();\n }\n\n /**\n * @deprecated Use microscope's `Find` method instead or instantiate manually.\n *\n * Finds an objective changer on a connection.\n * In case of conflict, specify the optional device addresses.\n * Devices on the connection must be identified.\n * @param connection Connection on which to detect the objective changer.\n * @param [options.turretAddress=0] Optional device address of the turret device (X-MOR).\n * @param [options.focusAddress=0] Optional device address of the focus device (X-LDA).\n * @returns New instance of objective changer.\n */\n public static async find(\n connection: Connection,\n options: ObjectiveChanger.FindOptions = {}\n ): Promise<ObjectiveChanger> {\n const {\n turretAddress = 0,\n focusAddress = 0,\n } = options;\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: connection.interfaceId,\n turretAddress: turretAddress,\n focusAddress: focusAddress,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.ObjectiveChangerCreateResponse>(\n 'objective_changer/detect',\n request,\n requests.ObjectiveChangerCreateResponse.fromBinary);\n return new ObjectiveChanger(new Device(connection, response.turret), new Axis(new Device(connection, response.focusAddress), response.focusAxis));\n }\n\n /**\n * Changes the objective.\n * Runs a sequence of movements switching from the current objective to the new one.\n * The focus stage moves to the focus datum after the objective change.\n * @param objective Objective number starting from 1.\n * @param options.focusOffset Optional offset from the focus datum.\n */\n public async change(\n objective: number,\n options: ObjectiveChanger.ChangeOptions = {}\n ): Promise<void> {\n const {\n focusOffset,\n } = options;\n const request: requests.ObjectiveChangerChangeRequest & gateway.Message = {\n ...requests.ObjectiveChangerChangeRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n objective: objective,\n focusOffset: focusOffset,\n toBinary() {\n return requests.ObjectiveChangerChangeRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/change', request);\n }\n\n /**\n * Moves the focus stage out of the turret releasing the current objective.\n */\n public async release(): Promise<void> {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/release', request);\n }\n\n /**\n * Returns current objective number starting from 1.\n * The value of 0 indicates that the position is either unknown or between two objectives.\n * @returns Current objective number starting from 1 or 0 if not applicable.\n */\n public async getCurrentObjective(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_position',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets number of objectives that the turret can accommodate.\n * @returns Number of positions.\n */\n public async getNumberOfObjectives(): Promise<number> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n axis: 1,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'device/get_index_count',\n request,\n requests.IntResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param [unit=Units.NATIVE] Units of datum.\n * @returns The datum.\n */\n public async getFocusDatum(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'objective_changer/get_datum',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the focus datum.\n * The focus datum is the position that the focus stage moves to after an objective change.\n * It is backed by the limit.home.offset setting.\n * @param datum Value of datum.\n * @param [unit=Units.NATIVE] Units of datum.\n */\n public async setFocusDatum(\n datum: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.ObjectiveChangerSetRequest & gateway.Message = {\n ...requests.ObjectiveChangerSetRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n value: datum,\n unit: unit,\n toBinary() {\n return requests.ObjectiveChangerSetRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('objective_changer/set_datum', request);\n }\n\n /**\n * Checks if this is a objective changer and throws an error if it is not.\n */\n private _verifyIsChanger(): void {\n const request: requests.ObjectiveChangerRequest & gateway.Message = {\n ...requests.ObjectiveChangerRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n turretAddress: this.turret.deviceAddress,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.ObjectiveChangerRequest.toBinary(this);\n },\n };\n\n gateway.callSync('objective_changer/verify', request);\n }\n\n /**\n * Returns a string that represents the device.\n * @returns A string that represents the device.\n */\n public toString(): string {\n const request: requests.AxisToStringRequest & gateway.Message = {\n ...requests.AxisToStringRequest.DEFAULT,\n interfaceId: this.turret.connection.interfaceId,\n device: this.turret.deviceAddress,\n toBinary() {\n return requests.AxisToStringRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'device/device_to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace ObjectiveChanger {\n export interface FindOptions {\n turretAddress?: number;\n focusAddress?: number;\n }\n export interface ChangeOptions {\n focusOffset?: Measurement;\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Third party components of the microscope.
3
+ */
4
+ export interface ThirdPartyComponents {
5
+ /**
6
+ * Autofocus provider identifier.
7
+ */
8
+ autofocus?: (number | null);
9
+ }
10
+ export declare const ThirdPartyComponents: {
11
+ fromBinary: (buffer: Uint8Array) => ThirdPartyComponents;
12
+ toBinary: (value: ThirdPartyComponents) => Uint8Array;
13
+ DEFAULT: Readonly<ThirdPartyComponents>;
14
+ sanitize: (value: ThirdPartyComponents) => ThirdPartyComponents;
15
+ };
16
+ //# sourceMappingURL=third_party_components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"third_party_components.d.ts","sourceRoot":"","sources":["../../../src/microscopy/third_party_components.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAE7B;AAED,eAAO,MAAM,oBAAoB;yBACV,UAAU,KAAG,oBAAoB;sBACpC,oBAAoB,KAAG,UAAU;;sBAIjC,oBAAoB,KAAG,oBAAoB;CAO9D,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ThirdPartyComponents = void 0;
4
+ /* This file is generated. Do not modify by hand. */
5
+ const bson_1 = require("bson");
6
+ const sanitizer_1 = require("../gateway/sanitizer");
7
+ exports.ThirdPartyComponents = {
8
+ fromBinary: (buffer) => bson_1.BSON.deserialize(buffer),
9
+ toBinary: (value) => bson_1.BSON.serialize(exports.ThirdPartyComponents.sanitize(value)),
10
+ DEFAULT: Object.freeze({
11
+ autofocus: null,
12
+ }),
13
+ sanitize: (value) => {
14
+ if (value == null) {
15
+ throw new TypeError('Expected ThirdPartyComponents object but got null or undefined.');
16
+ }
17
+ if (typeof value !== 'object') {
18
+ throw new TypeError(`Expected ThirdPartyComponents object but got ${typeof value}.`);
19
+ }
20
+ return {
21
+ autofocus: value.autofocus != null ? sanitizer_1.sanitizer.sanitizeInt(value.autofocus, 'autofocus') : null,
22
+ };
23
+ },
24
+ };
25
+ //# sourceMappingURL=third_party_components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"third_party_components.js","sourceRoot":"","sources":["../../../src/microscopy/third_party_components.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AAapC,QAAA,oBAAoB,GAAG;IAClC,UAAU,EAAE,CAAC,MAAkB,EAAwB,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAAyB;IAC1G,QAAQ,EAAE,CAAC,KAA2B,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,4BAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3G,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE,IAAI;KAChB,CAAmC;IACpC,QAAQ,EAAE,CAAC,KAA2B,EAAwB,EAAE;QAC9D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,iEAAiE,CAAC,CAAA;QAAC,CAAC;QAC7G,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,gDAAgD,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QACvH,OAAO;YACL,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,qBAAS,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;SAChG,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\n\n/**\n * Third party components of the microscope.\n */\nexport interface ThirdPartyComponents {\n /**\n * Autofocus provider identifier.\n */\n autofocus?: (number | null);\n\n}\n\nexport const ThirdPartyComponents = {\n fromBinary: (buffer: Uint8Array): ThirdPartyComponents => BSON.deserialize(buffer) as ThirdPartyComponents,\n toBinary: (value: ThirdPartyComponents): Uint8Array => BSON.serialize(ThirdPartyComponents.sanitize(value)),\n DEFAULT: Object.freeze({\n autofocus: null,\n }) as Readonly<ThirdPartyComponents>,\n sanitize: (value: ThirdPartyComponents): ThirdPartyComponents => {\n if (value == null) { throw new TypeError('Expected ThirdPartyComponents object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected ThirdPartyComponents object but got ${typeof value}.`) }\n return {\n autofocus: value.autofocus != null ? sanitizer.sanitizeInt(value.autofocus, 'autofocus') : null,\n };\n },\n};\n"]}
@@ -0,0 +1,77 @@
1
+ import { WdiAutofocusProviderStatus } from './wdi_autofocus_provider_status';
2
+ /**
3
+ * Class representing access to WDI Autofocus connection.
4
+ */
5
+ export declare class WdiAutofocusProvider {
6
+ /**
7
+ * Default port number for TCP connections to WDI autofocus.
8
+ */
9
+ static readonly DEFAULT_TCP_PORT: number;
10
+ /**
11
+ * The ID identifies the autofocus with the underlying library.
12
+ */
13
+ get providerId(): number;
14
+ private _providerId;
15
+ constructor(providerId: number);
16
+ /**
17
+ * Opens a TCP connection to WDI autofocus.
18
+ * @param hostName Hostname or IP address.
19
+ * @param [port=WdiAutofocusProvider.DEFAULT_TCP_PORT] Optional port number (defaults to 27).
20
+ * @returns An object representing the autofocus connection.
21
+ */
22
+ static openTcp(hostName: string, port?: number): Promise<WdiAutofocusProvider>;
23
+ /**
24
+ * Close the connection.
25
+ */
26
+ close(): Promise<void>;
27
+ /**
28
+ * Generic read operation.
29
+ * @param registerId Register address to read from.
30
+ * @param size Data size to read. Valid values are (1,2,4). Determines the data type (Byte, Word, DWord).
31
+ * @param [options.count=1] Number of values to read (defaults to 1).
32
+ * @param [options.offset=0] Offset within the register (defaults to 0).
33
+ * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).
34
+ * @returns Array of integers read from the device.
35
+ */
36
+ genericRead(registerId: number, size: number, options?: WdiAutofocusProvider.GenericReadOptions): Promise<number[]>;
37
+ /**
38
+ * Generic write operation.
39
+ * @param registerId Register address to read from.
40
+ * @param [size=0] Data size to write. Valid values are (0,1,2,4). Determines the data type (Nil, Byte, Word, DWord).
41
+ * @param [data=[]] Array of values to write to the register. Empty array is allowed.
42
+ * @param [options.offset=0] Offset within the register (defaults to 0).
43
+ * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).
44
+ */
45
+ genericWrite(registerId: number, size?: number, data?: number[], options?: WdiAutofocusProvider.GenericWriteOptions): Promise<void>;
46
+ /**
47
+ * Enables the laser.
48
+ */
49
+ enableLaser(): Promise<void>;
50
+ /**
51
+ * Disables the laser.
52
+ */
53
+ disableLaser(): Promise<void>;
54
+ /**
55
+ * Gets the status of the autofocus.
56
+ * @returns The status of the autofocus.
57
+ */
58
+ getStatus(): Promise<WdiAutofocusProviderStatus>;
59
+ /**
60
+ * Returns a string that represents the autofocus connection.
61
+ * @returns A string that represents the connection.
62
+ */
63
+ toString(): string;
64
+ }
65
+ declare namespace WdiAutofocusProvider {
66
+ interface GenericReadOptions {
67
+ count?: number;
68
+ offset?: number;
69
+ registerBank?: string;
70
+ }
71
+ interface GenericWriteOptions {
72
+ offset?: number;
73
+ registerBank?: string;
74
+ }
75
+ }
76
+ export {};
77
+ //# sourceMappingURL=wdi_autofocus_provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wdi_autofocus_provider.d.ts","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;GAEG;AACH,qBAAa,oBAAoB;IAC/B;;OAEG;IACH,gBAAuB,gBAAgB,EAAE,MAAM,CAAM;IAErD;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,OAAO,CAAC,WAAW,CAAS;gBAEhB,UAAU,EAAE,MAAM;IAI9B;;;;;OAKG;WACiB,OAAO,CACzB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAA8C,GACnD,OAAO,CAAC,oBAAoB,CAAC;IAkBhC;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC;;;;;;;;OAQG;IACU,WAAW,CACtB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,oBAAoB,CAAC,kBAAuB,GACpD,OAAO,CAAC,MAAM,EAAE,CAAC;IA0BpB;;;;;;;OAOG;IACU,YAAY,CACvB,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,MAAU,EAChB,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,GAAE,oBAAoB,CAAC,mBAAwB,GACrD,OAAO,CAAC,IAAI,CAAC;IAqBhB;;OAEG;IACU,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAazC;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAgB7D;;;OAGG;IACI,QAAQ,IAAI,MAAM;CAe1B;AAED,kBAAU,oBAAoB,CAAC;IAC7B,UAAiB,kBAAkB;QAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;IACD,UAAiB,mBAAmB;QAChC,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB;CACF"}
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+ // ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //
3
+ // ============= DO NOT EDIT DIRECTLY ============= //
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.WdiAutofocusProvider = void 0;
29
+ const gateway = __importStar(require("../gateway"));
30
+ const requests = __importStar(require("../requests"));
31
+ /**
32
+ * Class representing access to WDI Autofocus connection.
33
+ */
34
+ class WdiAutofocusProvider {
35
+ /**
36
+ * The ID identifies the autofocus with the underlying library.
37
+ */
38
+ get providerId() {
39
+ return this._providerId;
40
+ }
41
+ constructor(providerId) {
42
+ this._providerId = providerId;
43
+ }
44
+ /**
45
+ * Opens a TCP connection to WDI autofocus.
46
+ * @param hostName Hostname or IP address.
47
+ * @param [port=WdiAutofocusProvider.DEFAULT_TCP_PORT] Optional port number (defaults to 27).
48
+ * @returns An object representing the autofocus connection.
49
+ */
50
+ static async openTcp(hostName, port = WdiAutofocusProvider.DEFAULT_TCP_PORT) {
51
+ const request = {
52
+ ...requests.OpenInterfaceRequest.DEFAULT,
53
+ interfaceType: requests.InterfaceType.TCP,
54
+ hostName: hostName,
55
+ port: port,
56
+ toBinary() {
57
+ return requests.OpenInterfaceRequest.toBinary(this);
58
+ },
59
+ };
60
+ const response = await gateway.callAsync('wdi/open', request, requests.IntResponse.fromBinary);
61
+ return new WdiAutofocusProvider(response.value);
62
+ }
63
+ /**
64
+ * Close the connection.
65
+ */
66
+ async close() {
67
+ const request = {
68
+ ...requests.InterfaceEmptyRequest.DEFAULT,
69
+ interfaceId: this.providerId,
70
+ toBinary() {
71
+ return requests.InterfaceEmptyRequest.toBinary(this);
72
+ },
73
+ };
74
+ await gateway.callAsync('wdi/close', request);
75
+ }
76
+ /**
77
+ * Generic read operation.
78
+ * @param registerId Register address to read from.
79
+ * @param size Data size to read. Valid values are (1,2,4). Determines the data type (Byte, Word, DWord).
80
+ * @param [options.count=1] Number of values to read (defaults to 1).
81
+ * @param [options.offset=0] Offset within the register (defaults to 0).
82
+ * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).
83
+ * @returns Array of integers read from the device.
84
+ */
85
+ async genericRead(registerId, size, options = {}) {
86
+ const { count = 1, offset = 0, registerBank = 'U', } = options;
87
+ const request = {
88
+ ...requests.WdiGenericRequest.DEFAULT,
89
+ interfaceId: this.providerId,
90
+ registerId: registerId,
91
+ size: size,
92
+ count: count,
93
+ offset: offset,
94
+ registerBank: registerBank,
95
+ toBinary() {
96
+ return requests.WdiGenericRequest.toBinary(this);
97
+ },
98
+ };
99
+ const response = await gateway.callAsync('wdi/read', request, requests.IntArrayResponse.fromBinary);
100
+ return response.values;
101
+ }
102
+ /**
103
+ * Generic write operation.
104
+ * @param registerId Register address to read from.
105
+ * @param [size=0] Data size to write. Valid values are (0,1,2,4). Determines the data type (Nil, Byte, Word, DWord).
106
+ * @param [data=[]] Array of values to write to the register. Empty array is allowed.
107
+ * @param [options.offset=0] Offset within the register (defaults to 0).
108
+ * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).
109
+ */
110
+ async genericWrite(registerId, size = 0, data = [], options = {}) {
111
+ const { offset = 0, registerBank = 'U', } = options;
112
+ const request = {
113
+ ...requests.WdiGenericRequest.DEFAULT,
114
+ interfaceId: this.providerId,
115
+ registerId: registerId,
116
+ size: size,
117
+ data: data,
118
+ offset: offset,
119
+ registerBank: registerBank,
120
+ toBinary() {
121
+ return requests.WdiGenericRequest.toBinary(this);
122
+ },
123
+ };
124
+ await gateway.callAsync('wdi/write', request);
125
+ }
126
+ /**
127
+ * Enables the laser.
128
+ */
129
+ async enableLaser() {
130
+ const request = {
131
+ ...requests.WdiGenericRequest.DEFAULT,
132
+ interfaceId: this.providerId,
133
+ registerId: 1,
134
+ toBinary() {
135
+ return requests.WdiGenericRequest.toBinary(this);
136
+ },
137
+ };
138
+ await gateway.callAsync('wdi/write', request);
139
+ }
140
+ /**
141
+ * Disables the laser.
142
+ */
143
+ async disableLaser() {
144
+ const request = {
145
+ ...requests.WdiGenericRequest.DEFAULT,
146
+ interfaceId: this.providerId,
147
+ registerId: 2,
148
+ toBinary() {
149
+ return requests.WdiGenericRequest.toBinary(this);
150
+ },
151
+ };
152
+ await gateway.callAsync('wdi/write', request);
153
+ }
154
+ /**
155
+ * Gets the status of the autofocus.
156
+ * @returns The status of the autofocus.
157
+ */
158
+ async getStatus() {
159
+ const request = {
160
+ ...requests.InterfaceEmptyRequest.DEFAULT,
161
+ interfaceId: this.providerId,
162
+ toBinary() {
163
+ return requests.InterfaceEmptyRequest.toBinary(this);
164
+ },
165
+ };
166
+ const response = await gateway.callAsync('wdi/get_status', request, requests.WdiGetStatusResponse.fromBinary);
167
+ return response.status;
168
+ }
169
+ /**
170
+ * Returns a string that represents the autofocus connection.
171
+ * @returns A string that represents the connection.
172
+ */
173
+ toString() {
174
+ const request = {
175
+ ...requests.InterfaceEmptyRequest.DEFAULT,
176
+ interfaceId: this.providerId,
177
+ toBinary() {
178
+ return requests.InterfaceEmptyRequest.toBinary(this);
179
+ },
180
+ };
181
+ const response = gateway.callSync('wdi/to_string', request, requests.StringResponse.fromBinary);
182
+ return response.value;
183
+ }
184
+ }
185
+ exports.WdiAutofocusProvider = WdiAutofocusProvider;
186
+ /**
187
+ * Default port number for TCP connections to WDI autofocus.
188
+ */
189
+ WdiAutofocusProvider.DEFAULT_TCP_PORT = 27;
190
+ //# sourceMappingURL=wdi_autofocus_provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wdi_autofocus_provider.js","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AAGxC;;GAEG;AACH,MAAa,oBAAoB;IAM/B;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD,YAAY,UAAkB;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,KAAK,CAAC,OAAO,CACzB,QAAgB,EAChB,OAAe,oBAAoB,CAAC,gBAAgB;QAEpD,MAAM,OAAO,GAAoD;YAC/D,GAAG,QAAQ,CAAC,oBAAoB,CAAC,OAAO;YACxC,aAAa,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG;YACzC,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,IAAI;YACV,QAAQ;gBACN,OAAO,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,SAAS,CACtC,UAAU,EACV,OAAO,EACP,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACnC,OAAO,IAAI,oBAAoB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,KAAK;QAChB,MAAM,OAAO,GAAqD;YAChE,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO;YACzC,WAAW,EAAE,IAAI,CAAC,UAAU;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;S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U,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC,MAAM,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,MAAM,OAAO,GAAqD;YAChE,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO;YACzC,WAAW,EAAE,IAAI,CAAC,UAAU;YAC5B,QAAQ;gBACN,OAAO,QAAQ,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;QAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAC/B,eAAe,EACf,OAAO,EACP,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACtC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;;AA3MH,oDA4MC;AA3MC;;GAEG;AACoB,qCAAgB,GAAW,EAAE,CAAC","sourcesContent":["// ==== THIS FILE IS GENERATED FROM A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { WdiAutofocusProviderStatus } from './wdi_autofocus_provider_status';\n\n/**\n * Class representing access to WDI Autofocus connection.\n */\nexport class WdiAutofocusProvider {\n /**\n * Default port number for TCP connections to WDI autofocus.\n */\n public static readonly DEFAULT_TCP_PORT: number = 27;\n\n /**\n * The ID identifies the autofocus with the underlying library.\n */\n public get providerId(): number {\n return this._providerId;\n }\n private _providerId: number;\n\n constructor(providerId: number) {\n this._providerId = providerId;\n }\n\n /**\n * Opens a TCP connection to WDI autofocus.\n * @param hostName Hostname or IP address.\n * @param [port=WdiAutofocusProvider.DEFAULT_TCP_PORT] Optional port number (defaults to 27).\n * @returns An object representing the autofocus connection.\n */\n public static async openTcp(\n hostName: string,\n port: number = WdiAutofocusProvider.DEFAULT_TCP_PORT\n ): Promise<WdiAutofocusProvider> {\n const request: requests.OpenInterfaceRequest & gateway.Message = {\n ...requests.OpenInterfaceRequest.DEFAULT,\n interfaceType: requests.InterfaceType.TCP,\n hostName: hostName,\n port: port,\n toBinary() {\n return requests.OpenInterfaceRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntResponse>(\n 'wdi/open',\n request,\n requests.IntResponse.fromBinary);\n return new WdiAutofocusProvider(response.value);\n }\n\n /**\n * Close the connection.\n */\n public async close(): Promise<void> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/close', request);\n }\n\n /**\n * Generic read operation.\n * @param registerId Register address to read from.\n * @param size Data size to read. Valid values are (1,2,4). Determines the data type (Byte, Word, DWord).\n * @param [options.count=1] Number of values to read (defaults to 1).\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n * @returns Array of integers read from the device.\n */\n public async genericRead(\n registerId: number,\n size: number,\n options: WdiAutofocusProvider.GenericReadOptions = {}\n ): Promise<number[]> {\n const {\n count = 1,\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n count: count,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.IntArrayResponse>(\n 'wdi/read',\n request,\n requests.IntArrayResponse.fromBinary);\n return response.values;\n }\n\n /**\n * Generic write operation.\n * @param registerId Register address to read from.\n * @param [size=0] Data size to write. Valid values are (0,1,2,4). Determines the data type (Nil, Byte, Word, DWord).\n * @param [data=[]] Array of values to write to the register. Empty array is allowed.\n * @param [options.offset=0] Offset within the register (defaults to 0).\n * @param [options.registerBank='U'] Register bank letter (defaults to U for user bank).\n */\n public async genericWrite(\n registerId: number,\n size: number = 0,\n data: number[] = [],\n options: WdiAutofocusProvider.GenericWriteOptions = {}\n ): Promise<void> {\n const {\n offset = 0,\n registerBank = 'U',\n } = options;\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: registerId,\n size: size,\n data: data,\n offset: offset,\n registerBank: registerBank,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Enables the laser.\n */\n public async enableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 1,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Disables the laser.\n */\n public async disableLaser(): Promise<void> {\n const request: requests.WdiGenericRequest & gateway.Message = {\n ...requests.WdiGenericRequest.DEFAULT,\n interfaceId: this.providerId,\n registerId: 2,\n toBinary() {\n return requests.WdiGenericRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('wdi/write', request);\n }\n\n /**\n * Gets the status of the autofocus.\n * @returns The status of the autofocus.\n */\n public async getStatus(): Promise<WdiAutofocusProviderStatus> {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.WdiGetStatusResponse>(\n 'wdi/get_status',\n request,\n requests.WdiGetStatusResponse.fromBinary);\n return response.status;\n }\n\n /**\n * Returns a string that represents the autofocus connection.\n * @returns A string that represents the connection.\n */\n public toString(): string {\n const request: requests.InterfaceEmptyRequest & gateway.Message = {\n ...requests.InterfaceEmptyRequest.DEFAULT,\n interfaceId: this.providerId,\n toBinary() {\n return requests.InterfaceEmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'wdi/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace WdiAutofocusProvider {\n export interface GenericReadOptions {\n count?: number;\n offset?: number;\n registerBank?: string;\n }\n export interface GenericWriteOptions {\n offset?: number;\n registerBank?: string;\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Status of the WDI autofocus.
3
+ */
4
+ export interface WdiAutofocusProviderStatus {
5
+ /**
6
+ * Indicates whether the autofocus is in range.
7
+ */
8
+ inRange: boolean;
9
+ /**
10
+ * Indicates whether the laser is turned on.
11
+ */
12
+ laserOn: boolean;
13
+ }
14
+ export declare const WdiAutofocusProviderStatus: {
15
+ fromBinary: (buffer: Uint8Array) => WdiAutofocusProviderStatus;
16
+ toBinary: (value: WdiAutofocusProviderStatus) => Uint8Array;
17
+ DEFAULT: Readonly<WdiAutofocusProviderStatus>;
18
+ sanitize: (value: WdiAutofocusProviderStatus) => WdiAutofocusProviderStatus;
19
+ };
20
+ //# sourceMappingURL=wdi_autofocus_provider_status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wdi_autofocus_provider_status.d.ts","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider_status.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAElB;AAED,eAAO,MAAM,0BAA0B;yBAChB,UAAU,KAAG,0BAA0B;sBAC1C,0BAA0B,KAAG,UAAU;;sBAKvC,0BAA0B,KAAG,0BAA0B;CAQ1E,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WdiAutofocusProviderStatus = void 0;
4
+ /* This file is generated. Do not modify by hand. */
5
+ const bson_1 = require("bson");
6
+ const sanitizer_1 = require("../gateway/sanitizer");
7
+ exports.WdiAutofocusProviderStatus = {
8
+ fromBinary: (buffer) => bson_1.BSON.deserialize(buffer),
9
+ toBinary: (value) => bson_1.BSON.serialize(exports.WdiAutofocusProviderStatus.sanitize(value)),
10
+ DEFAULT: Object.freeze({
11
+ inRange: false,
12
+ laserOn: false,
13
+ }),
14
+ sanitize: (value) => {
15
+ if (value == null) {
16
+ throw new TypeError('Expected WdiAutofocusProviderStatus object but got null or undefined.');
17
+ }
18
+ if (typeof value !== 'object') {
19
+ throw new TypeError(`Expected WdiAutofocusProviderStatus object but got ${typeof value}.`);
20
+ }
21
+ return {
22
+ inRange: sanitizer_1.sanitizer.sanitizeBool(value.inRange, 'inRange'),
23
+ laserOn: sanitizer_1.sanitizer.sanitizeBool(value.laserOn, 'laserOn'),
24
+ };
25
+ },
26
+ };
27
+ //# sourceMappingURL=wdi_autofocus_provider_status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wdi_autofocus_provider_status.js","sourceRoot":"","sources":["../../../src/microscopy/wdi_autofocus_provider_status.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,oDAAiD;AAkBpC,QAAA,0BAA0B,GAAG;IACxC,UAAU,EAAE,CAAC,MAAkB,EAA8B,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAA+B;IACtH,QAAQ,EAAE,CAAC,KAAiC,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,kCAA0B,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvH,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,KAAK;KACf,CAAyC;IAC1C,QAAQ,EAAE,CAAC,KAAiC,EAA8B,EAAE;QAC1E,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,uEAAuE,CAAC,CAAA;QAAC,CAAC;QACnH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,sDAAsD,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QAC7H,OAAO;YACL,OAAO,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC;YACzD,OAAO,EAAE,qBAAS,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC;SAC1D,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from '../gateway/sanitizer';\n\n/**\n * Status of the WDI autofocus.\n */\nexport interface WdiAutofocusProviderStatus {\n /**\n * Indicates whether the autofocus is in range.\n */\n inRange: boolean;\n\n /**\n * Indicates whether the laser is turned on.\n */\n laserOn: boolean;\n\n}\n\nexport const WdiAutofocusProviderStatus = {\n fromBinary: (buffer: Uint8Array): WdiAutofocusProviderStatus => BSON.deserialize(buffer) as WdiAutofocusProviderStatus,\n toBinary: (value: WdiAutofocusProviderStatus): Uint8Array => BSON.serialize(WdiAutofocusProviderStatus.sanitize(value)),\n DEFAULT: Object.freeze({\n inRange: false,\n laserOn: false,\n }) as Readonly<WdiAutofocusProviderStatus>,\n sanitize: (value: WdiAutofocusProviderStatus): WdiAutofocusProviderStatus => {\n if (value == null) { throw new TypeError('Expected WdiAutofocusProviderStatus object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected WdiAutofocusProviderStatus object but got ${typeof value}.`) }\n return {\n inRange: sanitizer.sanitizeBool(value.inRange, 'inRange'),\n laserOn: sanitizer.sanitizeBool(value.laserOn, 'laserOn'),\n };\n },\n};\n"]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Named parameter with optional value.
3
+ */
4
+ export interface NamedParameter {
5
+ /**
6
+ * Name of the parameter.
7
+ */
8
+ name: string;
9
+ /**
10
+ * Optional value of the parameter.
11
+ */
12
+ value?: (number | null);
13
+ }
14
+ export declare const NamedParameter: {
15
+ fromBinary: (buffer: Uint8Array) => NamedParameter;
16
+ toBinary: (value: NamedParameter) => Uint8Array;
17
+ DEFAULT: Readonly<NamedParameter>;
18
+ sanitize: (value: NamedParameter) => NamedParameter;
19
+ };
20
+ //# sourceMappingURL=named_parameter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"named_parameter.d.ts","sourceRoot":"","sources":["../../src/named_parameter.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAEzB;AAED,eAAO,MAAM,cAAc;yBACJ,UAAU,KAAG,cAAc;sBAC9B,cAAc,KAAG,UAAU;;sBAK3B,cAAc,KAAG,cAAc;CAQlD,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NamedParameter = void 0;
4
+ /* This file is generated. Do not modify by hand. */
5
+ const bson_1 = require("bson");
6
+ const sanitizer_1 = require("./gateway/sanitizer");
7
+ exports.NamedParameter = {
8
+ fromBinary: (buffer) => bson_1.BSON.deserialize(buffer),
9
+ toBinary: (value) => bson_1.BSON.serialize(exports.NamedParameter.sanitize(value)),
10
+ DEFAULT: Object.freeze({
11
+ name: '',
12
+ value: null,
13
+ }),
14
+ sanitize: (value) => {
15
+ if (value == null) {
16
+ throw new TypeError('Expected NamedParameter object but got null or undefined.');
17
+ }
18
+ if (typeof value !== 'object') {
19
+ throw new TypeError(`Expected NamedParameter object but got ${typeof value}.`);
20
+ }
21
+ return {
22
+ name: sanitizer_1.sanitizer.sanitizeString(value.name, 'name'),
23
+ value: value.value != null ? sanitizer_1.sanitizer.sanitizeNumber(value.value, 'value') : null,
24
+ };
25
+ },
26
+ };
27
+ //# sourceMappingURL=named_parameter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"named_parameter.js","sourceRoot":"","sources":["../../src/named_parameter.ts"],"names":[],"mappings":";;;AAAA,oDAAoD;AACpD,+BAA4B;AAC5B,mDAAgD;AAkBnC,QAAA,cAAc,GAAG;IAC5B,UAAU,EAAE,CAAC,MAAkB,EAAkB,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,MAAM,CAAmB;IAC9F,QAAQ,EAAE,CAAC,KAAqB,EAAc,EAAE,CAAC,WAAI,CAAC,SAAS,CAAC,sBAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/F,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,IAAI;KACZ,CAA6B;IAC9B,QAAQ,EAAE,CAAC,KAAqB,EAAkB,EAAE;QAClD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,2DAA2D,CAAC,CAAA;QAAC,CAAC;QACvG,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAAC,MAAM,IAAI,SAAS,CAAC,0CAA0C,OAAO,KAAK,GAAG,CAAC,CAAA;QAAC,CAAC;QACjH,OAAO;YACL,IAAI,EAAE,qBAAS,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;YAClD,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,qBAAS,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;SACnF,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["/* This file is generated. Do not modify by hand. */\nimport { BSON } from 'bson';\nimport { sanitizer } from './gateway/sanitizer';\n\n/**\n * Named parameter with optional value.\n */\nexport interface NamedParameter {\n /**\n * Name of the parameter.\n */\n name: string;\n\n /**\n * Optional value of the parameter.\n */\n value?: (number | null);\n\n}\n\nexport const NamedParameter = {\n fromBinary: (buffer: Uint8Array): NamedParameter => BSON.deserialize(buffer) as NamedParameter,\n toBinary: (value: NamedParameter): Uint8Array => BSON.serialize(NamedParameter.sanitize(value)),\n DEFAULT: Object.freeze({\n name: '',\n value: null,\n }) as Readonly<NamedParameter>,\n sanitize: (value: NamedParameter): NamedParameter => {\n if (value == null) { throw new TypeError('Expected NamedParameter object but got null or undefined.') }\n if (typeof value !== 'object') { throw new TypeError(`Expected NamedParameter object but got ${typeof value}.`) }\n return {\n name: sanitizer.sanitizeString(value.name, 'name'),\n value: value.value != null ? sanitizer.sanitizeNumber(value.value, 'value') : null,\n };\n },\n};\n"]}
@@ -0,0 +1,16 @@
1
+ export interface AutofocusFocusRequest {
2
+ providerId: number;
3
+ interfaceId: number;
4
+ focusAddress: number;
5
+ focusAxis: number;
6
+ turretAddress: number;
7
+ scan: boolean;
8
+ once: boolean;
9
+ }
10
+ export declare const AutofocusFocusRequest: {
11
+ fromBinary: (buffer: Uint8Array) => AutofocusFocusRequest;
12
+ toBinary: (value: AutofocusFocusRequest) => Uint8Array;
13
+ DEFAULT: Readonly<AutofocusFocusRequest>;
14
+ sanitize: (value: AutofocusFocusRequest) => AutofocusFocusRequest;
15
+ };
16
+ //# sourceMappingURL=autofocus_focus_request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autofocus_focus_request.d.ts","sourceRoot":"","sources":["../../../src/requests/autofocus_focus_request.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IAEpB,YAAY,EAAE,MAAM,CAAC;IAErB,SAAS,EAAE,MAAM,CAAC;IAElB,aAAa,EAAE,MAAM,CAAC;IAEtB,IAAI,EAAE,OAAO,CAAC;IAEd,IAAI,EAAE,OAAO,CAAC;CAEf;AAED,eAAO,MAAM,qBAAqB;yBACX,UAAU,KAAG,qBAAqB;sBACrC,qBAAqB,KAAG,UAAU;;sBAUlC,qBAAqB,KAAG,qBAAqB;CAahE,CAAC"}