Ignore:
Timestamp:
Jul 20, 2010 2:36:35 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:
cb19af9f
Parents:
1b17a64
Message:

working on guiframe

File:
1 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant_panel.py

    r4e1c362 r3c44c66  
    113113        return flag 
    114114     
    115     def set_data(self, data): 
     115    def set_data(self, list=[], state=None): 
     116        """ 
     117        Receive  a list of data from gui_manager to compute invariant 
     118        """ 
     119        if list==[]: 
     120            msg = "Please select data for Invariant perspective.\n" 
     121            dial = wx.MessageDialog(None, msg, 'Error Loading File',  
     122                                    wx.OK | wx.ICON_EXCLAMATION) 
     123            dial.ShowModal()  
     124            return 
     125        elif len(list) == 1: 
     126            data, filepath = list[0] 
     127            if data.__class__.__name__ == "Data2D": 
     128                msg = "Invariant cannot be computed for Data2D.\n" 
     129                msg += "Please load another file.\n" 
     130                dial = wx.MessageDialog(None, msg, 'Error Loading File',  
     131                                        wx.OK | wx.ICON_EXCLAMATION) 
     132                dial.ShowModal()  
     133            else: 
     134                 self.set_current_data(data=data) 
     135        else: 
     136            msg = " Invariant cannot be computed for more than one data.\n" 
     137            msg += "Please load only file.\n" 
     138            dial = wx.MessageDialog(None, msg, 'Error Loading File',  
     139                                    wx.OK | wx.ICON_EXCLAMATION) 
     140            dial.ShowModal()  
     141     
     142    def set_current_data(self, data): 
    116143        """ 
    117144        Set the data 
    118145         
    119         : return: True/False; if False, it will not set_data 
     146        : return: True/False; if False, it will not set_current_data 
    120147        """ 
    121148        # warn the users 
     
    178205            self.state = IState() 
    179206        else: 
    180             if not self.set_data(data): 
     207            if not self.set_current_data(data): 
    181208                return 
    182209            self.new_state = True 
     
    826853    def _reset_state_list(self,data=None): 
    827854        """ 
    828         Reset the state_list just before data was loading: Used in 'set_data()' 
     855        Reset the state_list just before data was loading: Used in 'set_current_data()' 
    829856        """ 
    830857        #if data == None: return 
     
    17031730 
    17041731        data.name = data.filename 
    1705         self.panel.set_data(data) 
     1732        self.panel.set_current_data(data) 
    17061733        self.Centre() 
    17071734        self.Show(True) 
Note: See TracChangeset for help on using the changeset viewer.