Changeset 7432acb in sasview for src/sas/sasgui/guiframe
- Timestamp:
- Apr 9, 2017 4:11:31 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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 45dffa69
- Parents:
- ac07a3a
- Location:
- src/sas/sasgui/guiframe
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/dataFitting.py
r235f514 r7432acb 154 154 result.lam = np.append(self.lam, other.lam) 155 155 result.lam = result.lam[ind] 156 if result.dlam !=None:156 if result.dlam is not None: 157 157 result.dlam = np.append(self.dlam, other.dlam) 158 158 result.dlam = result.dlam[ind] 159 if result.dy !=None:159 if result.dy is not None: 160 160 result.dy = np.append(self.dy, other.dy) 161 161 result.dy = result.dy[ind] … … 307 307 result.lam = np.append(self.lam, other.lam) 308 308 result.lam = result.lam[ind] 309 if result.dy !=None:309 if result.dy is not None: 310 310 result.dy = np.append(self.dy, other.dy) 311 311 result.dy = result.dy[ind] -
src/sas/sasgui/guiframe/data_processor.py
rac07a3a r7432acb 1028 1028 label += create_label(col_name, 1029 1029 int(new_row) + 1, None) 1030 if row_min != None and row_max !=None:1030 if row_min is not None and row_max is not None: 1031 1031 if index == 0: 1032 1032 label += create_label(col_name, … … 1374 1374 wx.PostEvent(self.parent.parent, StatusEvent(status=msg, info="error")) 1375 1375 return 1376 if dy !=None and (len(y) != len(dy)):1376 if dy is not None and (len(y) != len(dy)): 1377 1377 msg = "Need same length for Y and dY axis and both greater than 0" 1378 1378 msg += " to plot.\n" … … 1572 1572 """ 1573 1573 1574 if label !=None:1574 if label is not None: 1575 1575 tcrtl_label.SetValue(str(label)) 1576 if title !=None:1576 if title is not None: 1577 1577 tcrtl_title.SetValue(str(title)) 1578 1578 … … 1685 1685 # I Believe this is no longer used now that we have removed the 1686 1686 # edit menu from the menubar - PDB July 12, 2015 1687 if event !=None:1687 if event is not None: 1688 1688 event.Skip() 1689 1689 pos = self.panel.notebook.GetSelection() … … 1697 1697 # I Believe this is no longer used now that we have removed the 1698 1698 # edit menu from the menubar - PDB July 12, 2015 1699 if event !=None:1699 if event is not None: 1700 1700 event.Skip() 1701 1701 pos = self.panel.notebook.GetSelection() … … 1739 1739 pos = self.panel.notebook.GetSelection() 1740 1740 grid = self.panel.notebook.GetPage(pos) 1741 has_data = (grid.data !=None and grid.data != {})1741 has_data = (grid.data is not None and grid.data != {}) 1742 1742 self.open_excel_menu.Enable(has_data) 1743 1743 self.save_menu.Enable(has_data) … … 1822 1822 path = dlg.GetPath() 1823 1823 dlg.Destroy() 1824 if path !=None:1824 if path is not None: 1825 1825 if self.parent is not None: 1826 1826 data = grid.get_grid_view() … … 2007 2007 path = dlg.GetPath() 2008 2008 dlg.Destroy() 2009 if path !=None:2009 if path is not None: 2010 2010 if self.parent is not None and self.data is not None: 2011 2011 self.parent.write_batch_tofile(data=self.data, -
src/sas/sasgui/guiframe/local_perspectives/plotting/AnnulusSlicer.py
r235f514 r7432acb 498 498 # Update locations 499 499 self.outer_circle.update() 500 # if self.is_inside !=None:500 # if self.is_inside is not None: 501 501 out = self._post_data() 502 502 return out -
src/sas/sasgui/guiframe/local_perspectives/plotting/Arc.py
r235f514 r7432acb 71 71 x = [] 72 72 y = [] 73 if theta1 !=None:73 if theta1 is not None: 74 74 self.theta1 = theta1 75 if theta2 !=None:75 if theta2 is not None: 76 76 self.theta2 = theta2 77 77 while self.theta2 < self.theta1: -
src/sas/sasgui/guiframe/local_perspectives/plotting/Edge.py
r959eb01 r7432acb 63 63 Draw the new roughness on the graph. 64 64 """ 65 if r1 !=None:65 if r1 is not None: 66 66 self.r1 = r1 67 if r2 !=None:67 if r2 is not None: 68 68 self.r2 = r2 69 if theta !=None:69 if theta is not None: 70 70 self.theta = theta 71 71 x1 = self.r1 * math.cos(self.theta) -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py
rac07a3a r7432acb 183 183 # So manually recode the size (=x_size) and compare here. 184 184 # Massy code to work around:< 185 if self.parent._mgr !=None:185 if self.parent._mgr is not None: 186 186 max_panel = self.parent._mgr.GetPane(self) 187 187 if max_panel.IsMaximized(): 188 188 self.parent._mgr.RestorePane(max_panel) 189 189 max_panel.Maximize() 190 if self.x_size !=None:190 if self.x_size is not None: 191 191 if self.x_size == self.GetSize(): 192 192 self.resizing = False … … 241 241 xval = float(active_ctrl.GetValue()) 242 242 position = self.get_data_xy_vals(xval) 243 if position !=None and not self.is_corfunc:243 if position is not None and not self.is_corfunc: 244 244 wx.PostEvent(self.parent, StatusEvent(status=position)) 245 245 except: … … 342 342 self.q_ctrl = None 343 343 return 344 if self.ly != None and event.xdata !=None:344 if self.ly is not None and event.xdata is not None: 345 345 # Selecting a new line if cursor lines are displayed already 346 346 dqmin = math.fabs(event.xdata - self.ly[0].get_xdata()) … … 364 364 return 365 365 # release a q range vline 366 if self.ly !=None and not self.leftdown:366 if self.ly is not None and not self.leftdown: 367 367 for ly in self.ly: 368 368 ly.set_alpha(0.7) … … 372 372 if ax is None or not hasattr(event, 'action'): 373 373 return 374 end_drag = event.action != 'drag' and event.xdata !=None374 end_drag = event.action != 'drag' and event.xdata is not None 375 375 nop = len(self.plots) 376 376 pos_x, _ = float(event.xdata), float(event.ydata) … … 514 514 ax = event.inaxes 515 515 PlotPanel.onLeftDown(self, event) 516 if ax !=None:516 if ax is not None: 517 517 try: 518 518 pos_x = float(event.xdata) # / size_x … … 683 683 684 684 685 if self.position !=None:685 if self.position is not None: 686 686 wx_id = ids.next() 687 687 self._slicerpop.Append(wx_id, '&Add Text') … … 760 760 default_name = default_name.split('.')[0] 761 761 default_name += "_out" 762 if self.parent !=None:762 if self.parent is not None: 763 763 self.parent.save_data1d(data, default_name) 764 764 … … 778 778 default_name = default_name.split('.')[0] 779 779 # default_name += "_out" 780 if self.parent !=None:780 if self.parent is not None: 781 781 self.parent.show_data1d(data, default_name) 782 782 -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
rac07a3a r7432acb 156 156 PlotPanel.onLeftDown(self, event) 157 157 ax = event.inaxes 158 if ax !=None:158 if ax is not None: 159 159 # data coordinate position 160 160 pos_x = "%8.3g" % event.xdata … … 264 264 # control axis labels from the panel itself 265 265 yname, yunits = data.get_yaxis() 266 if self.yaxis_label !=None:266 if self.yaxis_label is not None: 267 267 yname = self.yaxis_label 268 268 yunits = self.yaxis_unit … … 271 271 self.yaxis_unit = yunits 272 272 xname, xunits = data.get_xaxis() 273 if self.xaxis_label !=None:273 if self.xaxis_label is not None: 274 274 xname = self.xaxis_label 275 275 xunits = self.xaxis_unit … … 355 355 slicerpop.Append(wx_id, '&Box Averaging in Qy') 356 356 wx.EVT_MENU(self, wx_id, self.onBoxavgY) 357 if self.slicer !=None:357 if self.slicer is not None: 358 358 wx_id = ids.next() 359 359 slicerpop.Append(wx_id, '&Clear Slicer') … … 435 435 msg = "Add Text: Error. Check your property values..." 436 436 logger.error(msg) 437 if self.parent !=None:437 if self.parent is not None: 438 438 wx.PostEvent(self.parent, StatusEvent(status=msg)) 439 439 dial.Destroy() … … 629 629 630 630 """ 631 if self.slicer !=None:631 if self.slicer is not None: 632 632 from SlicerParameters import SlicerParameterPanel 633 633 dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") … … 735 735 """ 736 736 event_id = str(evt.GetId()) 737 if self.parent !=None:737 if self.parent is not None: 738 738 self._default_save_location = self.parent._default_save_location 739 739 default_name = self.plots[self.graph.selected_plottable].label … … 759 759 default_name = default_name.split('.')[0] 760 760 #default_name += "_out" 761 if self.parent !=None:761 if self.parent is not None: 762 762 self.parent.show_data2d(data, default_name) 763 763 -
src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py
r235f514 r7432acb 362 362 self.left_moving = left 363 363 theta3 = 0 364 if phi !=None:364 if phi is not None: 365 365 self.phi = phi 366 366 if delta is None: … … 374 374 self.theta = mline.theta + self.phi 375 375 376 if mline !=None:376 if mline is not None: 377 377 if delta != 0: 378 378 self.theta2 = mline + delta … … 538 538 """ 539 539 540 if theta !=None:540 if theta is not None: 541 541 self.theta = theta 542 542 x1 = self.radius * math.cos(self.theta) -
src/sas/sasgui/guiframe/local_perspectives/plotting/SimplePlot.py
r959eb01 r7432acb 87 87 pos = (pos_x, pos_y + 5) 88 88 self.PopupMenu(slicerpop, pos) 89 if self.scale !=None:89 if self.scale is not None: 90 90 self.parent.scale2d = self.scale 91 91 … … 106 106 self.leftdown = True 107 107 ax = event.inaxes 108 if ax !=None:108 if ax is not None: 109 109 self.xInit, self.yInit = event.xdata, event.ydata 110 110 try: … … 123 123 """ 124 124 self.resizing = False 125 if self.x_size !=None:125 if self.x_size is not None: 126 126 if self.x_size == self.GetSize(): 127 127 self.canvas.set_resizing(self.resizing) … … 161 161 self.plots[plot.name] = plot 162 162 # Axis scales 163 if plot.xtransform !=None:163 if plot.xtransform is not None: 164 164 self.xLabel = plot.xtransform 165 if plot.ytransform !=None:165 if plot.ytransform is not None: 166 166 self.yLabel = plot.ytransform 167 167 # Init graph -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxMask.py
r959eb01 r7432acb 123 123 x2=self.vertical_lines.x2, 124 124 width=self.vertical_lines.half_width) 125 # if self.is_inside !=None:125 # if self.is_inside is not None: 126 126 out = self._post_data() 127 127 return out -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py
r235f514 r7432acb 147 147 y_max = math.fabs(self.horizontal_lines.y) 148 148 149 if nbins !=None:149 if nbins is not None: 150 150 self.nbins = nbins 151 151 if self.averager is None: … … 357 357 """ 358 358 # # Reset x, y- coordinates if send as parameters 359 if x !=None:359 if x is not None: 360 360 self.x = np.sign(self.x) * math.fabs(x) 361 if y !=None:361 if y is not None: 362 362 self.y = np.sign(self.y) * math.fabs(y) 363 363 # # Draw lines and markers … … 464 464 """ 465 465 # # reset x, y -coordinates if given as parameters 466 if x !=None:466 if x is not None: 467 467 self.x = np.sign(self.x) * math.fabs(x) 468 if y !=None:468 if y is not None: 469 469 self.y = np.sign(self.y) * math.fabs(y) 470 470 # # draw lines and markers -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxSum.py
rd85c194 r7432acb 353 353 Draw the new roughness on the graph. 354 354 """ 355 if center_x !=None:355 if center_x is not None: 356 356 self.x = center_x 357 if center_y !=None:357 if center_y is not None: 358 358 self.y = center_y 359 359 self.center_marker.set(xdata=[self.x], ydata=[self.y]) … … 490 490 """ 491 491 # # save the new height, witdh of the rectangle if given as a param 492 if width !=None:492 if width is not None: 493 493 self.half_width = width 494 if height !=None:494 if height is not None: 495 495 self.half_height = height 496 496 # # If new center coordinates are given draw the rectangle 497 497 # #given these value 498 if center !=None:498 if center is not None: 499 499 self.center_x = center.x 500 500 self.center_y = center.y … … 511 511 return 512 512 # # if x1, y1, y2, y3 are given draw the rectangle with this value 513 if x1 !=None:513 if x1 is not None: 514 514 self.x1 = x1 515 if x2 !=None:515 if x2 is not None: 516 516 self.x2 = x2 517 if y1 !=None:517 if y1 is not None: 518 518 self.y1 = y1 519 if y2 !=None:519 if y2 is not None: 520 520 self.y2 = y2 521 521 # # Draw 2 vertical lines and a marker … … 657 657 """ 658 658 # # save the new height, witdh of the rectangle if given as a param 659 if width !=None:659 if width is not None: 660 660 self.half_width = width 661 if height !=None:661 if height is not None: 662 662 self.half_height = height 663 663 # # If new center coordinates are given draw the rectangle 664 664 # #given these value 665 if center !=None:665 if center is not None: 666 666 self.center_x = center.x 667 667 self.center_y = center.y … … 679 679 return 680 680 # # if x1, y1, y2, y3 are given draw the rectangle with this value 681 if x1 !=None:681 if x1 is not None: 682 682 self.x1 = x1 683 if x2 !=None:683 if x2 is not None: 684 684 self.x2 = x2 685 if y1 !=None:685 if y1 is not None: 686 686 self.y1 = y1 687 if y2 !=None:687 if y2 is not None: 688 688 self.y2 = y2 689 689 # # Draw 2 vertical lines and a marker -
src/sas/sasgui/guiframe/local_perspectives/plotting/detector_dialog.py
r235f514 r7432acb 155 155 self.qmax_ctl.SetLabel(str(format_number(qmax))) 156 156 self.beam_ctl.SetLabel(str(format_number(beam))) 157 if zmin !=None:157 if zmin is not None: 158 158 self.zmin_ctl.SetValue(str(format_number(zmin))) 159 if zmax !=None:159 if zmax is not None: 160 160 self.zmax_ctl.SetValue(str(format_number(zmax))) 161 161 -
src/sas/sasgui/guiframe/local_perspectives/plotting/masking.py
rac07a3a r7432acb 100 100 wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 101 101 102 if data !=None:102 if data is not None: 103 103 # Font size 104 104 kwds = [] … … 235 235 event.Skip() 236 236 # from boxMask import BoxMask 237 if event !=None:237 if event is not None: 238 238 self._on_clear_slicer(event) 239 239 self.slicer_z += 1 … … 336 336 """ 337 337 # the case of liitle numbers of True points 338 if len(mask[mask]) < 10 and self.data !=None:338 if len(mask[mask]) < 10 and self.data is not None: 339 339 self.ShowMessage() 340 340 mask = copy.deepcopy(self.mask) … … 355 355 temp_data.data[mask == False] = temp_mask[mask == False] 356 356 self.plotpanel.clear() 357 if self.slicer !=None:357 if self.slicer is not None: 358 358 self.slicer.clear() 359 359 self.slicer = None … … 460 460 wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 461 461 462 if data !=None:462 if data is not None: 463 463 # Font size 464 464 kwds = [] … … 710 710 Status msg 711 711 """ 712 if self.parent.parent.parent !=None:712 if self.parent.parent.parent is not None: 713 713 wx.PostEvent(self.parent.parent.parent, 714 714 StatusEvent(status=msg, type=type)) -
src/sas/sasgui/guiframe/local_perspectives/plotting/profile_dialog.py
r959eb01 r7432acb 44 44 wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 45 45 46 if data !=None:46 if data is not None: 47 47 #Font size 48 48 kwds = [] … … 284 284 default_name = default_name.split('.')[0] 285 285 default_name += "_out" 286 if self.parent !=None:286 if self.parent is not None: 287 287 # What an ancestor! 288 288 fit_panel = self.parent.parent.parent -
src/sas/sasgui/guiframe/local_perspectives/plotting/sector_mask.py
r235f514 r7432acb 96 96 self.left_line.update(phi=self.right_line.phi, delta=None, 97 97 mline=self.main_line, side=True, left=False) 98 #if self.is_inside !=None:98 #if self.is_inside is not None: 99 99 out = self._post_data() 100 100 return out -
src/sas/sasgui/guiframe/local_perspectives/plotting/slicerpanel.py
r235f514 r7432acb 114 114 self.Layout() 115 115 psizer = self.parent.GetSizer() 116 if psizer !=None:116 if psizer is not None: 117 117 psizer.Layout() 118 118 -
src/sas/sasgui/guiframe/plugin_base.py
rd85c194 r7432acb 161 161 Sets default frame config 162 162 """ 163 if self.frame !=None:163 if self.frame is not None: 164 164 self.frame.EnableCloseButton(False) 165 165 self.frame.Show(False) … … 230 230 old_frame = None 231 231 old_persp = self.parent.get_current_perspective() 232 if old_persp !=None:232 if old_persp is not None: 233 233 old_frame = old_persp.get_frame() 234 234 self.parent.check_multimode(self) … … 236 236 self.parent.set_perspective(self.perspective) 237 237 238 if self.frame !=None:239 if old_frame !=None:238 if self.frame is not None: 239 if old_frame is not None: 240 240 pos_x, pos_y = old_frame.GetPositionTuple() 241 241 self.frame.SetPosition((pos_x, pos_y)) -
src/sas/sasgui/guiframe/startup_configuration.py
r235f514 r7432acb 208 208 for key, item in strings.iteritems(): 209 209 if (key == 'DEFAULT_PERSPECTIVE') or \ 210 (key == 'DEFAULT_OPEN_FOLDER' and item !=None):210 (key == 'DEFAULT_OPEN_FOLDER' and item is not None): 211 211 out_f.write("%s = \"%s\"\n" % (key,str(item))) 212 212 else: -
src/sas/sasgui/guiframe/utils.py
r959eb01 r7432acb 89 89 list = [] 90 90 for item in mylist: 91 if re.search(separator,item) !=None:91 if re.search(separator,item)is not None: 92 92 if n > 0: 93 93 word = re.split(separator, item, int(n))
Note: See TracChangeset
for help on using the changeset viewer.