QInstrument 3.0.2__tar.gz → 3.1.0__tar.gz

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 (143) hide show
  1. {qinstrument-3.0.2 → qinstrument-3.1.0}/PKG-INFO +30 -6
  2. {qinstrument-3.0.2 → qinstrument-3.1.0}/QInstrument.egg-info/PKG-INFO +30 -6
  3. {qinstrument-3.0.2 → qinstrument-3.1.0}/QInstrument.egg-info/SOURCES.txt +28 -2
  4. qinstrument-3.1.0/QInstrument.egg-info/requires.txt +44 -0
  5. {qinstrument-3.0.2 → qinstrument-3.1.0}/QInstrumentRack.py +19 -14
  6. qinstrument-3.1.0/instruments/IPGPhotonics/IPGLaser/IPGLaserWidget_ui.py +34 -0
  7. qinstrument-3.1.0/instruments/IPGPhotonics/IPGLaser/__init__.py +10 -0
  8. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/IPGPhotonics/IPGLaser/fake.py +1 -0
  9. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/IPGPhotonics/IPGLaser/instrument.py +3 -2
  10. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/IPGPhotonics/IPGLaser/widget.py +8 -2
  11. qinstrument-3.1.0/instruments/Novanta/Opus/OpusWidget_ui.py +25 -0
  12. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus/__init__.py +1 -1
  13. qinstrument-3.0.2/instruments/Novanta/Opus/widget.py → qinstrument-3.1.0/instruments/Novanta/Opus/_widget.py +18 -7
  14. qinstrument-3.1.0/instruments/Novanta/Opus/fake.py +74 -0
  15. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus/instrument.py +59 -31
  16. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus1064/widget.py +1 -1
  17. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus532/widget.py +1 -1
  18. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus660/widget.py +1 -1
  19. qinstrument-3.1.0/instruments/PiezoDrive/PDUS210/PDUS210Widget_ui.py +42 -0
  20. qinstrument-3.1.0/instruments/PiezoDrive/PDUS210/__init__.py +10 -0
  21. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PiezoDrive/PDUS210/fake.py +3 -1
  22. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PiezoDrive/PDUS210/instrument.py +6 -3
  23. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PiezoDrive/PDUS210/widget.py +8 -1
  24. qinstrument-3.1.0/instruments/PriorScientific/Proscan/ProscanWidget_ui.py +46 -0
  25. qinstrument-3.1.0/instruments/PriorScientific/Proscan/__init__.py +10 -0
  26. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PriorScientific/Proscan/fake.py +4 -2
  27. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PriorScientific/Proscan/instrument.py +11 -6
  28. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PriorScientific/Proscan/widget.py +28 -9
  29. qinstrument-3.1.0/instruments/StanfordResearch/DS345/DS345Widget_ui.py +38 -0
  30. qinstrument-3.1.0/instruments/StanfordResearch/DS345/__init__.py +10 -0
  31. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/DS345/fake.py +3 -1
  32. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/DS345/instrument.py +11 -7
  33. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/DS345/tree.py +1 -1
  34. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/DS345/widget.py +8 -1
  35. qinstrument-3.1.0/instruments/StanfordResearch/SR830/SR830Widget_ui.py +42 -0
  36. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR830/fake.py +1 -0
  37. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR830/instrument.py +11 -7
  38. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR830/tree.py +1 -1
  39. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR830/widget.py +8 -1
  40. qinstrument-3.1.0/instruments/StanfordResearch/SR844/SR844Widget_ui.py +37 -0
  41. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR844/fake.py +1 -0
  42. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR844/instrument.py +13 -8
  43. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR844/tree.py +1 -1
  44. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR844/widget.py +8 -1
  45. qinstrument-3.1.0/instruments/Tektronix/TDS1000/instrument.py +158 -0
  46. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/__init__.py +1 -1
  47. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/Configure.py +7 -6
  48. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QAbstractInstrument.py +3 -2
  49. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QFakeInstrument.py +0 -1
  50. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QInstrumentTree.py +7 -6
  51. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QInstrumentWidget.py +51 -34
  52. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QPollingMixin.py +5 -2
  53. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QReconcileDialog.py +5 -2
  54. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QSerialInstrument.py +54 -15
  55. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/QSerialInterface.py +40 -13
  56. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/__init__.py +1 -1
  57. {qinstrument-3.0.2 → qinstrument-3.1.0}/lib/lazy.py +1 -1
  58. qinstrument-3.1.0/lib/uitypes.py +119 -0
  59. qinstrument-3.1.0/pyproject.toml +184 -0
  60. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QInstrumentWidget.py +15 -1
  61. qinstrument-3.1.0/tests/test_QJoystick.py +168 -0
  62. qinstrument-3.1.0/tests/test_QJoystickPad.py +111 -0
  63. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QLedWidget.py +13 -0
  64. qinstrument-3.1.0/tests/test_QRotaryEncoder.py +54 -0
  65. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QSerialInterface.py +29 -0
  66. qinstrument-3.1.0/tests/test_QTDS1000.py +116 -0
  67. qinstrument-3.1.0/tests/test_conventions.py +169 -0
  68. qinstrument-3.1.0/tests/test_docstrings.py +198 -0
  69. qinstrument-3.1.0/tests/test_import_cycles.py +47 -0
  70. qinstrument-3.1.0/tests/test_instrument_suite.py +137 -0
  71. qinstrument-3.1.0/tests/test_packaging.py +63 -0
  72. qinstrument-3.1.0/tests/test_uitypes.py +35 -0
  73. {qinstrument-3.0.2 → qinstrument-3.1.0}/widgets/QJoystick.py +2 -1
  74. {qinstrument-3.0.2 → qinstrument-3.1.0}/widgets/QJoystickPad.py +17 -5
  75. {qinstrument-3.0.2 → qinstrument-3.1.0}/widgets/QLedWidget.py +13 -1
  76. {qinstrument-3.0.2 → qinstrument-3.1.0}/widgets/QRotaryEncoder.py +1 -0
  77. {qinstrument-3.0.2 → qinstrument-3.1.0}/widgets/QRotaryEncoderSpinBox.py +33 -9
  78. {qinstrument-3.0.2 → qinstrument-3.1.0}/widgets/__init__.py +1 -1
  79. qinstrument-3.0.2/QInstrument.egg-info/requires.txt +0 -14
  80. qinstrument-3.0.2/instruments/IPGPhotonics/IPGLaser/__init__.py +0 -6
  81. qinstrument-3.0.2/instruments/Novanta/Opus/fake.py +0 -58
  82. qinstrument-3.0.2/instruments/PiezoDrive/PDUS210/__init__.py +0 -6
  83. qinstrument-3.0.2/instruments/PriorScientific/Proscan/__init__.py +0 -6
  84. qinstrument-3.0.2/instruments/StanfordResearch/DS345/__init__.py +0 -6
  85. qinstrument-3.0.2/instruments/Tektronix/TDS1000/instrument.py +0 -60
  86. qinstrument-3.0.2/pyproject.toml +0 -88
  87. {qinstrument-3.0.2 → qinstrument-3.1.0}/LICENSE.md +0 -0
  88. {qinstrument-3.0.2 → qinstrument-3.1.0}/QInstrument.egg-info/dependency_links.txt +0 -0
  89. {qinstrument-3.0.2 → qinstrument-3.1.0}/QInstrument.egg-info/entry_points.txt +0 -0
  90. {qinstrument-3.0.2 → qinstrument-3.1.0}/QInstrument.egg-info/top_level.txt +0 -0
  91. {qinstrument-3.0.2 → qinstrument-3.1.0}/README.md +0 -0
  92. {qinstrument-3.0.2 → qinstrument-3.1.0}/__init__.py +0 -0
  93. {qinstrument-3.0.2 → qinstrument-3.1.0}/__main__.py +0 -0
  94. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/IPGPhotonics/IPGLaser/IPGLaserWidget.ui +0 -0
  95. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/IPGPhotonics/IPGLaser/tree.py +0 -0
  96. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/IPGPhotonics/__init__.py +0 -0
  97. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus/OpusWidget.ui +0 -0
  98. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus/tree.py +0 -0
  99. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus1064/__init__.py +0 -0
  100. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus1064/fake.py +0 -0
  101. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus1064/instrument.py +0 -0
  102. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus1064/tree.py +0 -0
  103. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus532/__init__.py +0 -0
  104. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus532/fake.py +0 -0
  105. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus532/instrument.py +0 -0
  106. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus532/tree.py +0 -0
  107. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus660/__init__.py +0 -0
  108. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus660/fake.py +0 -0
  109. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus660/instrument.py +0 -0
  110. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/Opus660/tree.py +0 -0
  111. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Novanta/__init__.py +0 -0
  112. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PiezoDrive/PDUS210/PDUS210Widget.ui +0 -0
  113. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PiezoDrive/PDUS210/tree.py +0 -0
  114. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PiezoDrive/__init__.py +0 -0
  115. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PriorScientific/Proscan/ProscanWidget.ui +0 -0
  116. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PriorScientific/Proscan/tree.py +0 -0
  117. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/PriorScientific/__init__.py +0 -0
  118. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/DS345/DS345Widget.ui +0 -0
  119. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR830/SR830Widget.ui +0 -0
  120. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR830/__init__.py +0 -0
  121. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR844/SR844Widget.ui +0 -0
  122. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/SR844/__init__.py +0 -0
  123. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/StanfordResearch/__init__.py +0 -0
  124. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Tektronix/TDS1000/__init__.py +0 -0
  125. {qinstrument-3.0.2 → qinstrument-3.1.0}/instruments/Tektronix/__init__.py +0 -0
  126. {qinstrument-3.0.2 → qinstrument-3.1.0}/setup.cfg +0 -0
  127. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_Configure.py +0 -0
  128. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QAbstractInstrument.py +0 -0
  129. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QDS345.py +0 -0
  130. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QFakeInstrument.py +0 -0
  131. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QIPGLaser.py +0 -0
  132. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QInstrumentRack.py +0 -0
  133. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QInstrumentTree.py +0 -0
  134. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QOpus.py +0 -0
  135. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QPDUS210.py +0 -0
  136. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QPollingMixin.py +0 -0
  137. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QProscan.py +0 -0
  138. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QReconcileDialog.py +0 -0
  139. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QRotaryEncoderSpinBox.py +0 -0
  140. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QSR830.py +0 -0
  141. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QSR844.py +0 -0
  142. {qinstrument-3.0.2 → qinstrument-3.1.0}/tests/test_QSerialInstrument.py +0 -0
  143. {qinstrument-3.0.2 → qinstrument-3.1.0}/widgets/QRotaryEncoderSpinBox.ui +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QInstrument
