Ignore:
Timestamp:
Mar 31, 2010 4:56:54 PM (15 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:
f338d3b
Parents:
8d97277
Message:

small change on slit length calculator

Location:
calculatorview/perspectives/calculator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/perspectives/calculator/load_thread.py

    r378d2eb r7dca26e  
    1212            Load a data given a filename 
    1313    """ 
    14     def __init__(self, path, filename='',completefn=None, 
     14    def __init__(self, path, completefn=None, 
    1515                 updatefn   = None, 
    1616                 yieldtime  = 0.01, 
     
    2121                 yieldtime, 
    2222                 worktime) 
    23         self.filename = filename 
    2423        self.path = path 
    2524        #Instantiate a loader  
     
    4544            data =  self.loader.load(self.path) 
    4645            elapsed = time.time() - self.starttime 
    47             self.complete(data=data, filename=self.filename) 
     46            self.complete(data=data) 
    4847        except KeyboardInterrupt: 
    4948            # Thread was interrupted, just proceed and re-raise. 
  • calculatorview/perspectives/calculator/slit_length_calculator_panel.py

    rb7e0fff r7dca26e  
    151151        dlg.Destroy() 
    152152         
    153         return path, filename 
     153        return path 
    154154 
    155155    def on_close(self, event): 
     
    162162        """ 
    163163            Open a file dialog to allow the user to select a given file. 
    164             The user can allow load file with extension .DAT or .dat. 
     164            The user is only allow to load file with extension .DAT or .dat. 
    165165            Display the slit size corresponding to the loaded data. 
    166166        """ 
    167         path, filename = self.choose_data_file(location=self._default_save_location) 
    168          
    169         if path is None or filename == '': 
     167        path = self.choose_data_file(location=self._default_save_location) 
     168         
     169        if path is None: 
    170170            return  
    171171        self._default_save_location = path 
     
    180180                                type="progress")) 
    181181            self.reader = DataReader(path=path, 
    182                                      filename=filename, 
    183182                                    completefn=self.complete_loading, 
    184183                                    updatefn=None) 
     
    195194            Complete the loading and compute the slit size 
    196195        """ 
    197         if data is not None and data.__class__.__name__ == 'Data2D': 
     196        if data is None or data.__class__.__name__ == 'Data2D': 
    198197            if self.parent.parent is None: 
    199198                return  
     
    201200            wx.PostEvent(self.parent.parent, StatusEvent(status=msg, type='stop')) 
    202201            return  
    203         self.data_name_tcl.SetValue(str(filename)) 
     202        self.data_name_tcl.SetValue(str(data.filename)) 
    204203        #compute the slit size 
    205204        try: 
Note: See TracChangeset for help on using the changeset viewer.