Changeset 5236449 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
- Timestamp:
- Mar 8, 2017 7:35:49 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:
- cbcdd2c
- Parents:
- 86f88d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
r6f7f652 r5236449 5 5 from PyQt4 import QtGui 6 6 7 import sas.qtgui.GuiUtils as GuiUtils 8 7 9 from FittingWidget import FittingWidget 8 10 … … 10 12 """ 11 13 """ 14 updateTheoryFromPerspectiveSignal = QtCore.pyqtSignal(QtGui.QStandardItem) 12 15 name = "Fitting" # For displaying in the combo box in DataExplorer 13 16 def __init__(self, manager=None, parent=None, data=None): … … 41 44 self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer) 42 45 46 self.communicate = GuiUtils.Communicate() 47 43 48 def addFit(self, data): 44 49 """ 45 50 Add a new tab for passed data 46 51 """ 47 tab = FittingWidget(manager=self.manager, parent=self.parent, data=data )52 tab = FittingWidget(manager=self.manager, parent=self.parent, data=data, id=self.maxIndex+1) 48 53 self.tabs.append(tab) 49 54 self.maxIndex += 1 50 55 self.addTab(tab, self.tabName()) 56 tab.signalTheory.connect(self.passSignal) 51 57 52 58 def tabName(self): … … 77 83 """ 78 84 Assign new dataset to the fitting instance 85 Obtain a QStandardItem object and dissect it to get Data1D/2D 86 Pass it over to the calculator 79 87 """ 80 88 assert(data_item is not None) 81 89 82 # Find an unassigned tab. 90 if not isinstance(data_item, list): 91 msg = "Incorrect type passed to the Fitting Perspective" 92 raise AttributeError, msg 93 94 if not isinstance(data_item[0], QtGui.QStandardItem): 95 msg = "Incorrect type passed to the Fitting Perspective" 96 raise AttributeError, msg 97 98 self._model_item = data_item[0] 99 100 # Extract data on 1st child - this is the Data1D/2D component 101 data = GuiUtils.dataFromItem(self._model_item) 102 103 # self.model.item(WIDGETS.W_FILENAME).setData(QtCore.QVariant(self._model_item.text())) 104 105 # Find the first unassigned tab. 83 106 # If none, open a new tab. 84 107 available_tabs = list(map(lambda tab:tab.acceptsData(), self.tabs)) … … 90 113 91 114 115 def passSignal(self, theory_item): 116 """ 117 """ 118 self.updateTheoryFromPerspectiveSignal.emit(theory_item) 119 92 120 if __name__ == "__main__": 93 121 app = QtGui.QApplication([])
Note: See TracChangeset
for help on using the changeset viewer.