Changeset 9f7dde3 in sasview for src/sas/sasgui/perspectives
- Timestamp:
- Jul 11, 2016 4:36:55 AM (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:
- 3ec4b8f
- Parents:
- 7858575
- git-author:
- Lewis O'Driscoll <lewis.o'driscoll@…> (07/01/16 11:29:03)
- git-committer:
- Lewis O'Driscoll <lewis.o'driscoll@…> (07/11/16 04:36:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/corfunc/corfunc_panel.py
r7858575 r9f7dde3 4 4 from sas.sasgui.guiframe.panel_base import PanelBase 5 5 from sas.sasgui.perspectives.invariant.invariant_widgets import OutputTextCtrl 6 from sas.sasgui.perspectives.invariant.invariant_widgets import InvTextCtrl 6 7 7 BACKGROUND = 0.08 8 if sys.platform.count("win32") > 0: 9 9 _STATICBOX_WIDTH = 350 … … 31 31 self._manager = manager 32 32 self._data = data 33 self._background = BACKGROUND 33 self._data_name_box = None 34 self._output_ids = None 34 35 self.state = None 35 36 self.set_state() … … 37 38 38 39 def set_state(self, state=None, data=None): 40 # TODO: Implement state restoration 39 41 return False 40 42 … … 45 47 :param data: The data that has been loaded 46 48 """ 47 self. data_name_box.SetValue(str(data.name))49 self._data_name_box.SetValue(str(data.name)) 48 50 if self._manager is not None: 49 51 self._manager.show_data(data=data, reset=True) … … 57 59 58 60 # I(q) data box 59 databox = wx.StaticBox(self, -1, "I(q) data source") 61 databox = wx.StaticBox(self, -1, "I(Q) Data Source") 62 databox_sizer = wx.StaticBoxSizer(databox, wx.VERTICAL) 60 63 61 pars_sizer = wx.GridBagSizer(5, 5) 62 63 box_sizer1 = wx.StaticBoxSizer(databox, wx.VERTICAL) 64 box_sizer1.SetMinSize((350, 50)) 64 file_sizer = wx.GridBagSizer(5, 5) 65 65 66 66 file_name_label = wx.StaticText(self, -1, "Name:") 67 pars_sizer.Add(file_name_label, (0, 0), (1, 1),67 file_sizer.Add(file_name_label, (0, 0), (1, 1), 68 68 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 69 69 70 self.data_name_box = OutputTextCtrl(self, -1, size=(350,20)) 71 pars_sizer.Add(self.data_name_box, (0, 1), (1, 1), 72 wx.EXPAND | wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 15) 70 self._data_name_box = OutputTextCtrl(self, -1, 71 size=(300,20)) 72 file_sizer.Add(self._data_name_box, (0, 1), (1, 1), 73 wx.CENTER | wx.ADJUST_MINSIZE, 15) 73 74 74 box_sizer1.Add(pars_sizer, 0, wx.EXPAND) 75 vbox.Add(box_sizer1, (0, 0), (1, 1), 76 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE | wx.TOP, 5) 75 file_sizer.AddSpacer((1, 25), pos=(0,2)) 76 databox_sizer.Add(file_sizer, wx.TOP, 15) 77 78 vbox.Add(databox_sizer, (0, 0), (1, 1), 79 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE | wx.TOP, 15) 80 81 82 # Parameters 83 qbox = wx.StaticBox(self, -1, "Parameters") 84 qbox_sizer = wx.StaticBoxSizer(qbox, wx.VERTICAL) 85 qbox_sizer.SetMinSize((_STATICBOX_WIDTH, 75)) 86 87 q_sizer = wx.GridBagSizer(5, 5) 88 89 # Explanation 90 explanation_txt = ("Corfunc will use all values in the lower range for" 91 " Guinier back extrapolation, and all values in the upper range " 92 "for Porod forward extrapolation.") 93 explanation_label = wx.StaticText(self, -1, explanation_txt, 94 size=(_STATICBOX_WIDTH, 60)) 95 96 q_sizer.Add(explanation_label, (0,0), (1,4), wx.LEFT | wx.EXPAND, 5) 97 98 qrange_label = wx.StaticText(self, -1, "Q Range:", size=(50,20)) 99 q_sizer.Add(qrange_label, (1,0), (1,1), wx.LEFT | wx.EXPAND, 5) 100 101 # Lower Q Range 102 qmin_label = wx.StaticText(self, -1, "Lower:", size=(50,20)) 103 qmin_dash_label = wx.StaticText(self, -1, "-", size=(10,20), 104 style=wx.ALIGN_CENTER_HORIZONTAL) 105 106 qmin_lower = OutputTextCtrl(self, -1, size=(50, 20), value="0.0") 107 qmin_input = InvTextCtrl(self, -1, size=(50, 20), 108 style=wx.TE_PROCESS_ENTER, name='qmin_input') 109 qmin_input.SetToolTipString(("Values with q < qmin will be used for " 110 "Guinier back extrapolation")) 111 112 q_sizer.Add(qmin_label, (2, 0), (1, 1), wx.LEFT | wx.EXPAND, 5) 113 q_sizer.Add(qmin_lower, (2, 1), (1, 1), wx.LEFT, 5) 114 q_sizer.Add(qmin_dash_label, (2, 2), (1, 1), wx.CENTER | wx.EXPAND, 5) 115 q_sizer.Add(qmin_input, (2, 3), (1, 1), wx.LEFT, 5) 116 117 # Upper Q range 118 qmax_tooltip = ("Values with qmax1 < q < qmax2 will be used for Porod" 119 " forward extrapolation") 120 121 qmax_label = wx.StaticText(self, -1, "Upper:", size=(50,20)) 122 qmax_dash_label = wx.StaticText(self, -1, "-", size=(10,20), 123 style=wx.ALIGN_CENTER_HORIZONTAL) 124 125 qmax1_input = InvTextCtrl(self, -1, size=(50, 20), 126 style=wx.TE_PROCESS_ENTER, name="qmax1_input") 127 qmax1_input.SetToolTipString(qmax_tooltip) 128 qmax2_input = InvTextCtrl(self, -1, size=(50, 20), 129 style=wx.TE_PROCESS_ENTER, name="qmax2_input") 130 qmax2_input.SetToolTipString(qmax_tooltip) 131 132 q_sizer.Add(qmax_label, (3, 0), (1, 1), wx.LEFT | wx.EXPAND, 5) 133 q_sizer.Add(qmax1_input, (3, 1), (1, 1), wx.LEFT, 5) 134 q_sizer.Add(qmax_dash_label, (3, 2), (1, 1), wx.CENTER | wx.EXPAND, 5) 135 q_sizer.Add(qmax2_input, (3,3), (1, 1), wx.LEFT, 5) 136 137 qbox_sizer.Add(q_sizer, wx.TOP, 0) 138 139 vbox.Add(qbox_sizer, (1, 0), (1, 1), 140 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 141 142 # Output data 143 outputbox = wx.StaticBox(self, -1, "Output Measuments") 144 outputbox_sizer = wx.StaticBoxSizer(outputbox, wx.VERTICAL) 145 146 output_sizer = wx.GridBagSizer(5, 5) 147 148 label_strings = [ 149 "Long Period (A): ", 150 "Average Hard Block Thickness (A): ", 151 "Average Interface Thickness (A): ", 152 "Average Core Thickness: ", 153 "PolyDispersity: ", 154 "Filling Fraction: " 155 ] 156 self._output_ids = dict() 157 for i in range(len(label_strings)): 158 label = wx.StaticText(self, -1, label_strings[i]) 159 output_box = OutputTextCtrl(self, wx.NewId(), size=(50, 20), 160 value="-", style=wx.ALIGN_CENTER_HORIZONTAL) 161 self._output_ids[label_strings[i]] = output_box.GetId() 162 output_sizer.Add(label, (i, 0), (1, 1), wx.LEFT | wx.EXPAND, 15) 163 output_sizer.Add(output_box, (i, 2), (1, 1), 164 wx.RIGHT | wx.EXPAND, 15) 165 166 outputbox_sizer.Add(output_sizer, wx.TOP, 0) 167 168 vbox.Add(outputbox_sizer, (2, 0), (1, 1), 169 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 170 171 172 controlbox = wx.StaticBox(self, -1, "Controls") 173 controlbox_sizer = wx.StaticBoxSizer(controlbox, wx.VERTICAL) 174 175 controls_sizer = wx.BoxSizer(wx.VERTICAL) 176 177 extrapolate_btn = wx.Button(self, wx.NewId(), "Extrapolate") 178 transform_btn = wx.Button(self, wx.NewId(), "Transform") 179 compute_btn = wx.Button(self, wx.NewId(), "Compute Measuments") 180 181 controls_sizer.Add(extrapolate_btn, wx.CENTER | wx.EXPAND) 182 controls_sizer.Add(transform_btn, wx.CENTER | wx.EXPAND) 183 controls_sizer.Add(compute_btn, wx.CENTER | wx.EXPAND) 184 185 controlbox_sizer.Add(controls_sizer, wx.TOP | wx.EXPAND, 0) 186 vbox.Add(controlbox_sizer, (3, 0), (1, 1), 187 wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 77 188 78 189 self.SetSizer(vbox)
Note: See TracChangeset
for help on using the changeset viewer.