Changeset 9f25bce in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
Mar 31, 2017 9:32:19 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:
116260a
Parents:
4ff5e35
Message:

Towards more 1D plots responding to data change.
Minor bug fixes.

File:
1 edited

Legend:

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

    r7d077d1 r9f25bce  
    237237        self.cmdPlot.clicked.connect(self.onPlot) 
    238238        # Line edits 
    239         self.txtNpts.textChanged.connect(self.onNpts) 
    240         self.txtMinRange.textChanged.connect(self.onMinRange) 
    241         self.txtMaxRange.textChanged.connect(self.onMaxRange) 
     239        self.txtNpts.editingFinished.connect(self.onNpts) 
     240        self.txtMinRange.editingFinished.connect(self.onMinRange) 
     241        self.txtMaxRange.editingFinished.connect(self.onMaxRange) 
    242242 
    243243        # Respond to change in parameters from the UI 
     
    366366        Plot the current set of data 
    367367        """ 
    368         if self.data is None :#or not self.data.is_data: 
     368        if self.data is None : 
    369369            self.createDefaultDataset() 
    370370        self.calculateQGridForModel() 
    371371 
    372     def onNpts(self, text): 
     372    #def onNpts(self, text): 
     373    def onNpts(self): 
    373374        """ 
    374375        Callback for number of points line edit update 
     
    376377        # assumes type/value correctness achieved with QValidator 
    377378        try: 
    378             self.npts = int(text) 
     379            self.npts = int(self.txtNpts.text()) 
    379380        except ValueError: 
    380381            # TODO 
     
    382383            # notifying the user about format available. 
    383384            pass 
    384  
    385     def onMinRange(self, text): 
     385        # Force redisplay 
     386        if self.model_is_loaded: 
     387            self.onPlot() 
     388 
     389    #def onMinRange(self, text): 
     390    def onMinRange(self): 
    386391        """ 
    387392        Callback for minimum range of points line edit update 
     
    389394        # assumes type/value correctness achieved with QValidator 
    390395        try: 
    391             self.q_range_min = float(text) 
     396            self.q_range_min = float(self.txtMinRange.text()) 
    392397        except ValueError: 
    393398            # TODO 
     
    397402        # set Q range labels on the main tab 
    398403        self.lblMinRangeDef.setText(str(self.q_range_min)) 
    399  
    400     def onMaxRange(self, text): 
     404        if self.model_is_loaded: 
     405            self.onPlot() 
     406 
     407    #def onMaxRange(self, text): 
     408    def onMaxRange(self): 
    401409        """ 
    402410        Callback for maximum range of points line edit update 
     
    404412        # assumes type/value correctness achieved with QValidator 
    405413        try: 
    406             self.q_range_max = float(text) 
     414            self.q_range_max = float(self.txtMaxRange.text()) 
    407415        except: 
    408416            pass 
    409417        # set Q range labels on the main tab 
    410418        self.lblMaxRangeDef.setText(str(self.q_range_max)) 
     419        if self.model_is_loaded: 
     420            self.onPlot() 
    411421 
    412422    def setDefaultStructureCombo(self): 
     
    633643        # Notify the GUI manager so it can update the main model in DataExplorer 
    634644        GuiUtils.updateModelItemWithPlot(self._index, QtCore.QVariant(fitted_data), name) 
    635         # Force redisplay 
    636645 
    637646    def createTheoryIndex(self, fitted_data): 
     
    712721            residuals_plot.id = "Residual " + residuals_plot.id 
    713722            self.createNewIndex(residuals_plot) 
     723            self.communicate.plotUpdateSignal.emit([residuals_plot]) 
    714724 
    715725        self.communicate.plotUpdateSignal.emit([fitted_data]) 
Note: See TracChangeset for help on using the changeset viewer.