Changeset 2510b9b in sasview for src/sas/sasgui/guiframe


Ignore:
Timestamp:
Feb 7, 2017 12:05:10 PM (7 years ago)
Author:
GitHub <noreply@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
a99a4045, 1a8e13f0, b61bd57, 03137f1, 18da4a8, 1e13b53
Parents:
2ab9c432 (diff), bcabf4e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Paul Kienzle <pkienzle@…> (02/07/17 12:05:10)
git-committer:
GitHub <noreply@…> (02/07/17 12:05:10)
Message:

Merge pull request #30 from SasView?/ticket-827

Fixes #795, #819, #827, #847

Location:
src/sas/sasgui/guiframe
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py

    r6ffa0dd rca224b1  
    134134        """ 
    135135        for group_id in self.plot_panels.keys(): 
    136             panel = self.plot_panels[group_id] 
    137             panel.graph.reset() 
    138             self.hide_panel(group_id) 
     136            self.clear_panel_by_id(group_id) 
    139137        self.plot_panels = {} 
    140138 
  • src/sas/sasgui/guiframe/customdir.py

    r212bfc2 r73cbeec  
    3434        if not os.path.isfile(config_file): 
    3535            shutil.copyfile(os.path.join(path, "custom_config.py"), config_file) 
     36 
     37        #Adding SAS_OPENCL if it doesn't exist in the config file 
     38        # - to support backcompability 
     39        if not "SAS_OPENCL" in open(config_file).read(): 
     40            open(config_file,"a+").write("SAS_OPENCL = \"None\"\n") 
    3641    except: 
    3742        # Check for data path next to exe/zip file. 
  • src/sas/sasgui/guiframe/gui_manager.py

    r505706a r73cbeec  
    152152SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT 
    153153SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME 
     154SAS_OPENCL = config.SAS_OPENCL 
    154155if not WELCOME_PANEL_ON: 
    155156    WELCOME_PANEL_SHOW = False 
     
    176177    else: 
    177178        DEFAULT_OPEN_FOLDER = PATH_APP 
     179    SAS_OPENCL = custom_config.SAS_OPENCL 
    178180except: 
    179181    DATALOADER_SHOW = True 
     
    190192    CLEANUP_PLOT = False 
    191193    DEFAULT_OPEN_FOLDER = PATH_APP 
    192  
     194    SAS_OPENCL = None 
    193195DEFAULT_STYLE = config.DEFAULT_STYLE 
    194196 
     
    225227        CHILD_FRAME = wx.Frame 
    226228 
     229#Initiliaze enviromental variable with custom setting but only if variable not set 
     230if SAS_OPENCL and not "SAS_OPENCL" in os.environ: 
     231    os.environ["SAS_OPENCL"] = SAS_OPENCL 
    227232 
    228233class ViewerFrame(PARENT_FRAME): 
     
    21042109        Quit the application 
    21052110        """ 
     2111        #IF SAS_OPENCL is set, settings are stored in the custom config file 
     2112        self._write_opencl_config_file() 
    21062113        logging.info(" --- SasView session was closed --- \n") 
    21072114        wx.Exit() 
    21082115        sys.exit() 
     2116 
     2117    def _write_opencl_config_file(self): 
     2118        """ 
     2119        Writes OpenCL settings to custom config file, so they can be remmbered 
     2120        from session to session 
     2121        """ 
     2122        if custom_config is not None: 
     2123            sas_opencl = os.environ.get("SAS_OPENCL",None) 
     2124            new_config_lines = [] 
     2125            config_file = open(custom_config.__file__) 
     2126            config_lines = config_file.readlines() 
     2127            for line in config_lines: 
     2128                if "SAS_OPENCL" in line: 
     2129                    if sas_opencl: 
     2130                        new_config_lines.append("SAS_OPENCL = \""+sas_opencl+"\"") 
     2131                    else: 
     2132                        new_config_lines.append("SAS_OPENCL = None") 
     2133                else: 
     2134                    new_config_lines.append(line) 
     2135            config_file.close() 
     2136 
     2137            #If custom_config is None, settings will not be remmbered 
     2138            new_config_file = open(custom_config.__file__,"w") 
     2139            new_config_file.writelines(new_config_lines) 
     2140            new_config_file.close() 
     2141        else: 
     2142            logging.info("Failed to save OPENCL settings in custom config file") 
     2143 
    21092144 
    21102145    def _check_update(self, event=None): 
  • src/sas/sasgui/guiframe/startup_configuration.py

    rd85c194 r73cbeec  
    3131                   'CLEANUP_PLOT':False, 
    3232                   'DEFAULT_PERSPECTIVE':'Fitting', 
    33                    'DEFAULT_OPEN_FOLDER': None} 
     33                   'DEFAULT_OPEN_FOLDER': None, 
     34                   'SAS_OPENCL': None} 
    3435try: 
    3536    CURRENT_STRINGS = {'GUIFRAME_WIDTH':CURRENT.GUIFRAME_WIDTH, 
     
    4546                       'CLEANUP_PLOT':CURRENT.CLEANUP_PLOT, 
    4647                       'DEFAULT_PERSPECTIVE':CURRENT.DEFAULT_PERSPECTIVE, 
    47                        'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER} 
     48                       'DEFAULT_OPEN_FOLDER':CURRENT.DEFAULT_OPEN_FOLDER, 
     49                       'SAS_OPENCL': None} 
    4850except: 
    4951    CURRENT_STRINGS = DEFAULT_STRINGS 
Note: See TracChangeset for help on using the changeset viewer.