Changeset 8bd764d in sasview
- Timestamp:
- Feb 25, 2009 11:37:41 AM (16 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:
- 25579e8
- Parents:
- 72b524b
- Location:
- guiframe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
r18eba35 r8bd764d 91 91 temp[temp==0]=1 92 92 93 wx.PostEvent(parent, StatusEvent(status="Loading 2D error bars of 1 \94 created for : %s"% str(temp[temp==0])))93 wx.PostEvent(parent, StatusEvent(status="Loading 2D error bars of value 1 \ 94 were added to : %s"% output.filename)) 95 95 new_plot = Data2D(image=output.data,err_image=temp, 96 96 xmin=output.xmin,xmax=output.xmax, … … 101 101 else: 102 102 #print "output.dx, output.dy",output.dx, output.dy 103 if output.dy ==None: 104 #print "went here theory1D" 103 if output.dy ==None : 105 104 new_plot = Theory1D(output.x,output.y, dxl, dxw) 105 elif len(output.dy[output.dy==0])==len(output.dy): 106 output.dy[output.dy==0]=1 107 wx.PostEvent(parent, StatusEvent(status="Loading 1D error bars of value 1 \ 108 were added to : %s"%output.filename)) 109 new_plot = Theory1D(output.x,output.y,output.dy, dxl, dxw) 106 110 else: 107 new_plot = Data1D(x=output.x,y=output.y,dy=output.dy, dxl=dxl, dxw=dxw)108 #print "dataloader",output[0],output[1]109 111 112 new_plot = Data1D(x=output.x,y=output.y,dx=output.dx,dy=output.dy, dxl=dxl, dxw=dxw) 113 110 114 new_plot.source=output.source 111 115 new_plot.name = output.filename … … 129 133 except: 130 134 title= filename 131 print "dataloader title", title,output.filename135 132 136 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str(title))) 133 137 else: … … 144 148 new_plot = Theory1D(item.x,item.y,dxl,dxw) 145 149 else: 146 new_plot = Data1D(x=item.x,y=item.y,d y=item.dy,dxl=dxl,dxw=dxw)150 new_plot = Data1D(x=item.x,y=item.y,dx=item.dx,dy=item.dy,dxl=dxl,dxw=dxw) 147 151 148 152 new_plot.source=item.source -
guiframe/local_perspectives/plotting/Plotter1D.py
r18eba35 r8bd764d 213 213 self.action_ids[str(id)] = plot 214 214 wx.EVT_MENU(self, id, self._onSave) 215 #save as cansas 216 id = wx.NewId() 217 slicerpop.Append(id, "&Save %s canSAS XML" % name) 218 self.action_ids[str(id)] = plot 219 wx.EVT_MENU(self, id, self._onSaveXML) 215 220 216 221 # Option to delete plottable … … 364 369 365 370 self.graph.render(self) 366 self.subplot.figure.canvas.draw_idle() 367 371 self.subplot.figure.canvas.draw_idle() 372 373 def _onSaveXML(self, evt): 374 import os 375 id = str(evt.GetId()) 376 if id in self.action_ids: 377 path = None 378 dlg = wx.FileDialog(self, "Choose a file", os.getcwd(), "", "*.xml", wx.SAVE) 379 if dlg.ShowModal() == wx.ID_OK: 380 path = dlg.GetPath() 381 mypath = os.path.basename(path) 382 #print path 383 dlg.Destroy() 384 385 if not path == None: 386 out = open(path, 'w') 387 from DataLoader.readers import cansas_reader 388 reader = cansas_reader.Reader() 389 datainfo= self.plots[self.graph.selected_plottable].info 390 reader.write( path, datainfo) 391 return 392 393 394 395 368 396 def _onSave(self, evt): 369 397 """ -
guiframe/local_perspectives/plotting/Plotter2D.py
r18eba35 r8bd764d 209 209 210 210 slicerpop.AppendSeparator() 211 211 212 id = wx.NewId() 212 213 slicerpop.Append(id, '&Edit Detector Parameters') … … 262 263 pos = self.ScreenToClient(pos) 263 264 self.PopupMenu(slicerpop, pos) 264 265 265 266 def _onEditDetector(self, event): 266 267 print "edit detortor param",self.zmin_2D, self.zmax_2D
Note: See TracChangeset
for help on using the changeset viewer.