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

Merge branch 'temp-fix-gui-freezes' into 'master'

fixed gui freezes

See merge request !10
parents c67fc9cf b92a25e5
No related branches found
No related tags found
1 merge request!10fixed gui freezes
......@@ -244,6 +244,9 @@ class SimpleTab(QWidget):
self.shift_image_check.setStyleSheet("QCheckBox { margin: 5px; background-color: #3e3e3e;}")
options_layout.addWidget(self.shift_image_check)
#TODO: FIX THIS, BREAKS THE APP WHEN ENABLED AND PIPELINE IS RUN
self.shift_image_check.setEnabled(False)
# SSC Model selection
ssc_model_layout = QHBoxLayout()
ssc_model_label = QLabel("SSC Model:")
......@@ -342,7 +345,7 @@ class SimpleTab(QWidget):
layout.addWidget(controls_group)
# Image Distance section
## Image Distance section
self.image_distance_group = QGroupBox("Image Distance")
distance_layout = QVBoxLayout(self.image_distance_group)
info_label = QLabel("Please select two point on the image and input the distance from the camera to that point.")
......@@ -353,24 +356,24 @@ class SimpleTab(QWidget):
self.points_info_label = QLabel() # Label to display points and distances
self.points_info_label.setAlignment(Qt.AlignmentFlag.AlignTop | Qt.AlignmentFlag.AlignCenter)
self.image_distance_group.setStyleSheet("""
QGroupBox {
font-weight: bold;
border: 2px solid grey;
border-radius: 20px;
margin-top: 10px;
background-color: #3e3e3e;
padding: 20px;
}
QGroupBox::title {
margin: 10px;
background-color: transparent;
color: white;
}
QLabel {
margin: 5px;
background-color: #3e3e3e;
color: white;
}
QGroupBox {
font-weight: bold;
border: 2px solid grey;
border-radius: 20px;
margin-top: 10px;
background-color: #3e3e3e;
padding: 20px;
}
QGroupBox::title {
margin: 10px;
background-color: transparent;
color: white;
}
QLabel {
margin: 5px;
background-color: #3e3e3e;
color: white;
}
""")
# Center the ClickableLabel within its parent layout
distance_preview_layout = QHBoxLayout()
......@@ -382,11 +385,11 @@ class SimpleTab(QWidget):
self.distance_reset_btn.clicked.connect(self.distance_preview.clear_points)
self.distance_reset_btn.setFixedSize(150, 40)
self.distance_reset_btn.setStyleSheet("""
QPushButton {
margin: 5px;
padding: 5px;
border-radius: 10px;
}
QPushButton {
margin: 5px;
padding: 5px;
border-radius: 10px;
}
""")
distance_btn_layout = QHBoxLayout()
distance_btn_layout.addStretch()
......@@ -526,7 +529,7 @@ class SimpleTab(QWidget):
self.update_status("Waiting for distance points...")
self.info_labels["Status:"].setText("Waiting for distance points...")
# Enable the run pipeline button
#self.run_pipeline_btn.setEnabled(True)
self.run_pipeline_btn.setEnabled(True)
# Provide input path to all modules
self.shifter.input_file_path = file_path
......@@ -586,7 +589,8 @@ class SimpleTab(QWidget):
self.pipeline_thread.finished.connect(self.pipeline_completed)
# Disable controls while running
self.setEnabled(False)
#self.setEnabled(False)
self.disable_buttons_while_running()
self.progress_bar.setEnabled(True) # Keep progress bar enabled
#TODO: Add model selection for EdgeNet or MDBNet
......@@ -616,4 +620,13 @@ class SimpleTab(QWidget):
self.info_labels["Status:"].setText(message.split("...")[-1] if "..." in message else message)
# Scroll to bottom
scrollbar = self.status_text.verticalScrollBar()
scrollbar.setValue(scrollbar.maximum())
\ No newline at end of file
scrollbar.setValue(scrollbar.maximum())
def disable_buttons_while_running(self):
self.select_btn.setEnabled(False)
self.run_pipeline_btn.setEnabled(False)
self.include_top_check.setEnabled(False)
self.shift_image_check.setEnabled(False)
self.ssc_model_combo.setEnabled(False)
self.distance_reset_btn.setEnabled(False)
self.distance_preview.setEnabled(False)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment