Changeset 0d0aa40 in sasview for src/sas


Ignore:
Timestamp:
Sep 15, 2016 8:33:57 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:
d4115a55
Parents:
bc9efde
git-author:
Lewis O'Driscoll <lewis.o'driscoll@…> (08/12/16 10:26:05)
git-committer:
Piotr Rozyczko <rozyczko@…> (09/15/16 08:33:57)
Message:

Allow deletion of linear fits (closes #466)

Also fixes bug where the linear fit would disappear if the home button
was clicked whilst using a non-linear scale

Location:
src/sas/sasgui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    rbc9efde r0d0aa40  
    604604 
    605605            if self.parent.ClassName.count('wxDialog') == 0: 
    606                 wx_id = ids.next() 
    607                 plot_menu.Append(wx_id, '&Linear Fit', name) 
    608                 wx.EVT_MENU(self, wx_id, self.onFitting) 
    609                 plot_menu.AppendSeparator() 
     606                if plot.id != 'fit': 
     607                    wx_id = ids.next() 
     608                    plot_menu.Append(wx_id, '&Linear Fit', name) 
     609                    wx.EVT_MENU(self, wx_id, self.onFitting) 
     610                    plot_menu.AppendSeparator() 
    610611 
    611612                wx_id = ids.next() 
  • src/sas/sasgui/plottools/PlotPanel.py

    r54a1cf8 r0d0aa40  
    1515import os 
    1616import transform 
    17 from plottables import Data1D 
    1817#TODO: make the plottables interactive 
    1918from binder import BindArtist 
     
    190189 
    191190        # new data for the fit 
     191        from sas.sasgui.guiframe.dataFitting import Data1D 
    192192        self.fit_result = Data1D(x=[], y=[], dy=None) 
    193193        self.fit_result.symbol = 13 
     
    17251725        if remove_fit: 
    17261726            self.graph.delete(self.fit_result) 
     1727            if hasattr(self, 'plots'): 
     1728                if 'fit' in self.plots.keys(): 
     1729                    del self.plots['fit'] 
    17271730        self.ly = None 
    17281731        self.q_ctrl = None 
     
    17381741        _yscale = 'linear' 
    17391742        for item in list: 
     1743            if item.id == 'fit': 
     1744                continue 
    17401745            item.setLabel(self.xLabel, self.yLabel) 
    17411746            # control axis labels from the panel itself 
     
    18921897        self.graph.render(self) 
    18931898        self._offset_graph() 
     1899        if hasattr(self, 'plots'): 
     1900            # Used by Plotter1D 
     1901            fit_id = 'fit' 
     1902            self.fit_result.id = fit_id 
     1903            self.fit_result.title = 'Fit' 
     1904            self.fit_result.name = 'Fit' 
     1905            self.plots[fit_id] = self.fit_result 
    18941906        self.subplot.figure.canvas.draw_idle() 
    18951907 
Note: See TracChangeset for help on using the changeset viewer.