Changeset 9f25bce in sasview


Ignore:
Timestamp:
Mar 31, 2017 9:32:19 AM (2 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.

Location:
src/sas/qtgui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/DataExplorer.py

    r4ff5e35 r9f25bce  
    967967        # Check if there are any other items for this tab 
    968968        # If so, delete them 
     969        # TODO: fix this to resemble GuiUtils.updateModelItemWithPlot 
     970        #  
    969971        current_tab_name = model_item.text()[:2] 
    970972        for current_index in xrange(self.theory_model.rowCount()): 
  • 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]) 
  • src/sas/qtgui/Plotter.py

    r0268aed r9f25bce  
    572572 
    573573        #if self.leftdown and self.selectedText is not None: 
    574         if self.leftdown or self.selectedText is None: 
     574        if not self.leftdown or self.selectedText is None: 
    575575            return 
    576576        # User has clicked on text and is dragging 
    577         if event.inaxes is  None: 
     577        if event.inaxes is None: 
    578578            # User has dragged outside of axes 
    579579            self.selectedText = None 
  • src/sas/qtgui/Plotter2D.py

    r0274aea r9f25bce  
    277277        variant_plot = QtCore.QVariant(new_plot) 
    278278        GuiUtils.updateModelItemWithPlot(self._item, variant_plot, new_plot.id) 
    279         # TODO: force immediate display (?) 
    280279 
    281280    def setSlicer(self, slicer): 
Note: See TracChangeset for help on using the changeset viewer.