Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CFA Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
JOSSOUD Olivier
CFA Analysis
Commits
04b377db
Commit
04b377db
authored
5 years ago
by
JOSSOUD Olivier
Browse files
Options
Downloads
Patches
Plain Diff
ConductCalib. GUI. Channel next/prev selector. Disable not-yet-usable buttons.
parent
61fe55b8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyqt/mainwindow.ui
+55
-2
55 additions, 2 deletions
pyqt/mainwindow.ui
src/gui/uimainwindow.py
+18
-1
18 additions, 1 deletion
src/gui/uimainwindow.py
src/uim/conductcalibuim.py
+28
-2
28 additions, 2 deletions
src/uim/conductcalibuim.py
with
101 additions
and
5 deletions
pyqt/mainwindow.ui
+
55
−
2
View file @
04b377db
...
...
@@ -84,20 +84,54 @@
<rect>
<x>
450
</x>
<y>
140
</y>
<width>
2
1
1
</width>
<height>
3
1
</height>
<width>
2
0
1
</width>
<height>
3
2
</height>
</rect>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<property
name=
"sizeConstraint"
>
<enum>
QLayout::SetDefaultConstraint
</enum>
</property>
<item>
<widget
class=
"QLabel"
name=
"conduct_label_channel"
>
<property
name=
"minimumSize"
>
<size>
<width>
90
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"text"
>
<string>
Display channel:
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"conduct_pushbutton_channel_prev"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
20
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
<string>
<
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QComboBox"
name=
"conduct_combobox_channel"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
40
</width>
<height>
16777215
</height>
</size>
</property>
<item>
<property
name=
"text"
>
<string>
1
</string>
...
...
@@ -125,6 +159,22 @@
</item>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"conduct_pushbutton_channel_next"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
20
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
<string>
>
</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget
class=
"QTableWidget"
name=
"conduct_tablewidget_run"
>
...
...
@@ -173,6 +223,9 @@
</column>
</widget>
<widget
class=
"QPushButton"
name=
"conduct_pushbutton_save_csv"
>
<property
name=
"enabled"
>
<bool>
false
</bool>
</property>
<property
name=
"geometry"
>
<rect>
<x>
450
</x>
...
...
This diff is collapsed.
Click to expand it.
src/gui/uimainwindow.py
+
18
−
1
View file @
04b377db
...
...
@@ -37,15 +37,24 @@ class Ui_MainWindow(object):
item
=
QtWidgets
.
QTableWidgetItem
()
self
.
conduct_tablewidget_set
.
setHorizontalHeaderItem
(
3
,
item
)
self
.
horizontalLayoutWidget
=
QtWidgets
.
QWidget
(
self
.
conduct_groupbox
)
self
.
horizontalLayoutWidget
.
setGeometry
(
QtCore
.
QRect
(
450
,
140
,
2
1
1
,
3
1
))
self
.
horizontalLayoutWidget
.
setGeometry
(
QtCore
.
QRect
(
450
,
140
,
2
0
1
,
3
2
))
self
.
horizontalLayoutWidget
.
setObjectName
(
"
horizontalLayoutWidget
"
)
self
.
horizontalLayout
=
QtWidgets
.
QHBoxLayout
(
self
.
horizontalLayoutWidget
)
self
.
horizontalLayout
.
setSizeConstraint
(
QtWidgets
.
QLayout
.
SetDefaultConstraint
)
self
.
horizontalLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
)
self
.
horizontalLayout
.
setObjectName
(
"
horizontalLayout
"
)
self
.
conduct_label_channel
=
QtWidgets
.
QLabel
(
self
.
horizontalLayoutWidget
)
self
.
conduct_label_channel
.
setMinimumSize
(
QtCore
.
QSize
(
90
,
0
))
self
.
conduct_label_channel
.
setObjectName
(
"
conduct_label_channel
"
)
self
.
horizontalLayout
.
addWidget
(
self
.
conduct_label_channel
)
self
.
conduct_pushbutton_channel_prev
=
QtWidgets
.
QPushButton
(
self
.
horizontalLayoutWidget
)
self
.
conduct_pushbutton_channel_prev
.
setEnabled
(
False
)
self
.
conduct_pushbutton_channel_prev
.
setMaximumSize
(
QtCore
.
QSize
(
20
,
16777215
))
self
.
conduct_pushbutton_channel_prev
.
setObjectName
(
"
conduct_pushbutton_channel_prev
"
)
self
.
horizontalLayout
.
addWidget
(
self
.
conduct_pushbutton_channel_prev
)
self
.
conduct_combobox_channel
=
QtWidgets
.
QComboBox
(
self
.
horizontalLayoutWidget
)
self
.
conduct_combobox_channel
.
setEnabled
(
False
)
self
.
conduct_combobox_channel
.
setMaximumSize
(
QtCore
.
QSize
(
40
,
16777215
))
self
.
conduct_combobox_channel
.
setObjectName
(
"
conduct_combobox_channel
"
)
self
.
conduct_combobox_channel
.
addItem
(
""
)
self
.
conduct_combobox_channel
.
addItem
(
""
)
...
...
@@ -53,6 +62,11 @@ class Ui_MainWindow(object):
self
.
conduct_combobox_channel
.
addItem
(
""
)
self
.
conduct_combobox_channel
.
addItem
(
""
)
self
.
horizontalLayout
.
addWidget
(
self
.
conduct_combobox_channel
)
self
.
conduct_pushbutton_channel_next
=
QtWidgets
.
QPushButton
(
self
.
horizontalLayoutWidget
)
self
.
conduct_pushbutton_channel_next
.
setEnabled
(
False
)
self
.
conduct_pushbutton_channel_next
.
setMaximumSize
(
QtCore
.
QSize
(
20
,
16777215
))
self
.
conduct_pushbutton_channel_next
.
setObjectName
(
"
conduct_pushbutton_channel_next
"
)
self
.
horizontalLayout
.
addWidget
(
self
.
conduct_pushbutton_channel_next
)
self
.
conduct_tablewidget_run
=
QtWidgets
.
QTableWidget
(
self
.
conduct_groupbox
)
self
.
conduct_tablewidget_run
.
setGeometry
(
QtCore
.
QRect
(
930
,
180
,
391
,
521
))
self
.
conduct_tablewidget_run
.
setObjectName
(
"
conduct_tablewidget_run
"
)
...
...
@@ -73,6 +87,7 @@ class Ui_MainWindow(object):
item
=
QtWidgets
.
QTableWidgetItem
()
self
.
conduct_tablewidget_run
.
setHorizontalHeaderItem
(
6
,
item
)
self
.
conduct_pushbutton_save_csv
=
QtWidgets
.
QPushButton
(
self
.
conduct_groupbox
)
self
.
conduct_pushbutton_save_csv
.
setEnabled
(
False
)
self
.
conduct_pushbutton_save_csv
.
setGeometry
(
QtCore
.
QRect
(
450
,
70
,
101
,
30
))
self
.
conduct_pushbutton_save_csv
.
setObjectName
(
"
conduct_pushbutton_save_csv
"
)
MainWindow
.
setCentralWidget
(
self
.
centralwidget
)
...
...
@@ -123,11 +138,13 @@ class Ui_MainWindow(object):
item
=
self
.
conduct_tablewidget_set
.
horizontalHeaderItem
(
3
)
item
.
setText
(
_translate
(
"
MainWindow
"
,
"
Steps
"
))
self
.
conduct_label_channel
.
setText
(
_translate
(
"
MainWindow
"
,
"
Display channel:
"
))
self
.
conduct_pushbutton_channel_prev
.
setText
(
_translate
(
"
MainWindow
"
,
"
<
"
))
self
.
conduct_combobox_channel
.
setItemText
(
0
,
_translate
(
"
MainWindow
"
,
"
1
"
))
self
.
conduct_combobox_channel
.
setItemText
(
1
,
_translate
(
"
MainWindow
"
,
"
2
"
))
self
.
conduct_combobox_channel
.
setItemText
(
2
,
_translate
(
"
MainWindow
"
,
"
3
"
))
self
.
conduct_combobox_channel
.
setItemText
(
3
,
_translate
(
"
MainWindow
"
,
"
4
"
))
self
.
conduct_combobox_channel
.
setItemText
(
4
,
_translate
(
"
MainWindow
"
,
"
5
"
))
self
.
conduct_pushbutton_channel_next
.
setText
(
_translate
(
"
MainWindow
"
,
"
>
"
))
item
=
self
.
conduct_tablewidget_run
.
horizontalHeaderItem
(
0
)
item
.
setText
(
_translate
(
"
MainWindow
"
,
"
Mean
"
))
item
=
self
.
conduct_tablewidget_run
.
horizontalHeaderItem
(
1
)
...
...
This diff is collapsed.
Click to expand it.
src/uim/conductcalibuim.py
+
28
−
2
View file @
04b377db
...
...
@@ -41,7 +41,11 @@ class ConductCalibUim:
self
.
main_ui
.
conduct_pushbutton_save_csv
.
clicked
.
connect
(
self
.
save_as_csv
)
self
.
main_ui
.
conduct_tablewidget_set
.
cellClicked
.
connect
(
self
.
change_selected_run
)
# Channel selectors
self
.
main_ui
.
conduct_combobox_channel
.
currentTextChanged
.
connect
(
self
.
change_selected_channel
)
self
.
main_ui
.
conduct_pushbutton_channel_next
.
clicked
.
connect
(
self
.
display_next_channel
)
self
.
main_ui
.
conduct_pushbutton_channel_prev
.
clicked
.
connect
(
self
.
display_prev_channel
)
self
.
main_ui
.
conduct_tablewidget_run
.
cellClicked
.
connect
(
self
.
highlight_step
)
...
...
@@ -68,6 +72,10 @@ class ConductCalibUim:
self
.
__update_run_plot__
(
calib_run
,
self
.
current_channel
)
self
.
__update_run_table__
(
calib_run
,
self
.
current_channel
)
self
.
main_ui
.
conduct_pushbutton_channel_next
.
setEnabled
(
True
)
self
.
main_ui
.
conduct_combobox_channel
.
setEnabled
(
True
)
self
.
main_ui
.
conduct_pushbutton_save_csv
.
setEnabled
(
True
)
def
save_as_csv
(
self
):
filename
=
QFileDialog
.
getSaveFileName
(
caption
=
"
Save Calibration set as CSV...
"
,
filter
=
"
*.csv
"
)
if
filename
[
0
]
!=
''
:
...
...
@@ -135,8 +143,26 @@ class ConductCalibUim:
def
change_selected_channel
(
self
,
channel
:
str
):
self
.
current_channel
=
int
(
channel
)
self
.
main_ui
.
conduct_combobox_channel
.
setCurrentText
(
channel
)
# In case the current selected channel was not changed by acting directly on the combobox
self
.
__update_run_plot__
(
self
.
current_calib_run
,
int
(
channel
))
self
.
__update_run_table__
(
self
.
current_calib_run
,
int
(
channel
))
if
self
.
current_channel
==
1
:
self
.
main_ui
.
conduct_pushbutton_channel_prev
.
setEnabled
(
False
)
else
:
self
.
main_ui
.
conduct_pushbutton_channel_prev
.
setEnabled
(
True
)
if
self
.
current_channel
==
5
:
self
.
main_ui
.
conduct_pushbutton_channel_next
.
setEnabled
(
False
)
else
:
self
.
main_ui
.
conduct_pushbutton_channel_next
.
setEnabled
(
True
)
def
display_next_channel
(
self
):
next_channel
=
self
.
current_channel
+
1
self
.
change_selected_channel
(
str
(
next_channel
))
def
display_prev_channel
(
self
):
prev_channel
=
self
.
current_channel
-
1
self
.
change_selected_channel
(
str
(
prev_channel
))
####################################################################
# "Run" table
...
...
@@ -152,8 +178,8 @@ class ConductCalibUim:
self
.
main_ui
.
conduct_tablewidget_run
.
setColumnWidth
(
self
.
FREQ_COL
,
40
)
self
.
main_ui
.
conduct_tablewidget_run
.
setColumnWidth
(
self
.
HEADGAIN_COL
,
40
)
self
.
main_ui
.
conduct_tablewidget_run
.
setColumnWidth
(
self
.
EXCITE_COL
,
40
)
self
.
main_ui
.
conduct_tablewidget_run
.
setColumnWidth
(
self
.
VALIDAUTO_COL
,
5
0
)
self
.
main_ui
.
conduct_tablewidget_run
.
setColumnWidth
(
self
.
VALIDMANUAL_COL
,
5
0
)
self
.
main_ui
.
conduct_tablewidget_run
.
setColumnWidth
(
self
.
VALIDAUTO_COL
,
5
5
)
self
.
main_ui
.
conduct_tablewidget_run
.
setColumnWidth
(
self
.
VALIDMANUAL_COL
,
5
5
)
def
__update_run_table__
(
self
,
calib_run
:
CalibRun
,
channel
:
int
):
# Clear table
...
...
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