Changeset 477c473 in sasview


Ignore:
Timestamp:
Nov 16, 2017 4:23:30 PM (7 years ago)
Author:
krzywon
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:
d744767
Parents:
a657de3
Message:

Fix DMax window updates.

Location:
src/sas/qtgui/Perspectives/Inversion
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    rbcf1215 r477c473  
    2828 
    2929 
    30 # TODO: Remove data 
    3130# TODO: Modify plot references, don't just send new 
    3231# TODO: Update help with batch capabilities 
    33 # TODO: Easy way to scroll through results - no tabs in window(?) - 'spreadsheet' 
    3432# TODO: Method to export results in some meaningful way 
    3533class InversionWindow(QtGui.QTabWidget, Ui_PrInversion): 
     
    5351 
    5452        self.logic = InversionLogic() 
     53 
     54        self.dmaxWindow = None 
    5555 
    5656        # The window should not close 
     
    300300        self.pr_plot_list.pop(self._data) 
    301301        self.data_plot_list.pop(self._data) 
     302        if self.dmaxWindow is not None: 
     303            self.dmaxWindow = None 
    302304        self.dataList.removeItem(self.dataList.currentIndex()) 
    303305        self.dataList.setCurrentIndex(0) 
     
    331333            GuiUtils.updateModelItemWithPlot( 
    332334                self._data, QtCore.QVariant(self.data_plot), title) 
     335        if self.dmaxWindow is not None: 
     336            self.dmaxWindow.pr_state = self._calculator 
     337            self.dmaxWindow.nfunc = self.getNFunc() 
     338 
    333339        self.mapper.toFirst() 
    334340 
     
    360366        Open the Explorer window to see correlations between params and results 
    361367        """ 
    362         # TODO: Link Invertor() and DmaxWindow so window updates when recalculated 
    363368        from dmax import DmaxWindow 
    364369        self.dmaxWindow = DmaxWindow(self._calculator, self.getNFunc(), self) 
     
    423428    ###################################################################### 
    424429    # Thread Creators 
    425  
    426     # TODO: Move to individual class(?) 
    427430 
    428431    def startThreadAll(self): 
     
    535538        self.model.setItem(WIDGETS.W_COMP_TIME, 
    536539                           QtGui.QStandardItem(str(elapsed))) 
    537         self.PrTabWidget.setCurrentIndex(0) 
    538540        if message: 
    539541            logging.info(message) 
     
    557559        # Show result on control panel 
    558560 
    559         # TODO: Connect self._calculator to GUI - two-to-one connection possible? 
    560561        self.model.setItem(WIDGETS.W_RG, QtGui.QStandardItem(str(pr.rg(out)))) 
    561562        self.model.setItem(WIDGETS.W_I_ZERO, 
     
    563564        self.model.setItem(WIDGETS.W_BACKGROUND_INPUT, 
    564565                           QtGui.QStandardItem("{:.3f}".format(pr.est_bck))) 
    565         self.model.setItem(WIDGETS.W_BACKGROUND_OUTPUT, 
    566                            QtGui.QStandardItem(str(pr.background))) 
     566        self.model.setItem(WIDGETS.W_BACKGROUND_OUTPUT, QtGui.QStandardItem( 
     567            str("{:.3g}".format(pr.background)))) 
    567568        self.model.setItem(WIDGETS.W_CHI_SQUARED, 
    568569                           QtGui.QStandardItem(str(pr.chi2[0]))) 
     
    576577                           QtGui.QStandardItem(str(pr.get_pos_err(out, cov)))) 
    577578 
    578         # Display results tab 
    579         self.PrTabWidget.setCurrentIndex(1) 
    580579        # Save Pr invertor 
    581580        self._calculator = pr 
  • src/sas/qtgui/Perspectives/Inversion/dmax.py

    r7f5196e r477c473  
    7676        self.closeButton.clicked.connect(self.close) 
    7777 
     78        self.dependentVariable.currentIndexChanged.connect(self.dVChanged) 
     79 
    7880        self.model.itemChanged.connect(self.modelChanged) 
    7981 
     
    101103        self.mapper.toFirst() 
    102104 
    103     def modelChanged(self, item): 
     105    def dVChanged(self): 
     106        self.modelChanged() 
     107 
     108    def modelChanged(self): 
    104109        if not self.mapper: 
    105110            return 
Note: See TracChangeset for help on using the changeset viewer.