Skip to content
Snippets Groups Projects

GDP 4.2.10 - Adding Debug mode to GUI.py to run individual modules

Merged mhby1g21 requested to merge GDP-4.2.10 into master
1 file
+ 24
14
Compare changes
  • Side-by-side
  • Inline
@@ -86,6 +86,10 @@ class EdgeNetTab(QWidget):
hlayout.addWidget(right_panel)
layout.addLayout(hlayout)
# Initialize progress bar to stopped state
self.progress_bar.setMaximum(100)
self.progress_bar.setValue(0)
self.setLayout(layout)
def create_left_panel(self):
@@ -203,7 +207,7 @@ class EdgeNetTab(QWidget):
def select_input_file(self, file_type):
"""Handle input file selection"""
file_path = select_file(self, "Select Input File", "Image Files (*.png)")
file_path = select_file(self, "Select Input File", "Image Files (*.png)", initial_dir=self.input_dir)
if file_path:
self.manual_inputs[file_type] = file_path
label = getattr(self, f"{file_type.split('.')[0]}_label")
@@ -246,6 +250,15 @@ class EdgeNetTab(QWidget):
for directory in directories:
clean_directory(directory, self.update_status)
# remove monodepth image copied in 360monodepth if exists
if os.path.exists(os.path.join(self.config_reader.directories['monoDepthDir'], 'rgb.jpg')):
monodepth_image = os.path.join(self.config_reader.directories['monoDepthDir'], 'rgb.jpg')
os.remove(monodepth_image)
# remove shifted image from shifter if exists
if os.path.exists(os.path.join(self.config_reader.directories['scriptDir'], 'shifted_t.png')):
shifted_image = os.path.join(self.config_reader.directories['scriptDir'], 'shifted_t.png')
os.remove(shifted_image)
update_status_indicator(self.edge_status, "Not started")
update_status_indicator(self.split_status, "Not started")
update_status_indicator(self.flip_status, "Not started")
@@ -419,22 +432,15 @@ class EdgeNetTab(QWidget):
if self.is_processing:
QMessageBox.warning(self, "Warning", "A process is already running!")
return
self.is_processing = True
self.progress_bar.setMaximum(0) # Set to indeterminate mode
self.current_thread = ProcessThread(self._run_all_steps_process)
self.current_thread.finished.connect(self.on_all_steps_complete)
self.current_thread.progress.connect(self.update_status)
self.current_thread.start()
def cancel_operation(self):
if not self.is_processing:
return
if show_confirmation_dialog(self, "Confirm Cancel", "Cancel current operation?"):
self.update_status("Cancelling operation...")
if self.current_thread:
self.current_thread.stop()
self.is_processing = False
def _run_all_steps_process(self):
"""Execute complete pipeline process"""
try:
@@ -466,11 +472,15 @@ class EdgeNetTab(QWidget):
def on_all_steps_complete(self, success, error_message):
"""Handle complete pipeline completion"""
self.is_processing = False
self.is_processing = False
self.progress_bar.setMaximum(100)
self.progress_bar.setValue(0)
if success:
self.update_status("Complete pipeline processing finished successfully!")
update_status_indicator(self.edge_status, "Complete")
update_status_indicator(self.split_status, "Complete")
update_status_indicator(self.flip_status, "Complete")
QMessageBox.information(self, "Success",
"All processing steps completed successfully!")
else:
Loading