Skip to content

Commit

Permalink
Added code that will check the entire table for same column data or n…
Browse files Browse the repository at this point in the history
…ot. This refs #134
  • Loading branch information
JeanBilheux committed Apr 16, 2019
1 parent bf96425 commit 14d48e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions addie/processing/mantid/master_table/column_highlighting.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
class ColumnHighlighting:

data_type = 'sample'
column = -1

def __init__(self, main_window=None, column=-1):
def __init__(self, main_window=None):
self.main_window = main_window
self.column = column

self.nbr_row = self.get_nbr_row()
self.set_data_type()

def set_data_type(self):
if self.column >= INDEX_NORMALIZATION_START:
Expand All @@ -37,10 +35,21 @@ def get_nbr_row(self):
nbr_row = self.main_window.processing_ui.h3_table.rowCount()
return nbr_row

def check(self):
column = self.column
def get_nbr_column(self):
nbr_column = self.main_window.processing_ui.h3_table.columnCount()
return nbr_column

def check_all(self):
nbr_column = self.get_nbr_column()
for _col in np.arange(nbr_column):
self.check_column(column=_col)

def check_column(self, column=-1):
self.column = column
are_all_the_same = False

self.set_data_type()

if self.nbr_row > 1:

for _ in np.arange(self.nbr_row):
Expand Down
4 changes: 2 additions & 2 deletions scripts/addie
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@ class MainWindow(QMainWindow):
processing_event_handler.load_ascii(main_window=self, filename=filename)

def check_master_table_column_highlighting(self, row=None, column=-1):
o_highlights = ColumnHighlighting(main_window=self, column=column)
o_highlights.check()
o_highlights = ColumnHighlighting(main_window=self)
o_highlights.check_column(column=column)

def apply_clicked(self):
# do stuff
Expand Down

0 comments on commit 14d48e4

Please sign in to comment.