3
- Version: 3.0.2
3
+ Version: 3.1.0
4
4
  Summary: Qt-based framework for controlling scientific instruments over serial ports
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -24,19 +24,20 @@ License: GNU GENERAL PUBLIC LICENSE
24
24
  Project-URL: Homepage, https://github.com/davidgrier/QInstrument
25
25
  Project-URL: Repository, https://github.com/davidgrier/QInstrument
26
26
  Project-URL: Documentation, https://qinstrument.readthedocs.io
27
- Project-URL: Changelog, https://github.com/davidgrier/QInstrument/blob/main/CHANGELOG.rst
27
+ Project-URL: Changelog, https://github.com/davidgrier/QInstrument/blob/main/CHANGELOG.md
28
28
  Project-URL: Issue Tracker, https://github.com/davidgrier/QInstrument/issues
29
29
  Keywords: scientific instruments,serial port,Qt,laboratory automation
30
30
  Classifier: Development Status :: 5 - Production/Stable
31
31
  Classifier: Intended Audience :: Science/Research
32
32
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
33
33
  Classifier: Programming Language :: Python :: 3
34
- Classifier: Programming Language :: Python :: 3.10
35
34
  Classifier: Programming Language :: Python :: 3.11
36
35
  Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: Python :: 3.13
37
+ Classifier: Programming Language :: Python :: 3.14
37
38
  Classifier: Topic :: Scientific/Engineering
