diff --git a/schainpy/controller.py b/schainpy/controller.py index a1dd03d..b35d6d5 100644 --- a/schainpy/controller.py +++ b/schainpy/controller.py @@ -56,9 +56,6 @@ class ParameterConf(): if value == '': raise ValueError, "%s: This parameter value is empty" %self.name - - if format == 'bool': - value = int(value) if format == 'list': strList = value.split(',') @@ -158,6 +155,12 @@ class ParameterConf(): return self.__formated_value + if format == 'bool': + value = int(value) + + if format == 'int': + value = float(value) + format_func = eval(format) self.__formated_value = format_func(value) diff --git a/schainpy/gui/viewcontroller/basicwindow.py b/schainpy/gui/viewcontroller/basicwindow.py index b6508c1..63f020c 100644 --- a/schainpy/gui/viewcontroller/basicwindow.py +++ b/schainpy/gui/viewcontroller/basicwindow.py @@ -2953,7 +2953,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) else: value = parmObj.getValue() - if int(value): + if value: self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) else: self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) @@ -3131,16 +3131,14 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): else: for parmObj in opObj.getParameterObjList(): if parmObj.name == 'timeInterval': - value = opObj.getParameterValue(parameterName='timeInterval') - value = float(value) + value = opObj.getParameterValue(parameterName='timeInterval') self.specOpIncoherent.setText(str(value)) self.specOpIncoherent.setEnabled(True) self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) self.specOpCobIncInt.setCurrentIndex(0) if parmObj.name == 'n': - value = opObj.getParameterValue(parameterName='n') - value = float(value) + value = opObj.getParameterValue(parameterName='n') self.specOpIncoherent.setText(str(value)) self.specOpIncoherent.setEnabled(True) self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) @@ -3733,8 +3731,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): else: for parmObj in opObj.getParameterObjList(): if parmObj.name == 'timeInterval': - value = opObj.getParameterValue(parameterName='timeInterval') - value = float(value) + value = opObj.getParameterValue(parameterName='timeInterval') self.specHeisOpIncoherent.setText(str(value)) self.specHeisOpIncoherent.setEnabled(True) self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) diff --git a/schainpy/gui/viewer/ui_mainwindow.py b/schainpy/gui/viewer/ui_mainwindow.py index 12e2d6f..3a5c384 100644 --- a/schainpy/gui/viewer/ui_mainwindow.py +++ b/schainpy/gui/viewer/ui_mainwindow.py @@ -70,7 +70,7 @@ class Ui_EnvWindow(object): iconStart = QtGui.QIcon() iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH, icon_name) )), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionStarToolbar.setIcon(iconStart) - + return def setupUi(self, MainWindow):