Changeset 75fbd17 in sasview for sansview/perspectives/fitting
- Timestamp:
- Feb 9, 2011 2:04:24 AM (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:
- c83a5af
- Parents:
- 8240eab
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r3cd5806 r75fbd17 131 131 #Menu for fitting 132 132 self.menu1 = wx.Menu() 133 #menu for model 134 menu2 = wx.Menu() 135 self.menu_mng.populate_menu(menu2, owner) 136 id2 = wx.NewId() 137 owner.Bind(models.EVT_MODEL,self._on_model_menu) 133 138 134 #Set park engine 139 135 id3 = wx.NewId() … … 156 152 wx.EVT_MENU(owner, id1, self.on_add_sim_page) 157 153 154 #menu for model 155 menu2 = wx.Menu() 156 self.menu_mng.populate_menu(menu2, owner) 157 id2 = wx.NewId() 158 owner.Bind(models.EVT_MODEL,self._on_model_menu) 159 158 160 self.fit_panel.set_owner(owner) 159 161 self.fit_panel.set_model_list(self.menu_mng.get_model_list()) … … 231 233 """ 232 234 self.parent = parent 233 self.parent.Bind(EVT_FITSTATE_UPDATE, self.on_set_state_helper)235 #self.parent.Bind(EVT_FITSTATE_UPDATE, self.on_set_state_helper) 234 236 # Creation of the fit panel 235 237 self.fit_panel = FitPanel(self.parent, -1) … … 251 253 #Create reader when fitting panel are created 252 254 self.state_reader = Reader(self.set_state) 253 254 255 #append that reader to list of available reader 255 256 loader = Loader() 256 257 loader.associate_file_reader(".fitv", self.state_reader) 257 258 loader.associate_file_reader(".svs", self.state_reader) 259 from sans.perspectives.calculator.sld_panel import SldPanel 258 260 #Send the fitting panel to guiframe 259 261 self.mypanels.append(self.fit_panel) 260 262 self.mypanels.append(SldPanel(parent=self.parent, base=self.parent)) 261 263 return self.mypanels 262 264 … … 286 288 wx.PostEvent(self.parent, NewPlotEvent(plot=data, 287 289 title=str(data.title))) 288 289 290 290 291 def set_state(self, state=None, datainfo=None, format=None): … … 296 297 : param datainfo: data 297 298 """ 299 state = self.state_reader.get_state() 298 300 if state != None: 299 301 # store fitting state in temp_state … … 305 307 # state file format 306 308 self.sfile_ext = format 307 308 def on_set_state_helper(self,event=None): 309 310 self.on_set_state_helper(event=None) 311 312 def on_set_state_helper(self,event=None): 309 313 """ 310 314 Set_state_helper. This actually sets state after plotting data from state file. … … 325 329 if state.formfactorcombobox != None: 326 330 #set state 331 data = self.parent.create_gui_data(state.data) 332 data.group_id = state.data.group_id 333 wx.PostEvent(self.parent, NewPlotEvent(plot=data, 334 title=data.title)) 327 335 page = self.fit_panel.set_state(state) 328 336 else: 337 wx.PostEvent(self.parent, NewPlotEvent(plot=data, 338 title=data.title)) 329 339 #just set data because set_state won't work 330 page_info = self.fit_panel.get_page_info(data=state.data) 340 data = self.parent.create_gui_data(state.data) 341 data.group_id = state.data.group_id 342 page_info = self.fit_panel.get_page_info(data=data) 331 343 panel = self.fit_panel.add_page(page_info) 332 self.store_page(page=panel, data= state.data)344 self.store_page(page=panel, data=data) 333 345 self.mypanels.append(panel) 334 346 347 335 348 # get ready for the next set_state 336 349 self.state_index += 1 … … 342 355 #self.state_index = 0 343 356 # Make sure the user sees the fitting panel after loading 344 self.parent.set_perspective(self.perspective) 357 #self.parent.set_perspective(self.perspective) 358 self.on_perspective(event=None) 345 359 except: 346 360 self.state_index==0 … … 1382 1396 return 1383 1397 x = data.x 1384 1385 if qmin == None : 1386 qmin == DEFAULT_QMIN 1387 1388 if qmax == None: 1389 qmax == DEFAULT_QMAX 1390 1398 if qmin == DEFAULT_QMIN : 1399 qmin = min(data.x) 1400 if qmax == DEFAULT_QMAX: 1401 qmax = max(data.x) 1391 1402 if not enable1D: 1392 1403 return -
sansview/perspectives/fitting/pagestate.py
rfb59ed9 r75fbd17 631 631 ## CanSAS format flag 632 632 self.cansas = cansas 633 self.state = None 634 def get_state(self): 635 return self.state 633 636 634 637 def read(self, path): … … 1170 1173 state.data.group_id = name 1171 1174 #store state in fitting 1172 self.call_back(state=state, datainfo=output[ind],format=ext) 1175 #self.call_back(state=state, datainfo=output[ind],format=ext) 1176 self.state= state 1173 1177 return output 1174 1178 1175 1179 except: 1176 self.call_back(format=ext) 1180 #self.call_back(format=ext) 1181 self.state= state 1177 1182 raise 1178 1183
Note: See TracChangeset
for help on using the changeset viewer.