38
39
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
39
- Requires-Python: >=3.10
40
+ Requires-Python: >=3.11
40
41
  Description-Content-Type: text/markdown
41
42
  License-File: LICENSE.md
42
43
  Requires-Dist: numpy>=1.20
@@ -47,9 +48,32 @@ Provides-Extra: docs
47
48
  Requires-Dist: sphinx>=8.0; extra == "docs"
48
49
  Requires-Dist: pydata-sphinx-theme>=0.16; extra == "docs"
49
50
  Requires-Dist: sphinx-autodoc-typehints>=2.0; extra == "docs"
51
+ Provides-Extra: test
52
+ Requires-Dist: QInstrument[tree]; extra == "test"
53
+ Requires-Dist: pytest>=7.0; extra == "test"
54
+ Requires-Dist: pytest-cov; extra == "test"
55
+ Requires-Dist: pytest-qt>=4.0; extra == "test"
56
+ Provides-Extra: pyqt5
57
+ Requires-Dist: PyQt5>=5.15; extra == "pyqt5"
58
+ Provides-Extra: pyqt6
59
+ Requires-Dist: PyQt6; extra == "pyqt6"
60
+ Provides-Extra: pyside6
61
+ Requires-Dist: PySide6>=6.7; extra == "pyside6"
62
+ Provides-Extra: dev-pyqt5
63
+ Requires-Dist: QInstrument[test]; extra == "dev-pyqt5"
64
+ Requires-Dist: PyQt5>=5.15; extra == "dev-pyqt5"
65
+ Provides-Extra: dev-pyqt6
66
+ Requires-Dist: QInstrument[test]; extra == "dev-pyqt6"
67
+ Requires-Dist: PyQt6; extra == "dev-pyqt6"
68
+ Provides-Extra: dev-pyside6
69
+ Requires-Dist: QInstrument[test]; extra == "dev-pyside6"
70
+ Requires-Dist: PySide6>=6.7; extra == "dev-pyside6"
50
71
  Provides-Extra: dev
51
- Requires-Dist: pytest>=7.0; extra == "dev"
52
- Requires-Dist: pytest-qt>=4.0; extra == "dev"
72
+ Requires-Dist: QInstrument[test]; extra == "dev"
73
+ Requires-Dist: PyQt6; extra == "dev"
74
+ Requires-Dist: ruff; extra == "dev"
75
+ Requires-Dist: pyright==1.1.414; extra == "dev"
76
+ Requires-Dist: pre-commit; extra == "dev"
53
77
  Dynamic: license-file
54
78
 
55
79
  # QInstrument
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QInstrument
3
- Version: 3.0.2
3
+ Version: 3.1.0
4
4
  Summary: Qt-based framework for controlling scientific instruments over serial ports
5
5
  Author-email: "David G. Grier" <david.grier@nyu.edu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -24,19 +24,20 @@ License: GNU GENERAL PUBLIC LICENSE
24
24
  Project-URL: Homepage, https://github.com/davidgrier/QInstrument
25
25
  Project-URL: Repository, https://github.com/davidgrier/QInstrument
26
26
  Project-URL: Documentation, https://qinstrument.readthedocs.io
27
- Project-URL: Changelog, https://github.com/davidgrier/QInstrument/blob/main/CHANGELOG.rst
27
+ Project-URL: Changelog, https://github.com/davidgrier/QInstrument/blob/main/CHANGELOG.md
28
28
  Project-URL: Issue Tracker, https://github.com/davidgrier/QInstrument/issues
29
29
  Keywords: scientific instruments,serial port,Qt,laboratory automation
30
30
  Classifier: Development Status :: 5 - Production/Stable
31
31
  Classifier: Intended Audience :: Science/Research
32
32
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
33
33
  Classifier: Programming Language :: Python :: 3
34
- Classifier: Programming Language :: Python :: 3.10
35
34
  Classifier: Programming Language :: Python :: 3.11
36
35
  Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: Python :: 3.13
37
+ Classifier: Programming Language :: Python :: 3.14
37
38
  Classifier: Topic :: Scientific/Engineering
38
39
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
39
- Requires-Python: >=3.10
40
+ Requires-Python: >=3.11
40
41
  Description-Content-Type: text/markdown
41
42
  License-File: LICENSE.md
42
43
  Requires-Dist: numpy>=1.20
@@ -47,9 +48,32 @@ Provides-Extra: docs
47
48
  Requires-Dist: sphinx>=8.0; extra == "docs"
48
49
  Requires-Dist: pydata-sphinx-theme>=0.16; extra == "docs"
49
50
  Requires-Dist: sphinx-autodoc-typehints>=2.0; extra == "docs"
