- Timestamp:
- Aug 10, 2010 3:09:40 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:
- 3eb2811
- Parents:
- ac2dc0e
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpanel.py
rac2dc0e r8897d66 205 205 def close_all(self): 206 206 """ 207 remove all pages 208 """ 209 for index in range(self.GetPageCount()): 210 self.DeletePage(index) 211 self.model_list_box = {} 207 remove all pages, used when a svs file is opened 208 """ 209 #get number of pages 210 nop = self.GetPageCount() 211 #use while-loop, for-loop will not do the job well. 212 while (nop>0): 213 #delete the first page until no page exists 214 page = self.GetPage(0) 215 self._close_helper(selected_page=page) 216 self.DeletePage(0) 217 nop = nop - 1 212 218 ## save the title of the last page tab added 213 219 self.fit_page_name = {} -
sansview/perspectives/fitting/fitting.py
ref16f59 r8897d66 261 261 loader.associate_file_reader(".fitv", self.state_reader) 262 262 loader.associate_file_reader(".svs", self.state_reader) 263 self.format = None 263 264 #Send the fitting panel to guiframe 264 265 self.mypanels.append(self.fit_panel) … … 294 295 pass 295 296 296 def set_state(self, state, datainfo=None ):297 def set_state(self, state, datainfo=None, format=None): 297 298 """ 298 299 Call-back method for the fit page state reader. 299 This method is called when a .fitv file is loaded. 300 301 :param state: PageState object 302 300 This method is called when a .fitv/.svs file is loaded. 301 302 : param state: PageState object 303 : param datainfo: data 304 : param format: file extension in lower case with dot in front 303 305 """ 304 306 # store fitting state in temp_state … … 306 308 # index to start with for a new set_state 307 309 self.state_index = 0 310 #file format (extension of the file) opened 311 self.format = format 308 312 309 313 def on_set_state_helper(self,event=None): 310 314 """ 311 Set_state_helper. This ac utally sets state after plotting data from state file.315 Set_state_helper. This actually sets state after plotting data from state file. 312 316 313 317 : event: FitStateUpdateEvent called by plot_data from guiframe, data_loader … … 316 320 return 317 321 try: 322 #close all panels only when svs file opened 323 if self.format == '.svs': 324 self.fit_panel.close_all() 318 325 # Load fitting state 319 326 state = self.temp_state[self.state_index] … … 329 336 self.parent.set_perspective(self.perspective) 330 337 except: 331 self.temp_state = [] 338 self.temp_state = [] 339 self.format = None 332 340 raise 333 341 -
sansview/perspectives/fitting/pagestate.py
ref16f59 r8897d66 1158 1158 state.data.group_id = name 1159 1159 #store state in fitting 1160 self.call_back(state=state, datainfo=output[ind] )1160 self.call_back(state=state, datainfo=output[ind], format=extension.lower()) 1161 1161 1162 1162 return output
Note: See TracChangeset
for help on using the changeset viewer.