- Timestamp:
- Jul 2, 2015 11:13:55 AM (9 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:
- 78f75d02
- Parents:
- 3a5f7c8
- Location:
- src/sas
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/guiframe/gui_manager.py
rf7d2f4a rf21d496 818 818 # Load panels 819 819 self._load_panels() 820 self.set_default_perspective()821 820 822 821 def SetStatusText(self, *args, **kwds): … … 927 926 if hasattr(module, "PLUGIN_ID"): 928 927 try: 929 plug = module.Plugin() 930 if plug.set_default_perspective(): 931 self._current_perspective = plug 932 plugins.append(plug) 933 928 plugins.append(module.Plugin()) 934 929 msg = "Found plug-in: %s" % module.PLUGIN_ID 935 930 logging.info(msg) … … 2199 2194 item.post_init() 2200 2195 2201 def set_default_perspective(self):2202 """2203 Choose among the plugin the first plug-in that has2204 "set_default_perspective" method and its return value is True will be2205 as a default perspective when the welcome page is closed2206 """2207 for item in self.plugins:2208 if hasattr(item, "set_default_perspective"):2209 if item.set_default_perspective():2210 item.on_perspective(event=None)2211 return2212 2213 2196 def set_perspective(self, panels): 2214 2197 """ -
src/sas/guiframe/local_perspectives/data_loader/data_loader.py
rf76bf17 rf21d496 41 41 class Plugin(PluginBase): 42 42 43 def __init__(self , standalone=False):44 PluginBase.__init__(self, name="DataLoader" , standalone=standalone)43 def __init__(self): 44 PluginBase.__init__(self, name="DataLoader") 45 45 # Default location 46 46 self._default_save_location = DEFAULT_OPEN_FOLDER -
src/sas/guiframe/local_perspectives/plotting/plotting.py
rc039589 rf21d496 36 36 """ 37 37 38 def __init__(self , standalone=False):39 PluginBase.__init__(self, name="Plotting" , standalone=standalone)38 def __init__(self): 39 PluginBase.__init__(self, name="Plotting") 40 40 41 41 ## Plot panels -
src/sas/guiframe/plugin_base.py
r373d4ee rf21d496 34 34 """ 35 35 36 def __init__(self, name="Test_plugin" , standalone=True):36 def __init__(self, name="Test_plugin"): 37 37 """ 38 38 Abstract class for gui_manager Plugins. … … 42 42 ## Plug-in name. It will appear on the application menu. 43 43 self.sub_menu = name 44 #standalone flag45 self.standalone = standalone46 44 ## Reference to the parent window. Filled by get_panels() below. 47 45 self.parent = None … … 263 261 pass 264 262 265 def set_default_perspective(self):266 """267 Call back method that True to notify the parent that the current plug-in268 can be set as default perspective.269 when returning False, the plug-in is not candidate for an automatic270 default perspective setting271 """272 if self.standalone:273 return True274 return False275 276 263 def set_state(self, state=None, datainfo=None): 277 264 """ -
src/sas/perspectives/calculator/calculator.py
r49ab5d7 rf21d496 33 33 for calculator perspective 34 34 """ 35 def __init__(self , standalone=True):36 PluginBase.__init__(self, name="Calculator" , standalone=standalone)35 def __init__(self): 36 PluginBase.__init__(self, name="Calculator") 37 37 # Log startup 38 38 logging.info("Calculator plug-in started") -
src/sas/perspectives/fitting/fitting.py
re1442d4 rf21d496 61 61 Fitting plugin is used to perform fit 62 62 """ 63 def __init__(self , standalone=False):64 PluginBase.__init__(self, name="Fitting" , standalone=standalone)63 def __init__(self): 64 PluginBase.__init__(self, name="Fitting") 65 65 66 66 #list of panel to send to guiframe … … 221 221 Get the python editor panel 222 222 """ 223 id = event.GetId()224 label = self.edit_menu.GetLabel( id)223 event_id = event.GetId() 224 label = self.edit_menu.GetLabel(event_id) 225 225 from sas.perspectives.calculator.pyconsole import PyConsole 226 226 filename = os.path.join(models.find_plugins_dir(), label) … … 236 236 Delete custom model file 237 237 """ 238 id = event.GetId()239 label = self.delete_menu.GetLabel( id)238 event_id = event.GetId() 239 label = self.delete_menu.GetLabel(event_id) 240 240 toks = os.path.splitext(label) 241 241 path = os.path.join(models.find_plugins_dir(), toks[0]) … … 256 256 # info='warning')) 257 257 else: 258 self.delete_menu.Delete( id)258 self.delete_menu.Delete(event_id) 259 259 for item in self.edit_menu.GetMenuItems(): 260 260 if item.GetLabel() == label: … … 272 272 Edit summodel template and make one 273 273 """ 274 id = event.GetId()274 event_id = event.GetId() 275 275 model_manager = models.ModelManager() 276 276 model_list = model_manager.get_model_name_list() … … 290 290 self.new_model_frame.Show(True) 291 291 else: 292 id = event.GetId()292 event_id = event.GetId() 293 293 dir_path = models.find_plugins_dir() 294 294 title = "New Custom Model Function" … … 332 332 Set list of the edit model menu labels 333 333 """ 334 id = wx.NewId()334 wx_id = wx.NewId() 335 335 #new_model_menu = wx.Menu() 336 self.edit_model_menu.Append( id, 'New',336 self.edit_model_menu.Append(wx_id, 'New', 337 337 'Add a new model function') 338 wx.EVT_MENU(owner, id, self.make_new_model)339 id = wx.NewId()340 self.edit_model_menu.Append( id, 'Sum|Multi(p1, p2)',338 wx.EVT_MENU(owner, wx_id, self.make_new_model) 339 wx_id = wx.NewId() 340 self.edit_model_menu.Append(wx_id, 'Sum|Multi(p1, p2)', 341 341 'Sum of two model functions') 342 wx.EVT_MENU(owner, id, self.make_sum_model)342 wx.EVT_MENU(owner, wx_id, self.make_sum_model) 343 343 e_id = wx.NewId() 344 344 self.edit_menu = wx.Menu() … … 376 376 has_file = True 377 377 if not has_file: 378 id = wx.NewId()379 submenu.Append( id, name)380 wx.EVT_MENU(owner, id, menu)378 wx_id = wx.NewId() 379 submenu.Append(wx_id, name) 380 wx.EVT_MENU(owner, wx_id, menu) 381 381 has_file = False 382 382 … … 397 397 Create a page to access simultaneous fit option 398 398 """ 399 id = event.GetId()399 event_id = event.GetId() 400 400 caption = "Const & Simul Fit" 401 401 page = self.sim_page 402 if id == self.id_batchfit:402 if event_id == self.id_batchfit: 403 403 caption = "Combined Batch" 404 404 page = self.batch_page … … 516 516 selected_data_list = [] 517 517 if self.batch_on: 518 page =self.add_fit_page(data=data_list)518 self.add_fit_page(data=data_list) 519 519 else: 520 520 if len(data_list) > MAX_NBR_DATA: … … 537 537 if group_id not in data.list_group_id: 538 538 data.list_group_id.append(group_id) 539 page =self.add_fit_page(data=[data])539 self.add_fit_page(data=[data]) 540 540 except: 541 541 msg = "Fitting Set_data: " + str(sys.exc_value) … … 715 715 for uid, value in self.page_finder.iteritems(): 716 716 if uid != sim_page_id and uid != self.batch_page.uid: 717 list = value.get_model()718 model = list[0]717 model_list = value.get_model() 718 model = model_list[0] 719 719 if model.name == modelname: 720 720 value.set_model_param(names, values) … … 1564 1564 """ 1565 1565 if event.panel is not None: 1566 new_panel = event.panel1567 1566 self.slicer_panels.append(event.panel) 1568 1567 # Set group ID if available … … 1648 1647 #find if this theory was already plotted and replace that plot given 1649 1648 #the same id 1650 theory_data =self.page_finder[page_id].get_theory_data(fid=data.id)1649 self.page_finder[page_id].get_theory_data(fid=data.id) 1651 1650 1652 1651 if data.is_data: -
src/sas/perspectives/invariant/invariant.py
r824e488 rf21d496 33 33 """ 34 34 35 def __init__(self , standalone=False):36 PluginBase.__init__(self, name="Invariant" , standalone=standalone)35 def __init__(self): 36 PluginBase.__init__(self, name="Invariant") 37 37 38 38 # dictionary containing data name and error on dy of that data -
src/sas/perspectives/pr/inversion_panel.py
r3db44fb rf21d496 35 35 oscillation_max = 1.5 36 36 37 def __init__(self, parent, id=-1, plots=None, standalone=False,**kwargs):37 def __init__(self, parent, id=-1, plots=None, **kwargs): 38 38 """ 39 39 """ … … 83 83 ## Data manager 84 84 self._manager = None 85 ## Standalone flage86 self.standalone = standalone87 85 ## Default file location for save 88 86 self._default_save_location = os.getcwd() -
src/sas/perspectives/pr/pr.py
rc1c14ba rf21d496 54 54 DEFAULT_DMAX = 140.0 55 55 56 def __init__(self , standalone=True):57 PluginBase.__init__(self, name="Pr Inversion" , standalone=standalone)56 def __init__(self): 57 PluginBase.__init__(self, name="Pr Inversion") 58 58 ## Simulation window manager 59 59 self.simview = None … … 94 94 ## Number of P(r) points to display on the output plot 95 95 self._pr_npts = 51 96 ## Flag to let the plug-in know that it is running standalone97 self.standalone = standalone98 96 self._normalize_output = False 99 97 self._scale_output_unity = False … … 623 621 return [] 624 622 elif item.id == graph.selected_plottable: 625 if not self.standalone andissubclass(item.__class__, Data1D):623 if issubclass(item.__class__, Data1D): 626 624 return [["Compute P(r)", 627 625 "Compute P(r) from distribution", … … 1238 1236 self.frame = MDIFrame(self.parent, None, 'None', (100, 200)) 1239 1237 self.control_panel = InversionControl(self.frame, -1, 1240 style=wx.RAISED_BORDER, 1241 standalone=self.standalone) 1238 style=wx.RAISED_BORDER) 1242 1239 self.frame.set_panel(self.control_panel) 1243 1240 self._frame_set_helper() … … 1317 1314 [Somehow openGL needs this call] 1318 1315 """ 1319 if self.standalone: 1320 self.parent.set_perspective(self.perspective) 1316 pass
Note: See TracChangeset
for help on using the changeset viewer.