51
+ Provides-Extra: test
52
+ Requires-Dist: QInstrument[tree]; extra == "test"
53
+ Requires-Dist: pytest>=7.0; extra == "test"
54
+ Requires-Dist: pytest-cov; extra == "test"
55
+ Requires-Dist: pytest-qt>=4.0; extra == "test"
56
+ Provides-Extra: pyqt5
57
+ Requires-Dist: PyQt5>=5.15; extra == "pyqt5"
58
+ Provides-Extra: pyqt6
59
+ Requires-Dist: PyQt6; extra == "pyqt6"
60
+ Provides-Extra: pyside6
61
+ Requires-Dist: PySide6>=6.7; extra == "pyside6"
62
+ Provides-Extra: dev-pyqt5
63
+ Requires-Dist: QInstrument[test]; extra == "dev-pyqt5"
64
+ Requires-Dist: PyQt5>=5.15; extra == "dev-pyqt5"
65
+ Provides-Extra: dev-pyqt6
66
+ Requires-Dist: QInstrument[test]; extra == "dev-pyqt6"
67
+ Requires-Dist: PyQt6; extra == "dev-pyqt6"
68
+ Provides-Extra: dev-pyside6
69
+ Requires-Dist: QInstrument[test]; extra == "dev-pyside6"
70
+ Requires-Dist: PySide6>=6.7; extra == "dev-pyside6"
50
71
  Provides-Extra: dev
51
- Requires-Dist: pytest>=7.0; extra == "dev"
52
- Requires-Dist: pytest-qt>=4.0; extra == "dev"
72
+ Requires-Dist: QInstrument[test]; extra == "dev"
73
+ Requires-Dist: PyQt6; extra == "dev"
74
+ Requires-Dist: ruff; extra == "dev"
75
+ Requires-Dist: pyright==1.1.414; extra == "dev"
76
+ Requires-Dist: pre-commit; extra == "dev"
53
77
  Dynamic: license-file
54
78
 
55
79
  # QInstrument
@@ -10,6 +10,7 @@ pyproject.toml
10
10
  ./instruments/__init__.py
11
11
  ./instruments/IPGPhotonics/__init__.py
12
12
  ./instruments/IPGPhotonics/IPGLaser/IPGLaserWidget.ui
13
+ ./instruments/IPGPhotonics/IPGLaser/IPGLaserWidget_ui.py
13
14
  ./instruments/IPGPhotonics/IPGLaser/__init__.py
14
15
  ./instruments/IPGPhotonics/IPGLaser/fake.py
15
16
  ./instruments/IPGPhotonics/IPGLaser/instrument.py
@@ -17,11 +18,12 @@ pyproject.toml
17
18
  ./instruments/IPGPhotonics/IPGLaser/widget.py
18
19
  ./instruments/Novanta/__init__.py
19
20
  ./instruments/Novanta/Opus/OpusWidget.ui
21
+ ./instruments/Novanta/Opus/OpusWidget_ui.py
20
22
  ./instruments/Novanta/Opus/__init__.py
23
+ ./instruments/Novanta/Opus/_widget.py
21
24
  ./instruments/Novanta/Opus/fake.py
22
25
  ./instruments/Novanta/Opus/instrument.py
23
26
  ./instruments/Novanta/Opus/tree.py
24
- ./instruments/Novanta/Opus/widget.py
25
27
  ./instruments/Novanta/Opus1064/__init__.py
26
28
  ./instruments/Novanta/Opus1064/fake.py
27
29
  ./instruments/Novanta/Opus1064/instrument.py
@@ -39,6 +41,7 @@ pyproject.toml
39
41
  ./instruments/Novanta/Opus660/widget.py
40
42
  ./instruments/PiezoDrive/__init__.py
41
43
  ./instruments/PiezoDrive/PDUS210/PDUS210Widget.ui
44
+ ./instruments/PiezoDrive/PDUS210/PDUS210Widget_ui.py
42
45
  ./instruments/PiezoDrive/PDUS210/__init__.py
43
46
  ./instruments/PiezoDrive/PDUS210/fake.py
44
47
  ./instruments/PiezoDrive/PDUS210/instrument.py
@@ -46,6 +49,7 @@ pyproject.toml
46
49
  ./instruments/PiezoDrive/PDUS210/widget.py
47
50
  ./instruments/PriorScientific/__init__.py
48
51
  ./instruments/PriorScientific/Proscan/ProscanWidget.ui
52
+ ./instruments/PriorScientific/Proscan/ProscanWidget_ui.py
49
53
  ./instruments/PriorScientific/Proscan/__init__.py
50
54
  ./instruments/PriorScientific/Proscan/fake.py
51
55
  ./instruments/PriorScientific/Proscan/instrument.py
@@ -53,18 +57,21 @@ pyproject.toml
53
57
  ./instruments/PriorScientific/Proscan/widget.py
54
58
  ./instruments/StanfordResearch/__init__.py
55
59
  ./instruments/StanfordResearch/DS345/DS345Widget.ui
60
+ ./instruments/StanfordResearch/DS345/DS345Widget_ui.py
56
61
  ./instruments/StanfordResearch/DS345/__init__.py
57
62
  ./instruments/StanfordResearch/DS345/fake.py
58
63
  ./instruments/StanfordResearch/DS345/instrument.py
59
64
  ./instruments/StanfordResearch/DS345/tree.py
60
65
  ./instruments/StanfordResearch/DS345/widget.py
61
66
  ./instruments/StanfordResearch/SR830/SR830Widget.ui
67
+ ./instruments/StanfordResearch/SR830/SR830Widget_ui.py
62
68
  ./instruments/StanfordResearch/SR830/__init__.py
63
69
  ./instruments/StanfordResearch/SR830/fake.py
64
70
  ./instruments/StanfordResearch/SR830/instrument.py
65
71
  ./instruments/StanfordResearch/SR830/tree.py
66
72
  ./instruments/StanfordResearch/SR830/widget.py
