Changeset d76beb4 in sasview for src/sas/qtgui/Perspectives
- Timestamp:
- Apr 2, 2019 9:43:51 AM (6 years ago)
- Branches:
- ESS_GUI
- Parents:
- f994f188
- git-author:
- Piotr Rozyczko <piotr.rozyczko@…> (04/02/19 09:43:01)
- git-committer:
- Piotr Rozyczko <piotr.rozyczko@…> (04/02/19 09:43:51)
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r73fb503 rd76beb4 255 255 256 256 # Fit options 257 self.q_range_min = 0.005258 self.q_range_max = 0.1259 self.npts = 25257 self.q_range_min = OptionsWidget.QMIN_DEFAULT 258 self.q_range_max = OptionsWidget.QMAX_DEFAULT 259 self.npts = OptionsWidget.NPTS_DEFAULT 260 260 self.log_points = False 261 261 self.weighting = 0 -
src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
rdc3b34e rd76beb4 12 12 # Local UI 13 13 from sas.qtgui.Perspectives.Fitting.UI.OptionsWidgetUI import Ui_tabOptions 14 15 QMIN_DEFAULT = 0.000516 QMAX_DEFAULT = 0.517 NPTS_DEFAULT = 5018 19 MODEL = [20 'MIN_RANGE',21 'MAX_RANGE',22 'NPTS',23 'LOG_SPACED']24 14 25 15 class DataWidgetMapper(QtWidgets.QDataWidgetMapper): … … 44 34 class OptionsWidget(QtWidgets.QWidget, Ui_tabOptions): 45 35 plot_signal = QtCore.pyqtSignal() 36 QMIN_DEFAULT = 0.0005 37 QMAX_DEFAULT = 0.5 38 NPTS_DEFAULT = 50 39 MODEL = [ 40 'MIN_RANGE', 41 'MAX_RANGE', 42 'NPTS', 43 'LOG_SPACED'] 44 46 45 def __init__(self, parent=None, logic=None): 47 46 super(OptionsWidget, self).__init__() … … 79 78 self.weightingGroup.buttonClicked.connect(self.onWeightingChoice) 80 79 81 self.qmin = QMIN_DEFAULT82 self.qmax = QMAX_DEFAULT83 self.npts = NPTS_DEFAULT80 self.qmin = self.QMIN_DEFAULT 81 self.qmax = self.QMAX_DEFAULT 82 self.npts = self.NPTS_DEFAULT 84 83 if self.logic.data_is_loaded: 85 84 self.qmin, self.qmax, self.npts = self.logic.computeDataRange() … … 103 102 """ 104 103 self.model = QtGui.QStandardItemModel() 105 for model_item in range(len( MODEL)):104 for model_item in range(len(self.MODEL)): 106 105 self.model.setItem(model_item, QtGui.QStandardItem()) 107 106 # Attach slot … … 117 116 self.mapper.setOrientation(QtCore.Qt.Vertical) 118 117 119 self.mapper.addMapping(self.txtMinRange, MODEL.index('MIN_RANGE'))120 self.mapper.addMapping(self.txtMaxRange, MODEL.index('MAX_RANGE'))121 self.mapper.addMapping(self.txtNpts, MODEL.index('NPTS'))122 self.mapper.addMapping(self.chkLogData, MODEL.index('LOG_SPACED'))118 self.mapper.addMapping(self.txtMinRange, self.MODEL.index('MIN_RANGE')) 119 self.mapper.addMapping(self.txtMaxRange, self.MODEL.index('MAX_RANGE')) 120 self.mapper.addMapping(self.txtNpts, self.MODEL.index('NPTS')) 121 self.mapper.addMapping(self.chkLogData, self.MODEL.index('LOG_SPACED')) 123 122 124 123 self.mapper.toFirst() … … 185 184 qmax = GuiUtils.formatNumber(self.qmax, high=True) 186 185 qmin = GuiUtils.formatNumber(self.qmin, high=True) 187 self.model.item( MODEL.index('MIN_RANGE')).setText(qmin)188 self.model.item( MODEL.index('MAX_RANGE')).setText(qmax)189 self.model.item( MODEL.index('NPTS')).setText(str(npts))186 self.model.item(self.MODEL.index('MIN_RANGE')).setText(qmin) 187 self.model.item(self.MODEL.index('MAX_RANGE')).setText(qmax) 188 self.model.item(self.MODEL.index('NPTS')).setText(str(npts)) 190 189 self.qmin, self.qmax, self.npts = q_range_min, q_range_max, npts 191 190 … … 194 193 Returns current state of controls 195 194 """ 196 q_range_min = float(self.model.item( MODEL.index('MIN_RANGE')).text())197 q_range_max = float(self.model.item( MODEL.index('MAX_RANGE')).text())198 npts = int(self.model.item( MODEL.index('NPTS')).text())199 log_points = str(self.model.item( MODEL.index('LOG_SPACED')).text()) == 'true'195 q_range_min = float(self.model.item(self.MODEL.index('MIN_RANGE')).text()) 196 q_range_max = float(self.model.item(self.MODEL.index('MAX_RANGE')).text()) 197 npts = int(self.model.item(self.MODEL.index('NPTS')).text()) 198 log_points = str(self.model.item(self.MODEL.index('LOG_SPACED')).text()) == 'true' 200 199 201 200 return (q_range_min, q_range_max, npts, log_points, self.weighting)
Note: See TracChangeset
for help on using the changeset viewer.