- Timestamp:
- Aug 9, 2010 11:38:42 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:
- e683abb
- Parents:
- 4da35bc
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r4da35bc ref16f59 118 118 self.state_reader = None 119 119 self.temp_state = [] 120 self.state_index = 0 120 121 # Log startup 121 122 logging.info("Fitting plug-in started") … … 301 302 302 303 """ 303 #print "state", state 304 #return 305 #working on reading state 306 self.temp_state = [] 307 try: 308 # state 304 # store fitting state in temp_state 305 self.temp_state.append(state) 306 # index to start with for a new set_state 307 self.state_index = 0 308 309 def on_set_state_helper(self,event=None): 310 """ 311 Set_state_helper. This acutally sets state after plotting data from state file. 312 313 : event: FitStateUpdateEvent called by plot_data from guiframe, data_loader 314 """ 315 if self.temp_state == None or len(self.temp_state) == 0: 316 return 317 try: 309 318 # Load fitting state 310 self.temp_state.append(state) 311 # Make sure the user sees the fitting panel after loading 312 #self.parent.set_perspective(self.perspective) 313 319 state = self.temp_state[self.state_index] 320 #set state 321 page = self.fit_panel.set_state(state) 322 # get ready for the next set state 323 self.state_index += 1 324 325 #reset state variables to default when all set_state is finished. 326 if len(self.temp_state) == self.state_index: 327 self.temp_state = [] 328 # Make sure the user sees the fitting panel after loading 329 self.parent.set_perspective(self.perspective) 314 330 except: 331 self.temp_state = [] 315 332 raise 316 317 def on_set_state_helper(self,event=None):318 """319 """320 if self.temp_state == None:321 return322 # Load fitting state323 for index in range(len(self.temp_state)):324 page = self.fit_panel.set_state(self.temp_state[index])325 # Make sure the user sees the fitting panel after loading326 self.parent.set_perspective(self.perspective)327 328 self.temp_state = []329 333 330 334 def save_fit_state(self, filepath, fitstate): -
sansview/perspectives/fitting/pagestate.py
r4da35bc ref16f59 1139 1139 if max_char < 0: 1140 1140 max_char = len(state.file) 1141 state.file = state.file[0:max_char] +' [' + time_str + ']' 1141 original_fname = state.file[0:max_char] 1142 state.file = original_fname +' [' + time_str + ']' 1142 1143 1143 1144 … … 1149 1150 state.data.name = output[ind].filename #state.data_name 1150 1151 state.data.id = state.data_id 1151 state.data.id = state.data_id1152 1152 if state.is_data is not None: 1153 1153 state.data.is_data = state.is_data 1154 state.data.group_id = output[ind].filename 1155 1156 # make sure to put run name if none 1157 #if output[ind].run == None or output[ind].run ==[]: 1158 # exec 'output[%d].run = [output[%d].filename]'% (ind,ind) 1154 if output[ind].run_name is not None and len(output[ind].run_name) != 0 : 1155 name = output[ind].run_name 1156 else: 1157 name=original_fname 1158 state.data.group_id = name 1159 #store state in fitting 1159 1160 self.call_back(state=state, datainfo=output[ind]) 1160 return output[ind] 1161 1162 return output 1161 1163 1162 1164 except: … … 1176 1178 1177 1179 # Add fitting information to the XML document 1178 self.write_toXML(datainfo, fitstate)1180 doc = self.write_toXML(datainfo, fitstate) 1179 1181 # Write the XML document 1180 1182 fd = open(filename, 'w')
Note: See TracChangeset
for help on using the changeset viewer.