Changeset 35eeea8 in sasview
- Timestamp:
- Mar 20, 2009 5:24:05 PM (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:
- f2776f6
- Parents:
- bb18ef1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
rbc3dd65d r35eeea8 79 79 from sans.guicomm.events import NewPlotEvent, StatusEvent 80 80 from DataLoader.loader import Loader 81 81 ## dictionary of loaded data 82 ##{data.name, number of copy} 83 data_name_list={} 84 ## number of copies of the same loaded data 85 data_n= 1 82 86 #Instantiate a loader 83 87 L = Loader() … … 134 138 new_plot.source=output.source 135 139 ## name of the data allow to differentiate data when plotted 136 new_plot.name = output.filename 140 name= output.filename 141 if output.filename in data_name_list.iterkeys(): 142 indice = " copy"+ str(data_n) 143 144 name += indice 145 data_n += 1 146 #print "load data",name 147 else: 148 data_name_list[output.filename]=[] 149 data_name_list[output.filename].append(data_n) 150 151 #print "data_name_list",data_name_list 152 new_plot.name = name 137 153 ## allow to highlight data when plotted 138 154 new_plot.interactive = True 139 155 ## when 2 data have the same id override the 1 st plotted 140 new_plot.id = output.filename156 new_plot.id = name 141 157 ## info is a reference to output of dataloader that can be used 142 158 ## to save data 1D as cansas xml file … … 148 164 new_plot.yaxis(output._yaxis,output._yunit) 149 165 ##group_id specify on which panel to plot this data 150 new_plot.group_id = output.filename166 new_plot.group_id = name 151 167 ##post data to plot 152 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str( output.filename)))168 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str(name))) 153 169 154 170 ## the output of the loader is a list , some xml files contain more than one data … … 171 187 172 188 new_plot.source=item.source 173 new_plot.name = str(item.run[0]) 189 190 name= str(item.run[0]) 191 192 new_plot.name = name 174 193 new_plot.interactive = True 175 194 new_plot.detector =item.detector … … 177 196 new_plot.xaxis(item._xaxis,item._xunit) 178 197 new_plot.yaxis(item._yaxis,item._yunit) 179 new_plot.group_id = str(item.run[0])180 new_plot.id = str(item.run[0])198 new_plot.group_id = name 199 new_plot.id = name 181 200 new_plot.info= item 182 201 … … 184 203 title= item.title 185 204 else: 186 title= str(item.run[0])205 title= name 187 206 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=str(title))) 188 207 i+=1
Note: See TracChangeset
for help on using the changeset viewer.