67
73
  ./instruments/StanfordResearch/SR844/SR844Widget.ui
74
+ ./instruments/StanfordResearch/SR844/SR844Widget_ui.py
68
75
  ./instruments/StanfordResearch/SR844/__init__.py
69
76
  ./instruments/StanfordResearch/SR844/fake.py
70
77
  ./instruments/StanfordResearch/SR844/instrument.py
@@ -84,6 +91,7 @@ pyproject.toml
84
91
  ./lib/QSerialInterface.py
85
92
  ./lib/__init__.py
86
93
  ./lib/lazy.py
94
+ ./lib/uitypes.py
87
95
  ./widgets/QJoystick.py
88
96
  ./widgets/QJoystickPad.py
89
97
  ./widgets/QLedWidget.py
@@ -100,6 +108,7 @@ QInstrument.egg-info/top_level.txt
100
108
  instruments/__init__.py
101
109
  instruments/IPGPhotonics/__init__.py
102
110
  instruments/IPGPhotonics/IPGLaser/IPGLaserWidget.ui
111
+ instruments/IPGPhotonics/IPGLaser/IPGLaserWidget_ui.py
103
112
  instruments/IPGPhotonics/IPGLaser/__init__.py
104
113
  instruments/IPGPhotonics/IPGLaser/fake.py
105
114
  instruments/IPGPhotonics/IPGLaser/instrument.py
@@ -107,11 +116,12 @@ instruments/IPGPhotonics/IPGLaser/tree.py
107
116
  instruments/IPGPhotonics/IPGLaser/widget.py
108
117
  instruments/Novanta/__init__.py
109
118
  instruments/Novanta/Opus/OpusWidget.ui
119
+ instruments/Novanta/Opus/OpusWidget_ui.py
110
120
  instruments/Novanta/Opus/__init__.py
121
+ instruments/Novanta/Opus/_widget.py
111
122
  instruments/Novanta/Opus/fake.py
112
123
  instruments/Novanta/Opus/instrument.py
113
124
  instruments/Novanta/Opus/tree.py
114
- instruments/Novanta/Opus/widget.py
115
125
  instruments/Novanta/Opus1064/__init__.py
116
126
  instruments/Novanta/Opus1064/fake.py
117
127
  instruments/Novanta/Opus1064/instrument.py
@@ -129,6 +139,7 @@ instruments/Novanta/Opus660/tree.py
129
139
  instruments/Novanta/Opus660/widget.py
130
140
  instruments/PiezoDrive/__init__.py
131
141
  instruments/PiezoDrive/PDUS210/PDUS210Widget.ui
142
+ instruments/PiezoDrive/PDUS210/PDUS210Widget_ui.py
132
143
  instruments/PiezoDrive/PDUS210/__init__.py
133
144
  instruments/PiezoDrive/PDUS210/fake.py
134
145
  instruments/PiezoDrive/PDUS210/instrument.py
@@ -136,6 +147,7 @@ instruments/PiezoDrive/PDUS210/tree.py
136
147
  instruments/PiezoDrive/PDUS210/widget.py
137
148
  instruments/PriorScientific/__init__.py
138
149
  instruments/PriorScientific/Proscan/ProscanWidget.ui
150
+ instruments/PriorScientific/Proscan/ProscanWidget_ui.py
139
151
  instruments/PriorScientific/Proscan/__init__.py
140
152
  instruments/PriorScientific/Proscan/fake.py
141
153
  instruments/PriorScientific/Proscan/instrument.py
@@ -143,18 +155,21 @@ instruments/PriorScientific/Proscan/tree.py
143
155
  instruments/PriorScientific/Proscan/widget.py
144
156
  instruments/StanfordResearch/__init__.py
145
157
  instruments/StanfordResearch/DS345/DS345Widget.ui
158
+ instruments/StanfordResearch/DS345/DS345Widget_ui.py
146
159
  instruments/StanfordResearch/DS345/__init__.py
147
160
  instruments/StanfordResearch/DS345/fake.py
148
161
  instruments/StanfordResearch/DS345/instrument.py
149
162
  instruments/StanfordResearch/DS345/tree.py
150
163
  instruments/StanfordResearch/DS345/widget.py
151
164
  instruments/StanfordResearch/SR830/SR830Widget.ui
165
+ instruments/StanfordResearch/SR830/SR830Widget_ui.py
152
166
  instruments/StanfordResearch/SR830/__init__.py
153
167
  instruments/StanfordResearch/SR830/fake.py
154
168
  instruments/StanfordResearch/SR830/instrument.py
155
169
  instruments/StanfordResearch/SR830/tree.py
156
170
  instruments/StanfordResearch/SR830/widget.py
157
171
  instruments/StanfordResearch/SR844/SR844Widget.ui
172
+ instruments/StanfordResearch/SR844/SR844Widget_ui.py
158
173
  instruments/StanfordResearch/SR844/__init__.py
159
174
  instruments/StanfordResearch/SR844/fake.py
160
175
  instruments/StanfordResearch/SR844/instrument.py
@@ -174,6 +189,7 @@ lib/QSerialInstrument.py
174
189
  lib/QSerialInterface.py
175
190
  lib/__init__.py
176
191
  lib/lazy.py
192
+ lib/uitypes.py
177
193
  tests/test_Configure.py
178
194
  tests/test_QAbstractInstrument.py
179
195
  tests/test_QDS345.py
@@ -182,17 +198,27 @@ tests/test_QIPGLaser.py
182
198
  tests/test_QInstrumentRack.py
183
199
  tests/test_QInstrumentTree.py
184
200
  tests/test_QInstrumentWidget.py
201
+ tests/test_QJoystick.py
202
+ tests/test_QJoystickPad.py
185
203
  tests/test_QLedWidget.py
