GUI: added camera selection to gonio_camera_thread initialization
This commit is contained in:
@@ -127,7 +127,8 @@ class MainWindow(QMainWindow):
|
||||
self.beamline_view_layout.addWidget(self.beamline_view)
|
||||
|
||||
self.gonio_view = VideoGraphicsView()
|
||||
self.gonio_camera_thread = VideoThread(ip="axis-accc8ed2972e.psi.ch")
|
||||
#TODO add option to change cameras for gonio_camera_thread
|
||||
self.gonio_camera_thread = VideoThread(ip="axis-accc8ed2972e.psi.ch", camera=3)
|
||||
self.gonio_camera_thread.frame_ready.connect(self.gonio_view.update_frame)
|
||||
self.gonio_camera_thread.frame_ready.connect(self.beamline_view_1_combined.update_frame)
|
||||
self.gonio_camera_thread.start()
|
||||
|
||||
@@ -10,19 +10,20 @@ class VideoThread(QThread):
|
||||
frame_ready = Signal(QImage)
|
||||
error_occurred = Signal(str)
|
||||
|
||||
def __init__(self, ip: str):
|
||||
def __init__(self, ip: str, camera = 1):
|
||||
super().__init__()
|
||||
self.camera_ip = ip
|
||||
self.running = False
|
||||
self.session = None
|
||||
self.last_good_frame = None
|
||||
self.camera: int = camera
|
||||
|
||||
def set_camera_ip(self, ip: str):
|
||||
self.camera_ip = ip
|
||||
|
||||
def run(self):
|
||||
# MJPEG URL
|
||||
mjpeg_url = f"http://{self.camera_ip}/axis-cgi/mjpg/video.cgi?resolution=1280x720&fps=10"
|
||||
mjpeg_url = f"http://{self.camera_ip}/axis-cgi/mjpg/video.cgi?resolution=1280x720&fps=20&compression=30&camera={self.camera}"
|
||||
|
||||
# Create a session for connection reuse
|
||||
self.session = requests.Session()
|
||||
|
||||
Reference in New Issue
Block a user