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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.