186
204
  tests/test_QOpus.py
187
205
  tests/test_QPDUS210.py
188
206
  tests/test_QPollingMixin.py
189
207
  tests/test_QProscan.py
190
208
  tests/test_QReconcileDialog.py
209
+ tests/test_QRotaryEncoder.py
191
210
  tests/test_QRotaryEncoderSpinBox.py
192
211
  tests/test_QSR830.py
193
212
  tests/test_QSR844.py
194
213
  tests/test_QSerialInstrument.py
195
214
  tests/test_QSerialInterface.py
215
+ tests/test_QTDS1000.py
216
+ tests/test_conventions.py
217
+ tests/test_docstrings.py
218
+ tests/test_import_cycles.py
219
+ tests/test_instrument_suite.py
220
+ tests/test_packaging.py
221
+ tests/test_uitypes.py
196
222
  widgets/QJoystick.py
197
223
  widgets/QJoystickPad.py
198
224
  widgets/QLedWidget.py
@@ -0,0 +1,44 @@
1
+ numpy>=1.20
2
+ qtpy>=2.0
3
+
4
+ [dev]
5
+ QInstrument[test]
6
+ PyQt6
7
+ ruff
8
+ pyright==1.1.414
9
+ pre-commit
10
+
11
+ [dev-pyqt5]
12
+ QInstrument[test]
13
+ PyQt5>=5.15
14
+
15
+ [dev-pyqt6]
16
+ QInstrument[test]
17
+ PyQt6
18
+
19
+ [dev-pyside6]
20
+ QInstrument[test]
21
+ PySide6>=6.7
22
+
23
+ [docs]
24
+ sphinx>=8.0
25
+ pydata-sphinx-theme>=0.16
26
+ sphinx-autodoc-typehints>=2.0
27
+
28
+ [pyqt5]
29
+ PyQt5>=5.15
30
+
31
+ [pyqt6]
32
+ PyQt6
33
+
34
+ [pyside6]
35
+ PySide6>=6.7
36
+
37
+ [test]
38
+ QInstrument[tree]
39
+ pytest>=7.0
40
+ pytest-cov
41
+ pytest-qt>=4.0
42
+
43
+ [tree]
44
+ pyqtgraph>=0.13
@@ -42,19 +42,19 @@ class _DragHandle(QtWidgets.QLabel):
42
42
  self.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
43
43
  self.setCursor(QtCore.Qt.CursorShape.OpenHandCursor)
44
44
 
45
- def mousePressEvent(self, event: QtCore.QEvent) -> None:
46
- if event.button() == QtCore.Qt.MouseButton.LeftButton:
45
+ def mousePressEvent(self, event: QtGui.QMouseEvent | None) -> None:
46
+ if event and event.button() == QtCore.Qt.MouseButton.LeftButton:
47
47
  self.setCursor(QtCore.Qt.CursorShape.ClosedHandCursor)
48
48
  super().mousePressEvent(event)
49
49
 
50
- def mouseMoveEvent(self, event: QtCore.QEvent) -> None:
51
- if event.buttons() & QtCore.Qt.MouseButton.LeftButton:
50
+ def mouseMoveEvent(self, event: QtGui.QMouseEvent | None) -> None:
51
+ if event and event.buttons() & QtCore.Qt.MouseButton.LeftButton:
52
52
  self.dragging.emit(QtGui.QCursor.pos())
53
53
  super().mouseMoveEvent(event)
54
54
 
55
- def mouseReleaseEvent(self, event: QtCore.QEvent) -> None:
55
+ def mouseReleaseEvent(self, event: QtGui.QMouseEvent | None) -> None:
56
56
  self.setCursor(QtCore.Qt.CursorShape.OpenHandCursor)
57
- if event.button() == QtCore.Qt.MouseButton.LeftButton:
57
+ if event and event.button() == QtCore.Qt.MouseButton.LeftButton:
58
58
  self.dropped.emit(QtGui.QCursor.pos())
59
59
  super().mouseReleaseEvent(event)
60
60
 
@@ -261,9 +261,10 @@ class QInstrumentRack(QtWidgets.QWidget):
261
261
  layout.addStretch()
262
262
  return bar
263
263
 
264
- def _slotAt(self, index: int) -> '_InstrumentSlot | None':
264
+ def _slotAt(self, index: int) -> _InstrumentSlot | None:
265
265
  item = self._slots.itemAt(index)
266
- return item.widget() if item else None
266
+ slot = item.widget() if item else None
267
+ return slot if isinstance(slot, _InstrumentSlot) else None
267
268
 
268
269
  def _iterSlots(self):
269
270
  for i in range(self._slots.count()):
@@ -405,8 +406,9 @@ class QInstrumentRack(QtWidgets.QWidget):
405
406
  '''Remove and schedule deletion of all instrument widgets.'''
406
407
  while self._slots.count():
407
408
  item = self._slots.takeAt(0)
408
- if item.widget():
409
- item.widget().deleteLater()
409
+ widget = item.widget() if item is not None else None
410
+ if widget is not None:
411
+ widget.deleteLater()
410
412
 
411
413
  @classmethod
412
414
  def _instrumentPaths(cls):
@@ -457,12 +459,15 @@ class QInstrumentRack(QtWidgets.QWidget):
457
459
  def _removeInstrument(self, name: str) -> None:
458
460
  for i in range(self._slots.count()):
459
461
  if (slot := self._slotAt(i)) is not None and slot._name == name:
460
- self._slots.takeAt(i).widget().deleteLater()
462
+ item = self._slots.takeAt(i)
463
+ widget = item.widget() if item is not None else None
464
+ if widget is not None:
465
+ widget.deleteLater()
461
466
  self.adjustSize()
