Skip to content

Commit 30ef121

Browse files
committed
Renamed buttons for focus operations.
1 parent 28cc23a commit 30ef121

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

PythonTools/RemoteController.py

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def sendCameraSettings(self):
9898
sens: int = int(self.camera_sensitivity_line.text())
9999
self.ws.send(f"CAMERA_SETTINGS@@{exp_ns},{sens}")
100100
except Exception as e:
101-
self.show_error_popup(f"Can't start recording: {e}")
101+
self.show_error_popup(f"Can't set camera parameters: {e}")
102102
self.save_user_prefs()
103103
sys.exit()
104104

@@ -115,25 +115,21 @@ def startRec(self):
115115
self.save_user_prefs()
116116
sys.exit()
117117

118-
def enableFocus(self):
118+
def startAutofocus(self):
119119
try:
120-
if self.unlock_focus_btn.isEnabled():
121-
self.ws.send("UNLOCK_FOCUS")
122-
self.unlock_focus_btn.setEnabled(False)
123-
self.lock_focus_btn.setEnabled(True)
120+
if self.start_autofocus_btn.isEnabled():
121+
self.ws.send("START_AUTOFOCUS")
124122
except Exception as e:
125-
self.show_error_popup(f"Can't send enable focus command: {e}")
123+
self.show_error_popup(f"Can't send start autofocus command: {e}")
126124
self.save_user_prefs()
127125
sys.exit()
128126

129-
def lockFocus(self):
127+
def stopAutofocus(self):
130128
try:
131-
if self.lock_focus_btn.isEnabled():
132-
self.ws.send("LOCK_FOCUS")
133-
self.unlock_focus_btn.setEnabled(True)
134-
self.lock_focus_btn.setEnabled(False)
129+
if self.stop_autofocus_btn.isEnabled():
130+
self.ws.send("STOP_AUTOFOCUS")
135131
except Exception as e:
136-
self.show_error_popup(f"Can't send lock focus command: {e}")
132+
self.show_error_popup(f"Can't send stop autofocus focus command: {e}")
137133
self.save_user_prefs()
138134
sys.exit()
139135

@@ -246,7 +242,7 @@ def setupUi(self, MainWindow):
246242
font.setPointSize(20)
247243

248244
#
249-
# SESSION
245+
# SESSION panel (left side)
250246
sess_label = QtWidgets.QLabel("Session ID:")
251247
sess_label.setFont(font)
252248

@@ -262,22 +258,19 @@ def setupUi(self, MainWindow):
262258

263259
#
264260
# FOCUS CONTROL
265-
self.unlock_focus_btn = QtWidgets.QPushButton()
266-
self.unlock_focus_btn.setFont(font)
267-
self.unlock_focus_btn.setObjectName("unlock_focus_button")
268-
self.unlock_focus_btn.clicked.connect(self.enableFocus)
261+
self.start_autofocus_btn = QtWidgets.QPushButton()
262+
self.start_autofocus_btn.setFont(font)
263+
self.start_autofocus_btn.clicked.connect(self.startAutofocus)
269264

270-
self.lock_focus_btn = QtWidgets.QPushButton()
271-
self.lock_focus_btn.setFont(font)
272-
self.lock_focus_btn.setObjectName("lock_focus_button")
273-
self.lock_focus_btn.clicked.connect(self.lockFocus)
274-
self.lock_focus_btn.setEnabled(False)
265+
self.stop_autofocus_btn = QtWidgets.QPushButton()
266+
self.stop_autofocus_btn.setFont(font)
267+
self.stop_autofocus_btn.clicked.connect(self.stopAutofocus)
275268

276269
focus_layout = QHBoxLayout()
277270
focus_layout.addStretch(1)
278-
focus_layout.addWidget(self.unlock_focus_btn, 1)
271+
focus_layout.addWidget(self.start_autofocus_btn, 1)
279272
# focus_layout.addStretch(1)
280-
focus_layout.addWidget(self.lock_focus_btn, 1)
273+
focus_layout.addWidget(self.stop_autofocus_btn, 1)
281274
focus_layout.addStretch(1)
282275

283276
#
@@ -403,19 +396,30 @@ def setupUi(self, MainWindow):
403396
remote_control_layout.addLayout(clients_info_layout)
404397

405398
#
406-
# Local Analysis layout
399+
#
400+
# Local Analysis layout (Right side panel)
401+
402+
#
403+
# DOWNLOAD PATH
407404
local_dir_label = QtWidgets.QLabel("Local download dir:")
408405
local_dir_label.setFont(font)
409406
self.local_dir_path_edit = QtWidgets.QLineEdit()
410407
local_dir_layout = QHBoxLayout()
411408
local_dir_layout.addWidget(local_dir_label)
412409
local_dir_layout.addStretch(1)
413410

414-
411+
#
412+
# PLAY
415413
show_latest_video_btn = QtWidgets.QPushButton(text="Play Leader")
416414
show_latest_video_btn.setFont(font)
417415
show_latest_video_btn.clicked.connect(self.showLatestMasterVideo)
418416

417+
#
418+
#
419+
420+
421+
#
422+
# Compose session panel layout
419423
local_analysis_layout = QVBoxLayout()
420424
local_analysis_layout.addLayout(local_dir_layout)
421425
local_analysis_layout.addWidget(self.local_dir_path_edit)
@@ -470,8 +474,8 @@ def retranslateUi(self, MainWindow):
470474

471475
self.download_prefix_text.setPlaceholderText(_translate("MainWindow", " Enter Session Prefix"))
472476
self.download_btn.setText(_translate("MainWindow", "Download"))
473-
self.unlock_focus_btn.setText(_translate("MainWindow", "Unlock Focus"))
474-
self.lock_focus_btn.setText(_translate("MainWindow", "Lock Focus"))
477+
self.start_autofocus_btn.setText(_translate("MainWindow", "Start Autofocus"))
478+
self.stop_autofocus_btn.setText(_translate("MainWindow", "Stop Autofocus"))
475479

476480
self.prefix_list_btn.setText(_translate("MainWindow", "Prefix List"))
477481
self.phase_align_btn.setText(_translate("MainWindow", "Align Phases"))

0 commit comments

Comments
 (0)