Skip to content
Snippets Groups Projects
Commit a6b174b8 authored by Lan Dam's avatar Lan Dam
Browse files

move detail's comment to code

parent a01f48c8
No related branches found
No related tags found
1 merge request!217Implement dialogs to edit valueColors for 2 multiColorDots plot types
Pipeline #3346 passed with stage
in 6 minutes and 9 seconds
......@@ -253,8 +253,7 @@ class MultiColorDotDialog(EditValueColorDialog):
+ If the last row is empty string, that value will be eliminated
from condition.
+ If value not greater than previous row and less than latter row,
give error message. -20 and 20 are given to previous or latter
row if not exist b/c they are out of range of bound [-10, 10]
give error message.
Call set_value_row_id_dict to keep track of value by row_id.
:param row_id: id of the row being checked.
......@@ -272,9 +271,12 @@ class MultiColorDotDialog(EditValueColorDialog):
self.changed_row_id = None
# -20 is assigned to higher bound of the row before the first row
# to always satisfy validating this row's higher bound value for value
# range is [-10,10]
prev_higher_bound = (
float(self.higher_bound_lnedits[row_id - 1].text())
if row_id > 0 else -20)
-20 if row_id == 0
else float(self.higher_bound_lnedits[row_id - 1].text()))
if self.higher_bound_lnedits[row_id].text().strip() == '':
self.handle_clear_higher_bound(row_id)
......@@ -282,13 +284,12 @@ class MultiColorDotDialog(EditValueColorDialog):
self.save_colors_btn_clicked = False
return
if row_id >= len(self.row_id_value_dict) - 1:
# When the current higher_bound_lnedits is on the last row
# set the limit 20 to be the next_higher_bound
next_higher_bound = 20
else:
next_higher_bound = float(
self.higher_bound_lnedits[row_id + 1].text())
# 20 is assigned to higher bound of the row after the last edited row
# to always satisfy validating this row's higher bound value for value
# range is [-10,10]
next_higher_bound = (
20 if row_id == len(self.row_id_value_dict) - 1
else float(self.higher_bound_lnedits[row_id + 1].text()))
curr_higher_bound = float(self.higher_bound_lnedits[row_id].text())
if (curr_higher_bound <= prev_higher_bound
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment