Commit 995756eb authored by Yan's avatar Yan
Browse files

Number of digits can be set

parent 67b2f039
......@@ -14,7 +14,7 @@ from . import zcetools_help
from . import reactivitytools
__version__ = "0.0.37"
__version__ = "0.0.39"
__all__ = ['config', 'datatools', 'docks', 'drltools', 'datasets',
......
......@@ -11,6 +11,7 @@ def settings():
("view/consolevisible", True),
("view/acqparvisible", True),
("view/intensities", False),
("view/digits", 2),
("view/oddeven", False),
("view/legend", True),
("print/msspec_xinch", 10),
......@@ -150,7 +151,14 @@ def dial(parent):
config))
timstoflayout.addLayout(posvarconf(
"Bins - mobility", "timstof/mob_bins", config, "nonint"))
tabs.addTab(timstoftab, "timsTOF")
tabs.addTab(timstoftab, "TimsTOF")
viewtab = QtWidgets.QWidget()
viewlayout = QtWidgets.QVBoxLayout(viewtab)
viewlayout.addLayout(posvarconf(
"number of digits after decimal point", "view/digits", config))
tabs.addTab(viewtab, "View Settings")
close_button = QtWidgets.QPushButton("Close")
close_button.clicked.connect(dialog.close)
......
......@@ -361,8 +361,9 @@ def ann_spec(ms_spec, msdata, ann_limit=0.01):
dispints = cf.settings().value("view/intensities", type=bool)
for peak in s_peaks:
annotation = '{0:.2f}\n{1: .2e}'.format(peak[0], peak[1])\
if dispints else '{0:.2f}'.format(peak[0])
digits = cf.settings().value("view/digits", type=int)
annotation = '{0:.{2}f}\n{1: .{2}e}'.format(peak[0], peak[1], digits)\
if dispints else '{0:.{1}f}'.format(peak[0], digits)
peaktext = ms_spec.annotate(
annotation, xy=(peak['x'], peak['y']), textcoords='data',
picker=True, in_layout=False)
......
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