Changeset 2626 for trunk/GSASIIimgGUI.py


Ignore:
Timestamp:
Jan 12, 2017 11:56:41 AM (6 years ago)
Author:
vondreele
Message:

fix dialog issues (again) in image integration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimgGUI.py

    r2625 r2626  
    217217        sumImg = GetImageZ(G2frame,data)
    218218        if IntegrateOnly:
    219             G2frame.Integrate = G2img.ImageIntegrate(sumImg,data,masks,blkSize,
    220                 wx.ProgressDialog("Elapsed time","2D image integration\nPress Cancel to pause after current image",
    221                 Nup,style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT))           
     219            dlg = wx.ProgressDialog("Elapsed time","2D image integration\nPress Cancel to pause after current image",
     220                Nup,style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT)
    222221        else:
    223             G2frame.Integrate = G2img.ImageIntegrate(sumImg,data,masks,blkSize,
    224                 wx.ProgressDialog("Elapsed time","2D image integration",Nup,
    225                 style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE))
     222            dlg = wx.ProgressDialog("Elapsed time","2D image integration",Nup,
     223                style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE)
     224        try:
     225            G2frame.Integrate = G2img.ImageIntegrate(sumImg,data,masks,blkSize,dlg)           
     226        finally:
     227            dlg.Destroy()
    226228        G2frame.PauseIntegration = G2frame.Integrate[-1]
    227229        del sumImg  #force cleanup
     
    253255                        G2gd.GetPatternTreeItemId(G2frame,G2frame.Image,'Masks'))
    254256                    image = GetImageZ(G2frame,Data)
    255                     G2frame.Integrate = G2img.ImageIntegrate(image,Data,Masks,blkSize,
    256                         wx.ProgressDialog("Elapsed time","2D image integration",Nup,
    257                         style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT))
     257                    dlg = wx.ProgressDialog("Elapsed time","2D image integration",Nup,
     258                        style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT)
     259                    try:
     260                        G2frame.Integrate = G2img.ImageIntegrate(image,Data,Masks,blkSize,dlg)
     261                    finally:
     262                        dlg.Destroy()
    258263                    del image   #force cleanup
    259264                    pId = G2IO.SaveIntegration(G2frame,CId,Data)
     
    10721077                            vals = Items[Names.index(name)]
    10731078                            ctrls['GonioAngles'] = vals
    1074 #                            G2frame.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(G2frame,id, 'Image Controls'),ctrls)
    10751079                        id, cookie = G2frame.PatternTree.GetNextChild(G2frame.root, cookie)
    10761080            finally:
     
    11781182    fitSize = mainSizer.Fit(G2frame.dataFrame)
    11791183    G2frame.dataFrame.setSizePosLeft(fitSize)
     1184    G2frame.dataFrame.SendSizeEvent()
    11801185   
    11811186################################################################################
Note: See TracChangeset for help on using the changeset viewer.