Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    rb4398819 r5ae083b  
    3131 
    3232from sas.sasgui.guiframe.panel_base import PanelBase 
     33from sas.sasgui.guiframe.report_image_handler import ReportImageHandler 
    3334from sas.sasgui.guiframe.utils import format_number, check_float, IdList, \ 
    3435    check_int 
     
    651652        by plotting, putting it into wx.FileSystem image object 
    652653        """ 
    653         images = [] 
    654         refs = [] 
    655  
    656         # For no figures in the list, prepare empty plot 
    657         if figs is None or len(figs) == 0: 
    658             figs = [None] 
    659  
    660         # Loop over the list of figures 
    661         # use wx.MemoryFSHandler 
    662         imgRAM = wx.MemoryFSHandler() 
    663         for fig in figs: 
    664             if fig is not None: 
    665                 ind = figs.index(fig) 
    666                 canvas = canvases[ind] 
    667  
    668             # store the image in wx.FileSystem Object 
    669             wx.FileSystem.AddHandler(wx.MemoryFSHandler()) 
    670  
    671             # index of the fig 
    672             ind = figs.index(fig) 
    673  
    674             # AddFile, image can be retrieved with 'memory:filename' 
    675             name = 'img_fit%s.png' % ind 
    676             refs.append('memory:' + name) 
    677             imgRAM.AddFile(name, canvas.bitmap, wx.BITMAP_TYPE_PNG) 
    678             # append figs 
    679             images.append(fig) 
    680  
    681         return imgRAM, images, refs 
    682  
     654        bitmaps = [] 
     655        for canvas in canvases: 
     656            bitmaps.append(canvas.bitmap) 
     657        imgs, refs = ReportImageHandler.set_figs(figs, bitmaps, 'fit') 
     658 
     659        return ReportImageHandler.instance, imgs, refs 
    683660 
    684661    def on_save(self, event): 
     
    29072884            self.magnetic_on = True 
    29082885            button.SetLabel("Magnetic OFF") 
    2909             m_value = 1.0e-06 
     2886            m_value = 1 
    29102887            for key in self.model.magnetic_params: 
    29112888                if key.count('M0') > 0: 
    29122889                    self.model.setParam(key, m_value) 
    2913                     m_value += 0.5e-06 
     2890                    m_value += 0.5 
    29142891        else: 
    29152892            self.magnetic_on = False 
     
    29732950        Get the string copies of the param names and values in the tap 
    29742951        """ 
    2975         content = 'sasview_parameter_values:' 
     2952        content = 'sasview_parameter_values;' 
    29762953        # Do it if params exist 
    29772954        if self.parameters: 
     
    32353212                logger.error(traceback.format_exc()) 
    32363213            content += name + ',' + str(check) + ',' + value + disfunc + ',' + \ 
    3237                        bound_lo + ',' + bound_hi + ':' 
     3214                       bound_lo + ',' + bound_hi + ';' 
    32383215 
    32393216        return content 
     
    32743251        context = {} 
    32753252        # put the text into dictionary 
    3276         lines = text.split(':') 
     3253        lines = text.split(';') 
    32773254        if lines[0] != 'sasview_parameter_values': 
    32783255            self._copy_info(False) 
Note: See TracChangeset for help on using the changeset viewer.