Changeset 5e48acb in sasview for fittingview/src/sans/perspectives
- Timestamp:
- Sep 23, 2011 11:44:39 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:
- d03a356
- Parents:
- 22ce7e2
- Location:
- fittingview/src/sans/perspectives/fitting
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/basepage.py
r8e671c39 r5e48acb 75 75 self.mask = None 76 76 self.uid = wx.NewId() 77 self.graph_id = None 77 78 #Q range for data set 78 79 self.qmin_data_set = None -
fittingview/src/sans/perspectives/fitting/fitpage.py
r6721b75 r5e48acb 1804 1804 reset the current data 1805 1805 """ 1806 from sans.guiframe.dataFitting import check_data_validity 1806 1807 id = None 1807 group_id = None1808 1808 flag = False 1809 is_data = False 1809 1810 if self.data is not None: 1810 group_id = self.data.group_id 1811 1812 if self.data is None and data is not None: 1811 is_data = check_data_validity(self.data) 1812 if not is_data and data is not None: 1813 1813 flag = True 1814 1814 if data is not None: 1815 1815 id = data.id 1816 if self.data is not None: 1816 if is_data: 1817 self.graph_id = self.data.group_id 1817 1818 flag = (data.id != self.data.id) 1818 1819 self.data = data 1819 self.data.group_id = group_id 1820 if check_data_validity(data): 1821 self.graph_id = data.group_id 1822 self.data.group_id = self.graph_id 1823 1820 1824 if self.data is None: 1821 1825 data_min = "" … … 1905 1909 self.state.qmax = self.qmax_x 1906 1910 self.enable_fit_button() 1911 # send graph_id to page_finder 1912 self._manager.set_graph_id(uid=self.uid, graph_id=self.graph_id) 1907 1913 #update model plot with new data information 1908 1914 if flag: … … 1918 1924 #by removing the previous selected data 1919 1925 wx.PostEvent(self._manager.parent, NewPlotEvent(action="remove", 1920 group_id= group_id, id=id))1926 group_id=self.graph_id, id=id)) 1921 1927 #plot the current selected data 1922 1928 wx.PostEvent(self._manager.parent, NewPlotEvent(plot=self.data, -
fittingview/src/sans/perspectives/fitting/fitpanel.py
r22ce7e2 r5e48acb 536 536 self._manager.sim_page=None 537 537 return 538 """ 539 # The below is not working when delete #5 and still have #6. 538 540 if selected_page.__class__.__name__ == "FitPage": 539 541 self.fit_page_index -= 1 540 542 else: 541 543 self.batch_page_index -= 1 544 """ 542 545 ## closing other pages 543 546 state = selected_page.createMemento() … … 575 578 break 576 579 577 -
fittingview/src/sans/perspectives/fitting/fitproblem.py
r1b14795 r5e48acb 117 117 Return the caption of the page associated with object 118 118 """ 119 119 def set_graph_id(self, id): 120 """ 121 Set graph id (from data_group_id at the time the graph produced) 122 """ 123 def get_graph_id(self): 124 """ 125 Get graph_id 126 """ 120 127 121 128 class FitProblemDictionary(FitProblemComponent, dict): … … 136 143 self.qmin = None 137 144 self.qmax = None 145 self.graph_id = None 138 146 self._smear_on = False 139 147 self.scheduled = 0 … … 399 407 return self.result 400 408 401 409 def set_graph_id(self, id): 410 """ 411 Set graph id (from data_group_id at the time the graph produced) 412 """ 413 self.graph_id = id 414 415 def get_graph_id(self): 416 """ 417 Get graph_id 418 """ 419 return self.graph_id 420 421 402 422 class FitProblem(FitProblemComponent): 403 423 """ … … 617 637 return self.fit_tab_caption 618 638 619 639 def set_graph_id(self, id): 640 """ 641 Set graph id (from data_group_id at the time the graph produced) 642 """ 643 self.graph_id = id 644 645 def get_graph_id(self): 646 """ 647 Get graph_id 648 """ 649 return self.graph_id 620 650 -
fittingview/src/sans/perspectives/fitting/fitting.py
r22ce7e2 r5e48acb 321 321 selected_data_list = data_list 322 322 try: 323 group_id = wx.NewId() 323 324 for data in selected_data_list: 325 if data is not None: 326 data.group_id = group_id 327 if group_id not in data.list_group_id: 328 data.list_group_id.append(group_id) 324 329 page = self.add_fit_page(data=[data]) 325 330 except: … … 334 339 self.parent.on_close_welcome_panel() 335 340 336 341 337 342 def set_theory(self, theory_list=None): 338 343 """ … … 435 440 """ 436 441 self.page_finder[uid].set_param2fit(param2fit) 437 442 443 def set_graph_id(self, uid, graph_id): 444 """ 445 Set graph_id for fitprobelm 446 """ 447 self.page_finder[uid].set_graph_id(graph_id) 448 449 def get_graph_id(self, uid): 450 """ 451 Set graph_id for fitprobelm 452 """ 453 return self.page_finder[uid].get_graph_id() 454 438 455 def save_fit_state(self, filepath, fitstate): 439 456 """ … … 978 995 self.panel = event.GetEventObject() 979 996 Plugin.on_perspective(self, event=event) 997 self.select_data(self.panel) 998 999 def select_data(self, panel): 1000 """ 1001 """ 1002 self.panel = panel 980 1003 for plottable in self.panel.graph.plottables: 981 1004 if plottable.__class__.__name__ in ["Data1D", "Theory1D"]: … … 1319 1342 _xaxis, _xunit = data.get_xaxis() 1320 1343 new_plot.title = data.name 1321 new_plot.group_id = data.group_id 1344 1345 new_plot.group_id = self.page_finder[page_id].get_graph_id() 1346 if new_plot.group_id == None: 1347 new_plot.group_id = data.group_id 1322 1348 new_plot.id = str(page_id) + "model" 1323 1349 if new_plot.id in self.color_dict: … … 1631 1657 new_plot.id = "res" + str(data_copy.id)#name + " residuals" 1632 1658 ##group_id specify on which panel to plot this data 1633 new_plot.group_id = new_plot.id 1659 group_id = self.page_finder[page_id].get_graph_id() 1660 if group_id == None: 1661 group_id = data.group_id 1662 new_plot.group_id ="res" + str(group_id) 1634 1663 #new_plot.is_data = True 1635 1664 ##post data to plot
Note: See TracChangeset
for help on using the changeset viewer.