Changeset 2611
- Timestamp:
- Jan 4, 2017 10:46:36 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r2607 r2611 3520 3520 'Geometry':'Cylinder','Diam':1.0,'Pack':0.50,'Form Vol':10.0, 3521 3521 'DetType':'Image plate','ObliqCoeff':0.2,'Ruland':0.025,'QScaleLim':Qlimits[i], 3522 'Lorch': True,'BackRatio':0.0,'Rmax':100.,'noRing':True,'IofQmin':1.0}3522 'Lorch':False,'BackRatio':0.0,'Rmax':100.,'noRing':False,'IofQmin':1.0} 3523 3523 self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='PDF Controls'),Data) 3524 3524 self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='I(Q)'+PWDRname),[]) -
trunk/GSASIIElemGUI.py
r2546 r2611 24 24 import wx.lib.colourselect as wscs 25 25 class PickElement(wx.Dialog): 26 "Makes periodic table widget for picking element - caller maintains element list" 26 '''Makes periodic table widget for picking element. Modes: 27 oneOnly if True element symbols are provided, otherwise select isotope 28 ifNone ? 29 ifMag if True present magnetic scatters only 30 multiple if True multiple elements can be selected 31 ''' 27 32 Elem=None 28 33 def _init_ctrls(self,prnt,ifMag=False): … … 50 55 tip=E[3],color=color) 51 56 i+=1 52 53 def __init__(self, parent,oneOnly=False,ifNone=False,ifMag=False): 57 if self.multiple: 58 b = wx.Button(self,wx.ID_CLOSE, 59 pos=wx.Point(16.5*self.butWid+25,7.75*24+24), 60 label="Done") 61 b.Bind(wx.EVT_BUTTON, self.OnClose) 62 63 def __init__(self, parent,oneOnly=False,ifNone=False,ifMag=False,multiple=False): 54 64 'Needs a doc string' 55 65 self.oneOnly = oneOnly 56 66 self.ifNone = ifNone 67 self.multiple = multiple 57 68 self._init_ctrls(parent,ifMag=ifMag) 69 self.elementList = [] 58 70 59 71 def ElButton(self, name, pos, tip, color): … … 90 102 El = event.GetEventObject().GetValue() 91 103 self.Elem = El 92 self.EndModal(wx.ID_OK) 93 104 if self.multiple: 105 self.elementList.append(El) 106 event.GetEventObject().SetBackgroundColour('black') # Shows on Mac 107 event.GetEventObject().SetColour( 108 wx.Colour(*[int(i/2) for i in event.GetEventObject().GetColour()])) 109 else: 110 self.EndModal(wx.ID_OK) 111 112 def OnClose(self,event): 113 self.EndModal(wx.ID_OK) 114 94 115 class PickElements(wx.Dialog): 95 116 """Makes periodic table widget for picking elements - caller maintains element list""" -
trunk/GSASIIgrid.py
r2607 r2611 99 99 100 100 [ wxID_MASKCOPY, wxID_MASKSAVE, wxID_MASKLOAD, wxID_NEWMASKSPOT,wxID_NEWMASKARC,wxID_NEWMASKRING, 101 wxID_NEWMASKFRAME, wxID_NEWMASKPOLY,wxID_MASKLOADNOT,wxID_FINDSPOTS, wxID_MULTISPOTMASK,102 ] = [wx.NewId() for item in range(1 1)]101 wxID_NEWMASKFRAME, wxID_NEWMASKPOLY,wxID_MASKLOADNOT,wxID_FINDSPOTS, 102 ] = [wx.NewId() for item in range(10)] 103 103 104 104 [ wxID_STRSTACOPY, wxID_STRSTAFIT, wxID_STRSTASAVE, wxID_STRSTALOAD,wxID_STRSTSAMPLE, … … 2129 2129 submenu.Append(help='Create a ring mask with mouse input', 2130 2130 id=wxID_NEWMASKRING, kind=wx.ITEM_NORMAL,text='Ring mask') 2131 submenu.Append(help='Create a spot mask with mouse input',2131 submenu.Append(help='Create spot masks with mouse clicks', 2132 2132 id=wxID_NEWMASKSPOT, kind=wx.ITEM_NORMAL,text='Spot mask') 2133 submenu.Append(help='Turn on/off multiple spot mask creation mode',2134 id=wxID_MULTISPOTMASK, kind=wx.ITEM_NORMAL,text='Multiple spot masks')2135 2133 self.PostfillDataMenu() 2136 2134 … … 2165 2163 self.PDFEdit = wx.Menu(title='') 2166 2164 self.PDFMenu.Append(menu=self.PDFEdit, title='PDF Controls') 2167 self.PDFEdit.Append(help='Add elementto sample composition',id=wxID_PDFADDELEMENT, kind=wx.ITEM_NORMAL,2168 text='Add element ')2165 self.PDFEdit.Append(help='Add one or more elements to sample composition',id=wxID_PDFADDELEMENT, kind=wx.ITEM_NORMAL, 2166 text='Add elements') 2169 2167 self.PDFEdit.Append(help='Delete element from sample composition',id=wxID_PDFDELELEMENT, kind=wx.ITEM_NORMAL, 2170 2168 text='Delete element') -
trunk/GSASIIimgGUI.py
r2610 r2611 288 288 oldData = copy.deepcopy(G2frame.PatternTree.GetItemPyData(CId)) 289 289 Data = copy.deepcopy(data) 290 Data['range'][0] = oldData['range'][0] 290 291 Data['size'] = oldData['size'] 291 292 Data['GonioAngles'] = oldData.get('GonioAngles', [0.,0.,0.]) … … 297 298 if name == Data['background image'][0]: 298 299 Data['background image'] = ['',-1.] 299 G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Id, 'Image Controls'), copy.deepcopy(Data))300 G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,Id, 'Image Controls'),Data) 300 301 finally: 301 302 dlg.Destroy() … … 1313 1314 G2plt.ToggleMultiSpotMask(G2frame) 1314 1315 1315 def OnNewSpotMask(event):1316 'Start a new spot mask'1317 G2frame.MaskKey = 's'1318 G2plt.OnStartMask(G2frame)1319 1320 1316 def OnNewArcMask(event): 1321 1317 'Start a new arc mask' … … 1506 1502 G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveMask, id=G2gd.wxID_MASKSAVE) 1507 1503 G2frame.dataFrame.Bind(wx.EVT_MENU, OnAutoSpotMask, id=G2gd.wxID_FINDSPOTS) 1508 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewSpotMask, id=G2gd.wxID_NEWMASKSPOT) 1509 G2frame.dataFrame.Bind(wx.EVT_MENU, ToggleSpotMaskMode, id=G2gd.wxID_MULTISPOTMASK) 1504 G2frame.dataFrame.Bind(wx.EVT_MENU, ToggleSpotMaskMode, id=G2gd.wxID_NEWMASKSPOT) 1510 1505 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewArcMask, id=G2gd.wxID_NEWMASKARC) 1511 1506 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewRingMask, id=G2gd.wxID_NEWMASKRING) … … 1518 1513 elif G2frame.MaskKey == 'p': 1519 1514 G2frame.dataFrame.GetStatusBar().SetStatusText('Polygon mask active - LB pick next point, RB close polygon') 1520 elif G2frame.MaskKey == 's':1521 G2frame.dataFrame.GetStatusBar().SetStatusText('Spot mask active - LB pick spot location')1522 1515 elif G2frame.MaskKey == 'a': 1523 1516 G2frame.dataFrame.GetStatusBar().SetStatusText('Arc mask active - LB pick arc location') -
trunk/GSASIIplot.py
r2607 r2611 4124 4124 Page.figure.suptitle('Defining Polygon mask (use right-mouse to end)',color='r',fontweight='bold') 4125 4125 Page.canvas.draw() 4126 elif G2frame.MaskKey == 's':4127 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False)4128 Page.figure.suptitle('Left-click to create a spot mask',color='r',fontweight='bold')4129 Page.canvas.draw()4130 4126 elif G2frame.MaskKey == 'a': 4131 4127 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False) … … 4155 4151 ''' 4156 4152 new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('2D Powder Image','mpl',newImage=False) 4157 if G2frame.MaskKey == ' m':4153 if G2frame.MaskKey == 's': 4158 4154 G2frame.MaskKey = '' 4159 Page.Choice[-1] = ' m: start multiple spot mask mode'4155 Page.Choice[-1] = 's: start multiple spot mask mode' 4160 4156 wx.CallAfter(PlotImage,G2frame,newImage=True) 4161 4157 else: 4162 G2frame.MaskKey = ' m'4158 G2frame.MaskKey = 's' 4163 4159 (x0,y0),(x1,y1) = Plot.get_position().get_points() 4164 Page.figure.suptitle('Multiple spot mode on, press mor right-click to end',color='r',fontweight='bold')4165 Page.Choice[-1] = ' m: stop multiple spot mask mode'4160 Page.figure.suptitle('Multiple spot mode on, press s or right-click to end',color='r',fontweight='bold') 4161 Page.Choice[-1] = 's: stop multiple spot mask mode' 4166 4162 Page.canvas.draw() 4167 4163 … … 4280 4276 return 4281 4277 if treeItem == 'Masks': 4282 if event.key == ' m': # implement multiple spot mode4278 if event.key == 's': # implement multiple spot mode 4283 4279 ToggleMultiSpotMask(G2frame) 4284 4280 return … … 4302 4298 Page.canvas.draw() 4303 4299 return 4304 elif event.key in ['l','p','f',' s','a','r']:4300 elif event.key in ['l','p','f','a','r']: 4305 4301 G2frame.MaskKey = event.key 4306 4302 OnStartMask(G2frame) … … 4634 4630 if not Xpos or not Ypos or Page.toolbar._active: #got point out of frame or zoom/pan selected 4635 4631 return 4636 if G2frame.MaskKey == ' m':4632 if G2frame.MaskKey == 's': 4637 4633 if event.button == 3: 4638 4634 ToggleMultiSpotMask(G2frame) … … 4825 4821 Page.keyPress = OnImPlotKeyPress 4826 4822 elif G2frame.PatternTree.GetItemText(G2frame.PickId) in ['Masks',]: 4827 Page.Choice = [' key press','l: log(I) on',' s: spot mask','a: arc mask','r: ring mask',4823 Page.Choice = [' key press','l: log(I) on','a: arc mask','r: ring mask', 4828 4824 'p: polygon mask','f: frame mask', 4829 4825 't: add spot mask at mouse position'] 4830 Page.Choice.append(' m: start multiple spot mask mode') # this must be the last choice4826 Page.Choice.append('s: start multiple spot mask mode') # this must be the last choice 4831 4827 if G2frame.logPlot: 4832 4828 Page.Choice[1] = 'l: log(I) off' -
trunk/GSASIIpwdGUI.py
r2610 r2611 4780 4780 OnComputePDF(event) 4781 4781 wx.CallAfter(UpdatePDFGrid,G2frame,data) 4782 #UpdatePDFGrid(G2frame,data)4783 4782 4784 4783 def OnAddElement(event): 4785 4784 ElList = data['ElList'] 4786 PE = G2elemGUI.PickElement(G2frame,oneOnly=True )4785 PE = G2elemGUI.PickElement(G2frame,oneOnly=True,multiple=True) 4787 4786 if PE.ShowModal() == wx.ID_OK: 4788 El = PE.Elem 4789 if El not in ElList and El != 'None': 4790 data['ElList'][El] = G2elem.GetElInfo(El,inst) 4787 for El in PE.elementList: 4788 if El not in ElList and El != 'None': 4789 try: 4790 data['ElList'][El] = G2elem.GetElInfo(El,inst) 4791 data['ElList'][El]['FormulaNo'] = 1.0 4792 except IndexError: # happens with element Q 4793 pass 4791 4794 data['Form Vol'] = max(10.0,SumElementVolumes()) 4792 4795 PE.Destroy() 4793 4796 wx.CallAfter(UpdatePDFGrid,G2frame,data) 4794 #UpdatePDFGrid(G2frame,data)4795 4797 4796 4798 def OnDeleteElement(event): … … 5020 5022 sqBox = wx.BoxSizer(wx.HORIZONTAL) 5021 5023 sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' Scaling q-range: '),0,WACV) 5022 SQmin = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['QScaleLim'],0,nDig=(10,3),min=qLimits[0],max=.95*data['QScaleLim'][1], 5023 typeHint=float,OnLeave=AfterChangeNoRefresh) 5024 SQmin = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['QScaleLim'],0,nDig=(10,3), 5025 min=qLimits[0],max=.95*data['QScaleLim'][1], 5026 typeHint=float,OnLeave=AfterChangeNoRefresh) 5024 5027 sqBox.Add(SQmin,0,WACV) 5025 5028 sqBox.Add(wx.StaticText(G2frame.dataDisplay,label=' to Qmax '),0,WACV) 5026 SQmax = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['QScaleLim'],1,nDig=(10,3),min=qLimits[0],max=qLimits[1], 5027 typeHint=float,OnLeave=NewQmax) 5029 SQmax = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['QScaleLim'],1,nDig=(10,3), 5030 min=qLimits[0],max=qLimits[1], 5031 typeHint=float,OnLeave=NewQmax) 5028 5032 sqBox.Add(SQmax,0,WACV) 5029 5033 resetQ = wx.CheckBox(parent=G2frame.dataDisplay,label='Reset?') -
trunk/help/gsasII.html
r2609 r2611 5771 5771 <P style='margin-left:.25in'><B>Create Spot masks</B> after a menu command by clicking on 5772 5772 the location on the image that should be masked. There are also 5773 t hreeways to create spot masks with the keyboard:5773 two ways to create spot masks with the keyboard: 5774 5774 <UL> 5775 <LI style='margin-left:.2in'>Press the 's' key and then left-click on the mask location. 5776 (<a href="#Mac_rightclick">Right-click*</a> to cancel.) 5777 <LI style='margin-left:.2in'>Press the 'm' key and 5775 <LI style='margin-left:.2in'>Press the 's' key and 5778 5776 then left-click successively on multiple locations for spot 5779 masks. Press the ' m' key again or <a href="#Mac_rightclick">right-click*</a>5777 masks. Press the 's' key again or <a href="#Mac_rightclick">right-click*</a> 5780 5778 to stop adding spot masks. 5781 5779 <LI style='margin-left:.2in'>Move the mouse to the position for a … … 7202 7200 <hr size=2 width="100%" align=center> 7203 7201 7204 <!-- hhmts start -->Last modified: Tue Jan 3 12:18:13CST 2017 <!-- hhmts end -->7202 <!-- hhmts start -->Last modified: Wed Jan 4 16:40:54 CST 2017 <!-- hhmts end --> 7205 7203 7206 7204 </div>
Note: See TracChangeset
for help on using the changeset viewer.