Changeset f21d496 in sasview for src/sas/perspectives/fitting/fitting.py
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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:
Note: See TracChangeset
for help on using the changeset viewer.