Changeset d65a00a in sasview


Ignore:
Timestamp:
Jan 10, 2011 12:41:22 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:
3e41f43
Parents:
a0ac888
Message:

make invariant plugin inheriting from pluginbase in guiframe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant.py

    ra1f2002 rd65a00a  
    1111#copyright 2009, University of Tennessee 
    1212################################################################################ 
    13 #import os 
     13 
     14 
    1415import sys 
    1516import wx 
    1617import copy 
    1718import logging 
    18 #import time 
    19 #from sans.invariant import invariant 
     19 
    2020 
    2121from DataLoader.data_info import Data1D as LoaderData1D 
     
    3030from sans.guicomm.events import EVT_INVSTATE_UPDATE 
    3131 
    32 class Plugin: 
     32from sans.guiframe.plugin_base import PluginBase 
     33 
     34class Plugin(PluginBase): 
    3335    """ 
    3436    This class defines the interface for invariant Plugin class 
     
    3739     
    3840    def __init__(self, standalone=False): 
    39         """ 
    40         Abstract class for gui_manager Plugins. 
    41         """ 
    42         ## Plug-in name. It will appear on the application menu. 
    43         self.sub_menu = "Invariant" 
    44          
    45         ## Reference to the parent window. Filled by get_panels() below. 
    46         self.parent = None 
     41        PluginBase.__init__(self, name="Invariant", standalone=standalone) 
     42         
    4743        #dictionary containing data name and error on dy of that data  
    4844        self.err_dy = {} 
    49         ## List of panels that you would like to open in AUI windows 
    50         #  for your plug-in. This defines your plug-in "perspective" 
    51         self.perspective = [] 
     45        
    5246        #default state objects 
    5347        self.state_reader = None  
    5448        self.temp_state = None  
    5549        self.__data = None  
    56         """ 
    57         # Create a CanSAS/Pr reader 
    58         self.state_reader = Reader(self.set_state) 
    59         l = Loader() 
    60         l.associate_file_reader('.inv', self.state_reader)   
    61         """    
     50        
    6251        # Log startup 
    6352        logging.info("Invariant plug-in started") 
    6453        
    65     def populate_menu(self, id, parent): 
    66         """ 
    67         Create and return the list of application menu 
    68         items for the plug-in.  
    69          
    70         :param id: deprecated. Un-used. 
    71         :param parent: parent window 
    72          
    73         :return: plug-in menu 
    74         """ 
    75         return [] 
    76      
     54   
    7755    def help(self, evt): 
    7856        """ 
     
    11391        # Return the list of panels 
    11492        return [self.invariant_panel] 
    115      
    116     def get_tools(self): 
    117         """ 
    118         Returns a set of menu entries for tools 
    119         """ 
    120         return [] 
    121          
    122      
     93   
    12394    def get_context_menu(self, graph=None): 
    12495        """ 
     
    159130        return []    
    160131 
    161      
    162     def get_perspective(self): 
    163         """ 
    164         Get the list of panel names for this perspective 
    165         """ 
    166         return self.perspective 
    167      
    168     def on_perspective(self, event): 
    169         """ 
    170         Call back function for the perspective menu item. 
    171         We notify the parent window that the perspective 
    172         has changed. 
    173          
    174         :param event: menu event 
    175         """ 
    176         self.parent.set_perspective(self.perspective) 
    177      
    178     def post_init(self): 
    179         """ 
    180         Post initialization call back to close the loose ends 
    181         """ 
    182         pass 
    183      
    184     def set_default_perspective(self): 
    185         """ 
    186         Call back method that True to notify the parent that the current plug-in 
    187         can be set as default  perspective. 
    188         when returning False, the plug-in is not candidate for an automatic  
    189         default perspective setting 
    190         """ 
    191         return False 
    192      
    193132    def copy_data(self, item, dy=None): 
    194133        """ 
Note: See TracChangeset for help on using the changeset viewer.