forked from pgriffin17/cameraControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewfinder_buttons.py
More file actions
48 lines (35 loc) · 1.44 KB
/
viewfinder_buttons.py
File metadata and controls
48 lines (35 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import pyqtgraph as pg
from pyqtgraph.Qt import QtWidgets
from camera import CameraController
from ee_processor import EE_Processor
class ViewfinderButtons(QtWidgets.QWidget):
"""
Collection of buttons to be used with a viewfinder class.
Includes:
- Centroid
- Reset ROIs
- Show/Hide Crosshair
"""
def __init__(self, camera: CameraController = None, ee_processor : EE_Processor = None):
super().__init__(parent=None)
self.hlayout = QtWidgets.QHBoxLayout()
self.setLayout(self.hlayout)
self.reset_roi_button = QtWidgets.QPushButton("Reset ROIs")
# self.show_hide_crosshairs_button = QtWidgets.QPushButton("Show/hide Crosshair")
if camera:
self.centroid_button = camera.worker.spot_tracker.centroid_button
self.hlayout.addWidget(self.centroid_button)
self.hlayout.addWidget(camera.worker.spot_tracker.inner_com_check)
else:
print("No Camera connected to Viewfinder Buttons")
if ee_processor:
self.hlayout.addWidget(ee_processor.worker.use_com_for_half_check)
else:
print("No EE Processor connected to Viewfinder Buttons")
self.hlayout.addWidget(self.reset_roi_button)
# self.hlayout.addWidget(self.show_hide_crosshairs_button)
if __name__ == "__main__":
app = pg.mkQApp()
widget = ViewfinderButtons()
widget.show()
app.exec()