Ignore:
Timestamp:
Mar 21, 2011 3:00:52 PM (14 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:
6512644
Parents:
119dc89
Message:

working on the splashpage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/plotting.py

    r4158af4 r783940c  
    8787            panel.remove_data_by_id(id=id) 
    8888            return True 
    89         else: 
    90             msg = "Panel with GROUP_ID: %s cannot be located" % str(group_id) 
    91             raise ValueError, msg 
     89        return False 
     90         
     91    def clear_panel(self, group_id): 
     92        """ 
     93        clear the graph 
     94        """ 
     95        if group_id in self.plot_panels.keys(): 
     96            panel = self.plot_panels[group_id] 
     97            panel.graph.reset() 
     98            return True 
     99        return False 
     100             
    92101         
    93102    def hide_panel(self, group_id): 
     
    170179        _, x_unit =  data.get_xaxis() 
    171180        _, y_unit =  data.get_yaxis() 
    172         if x_unit != panel.graph.prop["xunit"] \ 
    173             or  y_unit != panel.graph.prop["yunit"]: 
     181        flag_x = (panel.graph.prop["xunit"] is not None) and \ 
     182                    (panel.graph.prop["xunit"].strip() != "") and\ 
     183                    (x_unit != panel.graph.prop["xunit"]) 
     184        flag_y = (panel.graph.prop["yunit"] is not None) and \ 
     185                    (panel.graph.prop["yunit"].strip() != "") and\ 
     186                    (x_unit != panel.graph.prop["yunit"]) 
     187        if (flag_x and flag_y): 
    174188            msg = "Cannot add %s" % str(data.name) 
    175189            msg += " to panel %s\n" % str(panel.window_caption) 
     
    224238            if event.action.lower() == 'delete': 
    225239                return self.delete_panel(group_id) 
     240            if event.action.lower() == "clear": 
     241                return self.clear_panel(group_id) 
     242             
    226243        title = None 
    227244        if hasattr(event, 'title'): 
Note: See TracChangeset for help on using the changeset viewer.