Changeset aefc09f in sasview for fittingview/src/sans/perspectives/fitting
- Timestamp:
- Aug 26, 2011 9:42:44 AM (13 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:
- 3e3ab46
- Parents:
- 6ff97c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/fitpanel.py
r09ef5a60 raefc09f 10 10 from sans.guiframe.events import PanelOnFocusEvent 11 11 from sans.guiframe.events import StatusEvent 12 from sans.guiframe.dataFitting import check_data_validity 12 13 13 14 import basepage … … 54 55 ## list of existing fit page 55 56 self.opened_pages = {} 56 #index of fit page 57 #index of fit page 57 58 self.fit_page_index = 0 58 59 #index of batch page … … 113 114 self.model_list_box = temp 114 115 return temp 115 116 116 117 117 def get_page_by_id(self, uid): 118 118 """ … … 324 324 from fitpage import FitPage 325 325 panel = FitPage(parent=self) 326 #Increment index of fit page 327 self.fit_page_index += 1 328 index = self.fit_page_index 329 panel.uid = wx.NewId() 326 if self.batch_on: 327 self.batch_page_index += 1 328 caption = "BatchPage " + str(self.batch_page_index) 329 panel.set_index_model(self.batch_page_index) 330 else: 331 #Increment index of fit page 332 self.fit_page_index += 1 333 caption = "FitPage " + str(self.fit_page_index) 334 panel.set_index_model(self.fit_page_index) 330 335 panel.populate_box(dict=self.model_list_box) 331 336 panel.set_manager(self._manager) 332 caption = str(panel.window_caption) + " " + str(index) 337 panel.window_caption = caption 338 panel.window_name = caption 333 339 self.AddPage(panel, caption, select=True) 334 340 self.opened_pages[panel.uid] = panel 335 341 self.set_engine_helper(panel=panel) 342 self._manager.create_fit_problem(panel.uid) 343 self._manager.page_finder[panel.uid].add_data(panel.get_data()) 336 344 self.enable_close_button() 337 345 return panel … … 396 404 page = None 397 405 for p in self.opened_pages.values(): 398 #check if the selected data existing in the fitpanel 399 pos = self.GetPageIndex(page) 400 if p.get_data() is None: 406 #check if there is an empty page to fill up 407 if not check_data_validity(p.get_data()): 401 408 page = p 409 self.batch_page_index += 1 402 410 break 403 404 411 if data_1d_list and data_2d_list: 405 412 # need to warning the user that this batch is a special case … … 428 435 elif not data_1d_list and data_2d_list: 429 436 page.fill_data_combobox(data_2d_list) 430 437 pos = self.GetPageIndex(page) 438 caption = "BatchPage" + str(self.batch_page_index) 439 self.SetPageText(pos, caption) 440 page.window_caption = caption 441 page.window_name = caption 431 442 self.opened_pages[page.uid] = page 432 443 return page … … 454 465 #check if the selected data existing in the fitpanel 455 466 pos = self.GetPageIndex(page) 456 if page.get_data() is None:467 if not check_data_validity(page.get_data()): 457 468 #make sure data get placed in 1D empty tab if data is 1D 458 469 #else data get place on 2D tab empty tab … … 460 471 if (data.__class__.__name__ == "Data2D" and enable2D)\ 461 472 or (data.__class__.__name__ == "Data1D" and not enable2D): 462 #page.set_data(data)463 473 page.fill_data_combobox(data_list) 464 self.SetPageText(pos, str(data.name))465 474 self.SetSelection(pos) 466 475 return page 467 # Todo: Need to set different window name when has same data 468 # Todo: to catch page with same data even if it is not on the top. 469 """ 470 elif page.get_data().id == data.id: 471 msg = "Data already existing in the fitting panel" 472 wx.PostEvent(self._manager.parent, 473 StatusEvent(status=msg, info='warning')) 474 self.SetSelection(pos) 475 return page 476 """ 476 #create new page and add data 477 477 page = self.add_empty_page() 478 478 pos = self.GetPageIndex(page) 479 479 page.fill_data_combobox(data_list) 480 #page.set_data(data)481 self.SetPageText(pos, str(data.name))482 480 self.opened_pages[page.uid] = page 483 481 self.SetSelection(pos)
Note: See TracChangeset
for help on using the changeset viewer.