@@ -1045,7 +1045,7 @@ def OnClearPeaks(event):
10451045 UpdatePeakGrid (G2frame ,peaks )
10461046 G2pwpl .PlotPatterns (G2frame ,plotType = 'PWDR' )
10471047
1048- def OnPeakFit (oneCycle = False ,noFit = False ):
1048+ def OnPeakFit (oneCycle = False ,noFit = False , noPlot = False ):
10491049 'Do peak fitting by least squares'
10501050 SaveState ()
10511051 controls = G2frame .GPXtree .GetItemPyData (G2gd .GetGPXtreeItemId (G2frame ,G2frame .root , 'Controls' ))
@@ -1100,7 +1100,8 @@ def OnPeakFit(oneCycle=False,noFit=False):
11001100 bxye = GetFileBackground (G2frame ,data ,background ,scale = False )
11011101 if noFit :
11021102 results = G2pwd .DoPeakFit (None ,peaksplus ,background ,limits ,inst ,inst2 ,data ,bxye ,[],oneCycle ,controls ,wtFactor ,noFit = True )
1103- G2pwpl .PlotPatterns (G2frame ,plotType = 'PWDR' )
1103+ if not noPlot :
1104+ G2pwpl .PlotPatterns (G2frame ,plotType = 'PWDR' )
11041105 return
11051106 # try:
11061107 dlg = wx .ProgressDialog ('Residual' ,'Peak fit Rwp = ' ,101 ,parent = G2frame ,
@@ -1199,7 +1200,7 @@ def KeyEditPeakGrid(event):
11991200 else :
12001201 event .Skip ()
12011202 return
1202- G2pwpl .PlotPatterns (G2frame ,plotType = 'PWDR' )
1203+ # G2pwpl.PlotPatterns(G2frame,plotType='PWDR')
12031204 wx .CallAfter (UpdatePeakGrid ,G2frame ,data )
12041205
12051206 def SelectVars (rows ):
@@ -1278,12 +1279,13 @@ def onCellListDClick(event):
12781279
12791280 def RefreshPeakGrid (event ):
12801281 'recompute & plot the peaks any time a value in the table is edited'
1282+ col = event .GetCol ()
12811283 if 'LF' in Inst ['Type' ][0 ]:
12821284 for i in range (len (data ['LFpeaks' ])):
12831285 data ['peaks' ][i ][2 :] = data ['LFpeaks' ][i ]
12841286 wx .CallAfter (UpdatePeakGrid ,G2frame ,data )
12851287 if data ['peaks' ]:
1286- OnPeakFit (noFit = True )
1288+ OnPeakFit (noFit = True , noPlot = col % 2 )
12871289
12881290 def ToggleXtraMode (event ):
12891291 '''Switch "Extra Peak" mode in response to button'''
0 commit comments