Changeset 6137b150 in sasview for calculatorview/perspectives/calculator/calculator.py
- Timestamp:
- Jun 9, 2010 4:45:37 PM (14 years ago)
- 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:
- 1b43306
- Parents:
- 16f60cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/perspectives/calculator/calculator.py
r91f151a r6137b150 1 """2 This software was developed by the University of Tennessee as part of the3 Distributed Data Analysis of Neutron Scattering Experiments (DANSE)4 project funded by the US National Science Foundation.5 1 6 See the license text in license.txt 7 8 copyright 2010, University of Tennessee 9 """ 2 ################################################################################ 3 #This software was developed by the University of Tennessee as part of the 4 #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) 5 #project funded by the US National Science Foundation. 6 # 7 #See the license text in license.txt 8 # 9 #copyright 2010, University of Tennessee 10 ################################################################################ 10 11 11 12 import wx … … 14 15 class Plugin: 15 16 """ 16 17 17 This class defines the interface for a Plugin class 18 for calculator perspective 18 19 """ 19 20 20 21 def __init__(self, standalone=True): 21 22 """ 22 23 Abstract class for gui_manager Plugins. 23 24 """ 24 25 ## Plug-in name. It will appear on the application menu. … … 36 37 def populate_menu(self, id, owner): 37 38 """ 38 Create and return the list of application menu 39 items for the plug-in. 40 41 @param id: deprecated. Un-used. 42 @param parent: parent window 43 @return: plug-in menu 39 Create and return the list of application menu 40 items for the plug-in. 41 42 :param id: deprecated. Un-used. 43 :param parent: parent window 44 45 :return: plug-in menu 46 44 47 """ 45 48 return [] … … 47 50 def get_panels(self, parent): 48 51 """ 49 Create and return the list of wx.Panels for your plug-in. 50 Define the plug-in perspective. 51 52 Panels should inherit from DefaultPanel defined below, 53 or should present the same interface. They must define 54 "window_caption" and "window_name". 55 56 @param parent: parent window 57 @return: list of panels 52 Create and return the list of wx.Panels for your plug-in. 53 Define the plug-in perspective. 54 55 Panels should inherit from DefaultPanel defined below, 56 or should present the same interface. They must define 57 "window_caption" and "window_name". 58 59 :param parent: parent window 60 61 :return: list of panels 62 58 63 """ 59 64 ## Save a reference to the parent … … 65 70 def help(self, evt): 66 71 """ 67 Show a general help dialog. 68 TODO: replace the text with a nice image 72 Show a general help dialog. 73 74 :TODO: replace the text with a nice image 69 75 provide more hint on the SLD calculator 70 76 """ … … 75 81 def get_context_menu(self, graph=None): 76 82 """ 77 This method is optional. 83 This method is optional. 84 85 When the context menu of a plot is rendered, the 86 get_context_menu method will be called to give you a 87 chance to add a menu item to the context menu. 78 88 79 When the context menu of a plot is rendered, the 80 get_context_menu method will be called to give you a 81 chance to add a menu item to the context menu. 82 83 A ref to a Graph object is passed so that you can 84 investigate the plot content and decide whether you 85 need to add items to the context menu. 86 87 This method returns a list of menu items. 88 Each item is itself a list defining the text to 89 appear in the menu, a tool-tip help text, and a 90 call-back method. 89 A ref to a Graph object is passed so that you can 90 investigate the plot content and decide whether you 91 need to add items to the context menu. 92 93 This method returns a list of menu items. 94 Each item is itself a list defining the text to 95 appear in the menu, a tool-tip help text, and a 96 call-back method. 91 97 92 98 @param graph: the Graph object to which we attach the context menu … … 97 103 def get_perspective(self): 98 104 """ 99 105 Get the list of panel names for this perspective 100 106 """ 101 107 return self.perspective … … 104 110 def get_tools(self): 105 111 """ 106 112 Returns a set of menu entries for tools 107 113 """ 108 114 sld_help = "Provides computation related to Scattering Length Density" … … 111 117 return [("SLD Calculator", sld_help, self.on_calculate_sld), 112 118 ("Slit Size Calculator", slit_length_help, 113 self.on_calculate_slit_size), 114 ("Data Editor", data_editor_help, 115 self.on_edit_data)] 119 self.on_calculate_slit_size)]#, 120 #("Data Editor", data_editor_help, self.on_edit_data)] 116 121 117 122 def on_edit_data(self, event): 118 123 """ 119 124 Edit meta data 120 125 """ 121 126 from data_editor import DataEditorWindow … … 125 130 def on_calculate_sld(self, event): 126 131 """ 127 132 Compute the scattering length density of molecula 128 133 """ 129 134 from sld_panel import SldWindow … … 133 138 def on_calculate_slit_size(self, event): 134 139 """ 135 140 Compute the slit size a given data 136 141 """ 137 142 from slit_length_calculator_panel import SlitLengthCalculatorWindow … … 141 146 def on_perspective(self, event): 142 147 """ 143 Call back function for the perspective menu item. 144 We notify the parent window that the perspective 145 has changed. 146 @param event: menu event 148 Call back function for the perspective menu item. 149 We notify the parent window that the perspective 150 has changed. 151 152 :param event: menu event 153 147 154 """ 148 155 self.parent.set_perspective(self.perspective) … … 151 158 def post_init(self): 152 159 """ 153 160 Post initialization call back to close the loose ends 154 161 """ 155 162 pass
Note: See TracChangeset
for help on using the changeset viewer.