Changeset 4c3be25 in sasview for src/sas/sasgui/perspectives/fitting/fitpage.py
- Timestamp:
- Oct 6, 2016 12:45:54 PM (8 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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- b2a3814, 9b6d62d
- Parents:
- 8d3d20a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
r6c382da r4c3be25 624 624 ## fill a sizer with the combobox to select dispersion type 625 625 model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 626 CHECK_STATE = self.cb1.GetValue()626 CHECK_STATE = False 627 627 628 628 ix = 0 … … 969 969 self.state.model = self.model.clone() 970 970 ## save state into 971 self.state.cb1 = self.cb1.GetValue()972 971 self._copy_parameters_state(self.parameters, self.state.parameters) 973 972 self._copy_parameters_state(self.orientation_params_disp, … … 980 979 StatusEvent(status=" Selected Distribution: Gaussian")) 981 980 #Fill the list of fittable parameters 982 #self.select_all_param(event=None)983 981 self.get_all_checked_params() 984 982 self.Layout() … … 2695 2693 self._manager.set_param2fit(self.uid, param2fit) 2696 2694 2697 def select_all_param(self, event):2698 """2699 set to true or false all checkBox given the main checkbox value cb12700 """2701 self.param_toFit = []2702 if self.parameters != []:2703 if self.cb1.GetValue():2704 for item in self.parameters:2705 if item[0].IsShown():2706 ## for data2D select all to fit2707 if self.data.__class__.__name__ == "Data2D" or \2708 self.enable2D:2709 item[0].SetValue(True)2710 self.param_toFit.append(item)2711 else:2712 ## for 1D all parameters except orientation2713 if not item in self.orientation_params:2714 item[0].SetValue(True)2715 self.param_toFit.append(item)2716 else:2717 item[0].SetValue(False)2718 #if len(self.fittable_param)>0:2719 for item in self.fittable_param:2720 if item[0].IsShown():2721 if self.data.__class__.__name__ == "Data2D" or \2722 self.enable2D:2723 item[0].SetValue(True)2724 self.param_toFit.append(item)2725 try:2726 if len(self.values[item[1]]) > 0:2727 item[0].SetValue(False)2728 except:2729 pass2730 2731 else:2732 ## for 1D all parameters except orientation2733 if not item in self.orientation_params_disp:2734 item[0].SetValue(True)2735 self.param_toFit.append(item)2736 try:2737 if len(self.values[item[1]]) > 0:2738 item[0].SetValue(False)2739 except:2740 pass2741 else:2742 item[0].SetValue(False)2743 2744 else:2745 for item in self.parameters:2746 item[0].SetValue(False)2747 for item in self.fittable_param:2748 item[0].SetValue(False)2749 self.param_toFit = []2750 2751 self.save_current_state_fit()2752 2753 if event != None:2754 #self._undo.Enable(True)2755 ## post state to fit panel2756 event = PageInfoEvent(page=self)2757 wx.PostEvent(self.parent, event)2758 param2fit = []2759 for item in self.param_toFit:2760 if item[0] and item[0].IsShown():2761 param2fit.append(item[1])2762 self.parent._manager.set_param2fit(self.uid, param2fit)2763 2764 2695 def select_param(self, event): 2765 2696 """ … … 2808 2739 if len(self.fittable_param) > 0: 2809 2740 len_orient_para *= 2 2810 #Set the value of checkbox that selected every checkbox or not2811 if len(self.parameters) + len(self.fittable_param) - len_orient_para \2812 == len(self.param_toFit):2813 self.cb1.SetValue(True)2814 else:2815 self.cb1.SetValue(False)2816 2741 2817 2742 self.save_current_state_fit() … … 2915 2840 iy = 0 2916 2841 ix = 0 2917 select_text = "Select All" 2918 self.cb1 = wx.CheckBox(self, wx.ID_ANY, str(select_text), (10, 10)) 2919 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 2920 self.cb1.SetToolTipString("To check/uncheck all the boxes below.") 2921 self.cb1.SetValue(True) 2922 2923 sizer.Add(self.cb1, (iy, ix), (1, 1), \ 2924 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 2842 sizer.Add(wx.StaticText(self, wx.ID_ANY, 'Parameter'), 2843 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0) 2925 2844 ix += 1 2926 2845 self.text2_2 = wx.StaticText(self, wx.ID_ANY, 'Value') … … 2949 2868 self.text2_4.Hide() 2950 2869 2951 CHECK_STATE = self.cb1.GetValue()2870 CHECK_STATE = False 2952 2871 for item in keys: 2953 2872
Note: See TracChangeset
for help on using the changeset viewer.