Changeset 80ddbd0 in sasview


Ignore:
Timestamp:
Jul 18, 2011 3:32:45 PM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
8f19b69
Parents:
c958e30
Message:

add switch to batch mode on guiframe

Location:
guiframe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_panel.py

    r05ab3f0 r80ddbd0  
    3535from sans.guiframe.events import NewPlotEvent 
    3636from sans.guiframe.gui_style import GUIFRAME 
     37from sans.guiframe.events import NewBatchEvent 
    3738from DataLoader.loader import Loader 
    3839 
     
    340341        self.sizer4.AddMany([(self.rb_single_mode,0, wx.ALL,5), 
    341342                            (self.rb_batch_mode,0, wx.ALL,5)]) 
     343         
     344    def on_single_mode(self, event): 
     345        """ 
     346        change guiframe to its single mode 
     347        """ 
     348        if self.parent is not None: 
     349                wx.PostEvent(self.parent,  
     350                             NewBatchEvent(enable=False)) 
     351        print "single mode" 
     352         
     353    def on_batch_mode(self, event): 
     354        """ 
     355        change guiframe to its batch mode 
     356        """ 
     357        if self.parent is not None: 
     358                wx.PostEvent(self.parent,  
     359                             NewBatchEvent(enable=True)) 
     360        print "batch mode" 
    342361       
    343362    def layout_data_list(self): 
  • guiframe/gui_manager.py

    r19b5c5c9 r80ddbd0  
    7474from sans.guiframe.panel_base import PanelBase 
    7575from sans.guiframe.gui_toolbar import GUIToolBar 
     76from sans.guiframe.events import EVT_NEW_BATCH 
    7677from DataLoader.loader import Loader 
    7778 
     
    244245        self.Bind(EVT_APPEND_BOOKMARK, self.append_bookmark) 
    245246        self.Bind(EVT_NEW_LOAD_DATA, self.on_load_data) 
    246          
     247        self.Bind(EVT_NEW_BATCH, self.on_batch_selection) 
    247248        self.setup_custom_conf() 
    248249     
     250    def on_batch_selection(self, event): 
     251        """ 
     252        :param event: contains parameter enable . when enable is set to True 
     253        the application is in Batch mode 
     254        else the application is default mode(single mode) 
     255        """ 
     256        self.batch_on = event.enable 
     257        for plug in self.plugins: 
     258            plug.set_bacth_selection(self.batch_on) 
     259             
    249260    def setup_custom_conf(self): 
    250261        """ 
  • guiframe/plugin_base.py

    r60fff67 r80ddbd0  
    4747        #  for your plug-in. This defines your plug-in "perspective" 
    4848        self.perspective = [] 
     49        #flag to tell the current plugin that aaplication is in batch mode 
     50        self.batch_on = False 
    4951         
    5052    def clear_panel(self): 
     
    197199        self.parent.set_current_perspective(self) 
    198200        self.parent.set_perspective(self.perspective) 
     201         
     202    def set_bacth_selection(self, flag): 
     203        """ 
     204        the plugin to its batch state if flag is True 
     205        """ 
     206        self.batch_on = flag 
     207        self.on_batch_selection(self.batch_on)     
     208     
     209    def on_batch_selection(self, flag): 
     210        """ 
     211        need to be overwritten by the derivated class 
     212        """ 
    199213     
    200214    def post_init(self): 
Note: See TracChangeset for help on using the changeset viewer.