Changeset 75fbd17 in sasview for prview/perspectives/pr
- Timestamp:
- Feb 9, 2011 12: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:
- prview/perspectives/pr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
prview/perspectives/pr/inversion_state.py
r3e41f43 r75fbd17 374 374 ## CanSAS format flag 375 375 self.cansas = cansas 376 self.state = None 376 377 377 378 def read(self, path): … … 404 405 405 406 # Call back to post the new state 406 self.call_back(state) 407 self.state = state 408 #self.call_back(state) 407 409 return None 408 410 411 def get_state(self): 412 return self.state 409 413 def _parse_prstate(self, entry): 410 414 """ … … 482 486 elif len(output) == 1: 483 487 # Call back to post the new state 484 self.call_back(output[0].meta_data['prstate'], datainfo = output[0]) 488 #self.call_back(output[0].meta_data['prstate'], datainfo = output[0]) 489 self.state = output[0].meta_data['prstate'] 485 490 return output[0] 486 491 else: -
prview/perspectives/pr/pr.py
r6d3d5ff r75fbd17 121 121 return self.current_plottable 122 122 123 def set_state(self, state , datainfo=None):123 def set_state(self, state=None, datainfo=None): 124 124 """ 125 125 Call-back method for the inversion state reader. … … 131 131 """ 132 132 try: 133 if datainfo is None: 133 if datainfo.__class__.__name__ == 'list': 134 if len(datainfo) == 1: 135 data = datainfo[0] 136 if data is None: 134 137 raise RuntimeError, "Pr.set_state: datainfo parameter cannot be None in standalone mode" 135 138 """ 136 139 # Ensuring that plots are coordinated correctly 137 t = time.localtime(data info.meta_data['prstate'].timestamp)140 t = time.localtime(data.meta_data['prstate'].timestamp) 138 141 time_str = time.strftime("%b %d %H:%M", t) 139 142 140 143 # Check that no time stamp is already appended 141 max_char = data info.meta_data['prstate'].file.find("[")144 max_char = data.meta_data['prstate'].file.find("[") 142 145 if max_char < 0: 143 max_char = len(datainfo.meta_data['prstate'].file) 144 145 datainfo.meta_data['prstate'].file = datainfo.meta_data['prstate'].file[0:max_char] +' [' + time_str + ']' 146 datainfo.filename = datainfo.meta_data['prstate'].file 147 148 self.current_plottable = datainfo 149 self.current_plottable.group_id = datainfo.meta_data['prstate'].file 146 max_char = len(data.meta_data['prstate'].file) 147 148 data.meta_data['prstate'].file = data.meta_data['prstate'].file[0:max_char] +' [' + time_str + ']' 149 data.filename = data.meta_data['prstate'].file 150 """ 151 self.current_plottable = data 152 # self.current_plottable.group_id = data.meta_data['prstate'].file 153 154 # Make sure the user sees the P(r) panel after loading 155 #self.parent.set_perspective(self.perspective) 156 self.on_perspective(event=None) 150 157 151 158 # Load the P(r) results 159 state = self.state_reader.get_state() 160 wx.PostEvent(self.parent, NewPlotEvent(plot=self.current_plottable, 161 title=self.current_plottable.title)) 152 162 self.control_panel.set_state(state) 153 154 # Make sure the user sees the P(r) panel after loading155 self.parent.set_perspective(self.perspective)156 157 163 except: 158 logging.error("prview.set_state: %s" % sys.exc_value) 164 raise 165 #logging.error("prview.set_state: %s" % sys.exc_value) 159 166 160 167 … … 391 398 new_plot.title = "P(r) fit" 392 399 # Make sure that the plot is linear 393 new_plot.xtransform ="x"394 new_plot.ytransform ="y"400 new_plot.xtransform = "x" 401 new_plot.ytransform = "y" 395 402 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title="P(r) fit")) 396 403
Note: See TracChangeset
for help on using the changeset viewer.