Changeset 9b18735 in sasview for guiframe


Ignore:
Timestamp:
Aug 11, 2010 5:35:03 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
b63dc6e
Parents:
3eb2811
Message:

now all panels are reset when opening svs files: except prview

Location:
guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_loader.py

    ref16f59 r9b18735  
    1212 
    1313from sans.guicomm.events import NewPlotEvent, StatusEvent 
     14SVS_FILE_EXT = ['.svs','.inv','.prv','.fitv'] 
    1415 
    1516def enable_add_data(existing_panel, new_plot): 
     
    228229        # plot data 
    229230        wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=title)) 
    230         # set state and plot computation if exists 
    231         wx.PostEvent(parent,InvStateUpdateEvent()) 
    232         wx.PostEvent(parent,FitStateUpdateEvent()) 
     231        if format in SVS_FILE_EXT: 
     232            # set state and plot computation if exists 
     233            wx.PostEvent(parent,InvStateUpdateEvent()) 
     234            wx.PostEvent(parent,FitStateUpdateEvent()) 
    233235    ## the output of the loader is a list , some xml files contain more than one data 
    234236    else: 
     
    262264                new_plot.copy_from_datainfo(item)     
    263265                item.clone_without_data(clone=new_plot)     
    264                  
     266                # find original data file name without timestemp 
    265267                name = parse_name(name=str(item.run[0]), expression="_") 
    266                      
     268                max_char = name.find("[") 
     269                if max_char < 0: 
     270                    max_char = len(name) 
     271                original_name =name[0:max_char] 
    267272                #TODO: this is a very annoying feature. We should make this 
    268273                # an option. Excel doesn't do this. Why should we? 
     
    272277                new_plot.name = name 
    273278                new_plot.interactive = True 
    274                 new_plot.group_id = name 
     279                new_plot.group_id = original_name 
    275280                new_plot.id = name 
    276281                new_plot.is_data = True 
     
    293298                # plot data 
    294299                wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str(title))) 
    295  
    296                 # set state and plot computation if exists 
    297                 wx.PostEvent(parent,InvStateUpdateEvent()) 
    298                 wx.PostEvent(parent,FitStateUpdateEvent()) 
     300                 
     301                if format in SVS_FILE_EXT: 
     302                    # set state and plot computation if exists 
     303                    wx.PostEvent(parent,InvStateUpdateEvent()) 
     304                    wx.PostEvent(parent,FitStateUpdateEvent()) 
    299305            except: 
    300306                raise 
  • guiframe/gui_manager.py

    r028a0e8 r9b18735  
    715715         
    716716        from data_loader import plot_data 
     717        from sans.perspectives import invariant 
    717718        if path and os.path.isfile(path): 
    718719             basename  = os.path.basename(path) 
    719720             if  basename.endswith('.svs'): 
     721                #remove panels for new states 
     722                 for item in self.panels: 
     723                     try: 
     724                         self.panels[item].clear_panel() 
     725                     except: pass 
    720726                 plot_data(self, path,'.inv') 
    721727                 plot_data(self, path,'.prv') 
Note: See TracChangeset for help on using the changeset viewer.