Changeset 8b6f489 in sasview for sansview/perspectives/fitting/fitpage.py
- Timestamp:
- Mar 9, 2011 7:26:26 PM (14 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:
- cab8143
- Parents:
- c70eb7c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
r6bbeacd4 r8b6f489 20 20 (Chi2UpdateEvent, EVT_CHI2_UPDATE) = wx.lib.newevent.NewEvent() 21 21 _BOX_WIDTH = 76 22 _DATA_BOX_WIDTH = 3 0022 _DATA_BOX_WIDTH = 366 23 23 SMEAR_SIZE_L = 0.005 24 24 SMEAR_SIZE_H = 0.006 … … 475 475 sizer_range.Add(wx.StaticText(self, -1, "Max: "),0, wx.LEFT, 10) 476 476 sizer_range.Add(self.maximum_q,0, wx.LEFT, 10) 477 478 477 id = wx.NewId() 478 self.model_view = wx.Button(self, id,'View 2D', size=(80, 23)) 479 self.model_view.Bind(wx.EVT_BUTTON, self._onModel2D, id=id) 480 hint = "toggle view of model from 1D to 2D or 2D from 1D" 481 self.model_view.SetToolTipString(hint) 482 sizer_range.Add(self.model_view,0, wx.LEFT, 10) 479 483 480 484 boxsizer1.Add(sizer_data,0, wx.ALL, 10) … … 2618 2622 self.SetupScrolling() 2619 2623 2624 def _onModel2D(self, event): 2625 """ 2626 toggle view of model from 1D to 2D or 2D from 1D 2627 """ 2628 if self.model_view.GetLabelText() == "View 2D": 2629 self.model_view.SetLabel("View 1D") 2630 self.enable2D = True 2631 else: 2632 self.model_view.SetLabel("View 2D") 2633 self.enable2D = False 2634 self._draw_model() 2620 2635 2621 2636 class BGTextCtrl(wx.TextCtrl): … … 2642 2657 pass 2643 2658 2644 """2645 Example: ::2646 2647 class HelpWindow(wx.Frame):2648 def __init__(self, parent, id, title):2649 wx.Frame.__init__(self, parent, id, title, size=(570, 400))2650 2651 from sans.models.CylinderModel import CylinderModel2652 model = CylinderModel()2653 2654 from danse.common.plottools.plottables import Data1D2655 data= Data1D(x=[1,2], y=[3,4], dy=[0.1, 0,1])2656 2657 from fitpanel import PageInfo2658 myinfo = PageInfo(self, model, data=data )2659 2660 ## add data2661 2662 from models import ModelList2663 mylist= ModelList()2664 2665 from sans.models.SphereModel import SphereModel2666 from sans.models.SquareWellStructure import SquareWellStructure2667 from sans.models.DebyeModel import DebyeModel2668 from sans.models.LineModel import LineModel2669 name= "shapes"2670 list1= [SphereModel]2671 mylist.set_list( name, list1)2672 2673 name= "Shape-independent"2674 list1= [DebyeModel]2675 mylist.set_list( name, list1)2676 2677 name= "Structure Factors"2678 list1= [SquareWellStructure]2679 mylist.set_list( name, list1)2680 2681 name= "Added models"2682 list1= [LineModel]2683 mylist.set_list( name, list1)2684 2685 myinfo.model_list_box = mylist.get_list()2686 2687 self.page = FitPage(self, myinfo)2688 2689 self.Centre()2690 self.Show(True)2691 2692 if __name__=="__main__":2693 app = wx.App()2694 HelpWindow(None, -1, 'HelpWindow')2695 app.MainLoop()2696 """2697
Note: See TracChangeset
for help on using the changeset viewer.