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): ...@@ -253,8 +253,7 @@ class MultiColorDotDialog(EditValueColorDialog):
+ If the last row is empty string, that value will be eliminated + If the last row is empty string, that value will be eliminated
from condition. from condition.
+ If value not greater than previous row and less than latter row, + If value not greater than previous row and less than latter row,
give error message. -20 and 20 are given to previous or latter give error message.
row if not exist b/c they are out of range of bound [-10, 10]
Call set_value_row_id_dict to keep track of value by row_id. Call set_value_row_id_dict to keep track of value by row_id.
:param row_id: id of the row being checked. :param row_id: id of the row being checked.
...@@ -272,9 +271,12 @@ class MultiColorDotDialog(EditValueColorDialog): ...@@ -272,9 +271,12 @@ class MultiColorDotDialog(EditValueColorDialog):
self.changed_row_id = None 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 = ( prev_higher_bound = (
float(self.higher_bound_lnedits[row_id - 1].text()) -20 if row_id == 0
if row_id > 0 else -20) else float(self.higher_bound_lnedits[row_id - 1].text()))
if self.higher_bound_lnedits[row_id].text().strip() == '': if self.higher_bound_lnedits[row_id].text().strip() == '':
self.handle_clear_higher_bound(row_id) self.handle_clear_higher_bound(row_id)
...@@ -282,13 +284,12 @@ class MultiColorDotDialog(EditValueColorDialog): ...@@ -282,13 +284,12 @@ class MultiColorDotDialog(EditValueColorDialog):
self.save_colors_btn_clicked = False self.save_colors_btn_clicked = False
return return
if row_id >= len(self.row_id_value_dict) - 1: # 20 is assigned to higher bound of the row after the last edited row
# When the current higher_bound_lnedits is on the last row # to always satisfy validating this row's higher bound value for value
# set the limit 20 to be the next_higher_bound # range is [-10,10]
next_higher_bound = 20 next_higher_bound = (
else: 20 if row_id == len(self.row_id_value_dict) - 1
next_higher_bound = float( else float(self.higher_bound_lnedits[row_id + 1].text()))
self.higher_bound_lnedits[row_id + 1].text())
curr_higher_bound = float(self.higher_bound_lnedits[row_id].text()) curr_higher_bound = float(self.higher_bound_lnedits[row_id].text())
if (curr_higher_bound <= prev_higher_bound 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