Changeset 00353b4 in sasview for sansview


Ignore:
Timestamp:
Oct 15, 2008 4:16:05 PM (16 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:
7764b41
Parents:
8809e48
Message:

modified context menu

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitpage.py

    r6f73a08 r00353b4  
    343343        self.text4_2.Show() 
    344344        self.text4_3.Show() 
    345         if not dataset.data.__class__.__name__=='Data2D': 
     345        if not hasattr(dataset.data,'image'): 
    346346            self.xmin.SetValue(format_number(min(dataset.data.x))) 
    347347            self.xmin.Show() 
     
    505505                     name=str(item[0].GetLabelText()) 
    506506                     value= float(item[1].GetValue()) 
    507                      self.model.setParam(name,value) 
    508                      self.manager.redraw_model(float(self.xmin.GetValue())\ 
    509                                                ,float(self.xmax.GetValue())) 
     507                     self.model.setParam(name,value)  
    510508                except: 
    511509                     wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\ 
    512510                            "Drawing  Error:wrong value entered : %s"% sys.exc_value)) 
    513                       
     511            self.manager.redraw_model(float(self.xmin.GetValue())\ 
     512                                               ,float(self.xmax.GetValue()))       
    514513                      
    515514    def select_all_param(self,event):  
     
    521520            if  self.cb1.GetValue()==True: 
    522521                for item in self.parameters: 
    523                     
    524522                    item[0].SetValue(True) 
    525523                    list= [item[0],item[1],item[2],item[3]] 
  • sansview/perspectives/fitting/fitting.py

    r6f73a08 r00353b4  
    44 
    55from copy import deepcopy  
    6 #from sans.guitools.plottables import Data1D, Theory1D 
    7 #from sans.guitools.PlotPanel import PlotPanel 
    86from danse.common.plottools.plottables import Data1D, Theory1D, Data2D 
     7 
     8from sans.guiframe.data_loader import MetaData1D, MetaTheory1D, MetaData2D 
    99from danse.common.plottools.PlotPanel import PlotPanel 
    1010from sans.guicomm.events import NewPlotEvent, StatusEvent   
     
    8484        self.graph=graph 
    8585        for item in graph.plottables: 
    86             if item.__class__.__name__ is "Data2D": 
     86            if item.__class__.__name__ is "MetaData2D": 
    8787                return [["Fit Data2D", "Dialog with fitting parameters ", self._onSelect]]  
    8888            else: 
    89                 if item.name==graph.selected_plottable and item.__class__.__name__ is not "Theory1D": 
    90                     return [["Select Data", "Dialog with fitting parameters ", self._onSelect]]  
     89                if item.name==graph.selected_plottable and (item.__class__.__name__ is  "MetaData1D"or \ 
     90                                        item.__class__.__name__ is  "Data1D" ): 
     91                    return [["Fit Data1D", "Dialog with fitting parameters ", self._onSelect]]  
    9192        return []    
    9293 
     
    143144        self.panel = event.GetEventObject() 
    144145        for item in self.panel.graph.plottables: 
    145             if item.name == self.panel.graph.selected_plottable or item.__class__.__name__ is "Data2D": 
     146            if item.name == self.panel.graph.selected_plottable or item.__class__.__name__ is "MetaData2D": 
    146147                #find a name for the page created for notebook 
    147148                try: 
     
    152153                    page = self.fit_panel.add_fit_page(name) 
    153154                    # add data associated to the page created 
    154                     if item.__class__.__name__=='Data1D': 
     155                    if item.__class__.__name__=='MetaData1D' or item.__class__.__name__=='Data1D' : 
    155156                        new_item=FitData1D(item) 
    156157                    else: 
     
    484485            data=fitdata.data 
    485486             
    486             if data!=None and data.__class__.__name__ != 'Data2D': 
     487            if data!=None and data.__class__.__name__ != 'MetaData2D': 
    487488                theory = Theory1D(x=[], y=[]) 
    488489                theory.name = "Model" 
Note: See TracChangeset for help on using the changeset viewer.