Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Software Public
PASSOFT
SOHViewer
Commits
8b5b0cd5
Commit
8b5b0cd5
authored
2 years ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
Shortcut, tooltip, pep8
parent
6c330361
No related branches found
Branches containing commit
No related tags found
1 merge request
!40
Shortcut, tooltip, pep8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sohstationviewer/view/file_list_widget.py
+4
-4
4 additions, 4 deletions
sohstationviewer/view/file_list_widget.py
sohstationviewer/view/ui/main_ui.py
+26
-7
26 additions, 7 deletions
sohstationviewer/view/ui/main_ui.py
with
30 additions
and
11 deletions
sohstationviewer/view/file_list_widget.py
+
4
−
4
View file @
8b5b0cd5
...
...
@@ -4,9 +4,9 @@ from PySide2 import QtWidgets
class
FileListItem
(
QtWidgets
.
QListWidgetItem
):
"""
Widget to select file and save the absolute path of the file under
self.file
P
ath variable
self.file
_p
ath variable
"""
def
__init__
(
self
,
file
P
ath
,
parent
=
None
):
super
().
__init__
(
file
P
ath
.
name
,
parent
,
def
__init__
(
self
,
file
_p
ath
,
parent
=
None
):
super
().
__init__
(
file
_p
ath
.
name
,
parent
,
type
=
QtWidgets
.
QListWidgetItem
.
UserType
)
self
.
file
P
ath
=
file
P
ath
self
.
file
_p
ath
=
file
_p
ath
This diff is collapsed.
Click to expand it.
sohstationviewer/view/ui/main_ui.py
+
26
−
7
View file @
8b5b0cd5
# UI and connectSignals for
M
ain
W
indow
# UI and connectSignals for
m
ain
_w
indow
from
PySide2
import
QtCore
,
QtGui
,
QtWidgets
from
sohstationviewer.view.calendar.calendar_widget
import
CalendarWidget
from
sohstationviewer.view.plotting.state_of_health_widget
import
SOHWidget
from
sohstationviewer.conf
import
constants
...
...
@@ -22,7 +23,7 @@ def add_separation_line(layout):
class
UIMainWindow
(
object
):
def
__init__
(
self
):
"""
Class that create widgets, menus and connect signals for
M
ain
W
indow.
Class that create widgets, menus and connect signals for
m
ain
_w
indow.
"""
super
().
__init__
()
"""
...
...
@@ -243,9 +244,9 @@ class UIMainWindow(object):
self
.
view_plot_type_action
=
None
# ========================= Help Menu =============================
"""
calendar
A
ction: QAction - Open Calendar Dialog as a helpful tool
calendar
_a
ction: QAction - Open Calendar Dialog as a helpful tool
"""
self
.
calendar
A
ction
=
None
self
.
calendar
_a
ction
=
None
"""
about_action: QAction - Open About Dialog to give information about
SOHView
...
...
@@ -277,6 +278,7 @@ class UIMainWindow(object):
main_layout
.
addWidget
(
self
.
tracking_info_text_browser
)
self
.
create_menu_bar
(
main_window
)
self
.
connect_signals
(
main_window
)
self
.
create_shortcuts
(
main_window
)
def
set_first_row
(
self
,
main_layout
):
"""
...
...
@@ -388,15 +390,21 @@ class UIMainWindow(object):
search_grid
.
addWidget
(
self
.
replot_button
,
1
,
3
,
1
,
1
)
color_tip_fmt
=
(
'
Set the background color of the plot
'
'
to {0}
'
)
background_layout
=
QtWidgets
.
QHBoxLayout
()
# background_layout.setContentsMargins(0, 0, 0, 0)
left_layout
.
addLayout
(
background_layout
)
background_layout
.
addWidget
(
QtWidgets
.
QLabel
(
'
Background:
'
))
self
.
background_black_radio_button
=
QtWidgets
.
QRadioButton
(
'
B
'
,
self
.
central_widget
)
self
.
background_black_radio_button
.
setToolTip
(
color_tip_fmt
.
format
(
'
black
'
))
background_layout
.
addWidget
(
self
.
background_black_radio_button
)
self
.
background_white_radio_button
=
QtWidgets
.
QRadioButton
(
'
W
'
,
self
.
central_widget
)
self
.
background_white_radio_button
.
setToolTip
(
color_tip_fmt
.
format
(
'
white
'
))
background_layout
.
addWidget
(
self
.
background_white_radio_button
)
add_separation_line
(
left_layout
)
...
...
@@ -477,16 +485,25 @@ class UIMainWindow(object):
submit_layout
.
setSpacing
(
5
)
left_layout
.
addLayout
(
submit_layout
)
self
.
read_button
=
QtWidgets
.
QPushButton
(
'
Read
'
,
self
.
central_widget
)
self
.
read_button
.
setToolTip
(
'
Read selected files
'
)
submit_layout
.
addWidget
(
self
.
read_button
)
self
.
stop_button
=
QtWidgets
.
QPushButton
(
'
Stop
'
,
self
.
central_widget
)
self
.
stop_button
.
setToolTip
(
'
Halt ongoing read
'
)
submit_layout
.
addWidget
(
self
.
stop_button
)
self
.
save_plot_button
=
QtWidgets
.
QPushButton
(
'
Save plot
'
,
self
.
central_widget
)
self
.
save_plot_button
.
setToolTip
(
'
Save plots to disk
'
)
submit_layout
.
addWidget
(
self
.
save_plot_button
)
self
.
info_list_widget
=
QtWidgets
.
QListWidget
(
self
.
central_widget
)
left_layout
.
addWidget
(
self
.
info_list_widget
,
1
)
def
create_shortcuts
(
self
,
main_window
):
seq
=
QtGui
.
QKeySequence
(
'
Ctrl+F
'
)
chdir_shortcut
=
QtWidgets
.
QShortcut
(
seq
,
main_window
)
chdir_shortcut
.
activated
.
connect
(
main_window
.
change_current_directory
)
def
create_menu_bar
(
self
,
main_window
):
"""
Setting up menu bar
...
...
@@ -505,6 +522,7 @@ class UIMainWindow(object):
self
.
create_file_menu
(
main_window
,
file_menu
)
self
.
create_command_menu
(
main_window
,
command_menu
)
self
.
create_option_menu
(
main_window
,
option_menu
)
self
.
create_database_menu
(
main_window
,
database_menu
)
self
.
create_help_menu
(
main_window
,
help_menu
)
...
...
@@ -603,9 +621,9 @@ class UIMainWindow(object):
:param main_window: QMainWindow - main GUI for user to interact with
:param menu: QMenu - Help Menu
"""
self
.
calendar
A
ction
=
QtWidgets
.
QAction
(
self
.
calendar
_a
ction
=
QtWidgets
.
QAction
(
'
Calendar
'
,
main_window
)
menu
.
addAction
(
self
.
calendar
A
ction
)
menu
.
addAction
(
self
.
calendar
_a
ction
)
self
.
about_action
=
QtWidgets
.
QAction
(
'
About
'
,
main_window
)
...
...
@@ -657,11 +675,12 @@ class UIMainWindow(object):
# Form
# Help
self
.
calendar
A
ction
.
triggered
.
connect
(
main_window
.
open_calendar
)
self
.
calendar
_a
ction
.
triggered
.
connect
(
main_window
.
open_calendar
)
def
connect_widget_signals
(
self
,
main_window
):
main_window
.
current_directory_changed
.
connect
(
self
.
cwd_line_edit
.
setText
)
# first Row
self
.
time_from_date_edit
.
setCalendarWidget
(
CalendarWidget
(
main_window
))
self
.
time_from_date_edit
.
setDate
(
QtCore
.
QDate
.
fromString
(
...
...
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