mirror of
https://github.com/Project-Babble/ProjectBabble.git
synced 2026-11-20 00:51:16 -08:00
Save valid int inputs as ints
This commit is contained in:
1 parent
38d888bcd2
commit
29f405f4e8
2 files changed
+7
-7
No files matched your search
@@ -43,7 +43,6 @@ class Camera:
|
||||
camera_output_outgoing: "queue.Queue(maxsize=2)",
|
||||
settings: BabbleSettingsConfig,
|
||||
):
|
||||
self.current_capture_sourc = None
|
||||
self.camera_status = CameraState.CONNECTING
|
||||
self.config = config
|
||||
self.settings = settings
|
||||
|
||||
@@ -15,6 +15,7 @@ from utils.misc_utils import (
|
||||
get_camera_index_by_name,
|
||||
bg_color_highlight,
|
||||
bg_color_clear,
|
||||
is_valid_int_input
|
||||
)
|
||||
from lang_manager import LocaleStringManager as lang
|
||||
|
||||
@@ -324,11 +325,11 @@ class CameraWidget:
|
||||
if any(x in str(value) for x in ports):
|
||||
self.config.capture_source = value
|
||||
else:
|
||||
cam = get_camera_index_by_name(
|
||||
value
|
||||
) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none
|
||||
cam = get_camera_index_by_name(value) # Set capture_source to the UVC index. Otherwise treat value like an ipcam if we return none
|
||||
if cam != None:
|
||||
self.config.capture_source = get_camera_index_by_name(value)
|
||||
self.config.capture_source = cam
|
||||
elif is_valid_int_input(value):
|
||||
self.config.capture_source = int(value)
|
||||
else:
|
||||
self.config.capture_source = value
|
||||
except ValueError:
|
||||
@@ -395,11 +396,11 @@ class CameraWidget:
|
||||
if self.settings_config.use_calibration == True:
|
||||
window[self.gui_restart_calibration].update(disabled=False)
|
||||
window[self.gui_stop_calibration].update(disabled=False)
|
||||
print(lang._instance.get_string("info.enabled"))
|
||||
print(f'[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.enabled")}')
|
||||
else:
|
||||
window[self.gui_restart_calibration].update(disabled=True)
|
||||
window[self.gui_stop_calibration].update(disabled=True)
|
||||
print(lang._instance.get_string("info.disabled"))
|
||||
print(f'[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.disabled")}')
|
||||
|
||||
if event == "{}+UP".format(self.gui_roi_selection):
|
||||
# Event for mouse button up in ROI mode
|
||||
|
||||
Reference in new issue
Block a user