Changeset 934cfc03 in sasview for fittingview
- Timestamp:
- Oct 18, 2011 12:52:31 PM (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:
- 02b0988d
- Parents:
- afa0a31
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/fitpage.py
r15f68ce r934cfc03 691 691 #sizer_select_dispers = wx.BoxSizer(wx.HORIZONTAL) 692 692 model_disp = wx.StaticText(self, -1, 'Function') 693 693 CHECK_STATE = self.cb1.GetValue() 694 694 import sans.models.dispersion_models 695 695 self.polydisp= sans.models.dispersion_models.models … … 766 766 ix = 0 767 767 cb = wx.CheckBox(self, -1, name0, (10, 10)) 768 cb.SetValue(CHECK_STATE) 768 769 cb.SetToolTipString("Check mark to fit") 769 770 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) … … 888 889 ix = 0 889 890 cb = wx.CheckBox(self, -1, name0, (10, 10)) 891 cb.SetValue(CHECK_STATE) 890 892 cb.SetToolTipString("Check mark to fit") 891 893 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) … … 1050 1052 " Selected Distribution: Gaussian")) 1051 1053 #Fill the list of fittable parameters 1052 self.select_all_param(event=None)1053 1054 #self.select_all_param(event=None) 1055 self.get_all_checked_params() 1054 1056 self.Layout() 1055 1057 … … 1309 1311 if copy_flag: 1310 1312 self.get_paste_params(copy_flag) 1313 1311 1314 self._onDraw(event=None) 1312 1315 else: … … 2632 2635 pass 2633 2636 2634 2635 def select_all_param(self,event): 2637 2638 def get_all_checked_params(self): 2639 """ 2640 Found all parameters current check and add them to list of parameters to 2641 fit 2642 """ 2643 self.param_toFit = [] 2644 for item in self.parameters: 2645 if item[0].GetValue() and item not in self.param_toFit: 2646 self.param_toFit.append(item) 2647 for item in self.fittable_param: 2648 if item[0].GetValue() and item not in self.param_toFit: 2649 self.param_toFit.append(item) 2650 self.save_current_state_fit() 2651 2652 2653 event = PageInfoEvent(page = self) 2654 wx.PostEvent(self.parent, event) 2655 param2fit = [] 2656 for item in self.param_toFit: 2657 if item[0]: 2658 param2fit.append(item[1]) 2659 self.parent._manager.set_param2fit(self.uid, param2fit) 2660 2661 def select_all_param(self, event): 2636 2662 """ 2637 2663 set to true or false all checkBox given the main checkbox value cb1 2638 2664 """ 2639 self.param_toFit =[]2665 self.param_toFit = [] 2640 2666 if self.parameters !=[]: 2641 2667 if self.cb1.GetValue(): … … 2645 2671 self.enable2D: 2646 2672 item[0].SetValue(True) 2647 self.param_toFit.append(item 2673 self.param_toFit.append(item) 2648 2674 else: 2649 2675 ## for 1D all parameters except orientation … … 2656 2682 self.enable2D: 2657 2683 item[0].SetValue(True) 2658 self.param_toFit.append(item 2684 self.param_toFit.append(item) 2659 2685 try: 2660 2686 if len(self.values[item[1]]) > 0: … … 2700 2726 in self.param_toFit=[] list 2701 2727 """ 2702 self.param_toFit =[]2728 self.param_toFit = [] 2703 2729 for item in self.parameters: 2704 2730 #Skip t ifhe angle parameters if 1D data … … 2741 2767 if len(self.fittable_param) > 0: 2742 2768 len_orient_para *= 2 2743 #Set the value of checkbox that selected every checkbox or not 2769 #Set the value of checkbox that selected every checkbox or not 2744 2770 if len(self.parameters)+len(self.fittable_param)-len_orient_para ==\ 2745 2771 len(self.param_toFit): … … 2747 2773 else: 2748 2774 self.cb1.SetValue(False) 2775 2776 2777 2749 2778 self.save_current_state_fit() 2750 2779 if event !=None: … … 2877 2906 self.text2_4.Hide() 2878 2907 2908 CHECK_STATE = self.cb1.GetValue() 2879 2909 for item in keys: 2880 2910 if not item in self.disp_list and not item in \ … … 2921 2951 else: 2922 2952 ## add parameters name with checkbox for selecting to fit 2923 cb = wx.CheckBox(self, -1, item ) 2953 cb = wx.CheckBox(self, -1, item) 2954 cb.SetValue(CHECK_STATE) 2924 2955 cb.SetToolTipString(" Check mark to fit.") 2925 2956 #cb.SetValue(True) … … 3018 3049 ## add parameters name with checkbox for selecting to fit 3019 3050 cb = wx.CheckBox(self, -1, item ) 3020 cb.SetValue( False)3051 cb.SetValue(CHECK_STATE) 3021 3052 cb.SetToolTipString("Check mark to fit") 3022 3053 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) … … 3115 3146 self.text2_4.Show() 3116 3147 #Fill the list of fittable parameters 3117 self.select_all_param(event=None) 3118 3148 self.get_all_checked_params() 3119 3149 self.save_current_state_fit() 3120 3150 boxsizer1.Add(sizer)
Note: See TracChangeset
for help on using the changeset viewer.