Changeset db4ed82 in sasview for prview


Ignore:
Timestamp:
Mar 16, 2011 1:30:51 PM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
27f4bee
Parents:
36cb4d2f
Message:

working data panel for prview

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prview/perspectives/pr/pr.py

    re88ebfd rdb4ed82  
    7373        self.invertor    = None 
    7474        self.pr          = None 
     75        self.data_id = IQ_DATA_LABEL  
    7576        # Copy of the last result in case we need to display it. 
    7677        self._last_pr    = None 
     
    222223        new_plot.id = "P_{obs}(r)" 
    223224        new_plot.title = title 
    224         self.parent.append_theory(data_id=self.current_plottable.id, 
    225                                        theory=new_plot) 
     225        self.parent.update_theory(data_id=self.data_id,  theory=new_plot) 
    226226        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=title)) 
    227227 
     
    254254        new_plot.id = "P_{true}(r)" 
    255255        new_plot.group_id = "P_{true}(r)" 
    256         self.parent.append_theory(data_id=self.current_plottable.id, 
    257                                        theory=new_plot) 
     256        self.parent.update_theory(data_id=self.data_id, theory=new_plot) 
    258257        #Put this call in plottables/guitools     
    259         wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Sphere P(r)")) 
     258        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 
     259                                                title="Sphere P(r)")) 
    260260        
    261261         
     
    314314            new_plot.group_id = pr.info["plot_group_id"] 
    315315        new_plot.id = IQ_FIT_LABEL 
    316         self.parent.append_theory(data_id=self.current_plottable.id, 
    317                                        theory=new_plot) 
     316        self.parent.update_theory(data_id=self.data_id, theory=new_plot) 
    318317        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=title)) 
    319318         
     
    342341            new_plot.id = IQ_SMEARED_LABEL 
    343342            new_plot.title = title 
    344             self.parent.append_theory(data_id=self.current_plottable.id, 
    345                                        theory=new_plot) 
     343            self.parent.update_theory(data_id=self.data_id, theory=new_plot) 
    346344            wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=title)) 
    347          
    348345         
    349346    def _on_pr_npts(self, evt): 
     
    410407        new_plot.ytransform = "y"   
    411408        new_plot.group_id = "P(r) fit" 
    412         self.parent.append_theory(data_id=self.current_plottable.id, 
    413                                        theory=new_plot)             
     409        self.parent.update_theory(data_id=self.data_id, theory=new_plot)     
    414410        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="P(r) fit")) 
    415          
    416411        return x, pr.d_max 
    417          
    418                  
     412           
    419413    def load(self, data): 
    420414        """ 
     
    669663            new_plot.xaxis("\\rm{r}", 'A') 
    670664            new_plot.yaxis("\\rm{P(r)} ","cm^{-3}") 
    671             self.parent.append_theory(data_id=self.current_plottable.id, 
    672                                        theory=new_plot)         
     665            self.parent.update_theory(data_id=self.data_id, theory=new_plot)         
    673666            wx.PostEvent(self.parent,  
    674667                         NewPlotEvent(plot=new_plot, update=True, 
     
    700693            new_plot.xaxis("\\rm{r}", 'A') 
    701694            new_plot.yaxis("\\rm{P(r)} ","cm^{-3}") 
    702             self.parent.append_theory(data_id=self.current_plottable.id, 
    703                                        theory=new_plot)         
     695            self.parent.update_theory(data_id=self.data_id,theory=new_plot)         
    704696            wx.PostEvent(self.parent,  
    705697                         NewPlotEvent(plot=new_plot, update=True, 
     
    747739         
    748740        filename = os.path.basename(path) 
    749  
    750741        new_plot = Data1D(x, y) 
    751742        new_plot.symbol = GUIFRAME_ID.CURVE_SYMBOL_NUM 
     
    753744        new_plot.xaxis("\\rm{r}", 'A') 
    754745        new_plot.yaxis("\\rm{P(r)} ","cm^{-3}") 
    755              
    756746        # Store a ref to the plottable for later use 
    757747        self._added_plots[filename] = new_plot 
    758748        self._default_Iq[filename]  = numpy.copy(y) 
    759          
    760749        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=filename)) 
    761750         
    762          
    763  
    764751    def start_thread(self): 
    765752        """ 
     
    798785        if not message==None: 
    799786            wx.PostEvent(self.parent, StatusEvent(status=str(message))) 
    800              
    801787        self.perform_estimateNT() 
    802      
    803  
    804788     
    805789    def _estimateNT_completed(self, nterms, alpha, message, elapsed): 
     
    876860            if pr.info.has_key("plot_group_id"): 
    877861                new_plot.group_id = pr.info["plot_group_id"] 
    878             new_plot.id = IQ_DATA_LABEL 
    879             self.parent.append_theory(data_id=self.current_plottable.id, 
     862            new_plot.id = self.data_id 
     863            self.parent.update_theory(data_id=self.data_id, 
    880864                                       theory=new_plot) 
    881865            wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Iq")) 
     
    925909        new_plot.interactive = True 
    926910        new_plot.group_id = IQ_DATA_LABEL  
    927         new_plot.id = IQ_DATA_LABEL 
    928         new_plot.title = "I(q)" 
    929         self.parent.append_theory(data_id=self.current_plottable.id, 
    930                                        theory=new_plot)         
     911        new_plot.id = self.data_id 
     912        new_plot.title = "I(q)"     
    931913        wx.PostEvent(self.parent,  
    932914                     NewPlotEvent(plot=new_plot, title="I(q)", reset=reset)) 
     
    12681250        new_plot.xaxis("\\rm{Q}", 'A^{-1}') 
    12691251        new_plot.yaxis("\\rm{Intensity} ","cm^{-1}") 
    1270         self.parent.append_theory(data_id=self.current_plottable.id, 
    1271                                        theory=new_plot) 
    12721252        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="Iq")) 
    12731253        # Show I(q) fit 
     
    13541334            if issubclass(data.__class__, Data1D): 
    13551335                try: 
     1336                    self.data_id = data.id 
    13561337                    self.control_panel._change_file(evt=None, data=data) 
    13571338                except: 
Note: See TracChangeset for help on using the changeset viewer.