Changeset 8d3d20a in sasview for src/sas/sasgui/guiframe
- Timestamp:
- Oct 6, 2016 12:35:24 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:
- 4c3be25
- Parents:
- 0639476 (diff), e32e35a (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. - git-author:
- Andrew Jackson <andrew.jackson@…> (10/06/16 12:35:24)
- git-committer:
- GitHub <noreply@…> (10/06/16 12:35:24)
- Location:
- src/sas/sasgui/guiframe
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/events.py
rd85c194 r6ffa0dd 8 8 # plot Qrange 9 9 (PlotQrangeEvent, EVT_PLOT_QRANGE) = wx.lib.newevent.NewEvent() 10 # set plot limits 11 (PlotLimitEvent, EVT_PLOT_LIM) = wx.lib.newevent.NewEvent() 10 12 # print the messages on statusbar 11 13 (StatusEvent, EVT_STATUS) = wx.lib.newevent.NewEvent() 12 #create a panel slicer 14 #create a panel slicer 13 15 (SlicerPanelEvent, EVT_SLICER_PANEL) = wx.lib.newevent.NewEvent() 14 #print update paramaters for panel slicer 16 #print update paramaters for panel slicer 15 17 (SlicerParamUpdateEvent, EVT_SLICER_PARS_UPDATE) = wx.lib.newevent.NewEvent() 16 #update the slicer from the panel 18 #update the slicer from the panel 17 19 (SlicerParameterEvent, EVT_SLICER_PARS) = wx.lib.newevent.NewEvent() 18 20 #slicer event -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py
r895c9cb r245ae18 95 95 self.parent.SetFocus() 96 96 97 # If true, there are 3 qrange bars 98 self.is_corfunc = False 99 97 100 98 101 def get_symbol_label(self): … … 214 217 if active_ctrl == None: 215 218 return 219 if hasattr(event, 'is_corfunc'): 220 self.is_corfunc = event.is_corfunc 216 221 if event.id in self.plots.keys(): 217 222 ctrl = event.ctrl … … 222 227 values = [max(x_data.min(), float(ctrl[0].GetValue())), 223 228 min(x_data.max(), float(ctrl[1].GetValue()))] 229 if len(ctrl) == 3: 230 colors.append('purple') 231 values.append(min(x_data.max(), float(ctrl[2].GetValue()))) 224 232 if self.ly == None: 225 233 self.ly = [] … … 232 240 xval = float(active_ctrl.GetValue()) 233 241 position = self.get_data_xy_vals(xval) 234 if position != None :242 if position != None and not self.is_corfunc: 235 243 wx.PostEvent(self.parent, StatusEvent(status=position)) 236 244 except: … … 293 301 ly0x = ly[0].get_xdata() 294 302 ly1x = ly[1].get_xdata() 303 ly2x = None 304 if self.is_corfunc: ly2x = ly[2].get_xdata() 295 305 self.q_ctrl[0].SetBackgroundColour('white') 296 306 self.q_ctrl[1].SetBackgroundColour('white') … … 306 316 self.q_ctrl[0].SetValue(str(pos_x)) 307 317 self.q_ctrl[1].SetBackgroundColour('pink') 318 elif ly2x is not None and ly1x >= ly2x: 319 if self.vl_ind == 1: 320 ly[2].set_xdata(posx) 321 ly[2].set_zorder(nop) 322 self.q_ctrl[2].SetValue(str(pos_x)) 323 elif self.vl_ind == 2: 324 ly[1].set_xdata(posx) 325 ly[1].set_zorder(nop) 326 self.q_ctrl[1].SetValue(str(pos_x)) 327 308 328 309 329 def _get_cusor_lines(self, event): … … 325 345 dqmin = math.fabs(event.xdata - self.ly[0].get_xdata()) 326 346 dqmax = math.fabs(event.xdata - self.ly[1].get_xdata()) 327 is_qmax = dqmin > dqmax 328 if is_qmax: 329 self.vl_ind = 1 347 if not self.is_corfunc: 348 is_qmax = dqmin > dqmax 349 if is_qmax: 350 self.vl_ind = 1 351 else: 352 self.vl_ind = 0 330 353 else: 331 self.vl_ind = 0 354 dqmax2 = math.fabs(event.xdata - self.ly[2].get_xdata()) 355 closest = min(dqmin, dqmax, dqmax2) 356 self.vl_ind = { dqmin: 0, dqmax: 1, dqmax2: 2 }.get(closest) 332 357 333 358 def cusor_line(self, event): -
src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py
rd85c194 r6ffa0dd 16 16 from sas.sasgui.guiframe.events import EVT_NEW_PLOT 17 17 from sas.sasgui.guiframe.events import EVT_PLOT_QRANGE 18 from sas.sasgui.guiframe.events import EVT_PLOT_LIM 18 19 from sas.sasgui.guiframe.events import DeletePlotPanelEvent 19 20 from sas.sasgui.guiframe.plugin_base import PluginBase … … 79 80 self.parent.Bind(EVT_NEW_PLOT, self._on_plot_event) 80 81 self.parent.Bind(EVT_PLOT_QRANGE, self._on_plot_qrange) 82 self.parent.Bind(EVT_PLOT_LIM, self._on_plot_lim) 81 83 # We have no initial panels for this plug-in 82 84 return [] … … 95 97 return 96 98 panel.on_plot_qrange(event) 99 100 def _on_plot_lim(self, event=None): 101 if event == None: 102 return 103 if event.id in self.plot_panels.keys(): 104 panel = self.plot_panels[event.id] 105 elif event.group_id in self.plot_panels.keys(): 106 panel = self.plot_panels[event.group_id] 107 else: 108 return 109 if hasattr(event, 'xlim'): 110 panel.subplot.set_xlim(event.xlim) 111 if hasattr(event, 'ylim'): 112 panel.subplot.set_ylim(event.ylim) 113 97 114 98 115 def _on_show_panel(self, event): … … 312 329 new_panel = self.create_2d_panel(data, group_id) 313 330 self.create_panel_helper(new_panel, data, group_id, title) 331 if hasattr(event, 'xlim'): 332 new_panel.subplot.set_xlim(event.xlim) 333 if hasattr(event, 'ylim'): 334 new_panel.subplot.set_ylim(event.ylim) 314 335 return -
src/sas/sasgui/guiframe/aboutbox.py
rd85c194 re0f28e6 106 106 self.bitmap_button_nist = wx.BitmapButton(self, -1, wx.NullBitmap) 107 107 self.bitmap_button_umd = wx.BitmapButton(self, -1, wx.NullBitmap) 108 self.bitmap_button_sns = wx.BitmapButton(self, -1, wx.NullBitmap) 108 self.bitmap_button_ornl = wx.BitmapButton(self, -1, wx.NullBitmap) 109 #self.bitmap_button_sns = wx.BitmapButton(self, -1, wx.NullBitmap) 109 110 #self.bitmap_button_nsf = wx.BitmapButton(self, -1, 110 111 # wx.NullBitmap) … … 115 116 self.bitmap_button_ess = wx.BitmapButton(self, -1, wx.NullBitmap) 116 117 self.bitmap_button_ill = wx.BitmapButton(self, -1, wx.NullBitmap) 118 self.bitmap_button_ansto = wx.BitmapButton(self, -1, wx.NullBitmap) 117 119 118 120 self.static_line_3 = wx.StaticLine(self, -1) … … 124 126 self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist) 125 127 self.Bind(wx.EVT_BUTTON, self.onUmdLogo, self.bitmap_button_umd) 126 self.Bind(wx.EVT_BUTTON, self.onSnsLogo, self.bitmap_button_sns) 128 #self.Bind(wx.EVT_BUTTON, self.onSnsLogo, self.bitmap_button_sns) 129 self.Bind(wx.EVT_BUTTON, self.onOrnlLogo, self.bitmap_button_ornl) 127 130 #self.Bind(wx.EVT_BUTTON, self.onNsfLogo, self.bitmap_button_nsf) 128 131 #self.Bind(wx.EVT_BUTTON, self.onDanseLogo, self.bitmap_button_danse) … … 131 134 self.Bind(wx.EVT_BUTTON, self.onEssLogo, self.bitmap_button_ess) 132 135 self.Bind(wx.EVT_BUTTON, self.onIllLogo, self.bitmap_button_ill) 136 self.Bind(wx.EVT_BUTTON, self.onAnstoLogo, self.bitmap_button_ansto) 133 137 # end wxGlade 134 138 # fill in acknowledgements … … 163 167 self.bitmap_button_umd.SetBitmapLabel(logo) 164 168 165 169 image = file_dir + "/images/ornl_logo.png" 170 if os.path.isfile(config._ornl_logo): 171 image = config._ornl_logo 172 logo = wx.Bitmap(image) 173 self.bitmap_button_ornl.SetBitmapLabel(logo) 174 175 """ 166 176 image = file_dir + "/images/sns_logo.png" 167 177 if os.path.isfile(config._sns_logo): … … 170 180 self.bitmap_button_sns.SetBitmapLabel(logo) 171 181 172 """173 182 image = file_dir + "/images/nsf_logo.png" 174 183 if os.path.isfile(config._nsf_logo): … … 206 215 logo = wx.Bitmap(image) 207 216 self.bitmap_button_ill.SetBitmapLabel(logo) 217 218 image = file_dir + "/images/ansto_logo.png" 219 if os.path.isfile(config._ansto_logo): 220 image = config._ansto_logo 221 logo = wx.Bitmap(image) 222 self.bitmap_button_ansto.SetBitmapLabel(logo) 208 223 209 224 # resize dialog window to fit version number nicely … … 227 242 self.bitmap_button_nist.SetSize(self.bitmap_button_nist.GetBestSize()) 228 243 self.bitmap_button_umd.SetSize(self.bitmap_button_umd.GetBestSize()) 229 self.bitmap_button_sns.SetSize(self.bitmap_button_sns.GetBestSize()) 244 self.bitmap_button_ornl.SetSize(self.bitmap_button_ornl.GetBestSize()) 245 #self.bitmap_button_sns.SetSize(self.bitmap_button_sns.GetBestSize()) 230 246 #self.bitmap_button_nsf.SetSize(self.bitmap_button_nsf.GetBestSize()) 231 247 #self.bitmap_button_danse.SetSize(self.bitmap_button_danse.GetBestSize()) … … 234 250 self.bitmap_button_ess.SetSize(self.bitmap_button_ess.GetBestSize()) 235 251 self.bitmap_button_ill.SetSize(self.bitmap_button_ill.GetBestSize()) 252 self.bitmap_button_ansto.SetSize(self.bitmap_button_ansto.GetBestSize()) 236 253 # end wxGlade 237 254 … … 285 302 sizer_logos.Add(self.bitmap_button_nist, 0, 286 303 wx.LEFT|wx.ADJUST_MINSIZE, 2) 287 sizer_logos.Add(self.bitmap_button_sns, 0, 304 #sizer_logos.Add(self.bitmap_button_sns, 0, 305 # wx.LEFT|wx.ADJUST_MINSIZE, 2) 306 sizer_logos.Add(self.bitmap_button_ornl, 0, 288 307 wx.LEFT|wx.ADJUST_MINSIZE, 2) 289 308 sizer_logos.Add(self.bitmap_button_isis, 0, … … 292 311 wx.LEFT|wx.ADJUST_MINSIZE, 2) 293 312 sizer_logos.Add(self.bitmap_button_ill, 0, 313 wx.LEFT|wx.ADJUST_MINSIZE, 2) 314 sizer_logos.Add(self.bitmap_button_ansto, 0, 294 315 wx.LEFT|wx.ADJUST_MINSIZE, 2) 295 316 … … 321 342 event.Skip() 322 343 344 def onOrnlLogo(self, event): 345 """ 346 """ 347 # wxGlade: DialogAbout.<event_handler> 348 launchBrowser(config._ornl_url) 349 event.Skip() 350 323 351 def onSnsLogo(self, event): 324 352 """ … … 368 396 # wxGlade: DialogAbout.<event_handler> 369 397 launchBrowser(config._ill_url) 398 event.Skip() 399 400 def onAnstoLogo(self, event): 401 """ 402 """ 403 # wxGlade: DialogAbout.<event_handler> 404 launchBrowser(config._ansto_url) 370 405 event.Skip() 371 406 -
src/sas/sasgui/guiframe/acknowledgebox.py
rd85c194 rc1fdf84 68 68 self.preamble.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "")) 69 69 self.SetTitle("Acknowledging SasView") 70 self.SetSize((525, 225)) 70 #Increased size of box from (525, 225), SMK, 04/10/16 71 self.SetSize((600, 300)) 71 72 # end wxGlade 72 73 -
src/sas/sasgui/guiframe/gui_manager.py
rc8a641e8 r3fac0df 1345 1345 self._help_menu.Append(wx_id, '&Documentation', '') 1346 1346 wx.EVT_MENU(self, wx_id, self._onSphinxDocs) 1347 self._help_menu.AppendSeparator() 1347 1348 1348 1349 if config._do_tutorial and (IS_WIN or sys.platform == 'darwin'): 1349 self._help_menu.AppendSeparator()1350 1350 wx_id = wx.NewId() 1351 1351 self._help_menu.Append(wx_id, '&Tutorial', 'Software tutorial') 1352 1352 wx.EVT_MENU(self, wx_id, self._onTutorial) 1353 self._help_menu.AppendSeparator() 1354 1353 1355 1354 1356 if config._do_acknowledge: 1355 self._help_menu.AppendSeparator()1356 1357 wx_id = wx.NewId() 1357 1358 self._help_menu.Append(wx_id, '&Acknowledge', 'Acknowledging SasView') 1358 1359 wx.EVT_MENU(self, wx_id, self._onAcknowledge) 1360 self._help_menu.AppendSeparator() 1361 1359 1362 1360 1363 if config._do_aboutbox: 1364 logging.info("Doing help menu") 1365 wx_id = wx.NewId() 1366 self._help_menu.Append(wx_id, '&About', 'Software information') 1367 wx.EVT_MENU(self, wx_id, self._onAbout) 1361 1368 self._help_menu.AppendSeparator() 1362 self._help_menu.Append(wx.ID_ABOUT, '&About', 'Software information') 1363 wx.EVT_MENU(self, wx.ID_ABOUT, self._onAbout) 1369 1364 1370 1365 1371 # Checking for updates -
src/sas/sasgui/guiframe/gui_statusbar.py
rd85c194 r3a22ce7 6 6 import sys 7 7 import logging 8 import datetime 8 9 from wx import StatusBar as wxStatusB 9 10 from wx.lib import newevent … … 46 47 47 48 self.msg_txt.SetEditable(False) 48 self.msg_txt.SetValue('No message available') 49 timestamp = datetime.datetime.now() 50 status = '{:%Y-%m-%d %H:%M:%S} : No message available'.format(timestamp) 51 self.msg_txt.SetValue(status) 49 52 self.sizer.Add(self.msg_txt, 1, wx.EXPAND|wx.ALL, 10) 50 53 self.SetSizer(self.sizer) … … 60 63 if status.strip() == "": 61 64 return 65 # Add timestamp 66 timestamp = datetime.datetime.now() 67 status = '{:%Y-%m-%d %H:%M:%S} : '.format(timestamp) + status 62 68 color = (0, 0, 0) #black 63 69 icon_bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR) -
src/sas/sasgui/guiframe/media/data_formats_help.rst
rd85c194 r280f929 3 3 .. This is a port of the original SasView html help file to ReSTructured text 4 4 .. by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 5 .. WG Bouwman, DUT, added during CodeCamp-V in Oct 2016 the SESANS data format 5 6 6 7 .. _Formats: … … 9 10 ============ 10 11 11 SasView reads several different 1D (I(Q) vs Q) and 2D (I(Qx,Qy) vs (Qx,Qy)) 12 SasView reads several different 1D (I(Q) vs Q), 2D SANS(I(Qx,Qy) vs (Qx,Qy)) 13 and SESANS (P(z) vs z) 12 14 data files. But please note that SasView does not at present load data where 13 15 the Q and I(Q) data are in separate files. 14 16 15 1D Formats 16 ---------- 17 1D Formats SANS 18 --------------- 17 19 18 20 SasView will read files with 2 to 4 columns of numbers in the following order: … … 46 48 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 47 49 48 2D Formats 49 ---------- 50 2D Formats SANS 51 --------------- 50 52 51 53 SasView will only read files in the NIST 2D format with the extensions … … 60 62 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 61 63 62 .. note:: This help document was last changed by Steve King, 01May2015 64 SESANS Format 65 ------------- 66 67 The current file extension is .ses or .sesans (not case sensitive). 68 69 The file format is to have a list of name-value pairs as a header at the top of the file, detailing general experimental parameters necessary for fitting and analyzing data. This list should contain all information necessary for the file to be 'portable' between users. 70 71 Following that is a 6 column list of instrument experimental variables: 72 73 - Spin echo length (z, in Angstroms) 74 - Spin echo length error (:math:`\Delta` z, in Angstroms) (experimental resolution) 75 - neutron wavelength (:math:`\lambda`, in Angstroms) (essential for ToF instruments) 76 - neutron wavelength error (:math:`\Delta \lambda`, in Angstroms) 77 - Normalized polarization (:math:`P/P_0`, unitless) 78 - Normalized polarization error (:math:`\Delta(P/P_0)`, unitless) (measurement error) 79 80 81 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 82 83 .. note:: This help document was last changed by Wim Bouwman, 05Oct2016 -
src/sas/sasgui/guiframe/media/graph_help.rst
re68c9bf rf9b0c81 42 42 plot window. 43 43 44 *NOTE! If a residuals graph (when fitting data) is hidden, it will not show up 45 after computation.* 44 .. note:: 45 *If a residuals graph (when fitting data) is hidden, it will not show up 46 after computation.* 46 47 47 48 Dragging a plot … … 67 68 After zooming in on a a region, the *left arrow* or *right arrow* buttons on 68 69 the toolbar will switch between recent views. 70 71 The axis range can also be specified manually. To do so go to the *Graph Menu* 72 (see Invoking_the_graph_menu_ for further details), choose the *Set Graph Range* 73 option and enter the limits in the pop box. 69 74 70 75 *NOTE! If a wheel mouse is available scrolling the wheel will zoom in/out … … 116 121 ^^^^^^^^^^^^^^^^^^^ 117 122 118 From the *Graph Menu* (see Invoking_the_graph_menu_) it is also possible to 119 make some custom modifications to plots, including: 123 It is possible to make custom modifications to plots including: 120 124 121 125 * changing the plot window title 122 * changing the axis legend locations123 * changing the axis l egend label text124 * changing the axis l egend label units125 * changing the axis l egend label font & font colour126 * changing the default legend location and toggling it on/off 127 * changing the axis label text 128 * changing the axis label units 129 * changing the axis label font & font colour 126 130 * adding/removing a text string 127 131 * adding a grid overlay 132 133 The legend and text strings can be drag and dropped around the plot 134 135 These options are accessed through the *Graph Menu* (see Invoking_the_graph_menu_) 136 and selecting *Modify Graph Appearance* (for axis labels, grid overlay and 137 legend position) or *Add Text* to add textual annotations, selecting font, color, 138 style and size. *Remove Text* will remove the last annotation added. To change 139 the legend. *Window Title* allows a custom title to be entered instead of Graph 140 x. 128 141 129 142 Changing scales … … 234 247 selected data will be removed from the plot. 235 248 236 *NOTE! This action cannot be undone.* 249 .. note:: 250 The Remove data set action cannot be undone. 237 251 238 252 Show-Hide error bars … … 248 262 In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Modify Plot 249 263 Property* to change the size, color, or shape of the displayed marker for the 250 chosen dataset, or to change the dataset label that appears on the plot. 264 chosen dataset, or to change the dataset label that appears in the plot legend 265 box. 251 266 252 267 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ … … 292 307 average. 293 308 294 *NOTE! The displayed average only updates when input focus is moved back to 295 that window; ie, when the mouse pointer is moved onto that plot.* 309 .. note:: 310 The displayed average only updates when input focus is moved back to 311 that window; ie, when the mouse pointer is moved onto that plot. 296 312 297 313 Selecting *Box Sum* automatically brings up the 'Slicer Parameters' dialog in … … 359 375 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 360 376 361 .. note:: This help document was last changed by Steve King, 01May2015377 .. note:: This help document was last modified by Paul Butler, 05 September, 2016 -
src/sas/sasgui/guiframe/utils.py
rd85c194 ra0373d5 46 46 return flag 47 47 48 48 49 def check_int(item): 50 """ 51 :param item: txtcrtl containing a value 52 """ 53 flag = True 54 try: 55 mini = int(item.GetValue()) 56 item.SetBackgroundColour(wx.WHITE) 57 item.Refresh() 58 except: 59 flag = False 60 item.SetBackgroundColour("pink") 61 item.Refresh() 62 return flag 63 64 49 65 class PanelMenu(wx.Menu): 50 66 """
Note: See TracChangeset
for help on using the changeset viewer.