462
467
  break
463
468
 
464
469
  def _hoverSlot(self,
465
- slot: '_InstrumentSlot',
470
+ slot: _InstrumentSlot,
466
471
  hover_pos: QtCore.QPoint) -> None:
467
472
  '''Highlight the slot under the cursor during a drag.
468
473
 
@@ -486,7 +491,7 @@ class QInstrumentRack(QtWidgets.QWidget):
486
491
  s.setHighlighted(s is target and s is not slot)
487
492
 
488
493
  def _moveSlot(self,
489
- slot: '_InstrumentSlot',
494
+ slot: _InstrumentSlot,
490
495
  drop_pos: QtCore.QPoint) -> None:
491
496
  '''Move *slot* to the position of the slot under the drop point.
492
497
 
@@ -569,7 +574,7 @@ class QInstrumentRack(QtWidgets.QWidget):
569
574
  help='use fake instruments')
570
575
  args, _ = parser.parse_known_args()
571
576
  app = QApplication.instance() or QApplication(sys.argv)
572
- rack = cls(instruments='Proscan DS345 SR830'.split(), fake=args.fake)
577
+ rack = cls(instruments=['Proscan', 'DS345', 'SR830'], fake=args.fake)
573
578
  rack.show()
574
579
  sys.exit(app.exec())
575
580
 
@@ -0,0 +1,34 @@
1
+ # Generated by QInstrument.lib.uitypes from IPGLaserWidget.ui. Do not edit.
2
+
3
+ from qtpy import QtWidgets
4
+
5
+ from QInstrument.widgets.QLedWidget import QLedWidget
6
+ from QInstrument.widgets.QRotaryEncoderSpinBox import QRotaryEncoderSpinBox
7
+
8
+
9
+ class UiIPGLaserWidget:
10
+ '''Children of IPGLaserWidget.ui.'''
11
+
12
+ outerLayout: QtWidgets.QVBoxLayout
13
+ groupBox: QtWidgets.QGroupBox
14
+ innerLayout: QtWidgets.QHBoxLayout
15
+ leftLayout: QtWidgets.QVBoxLayout
16
+ statusLayout: QtWidgets.QHBoxLayout
17
+ supplyGroup: QtWidgets.QGroupBox
18
+ supplyLedLayout: QtWidgets.QVBoxLayout
19
+ power_supply: QLedWidget
20
+ keyGroup: QtWidgets.QGroupBox
21
+ keyLedLayout: QtWidgets.QVBoxLayout
22
+ keyswitch: QLedWidget
23
+ faultGroup: QtWidgets.QGroupBox
24
+ faultLedLayout: QtWidgets.QVBoxLayout
25
+ fault: QLedWidget
26
+ powerGroup: QtWidgets.QGroupBox
27
+ powerSpinLayout: QtWidgets.QVBoxLayout
28
+ power: QtWidgets.QDoubleSpinBox
29
+ controlLayout: QtWidgets.QHBoxLayout
30
+ aiming: QLedWidget
31
+ aiming_button: QtWidgets.QPushButton
32
+ emission: QLedWidget
33
+ emission_button: QtWidgets.QPushButton
34
+ current: QRotaryEncoderSpinBox
@@ -0,0 +1,10 @@
1
+ from QInstrument.lib.lazy import make_getattr
2
+
3
+ _lazy = {
4
+ 'QIPGLaser': 'instrument',
5
+ 'QFakeIPGLaser': 'fake',
6
+ 'QIPGLaserWidget': 'widget',
7
+ }
8
+
9
+ __getattr__ = make_getattr(_lazy, __name__)
10
+ __all__ = list(_lazy)
@@ -74,6 +74,7 @@ class QFakeIPGLaser(QFakeInstrument, QIPGLaser):
74
74
  self.identification = 'Fake IPG Fiber Laser'
75
75
 
76
76
  def identify(self) -> bool:
77
+ '''Return True: a fake instrument is always the right device.'''
77
78
  return True
78
79
 
79
80
 
@@ -1,3 +1,4 @@
1
+ from typing import ClassVar
1
2
  import logging
2
3
  from QInstrument.lib.QSerialInstrument import QSerialInstrument
3
4
 
@@ -123,7 +124,7 @@ class QIPGLaser(QSerialInstrument):
123
124
  +---------+--------------------------+--------------------------+
124
125
  '''
125
126
 
126
- flag = {'TMP': 0x2, # over-temperature condition
127
+ flag: ClassVar[dict] = {'TMP': 0x2, # over-temperature condition
127
128
  'EMX': 0x4, # laser emission active
128
129
  'BKR': 0x8, # excessive backreflection
129
130
  'ACL': 0x10, # analog control mode enabled
@@ -138,7 +139,7 @@ class QIPGLaser(QSerialInstrument):
138
139
  'KEY': 0x200000, # keyswitch in REM position
139
140
  'ERR': 0x2 | 0x8 | 0x800 | 0x20000} # composite fault mask
140
141
 
141
- comm = dict(baudRate=QSerialInstrument.BaudRate.Baud57600,
142
+ comm: ClassVar[dict] = dict(baudRate=QSerialInstrument.BaudRate.Baud57600,
142
143
  dataBits=QSerialInstrument.DataBits.Data8,
143
144
  stopBits=QSerialInstrument.StopBits.OneStop,
144
145
  parity=QSerialInstrument.Parity.NoParity,
@@ -1,11 +1,17 @@
1
+ from typing import TYPE_CHECKING
1
2
  from qtpy import QtCore
2
3
  from QInstrument.lib.QInstrumentWidget import QInstrumentWidget
3
4
  from QInstrument.instruments.IPGPhotonics.IPGLaser.instrument import QIPGLaser
4
5
  from QInstrument.widgets.QLedWidget import QLedWidget
5
- from QInstrument.widgets.QRotaryEncoderSpinBox import QRotaryEncoderSpinBox
6
6
 
7
7
 
8
- class QIPGLaserWidget(QInstrumentWidget):
8
+ if TYPE_CHECKING:
9
+ from .IPGLaserWidget_ui import UiIPGLaserWidget
10
+ else:
11
+ UiIPGLaserWidget = object
12
+
13
+
14
+ class QIPGLaserWidget(QInstrumentWidget, UiIPGLaserWidget):
9
15
  '''Control widget for an IPG fiber laser.
