This commit is contained in:
Summer committed 2025-04-13 12:00:29 -07:00
1 parent 50d03cec35
commit cef3eb3297
5 files changed
+28 -8

No files matched your search

+2
View File
@@ -299,11 +299,13 @@ async def async_main():
ROSC = True
# Create the window
# Use finalize=True to ensure the window is created only once
window = sg.Window(
f"{AppConstants.VERSION}",
layout,
icon=os.path.join("Images", "logo.ico"),
background_color=bg_color_clear,
finalize=True
)
# Run the main loop
+17 -1
View File
@@ -214,8 +214,24 @@ class Camera:
if image is None:
return
self.frame_number = self.frame_number + 1
# Ensure we have a valid image for cropping mode
if image.size == 0:
print(f'{Fore.YELLOW}[{lang._instance.get_string("log.warn")}] Empty frame from VFT camera{Fore.RESET}')
return
elif self.cv2_camera is not None and self.cv2_camera.isOpened():
ret, image = self.cv2_camera.read() # MJPEG Stream reconnects are currently limited by the hard coded 30 second timeout time on VideoCapture.read(). We can get around this by recompiling OpenCV or using a custom MJPEG stream imp.
# Implement a timeout mechanism to prevent hanging on MJPEG streams
start_time = time.time()
ret, image = self.cv2_camera.read() # MJPEG Stream reconnects are currently limited by the hard coded 30 second timeout time on VideoCapture.read().
# If read takes too long, reset the connection
if time.time() - start_time > 5: # 5 second timeout instead of waiting for 30 seconds
print(f'{Fore.YELLOW}[{lang._instance.get_string("log.warn")}] MJPEG stream timeout, reconnecting...{Fore.RESET}')
self.cv2_camera.release()
if self.config.use_ffmpeg:
self.cv2_camera = cv2.VideoCapture(self.current_capture_source, cv2.CAP_FFMPEG)
else:
self.cv2_camera = cv2.VideoCapture()
self.cv2_camera.open(self.current_capture_source)
ret, image = self.cv2_camera.read()
if not ret:
self.cv2_camera.set(cv2.CAP_PROP_POS_FRAMES, 0)
raise RuntimeError(lang._instance.get_string("error.frame"))
@@ -72,7 +72,9 @@ class FTCameraController:
self.is_open = True
FTCameraController._logger.info("FTCameraController.open: start process")
self._proc_queue = multiprocessing.Queue(maxsize=1)
self._proc_read = multiprocessing.Process(target=self._read_process, args=(self._proc_queue,))
# Set daemon=True to ensure the process terminates when the main process exits
# This helps prevent spawning multiple GUI windows in PyInstaller builds
self._proc_read = multiprocessing.Process(target=self._read_process, args=(self._proc_queue,), daemon=True)
self._proc_read.start()
def _reopen(self: 'FTCameraController') -> None:
+1 -1
View File
@@ -1,6 +1,6 @@
:: File paths will all need to be updated to your setup
set babblepath=C:\Documents\GitHub\ProjectBabble
set babblepath=C:\Users\sameer\Documents\GitHub\ProjectBabble
set innopath="C:\Program Files (x86)\Inno Setup 6"
cd /d %babblepath%\BabbleApp
+5 -5
View File
@@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Project Babble"
#define MyAppVersion "2.0.7"
#define MyAppVersion "2.1.5 Beta Build"
#define MyAppPublisher "Project Babble Team"
#define MyAppURL "https://github.com/Project-Babble/ProjectBabble"
#define MyAppExeName "Babble_App.exe"
@@ -20,11 +20,11 @@ AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\Users\epicm\OneDrive\Desktop\build
OutputDir=C:\Users\sameer\OneDrive\Desktop\build
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputBaseFilename=Project_Babble-Setup
SetupIconFile=C:\Documents\GitHub\ProjectBabble\BabbleApp\Images\logo.ico
SetupIconFile=C:\Users\sameer\Documents\GitHub\ProjectBabble\BabbleApp\Images\logo.ico
Compression=lzma/ultra64
SolidCompression=yes
@@ -40,8 +40,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
[Files]
Source: "C:\Documents\GitHub\ProjectBabble\BabbleApp\dist\Babble_App\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Documents\GitHub\ProjectBabble\BabbleApp\dist\Babble_App\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\sameer\Documents\GitHub\ProjectBabble\BabbleApp\dist\Babble_App\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\sameer\Documents\GitHub\ProjectBabble\BabbleApp\dist\Babble_App\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Dirs]