Changes in src/sas/sasgui/perspectives/fitting/fitpage.py [7988501:4c3be25] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
r7988501 r4c3be25 55 55 self.weightbt_string = None 56 56 self.m_name = None 57 # transform implementation58 self._fill_Trafo_sizer()59 # self.Trafobt_string()60 57 # get smear info from data 61 58 self._get_smear_info() … … 95 92 self.parent.on_set_focus(event) 96 93 self.on_tap_focus() 97 98 def onTrafo(self, event):99 """100 On Trafo radio button event, sets the Trafobt_string101 """102 self.Trafobt_string = event.GetEventObject().GetLabelText()103 self._set_Trafo()104 105 def _fill_Trafo_sizer(self):106 107 title = "Transform"108 box_description_trafo = wx.StaticBox(self, wx.ID_ANY, str(title))109 box_description_trafo.SetForegroundColour(wx.BLUE)110 #boxsizer_trafo = wx.StaticBoxSizer(box_description_trafo, wx.VERTICAL)111 boxsizer_trafo = wx.StaticBoxSizer(box_description_trafo, wx.HORIZONTAL)112 #sizer_trafo = wx.StaticBoxSizer(box_description_trafo, wx.HORIZONTAL)113 #weighting_set_box = wx.StaticBox(self, wx.ID_ANY,114 # 'Select the type of SESANS analysis')115 116 #sizer_weighting = wx.BoxSizer(wx.HORIZONTAL)117 # weighting_box.SetMinSize((_DATA_BOX_WIDTH, 60))118 119 #For every radio button (each statement x3):120 self.no_transform = wx.RadioButton(self, wx.ID_ANY,121 'None', style=wx.RB_GROUP)122 123 #self.Bind(wx.EVT_RADIOBUTTON, self.onTrafo,124 # id=self.no_transform.GetId())125 self.hankel = wx.RadioButton(self, wx.ID_ANY,126 'Hankel')127 #self.Bind(wx.EVT_RADIOBUTTON, self.onTrafo,128 # id=self.hankel.GetId())129 self.cosine = wx.RadioButton(self, wx.ID_ANY,130 'Cosine')131 #self.Bind(wx.EVT_RADIOBUTTON, self.onTrafo,132 # id=self.cosine.GetId())133 134 #Not sure about this (only once though)135 self.no_transform.SetValue(True)136 137 #For every radio button (each statement x3):138 boxsizer_trafo.Add(self.no_transform, 0, wx.LEFT, 10)139 boxsizer_trafo.Add((14, 10))140 boxsizer_trafo.Add(self.hankel)141 boxsizer_trafo.Add((14, 10))142 boxsizer_trafo.Add(self.cosine)143 boxsizer_trafo.Add((14, 10))144 #Default for weighting is False, but these need to be on by default!145 self.no_transform.Enable(True)146 147 #Not sure about this (only once though)148 #weighting_box.Add(sizer_trafo)149 150 self.sizerTrafo.Clear(True)151 self.sizerTrafo.Add(boxsizer_trafo, 0, wx.EXPAND | wx.ALL, 10)152 #self.sizerTrafo.Add(sizer_trafo, 0, wx.EXPAND | wx.ALL, 10)153 self.sizerTrafo.Layout()154 94 155 95 def _fill_data_sizer(self): … … 684 624 ## fill a sizer with the combobox to select dispersion type 685 625 model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 686 CHECK_STATE = self.cb1.GetValue()626 CHECK_STATE = False 687 627 688 628 ix = 0 … … 1029 969 self.state.model = self.model.clone() 1030 970 ## save state into 1031 self.state.cb1 = self.cb1.GetValue()1032 971 self._copy_parameters_state(self.parameters, self.state.parameters) 1033 972 self._copy_parameters_state(self.orientation_params_disp, … … 1040 979 StatusEvent(status=" Selected Distribution: Gaussian")) 1041 980 #Fill the list of fittable parameters 1042 #self.select_all_param(event=None)1043 981 self.get_all_checked_params() 1044 982 self.Layout() … … 2755 2693 self._manager.set_param2fit(self.uid, param2fit) 2756 2694 2757 def select_all_param(self, event):2758 """2759 set to true or false all checkBox given the main checkbox value cb12760 """2761 self.param_toFit = []2762 if self.parameters != []:2763 if self.cb1.GetValue():2764 for item in self.parameters:2765 if item[0].IsShown():2766 ## for data2D select all to fit2767 if self.data.__class__.__name__ == "Data2D" or \2768 self.enable2D:2769 item[0].SetValue(True)2770 self.param_toFit.append(item)2771 else:2772 ## for 1D all parameters except orientation2773 if not item in self.orientation_params:2774 item[0].SetValue(True)2775 self.param_toFit.append(item)2776 else:2777 item[0].SetValue(False)2778 #if len(self.fittable_param)>0:2779 for item in self.fittable_param:2780 if item[0].IsShown():2781 if self.data.__class__.__name__ == "Data2D" or \2782 self.enable2D:2783 item[0].SetValue(True)2784 self.param_toFit.append(item)2785 try:2786 if len(self.values[item[1]]) > 0:2787 item[0].SetValue(False)2788 except:2789 pass2790 2791 else:2792 ## for 1D all parameters except orientation2793 if not item in self.orientation_params_disp:2794 item[0].SetValue(True)2795 self.param_toFit.append(item)2796 try:2797 if len(self.values[item[1]]) > 0:2798 item[0].SetValue(False)2799 except:2800 pass2801 else:2802 item[0].SetValue(False)2803 2804 else:2805 for item in self.parameters:2806 item[0].SetValue(False)2807 for item in self.fittable_param:2808 item[0].SetValue(False)2809 self.param_toFit = []2810 2811 self.save_current_state_fit()2812 2813 if event != None:2814 #self._undo.Enable(True)2815 ## post state to fit panel2816 event = PageInfoEvent(page=self)2817 wx.PostEvent(self.parent, event)2818 param2fit = []2819 for item in self.param_toFit:2820 if item[0] and item[0].IsShown():2821 param2fit.append(item[1])2822 self.parent._manager.set_param2fit(self.uid, param2fit)2823 2824 2695 def select_param(self, event): 2825 2696 """ … … 2868 2739 if len(self.fittable_param) > 0: 2869 2740 len_orient_para *= 2 2870 #Set the value of checkbox that selected every checkbox or not2871 if len(self.parameters) + len(self.fittable_param) - len_orient_para \2872 == len(self.param_toFit):2873 self.cb1.SetValue(True)2874 else:2875 self.cb1.SetValue(False)2876 2741 2877 2742 self.save_current_state_fit() … … 2975 2840 iy = 0 2976 2841 ix = 0 2977 select_text = "Select All" 2978 self.cb1 = wx.CheckBox(self, wx.ID_ANY, str(select_text), (10, 10)) 2979 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 2980 self.cb1.SetToolTipString("To check/uncheck all the boxes below.") 2981 self.cb1.SetValue(True) 2982 2983 sizer.Add(self.cb1, (iy, ix), (1, 1), \ 2984 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) 2985 2844 ix += 1 2986 2845 self.text2_2 = wx.StaticText(self, wx.ID_ANY, 'Value') … … 3009 2868 self.text2_4.Hide() 3010 2869 3011 CHECK_STATE = self.cb1.GetValue()2870 CHECK_STATE = False 3012 2871 for item in keys: 3013 2872
Note: See TracChangeset
for help on using the changeset viewer.