10
16
 
11
17
  Displays power-supply, keyswitch, and fault status as LED indicators.
@@ -0,0 +1,25 @@
1
+ # Generated by QInstrument.lib.uitypes from OpusWidget.ui. Do not edit.
2
+
3
+ from qtpy import QtWidgets
4
+
5
+ from QInstrument.widgets.QLedWidget import QLedWidget
6
+ from QInstrument.widgets.QRotaryEncoderSpinBox import QRotaryEncoderSpinBox
7
+
8
+
9
+ class UiOpusWidget:
10
+ '''Children of OpusWidget.ui.'''
11
+
12
+ outerLayout: QtWidgets.QVBoxLayout
13
+ groupBox: QtWidgets.QGroupBox
14
+ innerLayout: QtWidgets.QHBoxLayout
15
+ power_setpoint: QRotaryEncoderSpinBox
16
+ rightLayout: QtWidgets.QVBoxLayout
17
+ displayFrame: QtWidgets.QFrame
18
+ formLayout: QtWidgets.QGridLayout
19
+ powerLabel: QtWidgets.QLabel
20
+ power_display: QtWidgets.QDoubleSpinBox
21
+ currentLabel: QtWidgets.QLabel
22
+ current_display: QtWidgets.QDoubleSpinBox
23
+ emissionLayout: QtWidgets.QHBoxLayout
24
+ emission: QLedWidget
25
+ emission_button: QtWidgets.QPushButton
@@ -1,6 +1,6 @@
1
1
  from QInstrument.lib.lazy import make_getattr
2
2
 
3
- _lazy = {'QOpus': 'instrument', 'QFakeOpus': 'fake', 'QOpusWidget': 'widget'}
3
+ _lazy = {'QOpus': 'instrument', 'QFakeOpus': 'fake', 'QOpusWidget': '_widget'}
4
4
 
5
5
  __getattr__ = make_getattr(_lazy, __name__)
6
6
  __all__ = list(_lazy)
@@ -1,11 +1,17 @@
1
+ from typing import TYPE_CHECKING
1
2
  from qtpy import QtCore
2
3
  from QInstrument.lib.QInstrumentWidget import QInstrumentWidget
3
4
  from QInstrument.instruments.Novanta.Opus.instrument import QOpus
4
5
  from QInstrument.widgets.QLedWidget import QLedWidget
5
- from QInstrument.widgets.QRotaryEncoderSpinBox import QRotaryEncoderSpinBox
6
6
 
7
7
 
8
- class QOpusWidget(QInstrumentWidget):
8
+ if TYPE_CHECKING:
9
+ from .OpusWidget_ui import UiOpusWidget
10
+ else:
11
+ UiOpusWidget = object
12
+
13
+
14
+ class QOpusWidget(QInstrumentWidget, UiOpusWidget):
9
15
  '''Control widget for a Laser Quantum Opus diode laser.
10
16
 
11
17
  Shows actual output power [W] and diode current [%] as read-only
@@ -34,7 +40,9 @@ class QOpusWidget(QInstrumentWidget):
34
40
  }
35
41
 
36
42
  def __init__(self, *args, device=None, **kwargs) -> None:
37
- device = device or QOpus().find()
43
+ if device is None:
44
+ cls = self.INSTRUMENT if self.INSTRUMENT is not None else QOpus
45
+ device = cls().find()
38
46
  super().__init__(*args, device=device, **kwargs)
39
47
  self._timer = QtCore.QTimer(self)
40
48
  self._timer.setInterval(self.poll_interval)
@@ -44,7 +52,7 @@ class QOpusWidget(QInstrumentWidget):
44
52
  self._timer.start()
45
53
 
46
54
  def _setupControls(self) -> None:
47
- '''Configure the group box title, LED color, and power setpoint encoder.
55
+ '''Configure the group title, LED color and power setpoint encoder.
48
56
 
49
57
  Called once after the device is confirmed open. Updates the
50
58
  group box title with the device wavelength if available, sets the
@@ -63,14 +71,17 @@ class QOpusWidget(QInstrumentWidget):
63
71
  self._updatePowerRange()
64
72
 
65
73
  def _updatePowerRange(self) -> None:
66
- '''Apply ``maximum_power`` [mW] to the power setpoint encoder [W].
74
+ '''Apply power limits to the power setpoint encoder [W].
67
75
 
68
- Called at setup and again after the first show event so that a
76
+ Reads ``minimum_power`` and ``maximum_power`` from the device
77
+ [mW] and applies them to the encoder bounds [W]. Called at
78
+ setup and again after the first show event so that a
69
79
  ``maximum_power`` restored from the saved configuration is
70
80
  reflected in the encoder bounds.
71
81
  '''
82
+ min_p = float(self.device.get('minimum_power') or 0.)
72
83
  max_p = float(self.device.get('maximum_power') or 1000.)
73
- self.power_setpoint.setMinimum(0.)
84
+ self.power_setpoint.setMinimum(min_p / 1000.)
74
85
  self.power_setpoint.setMaximum(max_p / 1000.)
75
86
 
76
87
  def showEvent(self, event) -> None: