- Timestamp:
- Aug 8, 2010 5:24:15 PM (14 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:
- ef16f59
- Parents:
- 028a0e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
r028a0e8 r4da35bc 8 8 from DataLoader.loader import Loader 9 9 from load_thread import DataReader 10 from sans.perspectives.invariant import InvStateUpdateEvent 11 from perspectives.fitting import FitStateUpdateEvent 10 12 11 13 from sans.guicomm.events import NewPlotEvent, StatusEvent … … 232 234 new_plot.group_id = existing_panel.group_id 233 235 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=title)) 234 236 wx.PostEvent(parent,InvStateUpdateEvent()) 237 wx.PostEvent(parent,FitStateUpdateEvent()) 235 238 ## the output of the loader is a list , some xml files contain more than one data 236 239 else: 240 237 241 i=1 238 242 for item in output: 239 243 try: 240 msg = "Loading 1D data: %s"%str(item.run[0]) 241 wx.PostEvent(parent, StatusEvent(status=msg, info="info", type="stop")) 242 try: 243 dx = item.dx 244 dxl = item.dxl 245 dxw = item.dxw 246 except: 247 dx = None 248 dxl = None 249 dxw = None 250 251 new_plot = Data1D(x=item.x,y=item.y,dx=dx,dy=item.dy) 244 ## Creating a Data2D with output 245 if hasattr(item,'data'): 246 msg = "Loading 2D data: %s"%item.filename 247 wx.PostEvent(parent, StatusEvent(status=msg, info="info", type="stop")) 248 new_plot = Data2D(image=None, err_image=None) 249 250 else: 251 msg = "Loading 1D data: %s"%str(item.run[0]) 252 wx.PostEvent(parent, StatusEvent(status=msg, info="info", type="stop")) 253 try: 254 dx = item.dx 255 dxl = item.dxl 256 dxw = item.dxw 257 except: 258 dx = None 259 dxl = None 260 dxw = None 261 262 new_plot = Data1D(x=item.x,y=item.y,dx=dx,dy=item.dy) 263 264 new_plot.dxl = dxl 265 new_plot.dxw = dxw 266 267 item.clone_without_data(clone=new_plot) 252 268 new_plot.copy_from_datainfo(item) 253 item.clone_without_data(clone=new_plot)254 new_plot.dxl = dxl255 new_plot.dxw = dxw256 257 269 name = parse_name(name=str(item.run[0]), expression="_") 258 270 #if not name in parent.indice_load_data.keys(): … … 290 302 new_plot.group_id = existing_panel.group_id 291 303 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str(title))) 304 wx.PostEvent(parent,InvStateUpdateEvent()) 305 wx.PostEvent(parent,FitStateUpdateEvent()) 292 306 i+=1 293 307 except: 294 raise308 pass
Note: See TracChangeset
for help on using the changeset viewer.