Changeset 3658abed in sasview


Ignore:
Timestamp:
Jan 10, 2011 10:45:16 AM (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:
7f84e22
Parents:
3e41f43
Message:

make fitting plugin_inheriting from pluginbase

Location:
sansview
Files:
2 edited

Legend:

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

    r67e258c r3658abed  
    6969    info= None 
    7070     
    71      
    72 class Plugin: 
     71from sans.guiframe.plugin_base import PluginBase     
     72 
     73class Plugin(PluginBase): 
    7374    """ 
    7475    Fitting plugin is used to perform fit  
    7576    """ 
    76     def __init__(self): 
    77         """ 
    78         """ 
    79         ## Plug-in name 
    80         self.sub_menu = "Fitting" 
    81          
    82         ## Reference to the parent window 
    83         self.parent = None 
     77    def __init__(self, standalone=False): 
     78        PluginBase.__init__(self, name="Fitting", standalone=standalone) 
     79         
    8480        #Provide list of models existing in the application 
    8581        self.menu_mng = models.ModelManager() 
    86         ## List of panels for the simulation perspective (names) 
    87         self.perspective = [] 
     82         
    8883        #list of panel to send to guiframe 
    8984        self.mypanels = [] 
     
    268263        return self.mypanels 
    269264     
    270     def get_perspective(self): 
    271         """ 
    272         Get the list of panel names for this perspective 
    273         """ 
    274         return self.perspective 
    275      
    276     def on_perspective(self, event): 
    277         """ 
    278         Call back function for the perspective menu item. 
    279         We notify the parent window that the perspective 
    280         has changed. 
    281         """ 
    282         self.parent.set_perspective(self.perspective) 
    283     
    284265    def set_default_perspective(self): 
    285266        """ 
     
    290271        """ 
    291272        return True 
    292      
    293     def post_init(self): 
    294         """ 
    295         Post initialization call back to close the loose ends 
    296         """ 
    297         pass 
    298      
     273   
    299274    def set_state(self, state=None, datainfo=None, format=None): 
    300275        """ 
  • sansview/sansview.py

    rb9b9930 r3658abed  
    7474        except: 
    7575            logging.error("SansView: could not find P(r) plug-in module")  
     76            logging.error(sys.exc_value)   
    7677         
    7778        #Invariant perspective 
     
    8283        except: 
    8384            logging.error("SansView: could not find Invariant plug-in module")  
     85            logging.error(sys.exc_value)   
    8486         
    8587        #Calculator perspective    
     
    8991            self.gui.add_perspective(calculator_plug) 
    9092        except: 
    91             logging.error("SansView: could not find Calculator plug-in module")  
     93            logging.error("SansView: could not find Calculator plug-in module") 
     94            logging.error(sys.exc_value)   
    9295             
    9396        # theory perspective 
     
    98101        except: 
    99102            logging.error("SansView: could not find theory plug-in module") 
     103            logging.error(sys.exc_value)   
    100104             
    101105        # Fitting perspective 
Note: See TracChangeset for help on using the changeset viewer.