Commit 6d5adf9e authored by Yan's avatar Yan
Browse files

DRL evolution - pt3

* input checking when loading DRL configfile improved
parent c9569ca6
......@@ -83,7 +83,7 @@ def main():
drl_logger = logging.getLogger('drlLogger')
logging.basicConfig()
p_logger.setLevel("WARN")
drl_logger.setLevel("DEBUG")
drl_logger.setLevel("INFO")
graph = Figure(figsize=(5, 4), dpi=100, facecolor="None")
......
......@@ -43,7 +43,7 @@ def floatize(table, row, column):
def update_profile(pt, row, dataset):
"""parent table profile spectrum updating procedure"""
# Dont do anything to graph when the spectrum is not populated
logger.info("updating parent table row {} profile".format(row))
logger.debug("updating parent table row {} profile".format(row))
if isinstance(dataset['masses'], type(None)):
return
......@@ -195,6 +195,7 @@ def update_corrfors(drls):
def ptable_changed(row, column, ds, drls, drlspectrum):
"""routine called by change of the ptable spectra"""
logger.debug("ptable changed routine called")
update_corrfors(drls)
drls['dt'].item(row, 0).setText(gettableitemlist(drls['pt'])[row])
if column in (1, 2):
......@@ -249,6 +250,7 @@ def remove_rows(ds, drls, drlspectrum, rows=None):
def add_line(ds, drls, drlspectrum):
"""add parent ion to the table"""
logger.debug("adding line")
newrow = drls['pt'].rowCount()
drls['pt'].blockSignals(True)
......@@ -332,9 +334,10 @@ def load_drltables(parent, dataset, drls, drlspectrum):
for i in range(1, len(rawdata)):
rawline = rawdata[i].split(",")
# TODO: rawline[4] can be -1 - decide if accept this behaviour
# TODO: not checking if multiple corrections are sane
if len(rawline) < 6 or int(rawline[3]) not in range(3) \
or int(rawline[4]) not in range(-1,len(rawdata)):
n = len(rawline)
if n < 6 or not n % 2 == 0 or (int(rawline[3]) not in
range(3)) or not (set(map(int, rawline[4:n:2])) &
set(range(-1, n))):
QtWidgets.QMessageBox.warning(
parent, "Load DRL config tables",
"Config file corrupted on line {},"
......
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