Changeset 51a4d78 in sasview for src/sas/sasgui/perspectives/fitting/fitpage.py
- Timestamp:
- Oct 8, 2016 3:33:04 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:
- 1fac6c0
- Parents:
- 7988501 (diff), f7bc948 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
r4c3be25 r7988501 55 55 self.weightbt_string = None 56 56 self.m_name = None 57 # transform implementation 58 self._fill_Trafo_sizer() 59 # self.Trafobt_string() 57 60 # get smear info from data 58 61 self._get_smear_info() … … 92 95 self.parent.on_set_focus(event) 93 96 self.on_tap_focus() 97 98 def onTrafo(self, event): 99 """ 100 On Trafo radio button event, sets the Trafobt_string 101 """ 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() 94 154 95 155 def _fill_data_sizer(self): … … 624 684 ## fill a sizer with the combobox to select dispersion type 625 685 model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 626 CHECK_STATE = False686 CHECK_STATE = self.cb1.GetValue() 627 687 628 688 ix = 0 … … 969 1029 self.state.model = self.model.clone() 970 1030 ## save state into 1031 self.state.cb1 = self.cb1.GetValue() 971 1032 self._copy_parameters_state(self.parameters, self.state.parameters) 972 1033 self._copy_parameters_state(self.orientation_params_disp, … … 979 1040 StatusEvent(status=" Selected Distribution: Gaussian")) 980 1041 #Fill the list of fittable parameters 1042 #self.select_all_param(event=None) 981 1043 self.get_all_checked_params() 982 1044 self.Layout() … … 2693 2755 self._manager.set_param2fit(self.uid, param2fit) 2694 2756 2757 def select_all_param(self, event): 2758 """ 2759 set to true or false all checkBox given the main checkbox value cb1 2760 """ 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 fit 2767 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 orientation 2773 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 pass 2790 2791 else: 2792 ## for 1D all parameters except orientation 2793 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 pass 2801 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 panel 2816 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 2695 2824 def select_param(self, event): 2696 2825 """ … … 2739 2868 if len(self.fittable_param) > 0: 2740 2869 len_orient_para *= 2 2870 #Set the value of checkbox that selected every checkbox or not 2871 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) 2741 2876 2742 2877 self.save_current_state_fit() … … 2840 2975 iy = 0 2841 2976 ix = 0 2842 sizer.Add(wx.StaticText(self, wx.ID_ANY, 'Parameter'), 2843 (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 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) 2844 2985 ix += 1 2845 2986 self.text2_2 = wx.StaticText(self, wx.ID_ANY, 'Value') … … 2868 3009 self.text2_4.Hide() 2869 3010 2870 CHECK_STATE = False3011 CHECK_STATE = self.cb1.GetValue() 2871 3012 for item in keys: 2872 3013
Note: See TracChangeset
for help on using the changeset viewer.