- Timestamp:
- Oct 28, 2017 11:15:26 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- dfd8233
- Parents:
- d132f33
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
rd132f33 r26f42b1 252 252 self.explorerButton.setEnabled(False) 253 253 254 def populateDataComboBox(self, filename ):254 def populateDataComboBox(self, filename, data_ref): 255 255 """ 256 256 Append a new file name to the data combobox … … 258 258 """ 259 259 qt_item = QtCore.QString.fromUtf8(filename) 260 self.dataList.addItem(qt_item) 260 ref = QtCore.QVariant(data_ref) 261 self.dataList.addItem(qt_item, ref) 261 262 262 263 def acceptNoTerms(self): … … 271 272 272 273 def displayChange(self): 273 data_name = str(self.dataList.currentText()) 274 # TODO: Find data ref based on file name 275 # TODO: Find way to link standardmodelitem with combobox entry 274 variant_ref = self.currentWidget() 275 self.setCurrentData(variant_ref.toPyObject()[0]) 276 276 277 277 ###################################################################### … … 356 356 raise AttributeError, msg 357 357 358 if not isinstance(data_item[0], QtGui.QStandardItem): 358 for data in data_item: 359 self.setCurrentData(data) 360 361 def setCurrentData(self, data_ref): 362 """Set an individual data set to the current data""" 363 364 if not isinstance(data_ref, QtGui.QStandardItem): 359 365 msg = "Incorrect type passed to the P(r) Perspective" 360 366 raise AttributeError, msg 361 367 362 for data in data_item:363 # Data references364 self._data = data365 self._data_set = GuiUtils.dataFromItem(data)366 self.populateDataComboBox(self._data_set.filename)367 368 369 370 371 372 373 374 375 376 377 378 379 380 368 # Data references 369 self._data = data_ref 370 self._data_set = GuiUtils.dataFromItem(data_ref) 371 ref = QtCore.QVariant(self._data) 372 self.populateDataComboBox(self._data_set.filename, ref) 373 self._data_list[self._data] = self._calculator 374 375 # Estimate initial values from data 376 self.performEstimate() 377 self.logic = InversionLogic(self._data_set) 378 379 # Estimate q range 380 qmin, qmax = self.logic.computeDataRange() 381 self.model.setItem(WIDGETS.W_QMIN, QtGui.QStandardItem( 382 "{:.4g}".format(qmin))) 383 self.model.setItem(WIDGETS.W_QMAX, QtGui.QStandardItem( 384 "{:.4g}".format(qmax))) 385 386 self.enableButtons() 381 387 382 388 ######################################################################
Note: See TracChangeset
for help on using the changeset viewer.