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
f214b0e0
Commit
f214b0e0
authored
1 year ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
adjust last row; rearrange add_row() to be more readable
parent
761cc38f
No related branches found
No related tags found
1 merge request
!217
Implement dialogs to edit valueColors for 2 multiColorDots plot types
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/view/db_config/value_color_helper/edit_value_color_dialog/multi_color_dot_dialog.py
+21
-27
21 additions, 27 deletions
..._helper/edit_value_color_dialog/multi_color_dot_dialog.py
with
21 additions
and
27 deletions
sohstationviewer/view/db_config/value_color_helper/edit_value_color_dialog/multi_color_dot_dialog.py
+
21
−
27
View file @
f214b0e0
...
@@ -137,39 +137,37 @@ class MultiColorDotDialog(EditValueColorDialog):
...
@@ -137,39 +137,37 @@ class MultiColorDotDialog(EditValueColorDialog):
:param rowid: id of current row
:param rowid: id of current row
"""
"""
lower_bound_lnedit
=
QtWidgets
.
QLineEdit
()
lower_bound_lnedit
=
QtWidgets
.
QLineEdit
()
self
.
main_layout
.
addWidget
(
lower_bound_lnedit
,
rowid
,
1
,
1
,
1
)
lower_bound_lnedit
.
setEnabled
(
False
)
lower_bound_lnedit
.
setReadOnly
(
True
)
if
rowid
==
0
:
lower_bound_lnedit
.
setHidden
(
True
)
elif
rowid
<
ROW_TOTAL
-
1
:
lower_bound_lnedit
.
setEnabled
(
False
)
else
:
lower_bound_lnedit
.
setHidden
(
True
)
comparing_text
=
self
.
get_comparing_text
(
rowid
)
comparing_text
=
self
.
get_comparing_text
(
rowid
)
self
.
main_layout
.
addWidget
(
QtWidgets
.
QLabel
(
comparing_label
=
QtWidgets
.
QLabel
(
comparing_text
)
comparing_text
),
rowid
,
2
,
1
,
1
)
higher_bound_lnedit
=
QtWidgets
.
QLineEdit
()
higher_bound_lnedit
=
QtWidgets
.
QLineEdit
()
validator
=
BoundValidator
()
validator
=
BoundValidator
()
higher_bound_lnedit
.
setValidator
(
validator
)
higher_bound_lnedit
.
setValidator
(
validator
)
self
.
main_layout
.
addWidget
(
higher_bound_lnedit
,
rowid
,
3
,
1
,
1
)
if
rowid
==
ROW_TOTAL
-
1
:
if
rowid
==
0
:
higher_bound_lnedit
.
setEnabled
(
False
)
lower_bound_lnedit
.
setHidden
(
True
)
elif
rowid
==
ROW_TOTAL
-
1
:
higher_bound_lnedit
.
setHidden
(
True
)
select_color_btn
=
QtWidgets
.
QPushButton
(
"
Select Color
"
)
select_color_btn
=
QtWidgets
.
QPushButton
(
"
Select Color
"
)
select_color_btn
.
clicked
.
connect
(
lambda
:
self
.
on_select_color
(
rowid
))
# set focus policy to not be clicked by hitting enter in higher bound
# set focus policy to not be clicked by hitting enter in higher bound
select_color_btn
.
setFocusPolicy
(
QtCore
.
Qt
.
NoFocus
)
select_color_btn
.
setFocusPolicy
(
QtCore
.
Qt
.
NoFocus
)
self
.
main_layout
.
addWidget
(
select_color_btn
,
rowid
,
4
,
1
,
1
)
color_label
=
QtWidgets
.
QLabel
()
color_label
=
QtWidgets
.
QLabel
()
color_label
.
setFixedWidth
(
30
)
color_label
.
setFixedWidth
(
30
)
color_label
.
setAutoFillBackground
(
True
)
color_label
.
setAutoFillBackground
(
True
)
# layout
self
.
main_layout
.
addWidget
(
lower_bound_lnedit
,
rowid
,
1
,
1
,
1
)
self
.
main_layout
.
addWidget
(
comparing_label
,
rowid
,
2
,
1
,
1
)
self
.
main_layout
.
addWidget
(
higher_bound_lnedit
,
rowid
,
3
,
1
,
1
)
self
.
main_layout
.
addWidget
(
select_color_btn
,
rowid
,
4
,
1
,
1
)
self
.
main_layout
.
addWidget
(
color_label
,
rowid
,
5
,
1
,
1
)
self
.
main_layout
.
addWidget
(
color_label
,
rowid
,
5
,
1
,
1
)
select_color_btn
.
clicked
.
connect
(
lambda
:
self
.
on_select_color
(
rowid
))
return
(
lower_bound_lnedit
,
higher_bound_lnedit
,
return
(
lower_bound_lnedit
,
higher_bound_lnedit
,
select_color_btn
,
color_label
)
select_color_btn
,
color_label
)
...
@@ -319,9 +317,8 @@ class MultiColorDotDialog(EditValueColorDialog):
...
@@ -319,9 +317,8 @@ class MultiColorDotDialog(EditValueColorDialog):
self
.
rowid_value_dict
=
{
i
:
float
(
self
.
higher_bound_lnedits
[
i
].
text
())
self
.
rowid_value_dict
=
{
i
:
float
(
self
.
higher_bound_lnedits
[
i
].
text
())
for
i
in
range
(
ROW_TOTAL
-
1
)
for
i
in
range
(
ROW_TOTAL
-
1
)
if
self
.
higher_bound_lnedits
[
i
].
text
()
!=
''
}
if
self
.
higher_bound_lnedits
[
i
].
text
()
!=
''
}
last_row_lnedit
=
(
self
.
lower_bound_lnedits
[
ROW_TOTAL
-
1
]
last_row_lnedit
=
self
.
lower_bound_lnedits
[
ROW_TOTAL
-
1
]
if
self
.
upper_equal
else
self
.
higher_bound_lnedits
[
ROW_TOTAL
-
1
])
if
len
(
self
.
rowid_value_dict
)
==
0
:
if
len
(
self
.
rowid_value_dict
)
==
0
:
last_row_lnedit
.
clear
()
last_row_lnedit
.
clear
()
else
:
else
:
...
@@ -375,10 +372,8 @@ class MultiColorDotDialog(EditValueColorDialog):
...
@@ -375,10 +372,8 @@ class MultiColorDotDialog(EditValueColorDialog):
self
.
lower_bound_lnedits
[
vc_idx
+
1
].
setText
(
str
(
value
))
self
.
lower_bound_lnedits
[
vc_idx
+
1
].
setText
(
str
(
value
))
else
:
else
:
self
.
include_greater_than_chkbox
.
setChecked
(
True
)
self
.
include_greater_than_chkbox
.
setChecked
(
True
)
if
self
.
upper_equal
:
self
.
lower_bound_lnedits
[
ROW_TOTAL
-
1
].
setText
(
str
(
value
))
self
.
lower_bound_lnedits
[
ROW_TOTAL
-
1
].
setText
(
str
(
value
))
else
:
self
.
higher_bound_lnedits
[
ROW_TOTAL
-
1
].
setText
(
str
(
value
))
if
color
==
'
not plot
'
:
if
color
==
'
not plot
'
:
self
.
set_color_enabled
(
vc_idx
,
False
)
self
.
set_color_enabled
(
vc_idx
,
False
)
else
:
else
:
...
@@ -417,11 +412,10 @@ class MultiColorDotDialog(EditValueColorDialog):
...
@@ -417,11 +412,10 @@ class MultiColorDotDialog(EditValueColorDialog):
color
=
self
.
color_labels
[
ROW_TOTAL
-
1
].
palette
().
window
(
color
=
self
.
color_labels
[
ROW_TOTAL
-
1
].
palette
().
window
(
).
color
().
name
()
).
color
().
name
()
val
=
f
"
{
self
.
lower_bound_lnedits
[
ROW_TOTAL
-
1
].
text
()
}
"
if
self
.
upper_equal
:
if
self
.
upper_equal
:
val
=
f
"
{
self
.
lower_bound_lnedits
[
ROW_TOTAL
-
1
].
text
()
}
"
value_color_list
.
append
(
f
"
{
val
}
<:
{
color
}
"
)
value_color_list
.
append
(
f
"
{
val
}
<:
{
color
}
"
)
else
:
else
:
val
=
f
"
{
self
.
higher_bound_lnedits
[
ROW_TOTAL
-
1
].
text
()
}
"
value_color_list
.
append
(
f
"
=
{
val
}
:
{
color
}
"
)
value_color_list
.
append
(
f
"
=
{
val
}
:
{
color
}
"
)
self
.
value_color_str
=
'
|
'
.
join
(
value_color_list
)
self
.
value_color_str
=
'
|
'
.
join
(
value_color_list
)
...
@@ -444,7 +438,7 @@ class MultiColorDotLowerEqualDialog(MultiColorDotDialog):
...
@@ -444,7 +438,7 @@ class MultiColorDotLowerEqualDialog(MultiColorDotDialog):
elif
rowid
<
ROW_TOTAL
-
1
:
elif
rowid
<
ROW_TOTAL
-
1
:
comparing_text
=
"
<= d <
"
comparing_text
=
"
<= d <
"
else
:
else
:
comparing_text
=
"
d
=
"
comparing_text
=
"
=
d
"
return
comparing_text
return
comparing_text
def
set_value
(
self
):
def
set_value
(
self
):
...
...
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