@zaber/motion 7.9.0 → 7.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +179 -8
- package/dist/binding/wasm/zaber-motion-core.wasm +0 -0
- package/dist/lib/library.js +1 -1
- package/dist/lib/library.js.map +1 -1
- package/dist/lib/microscopy/autofocus.d.ts +7 -0
- package/dist/lib/microscopy/autofocus.d.ts.map +1 -1
- package/dist/lib/microscopy/autofocus.js +19 -0
- package/dist/lib/microscopy/autofocus.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -65,13 +65,13 @@ SOFTWARE.
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
------------------
|
|
68
|
-
github.com/davecgh/go-spew v1.1.
|
|
68
|
+
github.com/davecgh/go-spew v1.1.0
|
|
69
69
|
------------------
|
|
70
70
|
ISC License
|
|
71
71
|
|
|
72
72
|
Copyright (c) 2012-2016 Dave Collins <dave@davec.name>
|
|
73
73
|
|
|
74
|
-
Permission to use, copy, modify, and
|
|
74
|
+
Permission to use, copy, modify, and distribute this software for any
|
|
75
75
|
purpose with or without fee is hereby granted, provided that the above
|
|
76
76
|
copyright notice and this permission notice appear in all copies.
|
|
77
77
|
|
|
@@ -422,7 +422,33 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
422
422
|
THE SOFTWARE.
|
|
423
423
|
|
|
424
424
|
------------------
|
|
425
|
-
github.com/stretchr/
|
|
425
|
+
github.com/stretchr/objx v0.1.0
|
|
426
|
+
------------------
|
|
427
|
+
The MIT License
|
|
428
|
+
|
|
429
|
+
Copyright (c) 2014 Stretchr, Inc.
|
|
430
|
+
Copyright (c) 2017-2018 objx contributors
|
|
431
|
+
|
|
432
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
433
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
434
|
+
in the Software without restriction, including without limitation the rights
|
|
435
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
436
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
437
|
+
furnished to do so, subject to the following conditions:
|
|
438
|
+
|
|
439
|
+
The above copyright notice and this permission notice shall be included in all
|
|
440
|
+
copies or substantial portions of the Software.
|
|
441
|
+
|
|
442
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
443
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
444
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
445
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
446
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
447
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
448
|
+
SOFTWARE.
|
|
449
|
+
|
|
450
|
+
------------------
|
|
451
|
+
github.com/stretchr/testify v1.7.0
|
|
426
452
|
------------------
|
|
427
453
|
MIT License
|
|
428
454
|
|
|
@@ -1173,7 +1199,7 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
1173
1199
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1174
1200
|
|
|
1175
1201
|
------------------
|
|
1176
|
-
gitlab.com/ZaberTech/zaber-go-lib v0.0.0-
|
|
1202
|
+
gitlab.com/ZaberTech/zaber-go-lib v0.0.0-20240328212536-999ed1bc7b42
|
|
1177
1203
|
------------------
|
|
1178
1204
|
Copyright 2022 Zaber Technologies Inc.
|
|
1179
1205
|
|
|
@@ -1389,7 +1415,7 @@ go.mongodb.org/mongo-driver v1.14.0
|
|
|
1389
1415
|
limitations under the License.
|
|
1390
1416
|
|
|
1391
1417
|
------------------
|
|
1392
|
-
golang.org/x/crypto v0.
|
|
1418
|
+
golang.org/x/crypto v0.11.0
|
|
1393
1419
|
------------------
|
|
1394
1420
|
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
1395
1421
|
|
|
@@ -1482,7 +1508,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
1482
1508
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1483
1509
|
|
|
1484
1510
|
------------------
|
|
1485
|
-
golang.org/x/mod v0.
|
|
1511
|
+
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
|
|
1486
1512
|
------------------
|
|
1487
1513
|
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
1488
1514
|
|
|
@@ -1544,7 +1570,38 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
1544
1570
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1545
1571
|
|
|
1546
1572
|
------------------
|
|
1547
|
-
golang.org/x/sync v0.
|
|
1573
|
+
golang.org/x/sync v0.0.0-20190423024810-112230192c58
|
|
1574
|
+
------------------
|
|
1575
|
+
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
1576
|
+
|
|
1577
|
+
Redistribution and use in source and binary forms, with or without
|
|
1578
|
+
modification, are permitted provided that the following conditions are
|
|
1579
|
+
met:
|
|
1580
|
+
|
|
1581
|
+
* Redistributions of source code must retain the above copyright
|
|
1582
|
+
notice, this list of conditions and the following disclaimer.
|
|
1583
|
+
* Redistributions in binary form must reproduce the above
|
|
1584
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
1585
|
+
in the documentation and/or other materials provided with the
|
|
1586
|
+
distribution.
|
|
1587
|
+
* Neither the name of Google Inc. nor the names of its
|
|
1588
|
+
contributors may be used to endorse or promote products derived from
|
|
1589
|
+
this software without specific prior written permission.
|
|
1590
|
+
|
|
1591
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
1592
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
1593
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
1594
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
1595
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
1596
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
1597
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
1598
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
1599
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
1600
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1601
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1602
|
+
|
|
1603
|
+
------------------
|
|
1604
|
+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
|
|
1548
1605
|
------------------
|
|
1549
1606
|
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
1550
1607
|
|
|
@@ -1575,7 +1632,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
1575
1632
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1576
1633
|
|
|
1577
1634
|
------------------
|
|
1578
|
-
golang.org/x/
|
|
1635
|
+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
|
|
1579
1636
|
------------------
|
|
1580
1637
|
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
1581
1638
|
|
|
@@ -1636,6 +1693,37 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
1636
1693
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1637
1694
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1638
1695
|
|
|
1696
|
+
------------------
|
|
1697
|
+
golang.org/x/tools v0.1.12
|
|
1698
|
+
------------------
|
|
1699
|
+
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
1700
|
+
|
|
1701
|
+
Redistribution and use in source and binary forms, with or without
|
|
1702
|
+
modification, are permitted provided that the following conditions are
|
|
1703
|
+
met:
|
|
1704
|
+
|
|
1705
|
+
* Redistributions of source code must retain the above copyright
|
|
1706
|
+
notice, this list of conditions and the following disclaimer.
|
|
1707
|
+
* Redistributions in binary form must reproduce the above
|
|
1708
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
1709
|
+
in the documentation and/or other materials provided with the
|
|
1710
|
+
distribution.
|
|
1711
|
+
* Neither the name of Google Inc. nor the names of its
|
|
1712
|
+
contributors may be used to endorse or promote products derived from
|
|
1713
|
+
this software without specific prior written permission.
|
|
1714
|
+
|
|
1715
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
1716
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
1717
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
1718
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
1719
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
1720
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
1721
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
1722
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
1723
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
1724
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1725
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1726
|
+
|
|
1639
1727
|
------------------
|
|
1640
1728
|
gonum.org/v1/gonum v0.16.0
|
|
1641
1729
|
------------------
|
|
@@ -1662,6 +1750,89 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
1662
1750
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
1663
1751
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1664
1752
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1753
|
+
------------------
|
|
1754
|
+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
|
|
1755
|
+
------------------
|
|
1756
|
+
Gocheck - A rich testing framework for Go
|
|
1757
|
+
|
|
1758
|
+
Copyright (c) 2010-2013 Gustavo Niemeyer <gustavo@niemeyer.net>
|
|
1759
|
+
|
|
1760
|
+
All rights reserved.
|
|
1761
|
+
|
|
1762
|
+
Redistribution and use in source and binary forms, with or without
|
|
1763
|
+
modification, are permitted provided that the following conditions are met:
|
|
1764
|
+
|
|
1765
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
1766
|
+
list of conditions and the following disclaimer.
|
|
1767
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
1768
|
+
this list of conditions and the following disclaimer in the documentation
|
|
1769
|
+
and/or other materials provided with the distribution.
|
|
1770
|
+
|
|
1771
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
1772
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
1773
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
1774
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
1775
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
1776
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
1777
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
1778
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
1779
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
1780
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1781
|
+
|
|
1782
|
+
------------------
|
|
1783
|
+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
|
|
1784
|
+
------------------
|
|
1785
|
+
|
|
1786
|
+
This project is covered by two different licenses: MIT and Apache.
|
|
1787
|
+
|
|
1788
|
+
#### MIT License ####
|
|
1789
|
+
|
|
1790
|
+
The following files were ported to Go from C files of libyaml, and thus
|
|
1791
|
+
are still covered by their original MIT license, with the additional
|
|
1792
|
+
copyright staring in 2011 when the project was ported over:
|
|
1793
|
+
|
|
1794
|
+
apic.go emitterc.go parserc.go readerc.go scannerc.go
|
|
1795
|
+
writerc.go yamlh.go yamlprivateh.go
|
|
1796
|
+
|
|
1797
|
+
Copyright (c) 2006-2010 Kirill Simonov
|
|
1798
|
+
Copyright (c) 2006-2011 Kirill Simonov
|
|
1799
|
+
|
|
1800
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
1801
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
1802
|
+
the Software without restriction, including without limitation the rights to
|
|
1803
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
1804
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
1805
|
+
so, subject to the following conditions:
|
|
1806
|
+
|
|
1807
|
+
The above copyright notice and this permission notice shall be included in all
|
|
1808
|
+
copies or substantial portions of the Software.
|
|
1809
|
+
|
|
1810
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1811
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1812
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1813
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1814
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1815
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1816
|
+
SOFTWARE.
|
|
1817
|
+
|
|
1818
|
+
### Apache License ###
|
|
1819
|
+
|
|
1820
|
+
All the remaining project files are covered by the Apache license:
|
|
1821
|
+
|
|
1822
|
+
Copyright (c) 2011-2019 Canonical Ltd
|
|
1823
|
+
|
|
1824
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
1825
|
+
you may not use this file except in compliance with the License.
|
|
1826
|
+
You may obtain a copy of the License at
|
|
1827
|
+
|
|
1828
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
1829
|
+
|
|
1830
|
+
Unless required by applicable law or agreed to in writing, software
|
|
1831
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
1832
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1833
|
+
See the License for the specific language governing permissions and
|
|
1834
|
+
limitations under the License.
|
|
1835
|
+
|
|
1665
1836
|
------------------
|
|
1666
1837
|
gotest.tools v2.2.0+incompatible
|
|
1667
1838
|
------------------
|
|
Binary file
|
package/dist/lib/library.js
CHANGED
package/dist/lib/library.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/library.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,mDAAqC;AACrC,qDAAuC;AAIvC,MAAa,OAAO;IAClB;;;;OAIG;IACI,MAAM,CAAC,YAAY,CACxB,IAAmB,EACnB,QAAiB;QAEjB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,QAAQ;YAClB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC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QAEb,MAAM,OAAO,GAAsD;YACjE,GAAG,QAAQ,CAAC,sBAAsB,CAAC,OAAO;YAC1C,IAAI,EAAE,IAAI;YACV,QAAQ;gBACN,OAAO,QAAQ,CAAC,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,2BAA2B,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,oBAAoB,CAChC,MAAc;QAEd,MAAM,OAAO,GAA0C;YACrD,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO;YAC9B,KAAK,EAAE,MAAM;YACb,QAAQ;gBACN,OAAO,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,YAAY;QACxB,MAAM,OAAO,GAAmD;YAC9D,GAAG,QAAQ,CAAC,mBAAmB,CAAC,OAAO;YACvC,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,QAAQ;YACjB,QAAQ;gBACN,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,CAAC;SACF,CAAC;QAEF,OAAO,CAAC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACF;AAxKD,0BAwKC;AAED,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,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 { LogOutputMode } from './log_output_mode';\nimport { DeviceDbSourceType } from './device_db_source_type';\n\nexport class Library {\n /**\n * Sets library logging output.\n * @param mode Logging output mode.\n * @param filePath Path of the file to open.\n */\n public static setLogOutput(\n mode: LogOutputMode,\n filePath?: string\n ): void {\n const request: requests.SetLogOutputRequest & gateway.Message = {\n ...requests.SetLogOutputRequest.DEFAULT,\n mode: mode,\n filePath: filePath,\n toBinary() {\n return requests.SetLogOutputRequest.toBinary(this);\n },\n };\n\n gateway.callSync('logging/set_output', request);\n }\n\n /**\n * Sets source of Device DB data. Allows selection of a web service or a local file.\n * @param sourceType Source type.\n * @param urlOrFilePath URL of the web service or path to the local file.\n * Leave empty for the default URL of Zaber web service.\n */\n public static setDeviceDbSource(\n sourceType: DeviceDbSourceType,\n urlOrFilePath?: string\n ): void {\n const request: requests.SetDeviceDbSourceRequest & gateway.Message = {\n ...requests.SetDeviceDbSourceRequest.DEFAULT,\n sourceType: sourceType,\n urlOrFilePath: urlOrFilePath,\n toBinary() {\n return requests.SetDeviceDbSourceRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/set_source', request);\n }\n\n /**\n * Enables Device DB store.\n * The store uses filesystem to save information obtained from the Device DB.\n * The stored data are later used instead of the Device DB.\n * @param storeLocation Specifies relative or absolute path of the folder used by the store.\n * If left empty defaults to a folder in user home directory.\n * Must be accessible by the process.\n */\n public static enableDeviceDbStore(\n storeLocation?: string\n ): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toggleOn: true,\n storeLocation: storeLocation,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Disables Device DB store.\n */\n public static disableDeviceDbStore(): void {\n const request: requests.ToggleDeviceDbStoreRequest & gateway.Message = {\n ...requests.ToggleDeviceDbStoreRequest.DEFAULT,\n toBinary() {\n return requests.ToggleDeviceDbStoreRequest.toBinary(this);\n },\n };\n\n gateway.callSync('device_db/toggle_store', request);\n }\n\n /**\n * Checks if the Device DB store is currently enabled.\n * @returns True if the Device DB store is enabled.\n */\n public static isDeviceDbStoreEnabled(): boolean {\n const request: requests.EmptyRequest & gateway.Message = {\n ...requests.EmptyRequest.DEFAULT,\n toBinary() {\n return requests.EmptyRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.BoolResponse>(\n 'device_db/check_store',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Clears the Device DB store on the local filesystem.\n * Note: If the device DB was enabled with a custom store location, store files will be removed in that location.\n */\n public static async clearDeviceDbStore(): Promise<void> {\n const request: requests.EmptyRequest & gateway.Message = {\n ...requests.EmptyRequest.DEFAULT,\n toBinary() {\n return requests.EmptyRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device_db/clear_store', request);\n }\n\n /**\n * Disables certain customer checks (like FF flag).\n * @param mode Whether to turn internal mode on or off.\n */\n public static setInternalMode(\n mode: boolean\n ): void {\n const request: requests.SetInternalModeRequest & gateway.Message = {\n ...requests.SetInternalModeRequest.DEFAULT,\n mode: mode,\n toBinary() {\n return requests.SetInternalModeRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_internal_mode', request);\n }\n\n /**\n * Sets the period between polling for IDLE during movements.\n * Caution: Setting the period too low may cause performance issues.\n * @param period Period in milliseconds.\n * Negative value restores the default period.\n */\n public static setIdlePollingPeriod(\n period: number\n ): void {\n const request: requests.IntRequest & gateway.Message = {\n ...requests.IntRequest.DEFAULT,\n value: period,\n toBinary() {\n return requests.IntRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/set_idle_polling_period', request);\n }\n\n /**\n * Throws an error if the version of the loaded shared library does not match the caller's version.\n */\n public static checkVersion(): void {\n const request: requests.CheckVersionRequest & gateway.Message = {\n ...requests.CheckVersionRequest.DEFAULT,\n host: 'js',\n version: '7.10.0',\n toBinary() {\n return requests.CheckVersionRequest.toBinary(this);\n },\n };\n\n gateway.callSync('library/check_version', request);\n }\n}\n\ngateway.addInitCallback(Library.checkVersion);\n"]}
|
|
@@ -45,6 +45,7 @@ export declare class Autofocus {
|
|
|
45
45
|
* Moves the focus axis continuously maintaining focus.
|
|
46
46
|
* Starts the autofocus control loop.
|
|
47
47
|
* Note that the control loop may stop if the autofocus comes out of range or a movement error occurs.
|
|
48
|
+
* Use WaitUntilIdle of the focus axis to wait for the loop to stop and handle potential errors.
|
|
48
49
|
*/
|
|
49
50
|
startFocusLoop(): Promise<void>;
|
|
50
51
|
/**
|
|
@@ -52,6 +53,12 @@ export declare class Autofocus {
|
|
|
52
53
|
* If the focus axis already stopped moving because of an error, an exception will be thrown.
|
|
53
54
|
*/
|
|
54
55
|
stopFocusLoop(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns bool indicating whether the focus axis is busy.
|
|
58
|
+
* Can be used to determine if the focus loop is running.
|
|
59
|
+
* @returns True if the axis is currently executing a motion command.
|
|
60
|
+
*/
|
|
61
|
+
isBusy(): Promise<boolean>;
|
|
55
62
|
/**
|
|
56
63
|
* Gets the lower motion limit for the autofocus control loop.
|
|
57
64
|
* Gets motion.tracking.limit.min setting of the focus axis.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autofocus.d.ts","sourceRoot":"","sources":["../../../src/microscopy/autofocus.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAS,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD;;GAEG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IACD,OAAO,CAAC,WAAW,CAAS;IAE5B;;OAEG;IACH,IAAW,SAAS,IAAI,IAAI,CAE3B;IACD,OAAO,CAAC,UAAU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autofocus control loop.
|
|
123
123
|
* Note that the control loop may stop if the autofocus comes out of range or a movement error occurs.
|
|
124
|
+
* Use WaitUntilIdle of the focus axis to wait for the loop to stop and handle potential errors.
|
|
124
125
|
*/
|
|
125
126
|
async startFocusLoop() {
|
|
126
127
|
const request = {
|
|
@@ -154,6 +155,24 @@ class Autofocus {
|
|
|
154
155
|
};
|
|
155
156
|
await gateway.callAsync('autofocus/stop_focus_loop', request);
|
|
156
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Returns bool indicating whether the focus axis is busy.
|
|
160
|
+
* Can be used to determine if the focus loop is running.
|
|
161
|
+
* @returns True if the axis is currently executing a motion command.
|
|
162
|
+
*/
|
|
163
|
+
async isBusy() {
|
|
164
|
+
const request = {
|
|
165
|
+
...requests.AxisEmptyRequest.DEFAULT,
|
|
166
|
+
interfaceId: this.focusAxis.device.connection.interfaceId,
|
|
167
|
+
device: this.focusAxis.device.deviceAddress,
|
|
168
|
+
axis: this.focusAxis.axisNumber,
|
|
169
|
+
toBinary() {
|
|
170
|
+
return requests.AxisEmptyRequest.toBinary(this);
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
const response = await gateway.callAsync('device/is_busy', request, requests.BoolResponse.fromBinary);
|
|
174
|
+
return response.value;
|
|
175
|
+
}
|
|
157
176
|
/**
|
|
158
177
|
* Gets the lower motion limit for the autofocus control loop.
|
|
159
178
|
* Gets motion.tracking.limit.min setting of the focus axis.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autofocus.js","sourceRoot":"","sources":["../../../src/microscopy/autofocus.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AAGxC,oCAAwD;AAKxD;;GAEG;AACH,MAAa,SAAS;IACpB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IAC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============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Device } from '../ascii/device';\nimport { Axis } from '../ascii/axis';\nimport { Angle, Length, Native, Units } from '../units';\nimport { NamedParameter } from '../named_parameter';\nimport { AutofocusStatus } from './autofocus_status';\n\n\n/**\n * A generic autofocus device.\n */\nexport class Autofocus {\n /**\n * The identification of external device providing the capability.\n */\n public get providerId(): number {\n return this._providerId;\n }\n private _providerId: number;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n /**\n * The objective turret device if the microscope has one.\n */\n public get objectiveTurret(): Device | undefined {\n return this._objectiveTurret;\n }\n private _objectiveTurret: Device | undefined;\n\n /**\n * Creates instance of `Autofocus` based on the given provider id.\n */\n constructor(providerId: number, focusAxis: Axis, objectiveTurret?: Device) {\n this._providerId = providerId;\n this._focusAxis = focusAxis;\n this._objectiveTurret = objectiveTurret;\n }\n\n /**\n * Sets the current focus to be target for the autofocus control loop.\n */\n public async setFocusZero(): Promise<void> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/set_zero', request);\n }\n\n /**\n * Returns the status of the autofocus.\n * @returns The status of the autofocus.\n */\n public async getStatus(): Promise<AutofocusStatus> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.AutofocusGetStatusResponse>(\n 'autofocus/get_status',\n request,\n requests.AutofocusGetStatusResponse.fromBinary);\n return response.status;\n }\n\n /**\n * Moves the device until it's in focus.\n * @param [scan=false] If true, the autofocus will approach from the limit moving until it's in range.\n * @param [timeout=-1] Sets autofocus timeout duration in milliseconds.\n */\n public async focusOnce(\n scan: boolean = false,\n timeout: number = -1\n ): Promise<void> {\n const request: requests.AutofocusFocusRequest & gateway.Message = {\n ...requests.AutofocusFocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n once: true,\n scan: scan,\n timeout: timeout,\n toBinary() {\n return requests.AutofocusFocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/focus_once', request);\n }\n\n /**\n * Moves the focus axis continuously maintaining focus.\n * Starts the autofocus control loop.\n * Note that the control loop may stop if the autofocus comes out of range or a movement error occurs.\n */\n public async startFocusLoop(): Promise<void> {\n const request: requests.AutofocusFocusRequest & gateway.Message = {\n ...requests.AutofocusFocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.AutofocusFocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/start_focus_loop', request);\n }\n\n /**\n * Stops autofocus control loop.\n * If the focus axis already stopped moving because of an error, an exception will be thrown.\n */\n public async stopFocusLoop(): Promise<void> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/stop_focus_loop', request);\n }\n\n /**\n * Gets the lower motion limit for the autofocus control loop.\n * Gets motion.tracking.limit.min setting of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n * @returns Limit value.\n */\n public async getLimitMin(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.min',\n unit: unit,\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the upper motion limit for the autofocus control loop.\n * Gets motion.tracking.limit.max setting of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n * @returns Limit value.\n */\n public async getLimitMax(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.max',\n unit: unit,\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the lower motion limit for the autofocus control loop.\n * Use the limits to prevent the focus axis from crashing into the sample.\n * Changes motion.tracking.limit.min setting of the focus axis.\n * @param limit The lower limit of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n */\n public async setLimitMin(\n limit: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.min',\n value: limit,\n unit: unit,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Sets the upper motion limit for the autofocus control loop.\n * Use the limits to prevent the focus axis from crashing into the sample.\n * Changes motion.tracking.limit.max setting of the focus axis.\n * @param limit The upper limit of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n */\n public async setLimitMax(\n limit: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.max',\n value: limit,\n unit: unit,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Typically, the control loop parameters and objective are kept synchronized by the library.\n * If the parameters or current objective changes outside of the library, call this method to synchronize them.\n */\n public async synchronizeParameters(): Promise<void> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/sync_params', request);\n }\n\n /**\n * Sets the parameters for the autofocus objective.\n * Note that the method temporarily switches current objective to set the parameters.\n * @param objective The objective (numbered from 1) to set the parameters for.\n * If your microscope has only one objective, use value of 1.\n * @param parameters The parameters for the autofocus objective.\n */\n public async setObjectiveParameters(\n objective: number,\n parameters: NamedParameter[]\n ): Promise<void> {\n const request: requests.AutofocusSetObjectiveParamsRequest & gateway.Message = {\n ...requests.AutofocusSetObjectiveParamsRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n objective: objective,\n parameters: parameters,\n toBinary() {\n return requests.AutofocusSetObjectiveParamsRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/set_objective_params', request);\n }\n\n /**\n * Returns the parameters for the autofocus objective.\n * @param objective The objective (numbered from 1) to get the parameters for.\n * If your microscope has only one objective, use value of 1.\n * Note that the method temporarily switches current objective to get the parameters.\n * @returns The parameters for the autofocus objective.\n */\n public async getObjectiveParameters(\n objective: number\n ): Promise<NamedParameter[]> {\n const request: requests.AutofocusGetObjectiveParamsRequest & gateway.Message = {\n ...requests.AutofocusGetObjectiveParamsRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n objective: objective,\n toBinary() {\n return requests.AutofocusGetObjectiveParamsRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.AutofocusGetObjectiveParamsResponse>(\n 'autofocus/get_objective_params',\n request,\n requests.AutofocusGetObjectiveParamsResponse.fromBinary);\n return response.parameters;\n }\n\n /**\n * Returns a string that represents the autofocus.\n * @returns A string that represents the autofocus.\n */\n public toString(): string {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'autofocus/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Autofocus {\n}\n"]}
|
|
1
|
+
{"version":3,"file":"autofocus.js","sourceRoot":"","sources":["../../../src/microscopy/autofocus.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,sDAAsD;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,oDAAsC;AACtC,sDAAwC;AAGxC,oCAAwD;AAKxD;;GAEG;AACH,MAAa,SAAS;IACpB;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD;;OAEG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD;;OAEG;IACH,IAAW,eAAe;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAGD;;OAEG;IACH,YAAY,UAAkB,EAAE,SAAe,EAAE,eAAwB;QACvE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAY;QACvB,MAAM,OAAO,GAAqD;YAChE,GAAG,QAAQ,CAAC,qBAAqB,CAAC,OAAO;YACzC,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,MA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A TEMPLATE ==== //\n// ============= DO NOT EDIT DIRECTLY ============= //\n\nimport * as gateway from '../gateway';\nimport * as requests from '../requests';\nimport { Device } from '../ascii/device';\nimport { Axis } from '../ascii/axis';\nimport { Angle, Length, Native, Units } from '../units';\nimport { NamedParameter } from '../named_parameter';\nimport { AutofocusStatus } from './autofocus_status';\n\n\n/**\n * A generic autofocus device.\n */\nexport class Autofocus {\n /**\n * The identification of external device providing the capability.\n */\n public get providerId(): number {\n return this._providerId;\n }\n private _providerId: number;\n\n /**\n * The focus axis.\n */\n public get focusAxis(): Axis {\n return this._focusAxis;\n }\n private _focusAxis: Axis;\n\n /**\n * The objective turret device if the microscope has one.\n */\n public get objectiveTurret(): Device | undefined {\n return this._objectiveTurret;\n }\n private _objectiveTurret: Device | undefined;\n\n /**\n * Creates instance of `Autofocus` based on the given provider id.\n */\n constructor(providerId: number, focusAxis: Axis, objectiveTurret?: Device) {\n this._providerId = providerId;\n this._focusAxis = focusAxis;\n this._objectiveTurret = objectiveTurret;\n }\n\n /**\n * Sets the current focus to be target for the autofocus control loop.\n */\n public async setFocusZero(): Promise<void> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/set_zero', request);\n }\n\n /**\n * Returns the status of the autofocus.\n * @returns The status of the autofocus.\n */\n public async getStatus(): Promise<AutofocusStatus> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.AutofocusGetStatusResponse>(\n 'autofocus/get_status',\n request,\n requests.AutofocusGetStatusResponse.fromBinary);\n return response.status;\n }\n\n /**\n * Moves the device until it's in focus.\n * @param [scan=false] If true, the autofocus will approach from the limit moving until it's in range.\n * @param [timeout=-1] Sets autofocus timeout duration in milliseconds.\n */\n public async focusOnce(\n scan: boolean = false,\n timeout: number = -1\n ): Promise<void> {\n const request: requests.AutofocusFocusRequest & gateway.Message = {\n ...requests.AutofocusFocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n once: true,\n scan: scan,\n timeout: timeout,\n toBinary() {\n return requests.AutofocusFocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/focus_once', request);\n }\n\n /**\n * Moves the focus axis continuously maintaining focus.\n * Starts the autofocus control loop.\n * Note that the control loop may stop if the autofocus comes out of range or a movement error occurs.\n * Use WaitUntilIdle of the focus axis to wait for the loop to stop and handle potential errors.\n */\n public async startFocusLoop(): Promise<void> {\n const request: requests.AutofocusFocusRequest & gateway.Message = {\n ...requests.AutofocusFocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.AutofocusFocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/start_focus_loop', request);\n }\n\n /**\n * Stops autofocus control loop.\n * If the focus axis already stopped moving because of an error, an exception will be thrown.\n */\n public async stopFocusLoop(): Promise<void> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/stop_focus_loop', request);\n }\n\n /**\n * Returns bool indicating whether the focus axis is busy.\n * Can be used to determine if the focus loop is running.\n * @returns True if the axis is currently executing a motion command.\n */\n public async isBusy(): Promise<boolean> {\n const request: requests.AxisEmptyRequest & gateway.Message = {\n ...requests.AxisEmptyRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n toBinary() {\n return requests.AxisEmptyRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.BoolResponse>(\n 'device/is_busy',\n request,\n requests.BoolResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the lower motion limit for the autofocus control loop.\n * Gets motion.tracking.limit.min setting of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n * @returns Limit value.\n */\n public async getLimitMin(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.min',\n unit: unit,\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Gets the upper motion limit for the autofocus control loop.\n * Gets motion.tracking.limit.max setting of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n * @returns Limit value.\n */\n public async getLimitMax(\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<number> {\n const request: requests.DeviceGetSettingRequest & gateway.Message = {\n ...requests.DeviceGetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.max',\n unit: unit,\n toBinary() {\n return requests.DeviceGetSettingRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.DoubleResponse>(\n 'device/get_setting',\n request,\n requests.DoubleResponse.fromBinary);\n return response.value;\n }\n\n /**\n * Sets the lower motion limit for the autofocus control loop.\n * Use the limits to prevent the focus axis from crashing into the sample.\n * Changes motion.tracking.limit.min setting of the focus axis.\n * @param limit The lower limit of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n */\n public async setLimitMin(\n limit: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.min',\n value: limit,\n unit: unit,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Sets the upper motion limit for the autofocus control loop.\n * Use the limits to prevent the focus axis from crashing into the sample.\n * Changes motion.tracking.limit.max setting of the focus axis.\n * @param limit The upper limit of the focus axis.\n * @param [unit=Units.NATIVE] The units of the limit.\n */\n public async setLimitMax(\n limit: number,\n unit: Length | Angle | Native = Units.NATIVE\n ): Promise<void> {\n const request: requests.DeviceSetSettingRequest & gateway.Message = {\n ...requests.DeviceSetSettingRequest.DEFAULT,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n device: this.focusAxis.device.deviceAddress,\n axis: this.focusAxis.axisNumber,\n setting: 'motion.tracking.limit.max',\n value: limit,\n unit: unit,\n toBinary() {\n return requests.DeviceSetSettingRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('device/set_setting', request);\n }\n\n /**\n * Typically, the control loop parameters and objective are kept synchronized by the library.\n * If the parameters or current objective changes outside of the library, call this method to synchronize them.\n */\n public async synchronizeParameters(): Promise<void> {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/sync_params', request);\n }\n\n /**\n * Sets the parameters for the autofocus objective.\n * Note that the method temporarily switches current objective to set the parameters.\n * @param objective The objective (numbered from 1) to set the parameters for.\n * If your microscope has only one objective, use value of 1.\n * @param parameters The parameters for the autofocus objective.\n */\n public async setObjectiveParameters(\n objective: number,\n parameters: NamedParameter[]\n ): Promise<void> {\n const request: requests.AutofocusSetObjectiveParamsRequest & gateway.Message = {\n ...requests.AutofocusSetObjectiveParamsRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n objective: objective,\n parameters: parameters,\n toBinary() {\n return requests.AutofocusSetObjectiveParamsRequest.toBinary(this);\n },\n };\n\n await gateway.callAsync('autofocus/set_objective_params', request);\n }\n\n /**\n * Returns the parameters for the autofocus objective.\n * @param objective The objective (numbered from 1) to get the parameters for.\n * If your microscope has only one objective, use value of 1.\n * Note that the method temporarily switches current objective to get the parameters.\n * @returns The parameters for the autofocus objective.\n */\n public async getObjectiveParameters(\n objective: number\n ): Promise<NamedParameter[]> {\n const request: requests.AutofocusGetObjectiveParamsRequest & gateway.Message = {\n ...requests.AutofocusGetObjectiveParamsRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n objective: objective,\n toBinary() {\n return requests.AutofocusGetObjectiveParamsRequest.toBinary(this);\n },\n };\n\n const response = await gateway.callAsync<requests.AutofocusGetObjectiveParamsResponse>(\n 'autofocus/get_objective_params',\n request,\n requests.AutofocusGetObjectiveParamsResponse.fromBinary);\n return response.parameters;\n }\n\n /**\n * Returns a string that represents the autofocus.\n * @returns A string that represents the autofocus.\n */\n public toString(): string {\n const request: requests.EmptyAutofocusRequest & gateway.Message = {\n ...requests.EmptyAutofocusRequest.DEFAULT,\n providerId: this.providerId,\n interfaceId: this.focusAxis.device.connection.interfaceId,\n focusAddress: this.focusAxis.device.deviceAddress,\n focusAxis: this.focusAxis.axisNumber,\n turretAddress: this.objectiveTurret?.deviceAddress ?? 0,\n toBinary() {\n return requests.EmptyAutofocusRequest.toBinary(this);\n },\n };\n\n const response = gateway.callSync<requests.StringResponse>(\n 'autofocus/to_string',\n request,\n requests.StringResponse.fromBinary);\n return response.value;\n }\n}\n\nnamespace Autofocus {\n}\n"]}
|