Changeset 9df6a03 in sasview for src/sas/perspectives/fitting
- Timestamp:
- Jul 13, 2015 9:13:47 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:
- 24386b9
- Parents:
- a12c0a6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/fitting/resultpanel.py
r2f4b430 r9df6a03 9 9 import wx.lib.newevent 10 10 from wx.aui import AuiNotebook as Notebook 11 12 from bumps.gui.convergence_view import ConvergenceView 13 from bumps.gui.uncertainty_view import UncertaintyView, CorrelationView, TraceView 14 from bumps.dream.stats import var_stats, format_vars 11 15 12 16 from sas.guiframe.panel_base import PanelBase … … 55 59 result = event.result[0][0] 56 60 if hasattr(result, 'convergence'): 57 from bumps.gui.convergence_view import ConvergenceView58 61 best, pop = result.convergence[:, 0], result.convergence[:, 1:] 59 self.get_panel(ConvergenceView).update(best, pop) 62 self._get_view(ConvergenceView).update(best, pop) 63 else: 64 self._del_view(ConvergenceView) 60 65 if hasattr(result, 'uncertainty_state'): 61 from bumps.gui.uncertainty_view import UncertaintyView, CorrelationView, TraceView62 from bumps.dream.stats import var_stats, format_vars63 66 stats = var_stats(result.uncertainty_state.draw()) 64 67 msg = format_vars(stats) 65 self. get_panel(CorrelationView).update(result.uncertainty_state)66 self. get_panel(UncertaintyView).update((result.uncertainty_state, stats))67 self. get_panel(TraceView).update(result.uncertainty_state)68 self._get_view(CorrelationView).update(result.uncertainty_state) 69 self._get_view(UncertaintyView).update((result.uncertainty_state, stats)) 70 self._get_view(TraceView).update(result.uncertainty_state) 68 71 # TODO: stats should be stored in result rather than computed in bumps UncertaintyView 69 72 wx.PostEvent(self.frame.parent, 70 73 StatusEvent(status=msg, info="info")) 71 print 74 else: 75 for view in (CorrelationView, UncertaintyView, TraceView): 76 self._del_view(view) 72 77 73 78 def get_frame(self): 74 79 return self.frame 75 80 76 def add_panel(self, panel): 77 self.AddPage(panel, panel.title) 78 79 def get_panel(self, panel_class): 81 def _get_view(self, view_class): 80 82 for idx in range(self.PageCount): 81 if self.GetPageText(idx) == panel_class.title:83 if self.GetPageText(idx) == view_class.title: 82 84 return self.GetPage(idx) 83 85 else: 84 panel = panel_class(self)85 self. add_panel(panel)86 panel = view_class(self) 87 self.AddPage(panel, panel.title) 86 88 return panel 89 90 def _del_view(self, view_class): 91 for idx in range(self.PageCount): 92 if self.GetPageText(idx) == view_class.title: 93 self.DeletePage(idx) 94
Note: See TracChangeset
for help on using the changeset viewer.