- Timestamp:
- Aug 11, 2010 10:50:58 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:
- 7a07864
- Parents:
- 9b18735
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r9b18735 rb63dc6e 119 119 self.temp_state = [] 120 120 self.state_index = 0 121 self.sfile_ext = None 121 122 # Log startup 122 123 logging.info("Fitting plug-in started") … … 295 296 pass 296 297 297 def set_state(self, state , datainfo=None):298 def set_state(self, state=None, datainfo=None, format=None): 298 299 """ 299 300 Call-back method for the fit page state reader. … … 303 304 : param datainfo: data 304 305 """ 305 # store fitting state in temp_state 306 self.temp_state.append(state) 306 if state != None: 307 # store fitting state in temp_state 308 self.temp_state.append(state) 309 else: 310 self.temp_state = [] 307 311 # index to start with for a new set_state 308 312 self.state_index = 0 313 # state file format 314 self.sfile_ext = format 309 315 310 316 def on_set_state_helper(self,event=None): … … 314 320 : event: FitStateUpdateEvent called by dataloader.plot_data from guiframe 315 321 """ 316 if self.temp_state == None or len(self.temp_state) == 0:322 if len(self.temp_state) == 0 and self.sfile_ext =='.svs': 317 323 if self.state_index==0 and len(self.mypanels) <= 0: 318 324 self.fit_panel.add_default_pages() 325 self.temp_state = [] 326 self.state_index = 0 319 327 return 320 328 … … 331 339 panel = self.fit_panel.add_page(page_info) 332 340 self.store_page(page=panel, data=state.data) 341 self.mypanels.append(panel) 333 342 334 343 # get ready for the next set_state … … 339 348 340 349 self.temp_state = [] 350 #self.state_index = 0 341 351 # Make sure the user sees the fitting panel after loading 342 352 self.parent.set_perspective(self.perspective) 343 353 except: 354 self.state_index==0 344 355 self.temp_state = [] 345 356 raise -
sansview/perspectives/fitting/pagestate.py
r9b18735 rb63dc6e 1096 1096 """ 1097 1097 output = [] 1098 basename = os.path.basename(path) 1099 root, extension = os.path.splitext(basename) 1100 ext = extension.lower() 1098 1101 try: 1099 1102 if os.path.isfile(path): 1100 basename = os.path.basename(path) 1101 root, extension = os.path.splitext(basename) 1103 1102 1104 #TODO: eventually remove the check for .xml once 1103 1105 # the P(r) writer/reader is truly complete. 1104 if ext ension.lower()in self.ext or \1105 ext ension.lower()== '.xml':1106 if ext in self.ext or \ 1107 ext == '.xml': 1106 1108 1107 1109 tree = etree.parse(path, parser=etree.ETCompatXMLParser()) … … 1124 1126 output.append(sas_entry) 1125 1127 else: 1128 self.call_back(format=ext) 1126 1129 raise RuntimeError, "%s is not a file" % path 1127 1130 1128 1131 # Return output consistent with the loader's api 1129 1132 if len(output)==0: 1133 self.call_back(state=None, datainfo=None,format=ext) 1130 1134 return None 1131 1135 else: … … 1158 1162 state.data.group_id = name 1159 1163 #store state in fitting 1160 self.call_back(state=state, datainfo=output[ind]) 1161 1164 self.call_back(state=state, datainfo=output[ind],format=ext) 1162 1165 return output 1163 1166 1164 1167 except: 1168 self.call_back(format=ext) 1165 1169 raise 1166 1170
Note: See TracChangeset
for help on using the changeset viewer.