Ignore:
Timestamp:
Sep 7, 2018 10:20:46 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
f0365a2e
Parents:
fb560d2
git-author:
Piotr Rozyczko <rozyczko@…> (09/07/18 10:19:44)
git-committer:
Piotr Rozyczko <rozyczko@…> (09/07/18 10:20:46)
Message:

Improvements to fitting→plotting process SASVIEW-1029

File:
1 edited

Legend:

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

    r4ea8020 rc2f3ca2  
    15071507        # update charts 
    15081508        self.onPlot() 
     1509        #self.recalculatePlotData() 
     1510 
    15091511 
    15101512        # Read only value - we can get away by just printing it here 
     
    15941596            param_repr = GuiUtils.formatNumber(param_dict[param_name][0], high=True) 
    15951597            self._model_model.item(row, 1).setText(param_repr) 
     1598            self.kernel_module.setParam(param_name, param_dict[param_name][0]) 
    15961599            if self.has_error_column: 
    15971600                error_repr = GuiUtils.formatNumber(param_dict[param_name][1], high=True) 
     
    16351638            poly_item.insertColumn(2, [QtGui.QStandardItem("")]) 
    16361639 
    1637         # block signals temporarily, so we don't end up 
    1638         # updating charts with every single model change on the end of fitting 
    1639         self._model_model.blockSignals(True) 
    1640  
    16411640        if not self.has_error_column: 
    16421641            # create top-level error column 
     
    16451644            self.iterateOverModel(createErrorColumn) 
    16461645 
    1647             # we need to enable signals for this, otherwise the final column mysteriously disappears (don't ask, I don't 
    1648             # know) 
    1649             self._model_model.blockSignals(False) 
    16501646            self._model_model.insertColumn(2, error_column) 
    1651             self._model_model.blockSignals(True) 
    16521647 
    16531648            FittingUtilities.addErrorHeadersToModel(self._model_model) 
     
    16581653            self.has_error_column = True 
    16591654 
     1655        # block signals temporarily, so we don't end up 
     1656        # updating charts with every single model change on the end of fitting 
     1657        self._model_model.itemChanged.disconnect() 
    16601658        self.iterateOverModel(updateFittedValues) 
    16611659        self.iterateOverModel(updatePolyValues) 
    1662  
    1663         self._model_model.blockSignals(False) 
     1660        self._model_model.itemChanged.connect(self.onMainParamsChange) 
    16641661 
    16651662        # Adjust the table cells width. 
     
    16961693            param_repr = GuiUtils.formatNumber(param_dict[param_name][0], high=True) 
    16971694            self._poly_model.item(row_i, 1).setText(param_repr) 
     1695            self.kernel_module.setParam(param_name, param_dict[param_name][0]) 
    16981696            if self.has_poly_error_column: 
    16991697                error_repr = GuiUtils.formatNumber(param_dict[param_name][1], high=True) 
    17001698                self._poly_model.item(row_i, 2).setText(error_repr) 
    1701  
    17021699 
    17031700        def createErrorColumn(row_i): 
     
    17201717        # block signals temporarily, so we don't end up 
    17211718        # updating charts with every single model change on the end of fitting 
    1722         self._poly_model.blockSignals(True) 
     1719        self._poly_model.itemChanged.disconnect() 
    17231720        self.iterateOverPolyModel(updateFittedValues) 
    1724         self._poly_model.blockSignals(False) 
     1721        self._poly_model.itemChanged.connect(self.onPolyModelChange) 
    17251722 
    17261723        if self.has_poly_error_column: 
     
    17321729 
    17331730        # switch off reponse to model change 
    1734         self._poly_model.blockSignals(True) 
    17351731        self._poly_model.insertColumn(2, error_column) 
    1736         self._poly_model.blockSignals(False) 
    17371732        FittingUtilities.addErrorPolyHeadersToModel(self._poly_model) 
    17381733 
     
    17671762            param_repr = GuiUtils.formatNumber(param_dict[param_name][0], high=True) 
    17681763            self._magnet_model.item(row, 1).setText(param_repr) 
     1764            self.kernel_module.setParam(param_name, param_dict[param_name][0]) 
    17691765            if self.has_magnet_error_column: 
    17701766                error_repr = GuiUtils.formatNumber(param_dict[param_name][1], high=True) 
     
    17861782        # block signals temporarily, so we don't end up 
    17871783        # updating charts with every single model change on the end of fitting 
    1788         self._magnet_model.blockSignals(True) 
     1784        self._magnet_model.itemChanged.disconnect() 
    17891785        self.iterateOverMagnetModel(updateFittedValues) 
    1790         self._magnet_model.blockSignals(False) 
     1786        self._magnet_model.itemChanged.connect(self.onMagnetModelChange) 
    17911787 
    17921788        if self.has_magnet_error_column: 
     
    17981794 
    17991795        # switch off reponse to model change 
    1800         self._magnet_model.blockSignals(True) 
    18011796        self._magnet_model.insertColumn(2, error_column) 
    1802         self._magnet_model.blockSignals(False) 
    18031797        FittingUtilities.addErrorHeadersToModel(self._magnet_model) 
    18041798 
     
    18121806        self.cmdPlot.setText("Show Plot") 
    18131807        # Force data recalculation so existing charts are updated 
     1808        self.showPlot() 
    18141809        self.recalculatePlotData() 
    1815         self.showPlot() 
    18161810 
    18171811    def onSmearingOptionsUpdate(self): 
Note: See TracChangeset for help on using the changeset viewer.