Changes in / [225aca8:ae2a197] in sasview
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/sasview.py
r199bb42b r199bb42b 91 91 APP_NAME = 'SasView' 92 92 93 class SasViewApp(gui_manager.ViewApp): 94 """ 95 """ 96 97 93 98 class SasView(): 94 99 """ … … 99 104 """ 100 105 #from gui_manager import ViewApp 101 self.gui = gui_manager.SasViewApp(0)106 self.gui = SasViewApp(0) 102 107 # Set the application manager for the GUI 103 108 self.gui.set_manager(self) … … 121 126 try: 122 127 import sas.perspectives.pr as module 123 pr_plug = module.Plugin( )128 pr_plug = module.Plugin(standalone=False) 124 129 self.gui.add_perspective(pr_plug) 125 130 except: … … 130 135 try: 131 136 import sas.perspectives.invariant as module 132 invariant_plug = module.Plugin( )137 invariant_plug = module.Plugin(standalone=False) 133 138 self.gui.add_perspective(invariant_plug) 134 139 except: … … 140 145 try: 141 146 import sas.perspectives.calculator as module 142 calculator_plug = module.Plugin( )147 calculator_plug = module.Plugin(standalone=False) 143 148 self.gui.add_perspective(calculator_plug) 144 149 except: -
src/sas/guiframe/gui_manager.py
r957af0d r957af0d 235 235 Initialize the Frame object 236 236 """ 237 237 238 PARENT_FRAME.__init__(self, parent=parent, title=title, pos=pos, size=size) 238 239 # title … … 363 364 frame.SetIcon(icon) 364 365 except: 365 logging.error("ViewerFrame.put_icon: could not set icon")366 pass 366 367 367 368 def get_client_size(self): … … 751 752 self._toolbar.Realize() 752 753 754 753 755 def build_gui(self): 754 756 """ … … 776 778 # Append item from plugin under menu file if necessary 777 779 self._populate_file_menu() 780 778 781 779 782 if not wx.VERSION_STRING >= '3.0.0.0': … … 819 822 # Load panels 820 823 self._load_panels() 824 self.set_default_perspective() 821 825 822 826 def SetStatusText(self, *args, **kwds): … … 927 931 if hasattr(module, "PLUGIN_ID"): 928 932 try: 929 plugins.append(module.Plugin()) 933 plug = module.Plugin() 934 if plug.set_default_perspective(): 935 self._current_perspective = plug 936 plugins.append(plug) 937 930 938 msg = "Found plug-in: %s" % module.PLUGIN_ID 931 939 logging.info(msg) … … 1503 1511 for item in plugin.populate_file_menu(): 1504 1512 m_name, m_hint, m_handler = item 1505 wx_id = wx.NewId()1506 self._file_menu.Append( wx_id, m_name, m_hint)1507 wx.EVT_MENU(self, wx_id, m_handler)1513 id = wx.NewId() 1514 self._file_menu.Append(id, m_name, m_hint) 1515 wx.EVT_MENU(self, id, m_handler) 1508 1516 self._file_menu.AppendSeparator() 1509 1517 1510 1518 style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 1511 1519 if OPEN_SAVE_MENU: 1512 wx_id = wx.NewId()1520 id = wx.NewId() 1513 1521 hint_load_file = "read all analysis states saved previously" 1514 self._save_appl_menu = self._file_menu.Append( wx_id, '&Open Project', hint_load_file)1515 wx.EVT_MENU(self, wx_id, self._on_open_state_project)1522 self._save_appl_menu = self._file_menu.Append(id, '&Open Project', hint_load_file) 1523 wx.EVT_MENU(self, id, self._on_open_state_project) 1516 1524 1517 1525 if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: … … 1519 1527 hint_load_file = "Read a status files and load" 1520 1528 hint_load_file += " them into the analysis" 1521 wx_id = wx.NewId()1522 self._save_appl_menu = self._file_menu.Append( wx_id,1529 id = wx.NewId() 1530 self._save_appl_menu = self._file_menu.Append(id, 1523 1531 '&Open Analysis', hint_load_file) 1524 wx.EVT_MENU(self, wx_id, self._on_open_state_application)1532 wx.EVT_MENU(self, id, self._on_open_state_application) 1525 1533 if OPEN_SAVE_MENU: 1526 1534 self._file_menu.AppendSeparator() 1527 wx_id = wx.NewId()1528 self._file_menu.Append( wx_id, '&Save Project',1535 id = wx.NewId() 1536 self._file_menu.Append(id, '&Save Project', 1529 1537 'Save the state of the whole analysis') 1530 wx.EVT_MENU(self, wx_id, self._on_save_project)1538 wx.EVT_MENU(self, id, self._on_save_project) 1531 1539 if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: 1532 wx_id = wx.NewId()1533 self._save_appl_menu = self._file_menu.Append( wx_id, \1540 id = wx.NewId() 1541 self._save_appl_menu = self._file_menu.Append(id, \ 1534 1542 '&Save Analysis', 'Save state of the current active analysis panel') 1535 wx.EVT_MENU(self, wx_id, self._on_save_application)1543 wx.EVT_MENU(self, id, self._on_save_application) 1536 1544 if not sys.platform == 'darwin': 1537 1545 self._file_menu.AppendSeparator() 1538 wx_id = wx.NewId()1539 self._file_menu.Append( wx_id, '&Quit', 'Exit')1540 wx.EVT_MENU(self, wx_id, self.Close)1546 id = wx.NewId() 1547 self._file_menu.Append(id, '&Quit', 'Exit') 1548 wx.EVT_MENU(self, id, self.Close) 1541 1549 1542 1550 def _add_menu_file(self): … … 1709 1717 """ 1710 1718 """ 1719 message = "" 1711 1720 log_msg = '' 1721 output = [] 1722 error_message = "" 1712 1723 basename = os.path.basename(path) 1713 _, extension = os.path.splitext(basename)1724 root, extension = os.path.splitext(basename) 1714 1725 if extension.lower() not in EXTENSIONS: 1715 1726 log_msg = "File Loader cannot " … … 2213 2224 if hasattr(item, "post_init"): 2214 2225 item.post_init() 2226 2227 def set_default_perspective(self): 2228 """ 2229 Choose among the plugin the first plug-in that has 2230 "set_default_perspective" method and its return value is True will be 2231 as a default perspective when the welcome page is closed 2232 """ 2233 for item in self.plugins: 2234 if hasattr(item, "set_default_perspective"): 2235 if item.set_default_perspective(): 2236 item.on_perspective(event=None) 2237 return 2215 2238 2216 2239 def set_perspective(self, panels): … … 2391 2414 total_plot_list.append(theory_data) 2392 2415 for new_plot in total_plot_list: 2416 id = new_plot.id 2393 2417 for group_id in new_plot.list_group_id: 2394 wx.PostEvent(self, NewPlotEvent(id= new_plot.id,2418 wx.PostEvent(self, NewPlotEvent(id=id, 2395 2419 group_id=group_id, 2396 2420 action='remove')) 2397 2421 #remove res plot: Todo: improve 2398 wx.CallAfter(self._remove_res_plot, new_plot.id)2422 wx.CallAfter(self._remove_res_plot, id) 2399 2423 self._data_manager.delete_data(data_id=data_id, 2400 2424 theory_id=theory_id) … … 2431 2455 ext_num = dlg.GetFilterIndex() 2432 2456 if ext_num == 0: 2433 ext_format = '.txt'2457 format = '.txt' 2434 2458 else: 2435 ext_format = '.xml'2436 path = os.path.splitext(path)[0] + ext_format2459 format = '.xml' 2460 path = os.path.splitext(path)[0] + format 2437 2461 mypath = os.path.basename(path) 2438 2462 2439 2463 #Instantiate a loader 2440 2464 loader = Loader() 2441 ext_format = ".txt"2442 if os.path.splitext(mypath)[1].lower() == ext_format:2465 format = ".txt" 2466 if os.path.splitext(mypath)[1].lower() == format: 2443 2467 # Make sure the ext included in the file name 2444 2468 # especially on MAC 2445 fName = os.path.splitext(path)[0] + ext_format2469 fName = os.path.splitext(path)[0] + format 2446 2470 self._onsaveTXT(data, fName) 2447 ext_format = ".xml"2448 if os.path.splitext(mypath)[1].lower() == ext_format:2471 format = ".xml" 2472 if os.path.splitext(mypath)[1].lower() == format: 2449 2473 # Make sure the ext included in the file name 2450 2474 # especially on MAC 2451 fName = os.path.splitext(path)[0] + ext_format2452 loader.save(fName, data, ext_format)2475 fName = os.path.splitext(path)[0] + format 2476 loader.save(fName, data, format) 2453 2477 try: 2454 2478 self._default_save_location = os.path.dirname(path) … … 2574 2598 ext_num = dlg.GetFilterIndex() 2575 2599 if ext_num == 0: 2576 ext_format = '.dat'2600 format = '.dat' 2577 2601 else: 2578 ext_format = ''2579 path = os.path.splitext(path)[0] + ext_format2602 format = '' 2603 path = os.path.splitext(path)[0] + format 2580 2604 mypath = os.path.basename(path) 2581 2605 … … 2583 2607 loader = Loader() 2584 2608 2585 ext_format = ".dat"2586 if os.path.splitext(mypath)[1].lower() == ext_format:2609 format = ".dat" 2610 if os.path.splitext(mypath)[1].lower() == format: 2587 2611 # Make sure the ext included in the file name 2588 2612 # especially on MAC 2589 fileName = os.path.splitext(path)[0] + ext_format2590 loader.save(fileName, data, ext_format)2613 fileName = os.path.splitext(path)[0] + format 2614 loader.save(fileName, data, format) 2591 2615 try: 2592 2616 self._default_save_location = os.path.dirname(path) … … 3182 3206 3183 3207 3184 class SasViewApp(wx.App):3208 class ViewApp(wx.App): 3185 3209 """ 3186 SasView application3210 Toy application to test this Frame 3187 3211 """ 3188 3212 def OnInit(self): … … 3270 3294 if len(os.listdir(model_folder)) > 0: 3271 3295 try: 3272 for file namein os.listdir(model_folder):3273 file_path = os.path.join(model_folder, file name)3296 for file in os.listdir(model_folder): 3297 file_path = os.path.join(model_folder, file) 3274 3298 if os.path.isfile(file_path): 3275 3299 os.remove(file_path) … … 3290 3314 """ 3291 3315 #try to load file at the start 3292 self.open_file() 3316 try: 3317 self.open_file() 3318 except: 3319 raise 3293 3320 self.frame.build_gui() 3294 3321 -
src/sas/guiframe/local_perspectives/data_loader/data_loader.py
rf21d496 rf76bf17 41 41 class Plugin(PluginBase): 42 42 43 def __init__(self ):44 PluginBase.__init__(self, name="DataLoader" )43 def __init__(self, standalone=False): 44 PluginBase.__init__(self, name="DataLoader", standalone=standalone) 45 45 # Default location 46 46 self._default_save_location = DEFAULT_OPEN_FOLDER -
src/sas/guiframe/local_perspectives/plotting/plotting.py
rf21d496 rc039589 36 36 """ 37 37 38 def __init__(self ):39 PluginBase.__init__(self, name="Plotting" )38 def __init__(self, standalone=False): 39 PluginBase.__init__(self, name="Plotting", standalone=standalone) 40 40 41 41 ## Plot panels -
src/sas/guiframe/plugin_base.py
rf21d496 r373d4ee 34 34 """ 35 35 36 def __init__(self, name="Test_plugin" ):36 def __init__(self, name="Test_plugin", standalone=True): 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 flag 45 self.standalone = standalone 44 46 ## Reference to the parent window. Filled by get_panels() below. 45 47 self.parent = None … … 261 263 pass 262 264 265 def set_default_perspective(self): 266 """ 267 Call back method that True to notify the parent that the current plug-in 268 can be set as default perspective. 269 when returning False, the plug-in is not candidate for an automatic 270 default perspective setting 271 """ 272 if self.standalone: 273 return True 274 return False 275 263 276 def set_state(self, state=None, datainfo=None): 264 277 """ -
src/sas/perspectives/calculator/calculator.py
rf21d496 r49ab5d7 33 33 for calculator perspective 34 34 """ 35 def __init__(self ):36 PluginBase.__init__(self, name="Calculator" )35 def __init__(self, standalone=True): 36 PluginBase.__init__(self, name="Calculator", standalone=standalone) 37 37 # Log startup 38 38 logging.info("Calculator plug-in started") -
src/sas/perspectives/fitting/fitpage.py
r098f3d2 r098f3d2 268 268 weighting_box.Add(sizer_weighting) 269 269 270 sizer_fit = wx.GridSizer(2, 5, 2, 6) 271 270 272 # combobox for smear2d accuracy selection 271 273 self.smear_accuracy = wx.ComboBox(self, -1, size=(50, -1), … … 280 282 281 283 #Fit button 282 self.btFit = wx.Button(self, wx.NewId(), 'Fit' )284 self.btFit = wx.Button(self, wx.NewId(), 'Fit', size=(88, 25)) 283 285 self.default_bt_colour = self.btFit.GetDefaultAttributes() 284 286 self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id=self.btFit.GetId()) … … 286 288 287 289 #General Help button 288 self.btFitHelp = wx.Button(self, -1, 'H elp')289 self.btFitHelp.SetToolTipString("General fitting help.")290 self.btFitHelp = wx.Button(self, -1, 'HELP') 291 self.btFitHelp.SetToolTipString("General Fitting Help.") 290 292 self.btFitHelp.Bind(wx.EVT_BUTTON, self._onFitHelp) 291 293 … … 301 303 self.btSmearHelp = wx.Button(self, -1, '?', style=wx.BU_EXACTFIT,\ 302 304 size=size_q) 303 self.btSmearHelp.SetToolTipString("Resolution smearing help.")305 self.btSmearHelp.SetToolTipString("Resolution Smearing Help.") 304 306 self.btSmearHelp.Bind(wx.EVT_BUTTON, self._onSmearHelp) 305 307 … … 360 362 self.disable_smearer.SetValue(True) 361 363 364 # add 4 types of smearing to the sizer 365 # Note from June 14, 2015 366 # removed the extra (10,10) spaces to make room for help. Actually 367 # don't see the need for those anyway as the wx.LEFT, xx should take 368 # care of spacing anyway though it does not seem to work for some 369 # reason. Currently leaving as we are in "code freeze" only making 370 # minimal changes necessary for release 3.1. We probably want to clean 371 # up the whole fitpage (and basepage and fitpanel etc) eventually. 372 # ---- PDB 362 373 sizer_smearer.Add(self.disable_smearer, 0, wx.LEFT, 10) 374 # sizer_smearer.Add((10, 10)) 363 375 sizer_smearer.Add(self.enable_smearer) 376 # sizer_smearer.Add((10, 10)) 364 377 sizer_smearer.Add(self.pinhole_smearer) 378 # sizer_smearer.Add((10, 10)) 365 379 sizer_smearer.Add(self.slit_smearer) 380 # sizer_smearer.Add((10, 10)) 366 381 sizer_smearer.Add(self.btSmearHelp) 367 382 sizer_smearer.Add((10, 10)) … … 382 397 383 398 # Update and Draw button 384 self.draw_button = wx.Button(self, wx.NewId(), 'Compute') 399 self.draw_button = wx.Button(self, wx.NewId(), 400 'Compute', size=(88, 24)) 385 401 self.draw_button.Bind(wx.EVT_BUTTON, \ 386 402 self._onDraw, id=self.draw_button.GetId()) … … 398 414 box_description_1 = wx.StaticText(self, -1, ' Chi2/Npts') 399 415 box_description_2 = wx.StaticText(self, -1, 'Npts(Fit)') 416 #box_description_3 = wx.StaticText(self, -1, 'Total Npts') 417 #box_description_3.SetToolTipString( \ 418 # " Total Npts : total number of data points") 419 420 sizer_fit.Add(box_description_1, 0, 0) 421 sizer_fit.Add(box_description_2, 0, 0) 422 sizer_fit.Add(self.points_sizer, 0, 0) 423 #sizer_fit.Add(box_description_3, 0, 0) 424 sizer_fit.Add(self.draw_button, 0, 0) 425 sizer_fit.Add((-1,5)) 426 sizer_fit.Add(self.tcChi, 0, 0) 427 sizer_fit.Add(self.Npts_fit, 0, 0) 428 sizer_fit.Add(self.Npts_total, 0, 0) 429 sizer_fit.Add(self.btFit, 0, 0) 430 sizer_fit.Add(self.btFitHelp, 0, 0) 400 431 401 432 # StaticText for smear … … 545 576 self.qmin.Bind(wx.EVT_TEXT, self.on_qrange_text) 546 577 self.qmax.Bind(wx.EVT_TEXT, self.on_qrange_text) 547 wx_id = wx.NewId()548 self.reset_qrange = wx.Button(self, wx_id, 'Reset')549 550 self.reset_qrange.Bind(wx.EVT_BUTTON, self.on_reset_clicked, id= wx_id)578 id = wx.NewId() 579 self.reset_qrange = wx.Button(self, id, 'Reset', size=(77, 20)) 580 581 self.reset_qrange.Bind(wx.EVT_BUTTON, self.on_reset_clicked, id=id) 551 582 self.reset_qrange.SetToolTipString("Reset Q range to the default") 552 583 553 sizer = wx.GridSizer( 5, 5, 2, 6)554 555 self.btEditMask = wx.Button(self, wx.NewId(), 'Editor' )584 sizer = wx.GridSizer(2, 4, 2, 6) 585 586 self.btEditMask = wx.Button(self, wx.NewId(), 'Editor', size=(88, 23)) 556 587 self.btEditMask.Bind(wx.EVT_BUTTON, self._onMask, 557 588 id=self.btEditMask.GetId()) … … 563 594 sizer.Add(wx.StaticText(self, -1, ' Max[1/A]')) 564 595 sizer.Add(self.EditMask_title) 565 sizer.Add((-1,5))566 567 596 sizer.Add(self.reset_qrange) 568 597 sizer.Add(self.qmin) 569 598 sizer.Add(self.qmax) 599 #sizer.Add(self.theory_npts_tcrtl) 570 600 sizer.Add(self.btEditMask) 571 sizer.Add((-1,5))572 573 sizer.AddMany(5*[(-1,5)])574 575 sizer.Add(box_description_1, 0, 0)576 sizer.Add(box_description_2, 0, 0)577 sizer.Add(self.points_sizer, 0, 0)578 sizer.Add(self.draw_button, 0, 0)579 sizer.Add((-1,5))580 581 sizer.Add(self.tcChi, 0, 0)582 sizer.Add(self.Npts_fit, 0, 0)583 sizer.Add(self.Npts_total, 0, 0)584 sizer.Add(self.btFit, 0, 0)585 sizer.Add(self.btFitHelp, 0, 0)586 587 601 boxsizer_range.Add(sizer_chi2) 602 boxsizer_range.Add((10, 10)) 588 603 boxsizer_range.Add(sizer) 604 605 boxsizer_range.Add((10, 15)) 606 boxsizer_range.Add(sizer_fit) 589 607 if is_2Ddata: 590 608 self.btEditMask.Enable() -
src/sas/perspectives/fitting/fitting.py
r098f3d2 r098f3d2 61 61 Fitting plugin is used to perform fit 62 62 """ 63 def __init__(self ):64 PluginBase.__init__(self, name="Fitting" )63 def __init__(self, standalone=False): 64 PluginBase.__init__(self, name="Fitting", standalone=standalone) 65 65 66 66 #list of panel to send to guiframe … … 221 221 Get the python editor panel 222 222 """ 223 event_id = event.GetId()224 label = self.edit_menu.GetLabel( event_id)223 id = event.GetId() 224 label = self.edit_menu.GetLabel(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 event_id = event.GetId()239 label = self.delete_menu.GetLabel( event_id)238 id = event.GetId() 239 label = self.delete_menu.GetLabel(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( event_id)258 self.delete_menu.Delete(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 event_id = event.GetId()274 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 event_id = event.GetId()292 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 wx_id = wx.NewId()334 id = wx.NewId() 335 335 #new_model_menu = wx.Menu() 336 self.edit_model_menu.Append( wx_id, 'New',336 self.edit_model_menu.Append(id, 'New', 337 337 'Add a new model function') 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)',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)', 341 341 'Sum of two model functions') 342 wx.EVT_MENU(owner, wx_id, self.make_sum_model)342 wx.EVT_MENU(owner, 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 wx_id = wx.NewId()379 submenu.Append( wx_id, name)380 wx.EVT_MENU(owner, wx_id, menu)378 id = wx.NewId() 379 submenu.Append(id, name) 380 wx.EVT_MENU(owner, id, menu) 381 381 has_file = False 382 382 … … 397 397 Create a page to access simultaneous fit option 398 398 """ 399 event_id = event.GetId()399 id = event.GetId() 400 400 caption = "Const & Simul Fit" 401 401 page = self.sim_page 402 if event_id == self.id_batchfit:402 if id == self.id_batchfit: 403 403 caption = "Combined Batch" 404 404 page = self.batch_page … … 719 719 for uid, value in self.page_finder.iteritems(): 720 720 if uid != sim_page_id and uid != self.batch_page.uid: 721 model_list = value.get_model()722 model = model_list[0]721 list = value.get_model() 722 model = list[0] 723 723 if model.name == modelname: 724 724 value.set_model_param(names, values) … … 1568 1568 """ 1569 1569 if event.panel is not None: 1570 new_panel = event.panel 1570 1571 self.slicer_panels.append(event.panel) 1571 1572 # Set group ID if available … … 1651 1652 #find if this theory was already plotted and replace that plot given 1652 1653 #the same id 1653 self.page_finder[page_id].get_theory_data(fid=data.id)1654 theory_data = self.page_finder[page_id].get_theory_data(fid=data.id) 1654 1655 1655 1656 if data.is_data: -
src/sas/perspectives/invariant/invariant.py
rf21d496 r824e488 33 33 """ 34 34 35 def __init__(self ):36 PluginBase.__init__(self, name="Invariant" )35 def __init__(self, standalone=False): 36 PluginBase.__init__(self, name="Invariant", standalone=standalone) 37 37 38 38 # dictionary containing data name and error on dy of that data -
src/sas/perspectives/pr/inversion_panel.py
rf21d496 r3db44fb 35 35 oscillation_max = 1.5 36 36 37 def __init__(self, parent, id=-1, plots=None, **kwargs):37 def __init__(self, parent, id=-1, plots=None, standalone=False, **kwargs): 38 38 """ 39 39 """ … … 83 83 ## Data manager 84 84 self._manager = None 85 ## Standalone flage 86 self.standalone = standalone 85 87 ## Default file location for save 86 88 self._default_save_location = os.getcwd() -
src/sas/perspectives/pr/pr.py
rf21d496 rc1c14ba 54 54 DEFAULT_DMAX = 140.0 55 55 56 def __init__(self ):57 PluginBase.__init__(self, name="Pr Inversion" )56 def __init__(self, standalone=True): 57 PluginBase.__init__(self, name="Pr Inversion", standalone=standalone) 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 standalone 97 self.standalone = standalone 96 98 self._normalize_output = False 97 99 self._scale_output_unity = False … … 621 623 return [] 622 624 elif item.id == graph.selected_plottable: 623 if issubclass(item.__class__, Data1D):625 if not self.standalone and issubclass(item.__class__, Data1D): 624 626 return [["Compute P(r)", 625 627 "Compute P(r) from distribution", … … 1236 1238 self.frame = MDIFrame(self.parent, None, 'None', (100, 200)) 1237 1239 self.control_panel = InversionControl(self.frame, -1, 1238 style=wx.RAISED_BORDER) 1240 style=wx.RAISED_BORDER, 1241 standalone=self.standalone) 1239 1242 self.frame.set_panel(self.control_panel) 1240 1243 self._frame_set_helper() … … 1314 1317 [Somehow openGL needs this call] 1315 1318 """ 1316 pass 1319 if self.standalone: 1320 self.parent.set_perspective(self.perspective)
Note: See TracChangeset
for help on using the changeset viewer.