Skip to content
Snippets Groups Projects
Commit fd87b9f6 authored by mhby1g21's avatar mhby1g21
Browse files

fixed progress bar on run all, init dir on select files, added monodepth rgb...

fixed progress bar on run all, init dir on select files, added monodepth rgb and shifted image to clean all, removed cancel operation button and functions as its hard to implement for wsl (not worth it)
parent 96356804
No related branches found
No related tags found
1 merge request!4GDP 4.2.10 - Adding Debug mode to GUI.py to run individual modules
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment