Commit 720d1973 authored by Yan's avatar Yan
Browse files

Fixed parameters readout

parent ec19455e
......@@ -21,6 +21,7 @@ class Dataset():
self.chromatograms = []
self.dataset = []
self.headers = []
self.params = []
self.timemin = -np.inf
self.timemax = np.inf
......@@ -51,7 +52,6 @@ class Dataset():
class ThermoRawDataset(Dataset):
def __init__(self, rawfile):
super().__init__(rawfile)
self.params = []
self.machtype = []
self.refresh()
......
......@@ -262,6 +262,7 @@ def plot_subtime(augCanvas):
augCanvas.chromplot.set_xlim(chlims[0])
augCanvas.chromplot.set_ylim(chlims[1])
augCanvas.draw()
update_paramstable(augCanvas)
def pick_times(x_min, x_max, augCanvas):
......@@ -470,25 +471,25 @@ def populate(augCanvas):
def update_paramstable(augCanvas):
if len(augCanvas.ms['params']) == 0:
if augCanvas.ds.params == []:
augCanvas.paramstable.setRowCount(0)
return
elif len(augCanvas.ms['params'][0]) == augCanvas.paramstable.rowCount():
elif len(augCanvas.ds.params[0]) == augCanvas.paramstable.rowCount():
states = [augCanvas.paramstable.cellWidget(row, 0).checkState()
for row in range(augCanvas.paramstable.rowCount())]
else:
states = False
augCanvas.paramstable.setRowCount(len(augCanvas.ms['params'][0]))
for row, paramname in enumerate(augCanvas.ms['params'][0]):
augCanvas.paramstable.setRowCount(len(augCanvas.ds.params[0]))
for row, paramname in enumerate(augCanvas.ds.params[0]):
[augCanvas.paramstable.setItem(row, col, QtWidgets.QTableWidgetItem())
for col in range(1, 3)]
augCanvas.paramstable.setCellWidget(row, 0, QtWidgets.QCheckBox())
if states:
augCanvas.paramstable.cellWidget(row, 0).setCheckState(states[row])
augCanvas.paramstable.item(row, 1).setText(paramname)
vals = [param[row] for param in augCanvas.ms['params'][1]
if (param[0] >= augCanvas.chrom['t_start'] and
param[0] <= augCanvas.chrom['t_end'])]
vals = [param[row] for param in augCanvas.ds.params[1]
if (param[0] >= augCanvas.ds.timemin and
param[0] <= augCanvas.ds.timemax)]
if len(vals) == 0:
text = ""
elif all([type(val) in [np.float32, np.float64] for val in vals]):
......
......@@ -141,7 +141,7 @@ def pop_dial(augCanvas, drls, graph, labels, parselect):
names, times, intensities = drl.get_daughterset(augCanvas.ds, drls)
colorargs = [row for row in range(drls['dt'].rowCount())
if drls['dt'].cellWidget(row, 0).checkState() == 2]
params = augCanvas.ms['params'][1]
params = augCanvas.ds.params[1]
headers = np.concatenate(augCanvas.ds.headers, axis=0)
parlen = len(params)
if len(names) < 2:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment