Changeset 1124
- Timestamp:
- Oct 25, 2013 3:19:10 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIgrid.py
r1117 r1124 95 95 96 96 [ wxID_MASKCOPY, wxID_MASKSAVE, wxID_MASKLOAD, 97 ] = [wx.NewId() for item in range(3)] 97 wxID_NEWMASKFRAME, wxID_NEWMASKPOLY, 98 ] = [wx.NewId() for item in range(5)] 99 98 100 99 101 [ wxID_STRSTACOPY, wxID_STRSTAFIT, wxID_STRSTASAVE, wxID_STRSTALOAD,wxID_APPENDDZERO, … … 2179 2181 self.MaskEdit = wx.Menu(title='') 2180 2182 self.MaskMenu.Append(menu=self.MaskEdit, title='Operations') 2183 submenu = wx.Menu() 2184 self.MaskEdit.AppendMenu( 2185 wx.ID_ANY,'Create new', submenu, 2186 help='' 2187 ) 2181 2188 self.MaskEdit.Append(help='Copy mask to other images', 2182 2189 id=wxID_MASKCOPY, kind=wx.ITEM_NORMAL,text='Copy mask') … … 2185 2192 self.MaskEdit.Append(help='Load mask from file', 2186 2193 id=wxID_MASKLOAD, kind=wx.ITEM_NORMAL,text='Load mask') 2194 submenu.Append(help='Create a Frame mask with mouse input', 2195 id=wxID_NEWMASKFRAME, kind=wx.ITEM_NORMAL,text='Frame mask') 2196 submenu.Append(help='Create a polygon mask with mouse input', 2197 id=wxID_NEWMASKPOLY, kind=wx.ITEM_NORMAL,text='Polygon mask') 2187 2198 self.PostfillDataMenu() 2188 2199 -
trunk/GSASIIimgGUI.py
r1121 r1124 990 990 finally: 991 991 dlg.Destroy() 992 def OnNewFrameMask(event): 993 'Start a new Frame mask' 994 G2plt.OnStartMask(G2frame,'f') 995 def OnNewPolyMask(event): 996 'Start a new polygon mask' 997 G2plt.OnStartMask(G2frame,'p') 992 998 993 999 if G2frame.dataDisplay: … … 996 1002 G2frame.dataFrame.Bind(wx.EVT_MENU, OnCopyMask, id=G2gd.wxID_MASKCOPY) 997 1003 G2frame.dataFrame.Bind(wx.EVT_MENU, OnLoadMask, id=G2gd.wxID_MASKLOAD) 998 G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveMask, id=G2gd.wxID_MASKSAVE) 1004 G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveMask, id=G2gd.wxID_MASKSAVE) 1005 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewFrameMask, id=G2gd.wxID_NEWMASKFRAME) 1006 G2frame.dataFrame.Bind(wx.EVT_MENU, OnNewPolyMask, id=G2gd.wxID_NEWMASKPOLY) 999 1007 if not G2frame.dataFrame.GetStatusBar(): 1000 1008 Status = G2frame.dataFrame.CreateStatusBar() 1001 Status.SetStatusText("To add mask: On 2D Powder Image, key a:arc, r:ring, s:spot, p:polygon, f:frame") 1009 if G2frame.setFrame: 1010 G2frame.dataFrame.GetStatusBar().SetStatusText("Adding frame mask") 1011 elif G2frame.setPoly: 1012 G2frame.dataFrame.GetStatusBar().SetStatusText("Adding polygon mask") 1013 else: 1014 G2frame.dataFrame.GetStatusBar().SetStatusText("To add mask: On 2D Powder Image, key a:arc, r:ring, s:spot, p:polygon, f:frame") 1002 1015 G2frame.dataDisplay = wx.Panel(G2frame.dataFrame) 1003 1016 mainSizer = wx.BoxSizer(wx.VERTICAL) -
trunk/GSASIIplot.py
r1121 r1124 2083 2083 PlotIntegration(G2frame,newPlot,event) 2084 2084 2085 def OnStartMask(G2frame,eventkey): 2086 '''Initiate the start of a Frame or Polygon map 2087 2088 :param wx.Frame G2frame: The main GSAS-II tree "window" 2089 :param str eventkey: a single letter ('f' or 'p') that 2090 determines what type of mask is created. 2091 ''' 2092 Masks = G2frame.PatternTree.GetItemPyData( 2093 G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Masks')) 2094 if eventkey == 'f': 2095 G2frame.setFrame = True 2096 Masks['Frames'] = [] 2097 G2frame.G2plotNB.status.SetFields(['','Frame mask active - LB pick next point, RB close polygon']) 2098 elif eventkey == 'p': 2099 G2frame.setPoly = True 2100 Masks['Polygons'].append([]) 2101 G2frame.G2plotNB.status.SetFields(['','Polygon mask active - LB pick next point, RB close polygon']) 2102 G2imG.UpdateMasks(G2frame,Masks) 2103 PlotImage(G2frame,newImage=True) 2104 2085 2105 def PlotImage(G2frame,newPlot=False,event=None,newImage=True): 2086 2106 '''Plot of 2D detector images as contoured plot. Also plot calibration ellipses, … … 2159 2179 Masks['Arcs'].append([tth,[azm-5,azm+5],0.1]) 2160 2180 elif event.key == 'p': 2161 G2frame.setPoly = True 2162 Masks['Polygons'].append([]) 2163 G2frame.G2plotNB.status.SetFields(['','Polygon mask active - LB pick next point, RB close polygon']) 2181 OnStartMask(G2frame,event.key) 2182 #G2frame.setPoly = True 2183 #Masks['Polygons'].append([]) 2184 #G2frame.G2plotNB.status.SetFields(['','Polygon mask active - LB pick next point, RB close polygon']) 2164 2185 elif event.key == 'f': 2165 G2frame.setFrame = True 2166 Masks['Frames'] = [] 2167 G2frame.G2plotNB.status.SetFields(['','Frame mask active - LB pick next point, RB close polygon']) 2186 OnStartMask(G2frame,event.key) 2187 #G2frame.setFrame = True 2188 #Masks['Frames'] = [] 2189 #G2frame.G2plotNB.status.SetFields(['','Frame mask active - LB pick next point, RB close polygon']) 2168 2190 G2imG.UpdateMasks(G2frame,Masks) 2169 2191 elif PickName == 'Image Controls':
Note: See TracChangeset
for help on using the changeset viewer.