- Timestamp:
- May 12, 2009 11:37:55 AM (16 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:
- ddd864e
- Parents:
- 63c7d85d
- Location:
- sansview/perspectives/fitting
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
r2cded48 r848a2ef 538 538 evt = ModelEventbox(model=self.model) 539 539 wx.PostEvent(self.event_owner, evt) 540 540 self.btFit.SetFocus() 541 541 542 542 def _onparamRangeEnter(self, event): -
sansview/perspectives/fitting/fitpanel.py
re814734 r848a2ef 52 52 CENTER_PANE = True 53 53 def __init__(self, parent, *args, **kwargs): 54 #wx.aui.AuiNotebook.__init__(self,parent,-1, style=wx.aui.AUI_NB_DEFAULT_STYLE )55 54 wx.aui.AuiNotebook.__init__(self,parent,-1, 56 style= wx.aui.AUI_NB_WINDOWLIST_BUTTON|wx.aui.AUI_NB_DEFAULT_STYLE \ 57 |wx.CLIP_CHILDREN ) 58 59 55 style= wx.aui.AUI_NB_WINDOWLIST_BUTTON|wx.aui.AUI_NB_DEFAULT_STYLE|wx.CLIP_CHILDREN ) 56 60 57 self.manager=None 61 58 self.parent=parent … … 121 118 self.count =0 122 119 ## page on menu 123 #self.manager._add_page_onmenu(page_name, fitproblem)120 self.manager._add_page_onmenu(page_name, fitproblem) 124 121 else: 125 122 if selected_page in page_finder: … … 131 128 self.fit_page2D_number=None 132 129 ## page on menu 133 #self.manager._add_page_onmenu(page_name, fitproblem)130 self.manager._add_page_onmenu(page_name, fitproblem) 134 131 del page_finder[selected_page] 135 132 ##remove the check box link to the model name of this page (selected_page) … … 270 267 self.fit_page_name[page_title].insert(0,self.model_page.createMemento()) 271 268 272 269 270 271 def _close_fitpage(self,data): 272 """ 273 close a fit page when its data is completely remove from the graph 274 """ 275 name = data.name 276 for index in range(self.GetPageCount()): 277 if self.GetPageText(index)== name: 278 selected_page = self.GetPage(index) 279 280 if index ==self.fit_page1D_number: 281 self.fit_page1D_number=None 282 if index ==self.fit_page2D_number: 283 self.fit_page2D_number=None 284 if selected_page in self.manager.page_finder: 285 del self.manager.page_finder[selected_page] 286 ##remove the check box link to the model name of this page (selected_page) 287 try: 288 self.sim_page.draw_page() 289 except: 290 ## that page is already deleted no need to remove check box on 291 ##non existing page 292 pass 293 294 #Delete the name of the page into the list of open page 295 if selected_page.window_name in self.list_fitpage_name: 296 self.list_fitpage_name.remove(selected_page.window_name) 297 self.DeletePage(index) 298 break 299 300 273 301 def _onGetstate(self, event): 274 302 """ … … 300 328 panel = ModelPage(self,myinfo) 301 329 302 self.AddPage(page=panel, caption=page_title,select=True)330 self.AddPage(page=panel, caption=page_title, select=True) 303 331 304 332 self.model_page_number=self.GetSelection() … … 309 337 if reset: 310 338 if page_title in self.fit_page_name.keys(): 311 339 312 340 memento= self.fit_page_name[page_title][0] 341 print "" 313 342 panel.reset_page(memento) 314 343 else: -
sansview/perspectives/fitting/fitting.py
r3349893 r848a2ef 7 7 from danse.common.plottools.PlotPanel import PlotPanel 8 8 from sans.guicomm.events import NewPlotEvent, StatusEvent 9 from sans.guicomm.events import EVT_SLICER_PANEL,ERR_DATA 9 from sans.guicomm.events import EVT_SLICER_PANEL,ERR_DATA,EVT_REMOVE_DATA 10 from sans.guicomm.events import EVT_SLICER_PARS_UPDATE 10 11 from sans.guiframe import dataFitting 11 12 from sans.fit.AbstractFitEngine import Model 13 12 14 13 15 from fitproblem import FitProblem … … 208 210 self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event) 209 211 self.parent.Bind( ERR_DATA, self._on_data_error) 212 self.parent.Bind(EVT_REMOVE_DATA, self._closed_fitpage) 213 self.parent.Bind(EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PANEL) 210 214 211 215 #Send the fitting panel to guiframe … … 487 491 wx.PostEvent(self.parent, StatusEvent(status= msg ,type="stop")) 488 492 return 489 490 493 494 495 496 def _onEVT_SLICER_PANEL(self, event): 497 """ 498 receive and event telling to update a panel with a name starting with 499 event.panel_name. this method update slicer panel for a given interactor. 500 @param event: contains type of slicer , paramaters for updating the panel 501 and panel_name to find the slicer 's panel concerned. 502 """ 503 for item in self.parent.panels: 504 if self.parent.panels[item].window_caption.startswith(event.panel_name): 505 self.parent.panels[item].set_slicer(event.type, event.params) 506 self.parent._mgr.Update() 507 break 508 509 510 def _closed_fitpage(self, event): 511 """ 512 request fitpanel to close a given page when its unique data is removed 513 from the plot 514 """ 515 self.fit_panel._close_fitpage(event.data) 516 517 491 518 def _add_page_onmenu(self, name,fitproblem=None): 492 519 """ … … 729 756 @param elapsed: computation time 730 757 """ 731 wx.PostEvent(self.parent, StatusEvent(status="Simultaneous fit \ 732 complete ")) 758 wx.PostEvent(self.parent, StatusEvent(status="Simultaneous fit complete ")) 733 759 734 760 ## fit more than 1 model at the same time … … 805 831 if event.panel!=None: 806 832 new_panel = event.panel 833 self.main_panel= event.main_panel 807 834 # Set group ID if available 808 835 event_id = self.parent.popup_panel(new_panel) … … 810 837 # "Show %s plot panel" % new_panel.window_caption) 811 838 # Set UID to allow us to reference the panel later 839 self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE, 840 841 self._onclearslicer) 842 812 843 new_panel.uid = event_id 813 844 self.mypanels.append(new_panel) 814 845 return 815 846 816 847 def _onclearslicer(self, event): 848 """ 849 Clear the boxslicer when close the panel associate with this slicer 850 """ 851 self.main_panel.onClearSlicer(event) 852 853 854 817 855 def _return_engine_type(self): 818 856 """ -
sansview/perspectives/fitting/modelpage.py
r70c57ebf r848a2ef 330 330 """ 331 331 self.model = model 332 333 332 self.set_model_param_sizer(self.model) 334 self.set_model_param_sizer(self.model)335 333 ## keep the sizer view consistent with the model menu selecting 336 334 self._set_model_sizer_selection( self.model ) … … 338 336 self.disable_disp.SetValue(True) 339 337 self.set_dispers_sizer() 338 340 339 self.model_view.SetFocus() 341 340 if self.model !=None: … … 353 352 box_description= wx.StaticBox(self, -1, 'Model Description') 354 353 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 355 354 356 355 sizer_selection=wx.BoxSizer(wx.HORIZONTAL) 357 358 356 self.description_hide = wx.RadioButton(self, -1, 'Hide', style=wx.RB_GROUP) 359 357 self.description_show = wx.RadioButton(self, -1, 'Show') … … 379 377 sizer_selection.Add( (20,20)) 380 378 sizer_selection.Add( self.description_hide ) 381 #sizer_selection.Add( (20,20))382 379 sizer_selection.Add((20,20),0, wx.LEFT|wx.RIGHT|wx.EXPAND,67) 383 380 sizer_selection.Add( self.model_description )
Note: See TracChangeset
for help on using the changeset viewer.