|
10 | 10 |
|
11 | 11 | from colorama import Fore |
12 | 12 | from config import BabbleConfig, BabbleSettingsConfig |
13 | | -from utils.misc_utils import is_nt, get_camera_index_by_name, list_camera_names |
| 13 | +from utils.misc_utils import get_camera_index_by_name, list_camera_names, is_nt |
14 | 14 | from enum import Enum |
15 | 15 | import sys |
16 | 16 |
|
@@ -86,8 +86,8 @@ def run(self): |
86 | 86 | self.config.capture_source is not None |
87 | 87 | and self.config.capture_source != "" |
88 | 88 | ): |
89 | | - capture = str(self.config.capture_source) |
90 | | - if "COM" in capture or "/dev/tty" in capture: |
| 89 | + ports = ("COM", "/dev/ttyACM") |
| 90 | + if any(x in str(self.config.capture_source) for x in ports): |
91 | 91 | if ( |
92 | 92 | self.serial_connection is None |
93 | 93 | or self.camera_status == CameraState.DISCONNECTED |
@@ -151,7 +151,7 @@ def run(self): |
151 | 151 | if should_push and not self.capture_event.wait(timeout=0.02): |
152 | 152 | continue |
153 | 153 | if self.config.capture_source is not None: |
154 | | - ports = ("COM", "/dev/tty") |
| 154 | + ports = ("COM", "/dev/ttyACM") |
155 | 155 | if any(x in str(self.config.capture_source) for x in ports): |
156 | 156 | self.get_serial_camera_picture(should_push) |
157 | 157 | else: |
@@ -275,10 +275,11 @@ def start_serial_connection(self, port): |
275 | 275 | ) |
276 | 276 | self.serial_connection = conn |
277 | 277 | self.camera_status = CameraState.CONNECTED |
278 | | - except Exception: |
| 278 | + except Exception as e: |
279 | 279 | print( |
280 | 280 | f'{Fore.CYAN}[{lang._instance.get_string("log.info")}] {lang._instance.get_string("info.ETVRFailiure")} {port}{Fore.RESET}' |
281 | 281 | ) |
| 282 | + print(e) |
282 | 283 | self.camera_status = CameraState.DISCONNECTED |
283 | 284 |
|
284 | 285 | def clamp_max_res(self, image: MatLike) -> MatLike: |
|
0 commit comments