Commit add67ec7 authored by 3Yan's avatar 3Yan
Browse files

Changed DRL layout to docks, fixed few small glitches

parent 409e4b6f
......@@ -237,11 +237,11 @@ def remove_rows(ds, drls, drlspectrum, rows=None):
if rows == None:
rows = reversed(list(set(
map(lambda x: x.row(), drls['pt'].selectedIndexes()))))
cors = []
for row in rows:
drls['dt'].cellWidget(row,0).setCheckState(0)
drls['dt'].removeRow(row)
drls['pt'].removeRow(row)
cors = []
for i in range(drls['dt'].rowCount()):
for cornum in range(drls['cors']):
corfor = drls['dt'].cellWidget(i, 1+cornum*2)
......@@ -454,6 +454,7 @@ def export_drlspectrum(parent, fn, ds, drls):
[names, intensities]]):
expf = open(exp_f_name[i], 'w')
expf.write("times, {}\n".format((",".join(table[0]))))
expf.write("timeshift = {}".format(drls['tshift'].value()))
for j in range(len(times)):
dataset = list()
dataset.append(times[j])
......@@ -530,7 +531,7 @@ def paste_clip(ds, drls, drlspectrum):
if i >= (table.rowCount()):
add_line(ds, drls, drlspectrum)
table.item(i, j).setText(col)
if table == drls['dt'] and j == 2\
if table == drls['dt'] and j != 0 and j % 2 == 0\
and i < table.rowCount():
table.item(i,j).setText(col)
......@@ -672,44 +673,52 @@ def main_window(parent, ds, filename, cache):
drls['checkAll'].stateChanged.connect(lambda state:
select_all_btn_up(ds, drls, chromplot, state))
main_layout = QtWidgets.QVBoxLayout(main_widget)
sub_layout = QtWidgets.QHBoxLayout()
graph_layout = QtWidgets.QVBoxLayout()
graphparams_layout = QtWidgets.QHBoxLayout()
tablelayout = QtWidgets.QVBoxLayout()
actionBar = QtWidgets.QToolBar(window)
window.addToolBar(QtCore.Qt.BottomToolBarArea, actionBar)
actionBar.setAllowedAreas(QtCore.Qt.BottomToolBarArea)
actionBar.setFloatable(False)
actionBar.setMovable(False)
actionBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
actionBar.addWidget(drl_load)
actionBar.addWidget(drl_save)
actionBar.addWidget(drl_print)
stretchWidget = QtWidgets.QWidget()
stretchWidget.setSizePolicy(QtWidgets.QSizePolicy.Expanding
,QtWidgets.QSizePolicy.Preferred)
actionBar.addWidget(stretchWidget)
actionBar.addWidget(drl_export)
actionBar.addWidget(close)
dtdock = QtWidgets.QDockWidget()
dtdock.setWidget(QtWidgets.QWidget())
dtdock_layout = QtWidgets.QVBoxLayout(dtdock.widget())
dtdock.setWindowTitle("Corrected ions table")
dtdock_layout.addWidget(drls['checkAll'])
dtdock_layout.addWidget(drls['dt'])
ptdock = QtWidgets.QDockWidget()
ptdock.setWidget(QtWidgets.QWidget())
ptdock_layout = QtWidgets.QVBoxLayout(ptdock.widget())
ptdock.setWindowTitle("Raw ions table")
ptdock_layout.addWidget(drls['pt'])
pt_butlayout = QtWidgets.QHBoxLayout()
main_butlayout = QtWidgets.QHBoxLayout()
pt_butlayout.addWidget(btn_add)
pt_butlayout.addWidget(btn_rem)
pt_butlayout.addStretch(0)
ptdock_layout.addLayout(pt_butlayout)
main_layout.addLayout(sub_layout)
main_layout.addWidget(HBar())
main_layout.addLayout(main_butlayout)
main_butlayout.addWidget(drl_load)
main_butlayout.addWidget(drl_save)
main_butlayout.addWidget(drl_print)
main_butlayout.addStretch(1)
main_butlayout.addWidget(drl_export)
main_butlayout.addWidget(close)
sub_layout.addLayout(graph_layout, stretch=1)
sub_layout.addLayout(tablelayout)
graph_layout.addWidget(graph_canvas, stretch=1)
graph_layout.addLayout(graphparams_layout)
window.addDockWidget(QtCore.Qt.BottomDockWidgetArea, dtdock)
window.addDockWidget(QtCore.Qt.RightDockWidgetArea, ptdock)
main_layout = QtWidgets.QVBoxLayout(main_widget)
graphparams_layout = QtWidgets.QHBoxLayout()
main_layout.addWidget(graph_canvas, stretch=1)
main_layout.addLayout(graphparams_layout)
graphparams_layout.addWidget(time_title)
graphparams_layout.addWidget(drls['tshift'])
graphparams_layout.addStretch(1)
graphparams_layout.addWidget(drls['rel'])
graphparams_layout.addStretch(1)
tablelayout.addWidget(QtWidgets.QLabel("Raw ions table:"))
tablelayout.addWidget(drls['pt'])
tablelayout.addLayout(pt_butlayout)
tablelayout.addWidget(QtWidgets.QLabel("Corrected ions table:"))
tablelayout.addWidget(drls['checkAll'])
tablelayout.addWidget(drls['dt'])
window.show()
Supports Markdown
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