Changeset 4c3be25 in sasview for src/sas/sasgui/perspectives/fitting
- 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
- Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
rc65a265 r4c3be25 143 143 self.theory_qmin_x = None 144 144 self.theory_qmax_x = None 145 self.cb1 = None146 145 self.btEditMask = None 147 146 self.btFit = None … … 1197 1196 # set data, etc. from the state 1198 1197 # reset page between theory and fitting from bookmarking 1199 #if state.data == None:1200 # data = None1201 #else:1202 1198 data = state.data 1203 1199 … … 1225 1221 self.disp_cb_dict = state.disp_cb_dict 1226 1222 self.disp_list = state.disp_list 1227 1228 ## set the state of the radio box1229 #self.shape_rbutton.SetValue(state.shape_rbutton)1230 #self.shape_indep_rbutton.SetValue(state.shape_indep_rbutton)1231 #self.struct_rbutton.SetValue(state.struct_rbutton)1232 #self.plugin_rbutton.SetValue(state.plugin_rbutton)1233 1223 1234 1224 ## fill model combobox … … 1286 1276 else: 1287 1277 self.model_view.SetLabel("1D Mode") 1288 1289 ## set the select all check box to the a given state1290 self.cb1.SetValue(state.cb1)1291 1278 1292 1279 ## reset state of checkbox,textcrtl and regular parameters value … … 1418 1405 except Exception: 1419 1406 logging.error(traceback.format_exc()) 1420 1421 # Make sure the check box updated when all checked1422 if self.cb1.GetValue():1423 self.select_all_param(None)1424 1407 1425 1408 def _selectDlg(self): … … 2557 2540 item[2].Enable() 2558 2541 2559 # Make sure the check box updated when all checked 2560 if self.cb1.GetValue(): 2561 #self.select_all_param(None) 2562 self.get_all_checked_params() 2542 # Make sure the check box updated 2543 self.get_all_checked_params() 2563 2544 2564 2545 # update params … … 3715 3696 call back for model selection if implemented 3716 3697 """ 3717 def select_all_param(self, event):3718 """3719 set to true or false all checkBox if implemented3720 """3721 3698 def get_weight_flag(self): 3722 3699 """ -
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.