Changeset 2322


Ignore:
Timestamp:
Jun 15, 2016 7:40:20 AM (5 years ago)
Author:
vondreele
Message:

(partially) fixed Cancel/Pause? behavior in AutoIntegrate?. Will crash 32-bit if Cancel pressed too soon & if Pause pressed repeatedly during integration. 64-bit seems immune to this.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r2305 r2322  
    904904            Nup += 1
    905905            if dlg:
    906                 dlg.Update(Nup)
     906                pause = dlg.Update(Nup)
    907907            Block = image[iBeg:iFin,jBeg:jFin]
    908908            t0 = time.time()
     
    912912            Nup += 1
    913913            if dlg:
    914                 dlg.Update(Nup)
     914                pause = dlg.Update(Nup)
    915915            tax = np.where(tax > LRazm[1],tax-360.,tax)                 #put azm inside limits if possible
    916916            tax = np.where(tax < LRazm[0],tax+360.,tax)
     
    934934            del tax; del tay; del taz; del tad; del tabs
    935935            if dlg:
    936                 dlg.Update(Nup)
     936                pause = dlg.Update(Nup)
    937937    t0 = time.time()
    938938    NST = np.array(NST,dtype=np.float)
  • trunk/GSASIIimgGUI.py

    r2312 r2322  
    19951995    cntlList = ['wavelength','distance','tilt','invert_x','invert_y','type',
    19961996            'fullIntegrate','outChannels','outAzimuths','LRazimuth','IOtth','azmthOff','DetDepth',
    1997             'calibskip','pixLimit','cutoff','calibdmin','chisq','Flat Bkg',
     1997            'calibskip','pixLimit','cutoff','calibdmin','Flat Bkg',
    19981998            'PolaVal','SampleAbs','dark image','background image']
    19991999    File = open(filename,'r')
     
    20342034    cntlList = ['wavelength','distance','tilt','invert_x','invert_y','type',
    20352035                        'fullIntegrate','outChannels','outAzimuths','LRazimuth','IOtth','azmthOff','DetDepth',
    2036                         'calibskip','pixLimit','cutoff','calibdmin','chisq','Flat Bkg',
     2036                        'calibskip','pixLimit','cutoff','calibdmin','Flat Bkg',
    20372037                        'PolaVal','SampleAbs','dark image','background image']
    20382038    File = open(imctrl_file,'r')
     
    24942494        '''A method that is called every :meth:`PollTime` seconds that is
    24952495        used to check for new files and process them. This is called only
    2496         after the "Start" button is pressed (when its label reads "Pause").
     2496        after the "Start" button is pressed (then its label reads "Pause").
    24972497        '''
    24982498        G2frame = self.G2frame
     
    25282528            ImageMasks.update(self.ImageMasks)
    25292529            self.IntegrateImage(img)
     2530            self.Pause = G2frame.PauseIntegration
    25302531            self.G2frame.oldImagefile = '' # mark image as changed; reread as needed
    25312532            wx.Yield()
    25322533            self.ShowMatchingFiles(self.params['filter'])
    25332534            wx.Yield()
    2534             if self.Pause: return
     2535            if self.Pause:
     2536                self.btnstart.SetLabel('Resume')
     2537                if self.timer.IsRunning(): self.timer.Stop()
     2538                print('\nPausing autointegration\n')
     2539                self.Status.SetStatusText('Press Resume to continue integration or Reset to prepare to reintegrate all images')
     2540                return
    25352541
    25362542        # loop over image files matching glob, reading in any new ones
    25372543        for newImage in self.currImageList:
    25382544
    2539             if newImage in imageFileList: continue # already read?
     2545            if newImage in imageFileList or self.Pause: continue # already read?
    25402546            for imgId in G2IO.ReadImages(G2frame,newImage):
    25412547                controlsDict = G2frame.PatternTree.GetItemPyData(
     
    25572563                wx.Yield()
    25582564                self.Pause = G2frame.PauseIntegration
     2565                print 'pause',self.Pause
    25592566            if self.Pause:
    25602567                self.btnstart.SetLabel('Resume')
     
    25622569                print('\nPausing autointegration\n')
    25632570                self.Status.SetStatusText('Press Resume to continue integration or Reset to prepare to reintegrate all images')
    2564                 return
     2571                break
    25652572       
    25662573        if GSASIIpath.GetConfigValue('debug'):
Note: See TracChangeset for help on using the changeset viewer.