Changeset cc1ead1 in sasview
- Timestamp:
- May 17, 2010 9:48:29 AM (15 years ago)
- 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:
- 4708f3a
- Parents:
- c1d2af4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
rd792e813 rcc1ead1 139 139 wx.PostEvent(parent, StatusEvent(status="Load cancel..", info="warning", 140 140 type="stop")) 141 141 142 def plot_data(parent, path): 142 143 """ … … 144 145 @param path: the path of the data to load 145 146 """ 146 #Load data 147 from load_thread import DataReader 148 if parent is not None: 149 wx.PostEvent(parent, StatusEvent(status="Loading...", info="info", 150 type="progress")) 151 reader = DataReader(path=path, 152 parent=parent, 153 err_fct=load_error, 154 msg_fct=on_load_error, 155 completefn=complete_loading) 156 reader.queue() 147 from sans.guicomm.events import NewPlotEvent, StatusEvent 148 from DataLoader.loader import Loader 157 149 158 def complete_loading(output, path, parent): 150 # Instantiate a loader 151 L = Loader() 152 153 # Load data 154 try: 155 output = L.load(path) 156 except: 157 load_error(sys.exc_value) 158 return 159 159 160 # Notify user if the loader completed the load but no data came out 160 161 if output == None: 161 msg = "The data file appears to be empty." 162 load_error(msg) 163 wx.PostEvent(parent, StatusEvent(status=msg, info="warning", 164 type="stop")) 162 load_error("The data file appears to be empty.") 165 163 return 166 164 165 167 166 filename = os.path.basename(path) 168 167 … … 277 276 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str(title))) 278 277 i+=1 279 280 278
Note: See TracChangeset
for help on using the changeset viewer.