Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
AVVR-Pipeline-GDP4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GDP Project 4
AVVR-Pipeline-GDP4
Commits
69480338
Commit
69480338
authored
6 months ago
by
mhz1g21
Browse files
Options
Downloads
Patches
Plain Diff
small ui improvements: added colour to buttons
parent
8b140465
No related branches found
No related tags found
1 merge request
!8
enhanced UI: improved styling for main window, tabs, and controls; updated...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/simple_tab.py
+90
-6
90 additions, 6 deletions
scripts/simple_tab.py
with
90 additions
and
6 deletions
scripts/simple_tab.py
+
90
−
6
View file @
69480338
from
PyQt6.QtWidgets
import
(
QWidget
,
QVBoxLayout
,
QHBoxLayout
,
from
PyQt6.QtWidgets
import
(
QWidget
,
QVBoxLayout
,
QHBoxLayout
,
QGroupBox
,
QCheckBox
,
QMessageBox
,
QPushButton
,
QGroupBox
,
QCheckBox
,
QMessageBox
,
QPushButton
,
QProgressBar
)
QProgressBar
)
from
PyQt6.QtCore
import
Qt
,
QThread
,
pyqtSignal
from
PyQt6.QtCore
import
Qt
,
QThread
,
pyqtSignal
,
QTimer
import
os
import
os
import
sys
import
sys
...
@@ -149,7 +149,10 @@ class SimpleTab(QWidget):
...
@@ -149,7 +149,10 @@ class SimpleTab(QWidget):
self
.
depth
.
hide
()
self
.
depth
.
hide
()
self
.
material
.
hide
()
self
.
material
.
hide
()
self
.
edge_net
.
hide
()
self
.
edge_net
.
hide
()
self
.
file_selected
=
False
self
.
flash_timer
=
QTimer
(
self
)
self
.
flash_timer
.
timeout
.
connect
(
self
.
toggle_flash
)
self
.
setup_ui
()
self
.
setup_ui
()
def
setup_ui
(
self
):
def
setup_ui
(
self
):
...
@@ -165,15 +168,18 @@ class SimpleTab(QWidget):
...
@@ -165,15 +168,18 @@ class SimpleTab(QWidget):
(
"
Status:
"
,
"
Ready
"
)
(
"
Status:
"
,
"
Ready
"
)
]
]
self
.
info_group
,
self
.
info_labels
=
create_info_group
(
"
Information
"
,
info_rows
)
self
.
info_group
,
self
.
info_labels
=
create_info_group
(
"
Information
"
,
info_rows
)
self
.
info_group
.
setStyleSheet
(
"
QGroupBox { font-weight: bold; }
"
)
controls_layout
.
addWidget
(
self
.
info_group
)
controls_layout
.
addWidget
(
self
.
info_group
)
# Options
# Options
options_layout
=
QHBoxLayout
()
options_layout
=
QHBoxLayout
()
self
.
include_top_check
=
QCheckBox
(
"
Include Top in Mesh
"
)
self
.
include_top_check
=
QCheckBox
(
"
Include Top in Mesh
"
)
self
.
include_top_check
.
setStyleSheet
(
"
QCheckBox { margin: 5px; }
"
)
options_layout
.
addWidget
(
self
.
include_top_check
)
options_layout
.
addWidget
(
self
.
include_top_check
)
self
.
shift_image_check
=
QCheckBox
(
"
Shift Input Image
"
)
self
.
shift_image_check
=
QCheckBox
(
"
Shift Input Image
"
)
self
.
shift_image_check
.
setStyleSheet
(
"
QCheckBox { margin: 5px; }
"
)
options_layout
.
addWidget
(
self
.
shift_image_check
)
options_layout
.
addWidget
(
self
.
shift_image_check
)
controls_layout
.
addLayout
(
options_layout
)
controls_layout
.
addLayout
(
options_layout
)
...
@@ -183,18 +189,44 @@ class SimpleTab(QWidget):
...
@@ -183,18 +189,44 @@ class SimpleTab(QWidget):
self
.
progress_bar
.
setMinimum
(
0
)
self
.
progress_bar
.
setMinimum
(
0
)
self
.
progress_bar
.
setMaximum
(
0
)
# Makes it an indefinite progress bar
self
.
progress_bar
.
setMaximum
(
0
)
# Makes it an indefinite progress bar
self
.
progress_bar
.
hide
()
# Hidden by default
self
.
progress_bar
.
hide
()
# Hidden by default
self
.
progress_bar
.
setStyleSheet
(
"""
QProgressBar {
border: 2px solid grey;
border-radius: 5px;
text-align: center;
}
QProgressBar::chunk {
background-color: #05B8CC;
width: 20px;
}
"""
)
controls_layout
.
addWidget
(
self
.
progress_bar
)
controls_layout
.
addWidget
(
self
.
progress_bar
)
# Buttons
# Buttons
self
.
run_pipeline_btn
=
QPushButton
(
"
Run Pipeline
"
)
self
.
run_pipeline_btn
=
QPushButton
(
"
Run Pipeline
"
)
self
.
run_pipeline_btn
.
clicked
.
connect
(
self
.
run_full_pipeline
)
self
.
run_pipeline_btn
.
clicked
.
connect
(
self
.
run_full_pipeline
)
self
.
run_pipeline_btn
.
setEnabled
(
False
)
# Disabled by default
self
.
run_pipeline_btn
.
setEnabled
(
False
)
# Disabled by default
self
.
run_pipeline_btn
.
setStyleSheet
(
"""
QPushButton {
margin: 5px;
padding: 5px;
}
QPushButton:enabled {
background-color: green;
color: white;
}
QPushButton:disabled {
background-color: red;
color: white;
}
"""
)
buttons_layout
=
QHBoxLayout
()
buttons_layout
=
QHBoxLayout
()
select_btn
=
QPushButton
(
"
Select Input Image
"
)
self
.
select_btn
=
QPushButton
(
"
Select Input Image
"
)
select_btn
.
clicked
.
connect
(
self
.
handle_file_select
)
self
.
select_btn
.
clicked
.
connect
(
self
.
handle_file_select
)
self
.
select_btn
.
setStyleSheet
(
"
QPushButton { margin: 5px; padding: 5px; }
"
)
buttons_layout
.
addWidget
(
select_btn
)
buttons_layout
.
addWidget
(
self
.
select_btn
)
buttons_layout
.
addWidget
(
self
.
run_pipeline_btn
)
buttons_layout
.
addWidget
(
self
.
run_pipeline_btn
)
controls_layout
.
addLayout
(
buttons_layout
)
controls_layout
.
addLayout
(
buttons_layout
)
...
@@ -202,19 +234,56 @@ class SimpleTab(QWidget):
...
@@ -202,19 +234,56 @@ class SimpleTab(QWidget):
# Status section
# Status section
status_group
,
self
.
status_text
=
create_group_with_text
(
"
Pipeline Status
"
,
150
)
status_group
,
self
.
status_text
=
create_group_with_text
(
"
Pipeline Status
"
,
150
)
status_group
.
setStyleSheet
(
"""
QGroupBox {
font-weight: bold;
border: 2px solid grey;
border-radius: 5px;
margin-top: 10px;
}
QLabel {
margin: 5px;
}
"""
)
layout
.
addWidget
(
status_group
)
layout
.
addWidget
(
status_group
)
# Preview section
# Preview section
preview_group
=
QGroupBox
(
"
Preview
"
)
preview_group
=
QGroupBox
(
"
Preview
"
)
preview_group
.
setStyleSheet
(
"""
QGroupBox {
font-weight: bold;
border: 2px solid grey;
border-radius: 5px;
margin-top: 10px;
}
"""
)
preview_layout
=
QHBoxLayout
(
preview_group
)
preview_layout
=
QHBoxLayout
(
preview_group
)
input_group
,
self
.
input_preview
=
create_preview_group
(
"
Input Image
"
)
input_group
,
self
.
input_preview
=
create_preview_group
(
"
Input Image
"
)
output_group
,
self
.
output_preview
=
create_preview_group
(
"
Current Output
"
)
output_group
,
self
.
output_preview
=
create_preview_group
(
"
Current Output
"
)
input_group
.
setStyleSheet
(
"""
QGroupBox {
font-weight: bold;
border: 1px solid grey;
border-radius: 5px;
margin: 5px;
}
"""
)
output_group
.
setStyleSheet
(
"""
QGroupBox {
font-weight: bold;
border: 1px solid grey;
border-radius: 5px;
margin: 5px;
}
"""
)
preview_layout
.
addWidget
(
input_group
)
preview_layout
.
addWidget
(
input_group
)
preview_layout
.
addWidget
(
output_group
)
preview_layout
.
addWidget
(
output_group
)
layout
.
addWidget
(
preview_group
)
layout
.
addWidget
(
preview_group
)
# Start flashing if no file is selected
self
.
start_flashing
()
def
handle_file_select
(
self
):
def
handle_file_select
(
self
):
file_path
=
select_file
(
file_path
=
select_file
(
...
@@ -239,6 +308,21 @@ class SimpleTab(QWidget):
...
@@ -239,6 +308,21 @@ class SimpleTab(QWidget):
self
.
depth
.
depth_input_path
=
file_path
self
.
depth
.
depth_input_path
=
file_path
self
.
material
.
input_file_path
=
file_path
self
.
material
.
input_file_path
=
file_path
# self.edge_net.input_path = file_path # edgenet have default input path
# self.edge_net.input_path = file_path # edgenet have default input path
self
.
file_selected
=
True
self
.
flash_timer
.
stop
()
self
.
select_btn
.
setStyleSheet
(
"
QPushButton { margin: 5px; padding: 5px; }
"
)
def
start_flashing
(
self
):
if
not
self
.
file_selected
:
self
.
flash_timer
.
start
(
1000
)
# Flash every 1000 milliseconds
def
toggle_flash
(
self
):
current_style
=
self
.
select_btn
.
styleSheet
()
if
"
background-color: DarkOrange;
"
in
current_style
:
self
.
select_btn
.
setStyleSheet
(
"
QPushButton { margin: 5px; padding: 5px; }
"
)
else
:
self
.
select_btn
.
setStyleSheet
(
"
QPushButton { margin: 5px; padding: 5px; background-color: DarkOrange; }
"
)
def
run_full_pipeline
(
self
):
def
run_full_pipeline
(
self
):
if
not
self
.
input_path
:
if
not
self
.
input_path
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment