Ignore:
Timestamp:
Mar 10, 2017 9:44:44 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
cd31251
Parents:
5236449
Message:

QModel items conversion into SasModel? parameters + data display SASVIEW-535

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r5236449 rcbcdd2c  
    1212    """ 
    1313    """ 
    14     updateTheoryFromPerspectiveSignal =  QtCore.pyqtSignal(QtGui.QStandardItem) 
    1514    name = "Fitting" # For displaying in the combo box in DataExplorer 
    1615    def __init__(self, manager=None, parent=None, data=None): 
     
    4443        self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer) 
    4544 
    46         self.communicate = GuiUtils.Communicate() 
     45        #self.communicate = GuiUtils.Communicate() 
     46        self.communicate = self.parent.communicator() 
    4747 
    4848    def addFit(self, data): 
     
    5454        self.maxIndex += 1 
    5555        self.addTab(tab, self.tabName()) 
    56         tab.signalTheory.connect(self.passSignal) 
    5756 
    5857    def tabName(self): 
     
    6766        Update local bookkeeping on tab close 
    6867        """ 
    69         assert(len(self.tabs) >= index) 
     68        assert len(self.tabs) >= index 
    7069        # don't remove the last tab 
    7170        if len(self.tabs) <= 1: 
     
    8685        Pass it over to the calculator 
    8786        """ 
    88         assert(data_item is not None) 
     87        assert data_item is not None 
    8988 
    9089        if not isinstance(data_item, list): 
     
    9897        self._model_item = data_item[0] 
    9998 
    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  
    10599        # Find the first unassigned tab. 
    106100        # If none, open a new tab. 
    107         available_tabs = list(map(lambda tab:tab.acceptsData(), self.tabs)) 
     101        available_tabs = list(map(lambda tab: tab.acceptsData(), self.tabs)) 
    108102 
    109103        if numpy.any(available_tabs): 
     
    111105        else: 
    112106            self.addFit(data_item) 
    113  
    114  
    115     def passSignal(self, theory_item): 
    116         """ 
    117         """ 
    118         self.updateTheoryFromPerspectiveSignal.emit(theory_item) 
    119  
    120 if __name__ == "__main__": 
    121     app = QtGui.QApplication([]) 
    122     dlg = FittingWindow() 
    123     dlg.show() 
    124     sys.exit(app.exec_()) 
Note: See TracChangeset for help on using the changeset viewer.