Changeset ec4b19c in sasview for src


Ignore:
Timestamp:
Sep 6, 2018 9:13:35 AM (6 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
fa412df
Parents:
0cf4f84
Message:

Apply image handler to invariant report generation and fix issue with passed variables.

Location:
src/sas/sasgui/perspectives/invariant
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/invariant/invariant_panel.py

    r2469df7 rec4b19c  
    783783        report_img = self.state.image 
    784784        report_list = [report_html_str, report_text_str, report_img] 
    785         dialog = ReportDialog(report_list, None, -1, "") 
     785        imgRAM = self.state.img_handler 
     786        refs = [self.state.wximgbmp] 
     787        dialog = ReportDialog(report_list, imgRAM, refs, None, wx.ID_ANY, "") 
    786788        dialog.Show() 
    787789 
  • src/sas/sasgui/perspectives/invariant/invariant_state.py

    r2469df7 rec4b19c  
    1212from lxml import etree 
    1313from sas.sascalc.dataloader.readers.cansas_reader import Reader as CansasReader 
     14from sas.sasgui.guiframe.report_image_handler import ReportImageHandler 
    1415from sas.sascalc.dataloader.readers.cansas_reader import get_content 
    1516from sas.sasgui.guiframe.utils import format_number 
     
    611612        wximgbmp = wx.BitmapFromImage(wximg) 
    612613        # store the image in wx.FileSystem Object 
    613         wx.FileSystem.AddHandler(wx.MemoryFSHandler()) 
    614         # use wx.MemoryFSHandler 
    615         self.imgRAM = wx.MemoryFSHandler() 
    616         # AddFile, image can be retrieved with 'memory:filename' 
    617         self.imgRAM.AddFile('img_inv.png', wximgbmp, wx.BITMAP_TYPE_PNG) 
    618  
    619         self.wximgbmp = 'memory:img_inv.png' 
    620         self.image = fig 
     614        self.img_handler = ReportImageHandler() 
     615        imgs, refs = self.img_handler.instance.set_figs([fig], [wximgbmp], 'inv') 
     616 
     617        self.wximgbmp = refs[0] 
     618        self.image = imgs[0] 
    621619 
    622620class Reader(CansasReader): 
Note: See TracChangeset for help on using the changeset viewer.