small fix preventing eventID from being changed in TuneAutopick when parameters are loaded

This commit is contained in:
Marcel Paffrath 2017-05-18 11:41:14 +02:00
parent b979649e82
commit 11a7f17655
2 changed files with 7 additions and 4 deletions

View File

@ -1 +1 @@
45ff-dirty
b979-dirty

View File

@ -1804,8 +1804,11 @@ class AutoPickParaBox(QtGui.QWidget):
self.parameter.setParamKV(param, value)
return self.parameter
def params_to_gui(self):
def params_to_gui(self, tuneMode=False):
for param in self.parameter.get_all_para_names():
if param == 'eventID':
if tuneMode:
continue
box = self.boxes[param]
value = self.parameter[param]
#self.parameter.checkValue(param, value)
@ -1847,7 +1850,7 @@ class AutoPickParaBox(QtGui.QWidget):
if fname[0]:
try:
self.parameter.from_file(fname[0])
self.params_to_gui()
self.params_to_gui(tuneMode=True)
except Exception as e:
self._warn('Could not open file {}:\n{}'.format(fname[0], e))
return
@ -1866,7 +1869,7 @@ class AutoPickParaBox(QtGui.QWidget):
def restoreDefaults(self):
try:
self.parameter.reset_defaults()
self.params_to_gui()
self.params_to_gui(tuneMode=True)
except Exception as e:
self._warn('Could not restore defaults:\n{}'.format(e))
return