Changeset f1e06a8e in sasview for invariantview
- Timestamp:
- Jan 19, 2011 12:13:54 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:
- 890a909b
- Parents:
- ca4c150
- Location:
- invariantview/perspectives/invariant
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
invariantview/perspectives/invariant/invariant.py
rd65a00a rf1e06a8e 23 23 from sans.guiframe.dataFitting import Data1D 24 24 25 from sans.gui comm.events import NewPlotEvent26 from sans.gui comm.events import ERR_DATA27 from invariant_state import Reader as reader25 from sans.guiframe.events import NewPlotEvent 26 from sans.guiframe.events import ERR_DATA 27 from .invariant_state import Reader as reader 28 28 from DataLoader.loader import Loader 29 from invariant_panel import InvariantPanel29 from .invariant_panel import InvariantPanel 30 30 from sans.guicomm.events import EVT_INVSTATE_UPDATE 31 31 … … 57 57 Show a general help dialog. 58 58 """ 59 from help_panel import HelpWindow59 from .help_panel import HelpWindow 60 60 frame = HelpWindow(None, -1) 61 61 frame.Show(True) … … 144 144 data.dy = dy 145 145 data.name = item.name 146 data.title = item.title 146 147 147 148 ## allow to highlight data when plotted … … 178 179 self.compute_helper(data=data) 179 180 181 def set_data(self, data_list): 182 """ 183 receive a list of data and compute invariant 184 """ 185 if len(data_list) > 1: 186 msg = "invariant panel does not allow more than one value" 187 msg += " at this time" 188 raise ValueError, msg 189 elif len(data_list) == 1: 190 if issubclass(data_list[0].__class__, LoaderData1D): 191 self.compute_helper(data_list[0]) 192 wx.PostEvent(self.parent, NewPlotEvent(plot=data_list[0], 193 title=data_list[0].title)) 194 else: 195 msg = "invariant cannot be computed for" 196 msg += " data of type %s" % (data_list[0].__class__.__name__) 197 raise ValueError, msg 198 199 180 200 def compute_helper(self, data): 181 201 """ … … 189 209 # Set the data set to be user for invariant calculation 190 210 self.invariant_panel.set_data(data=data) 191 211 192 212 def save_file(self, filepath, state=None): 193 213 """ … … 282 302 new_plot.group_id = self.__data.group_id 283 303 new_plot.id = self.__data.id + name 304 new_plot.title = self.__data.title 284 305 # Save theory_data in a state 285 306 if data != None: … … 288 309 self.invariant_panel.state.theory_lowQ = copy.deepcopy(new_plot) 289 310 elif name_head[0] == 'High': 290 self.invariant_panel.state.theory_highQ = 311 self.invariant_panel.state.theory_highQ =copy.deepcopy(new_plot) 291 312 292 313 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 293 title=self.__data. name))314 title=self.__data.title)) 294 315 295 316 def plot_data(self, scale, background): … … 301 322 new_plot.group_id = self.__data.group_id 302 323 new_plot.id = self.__data.id 324 new_plot.title = self.__data.title 303 325 304 326 # Save data in a state: but seems to never happen … … 306 328 self.invariant_panel.state.data = copy.deepcopy(new_plot) 307 329 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, 308 title=new_plot. name))309 330 title=new_plot.title)) 331 -
invariantview/perspectives/invariant/invariant_panel.py
r6a0cbcf4 rf1e06a8e 12 12 from sans.guiframe.utils import format_number 13 13 from sans.guiframe.utils import check_float 14 from sans.gui comm.events import NewPlotEvent,StatusEvent15 from invariant_details import InvariantDetailsPanel16 from invariant_details import InvariantContainer17 from invariant_widgets import OutputTextCtrl18 from invariant_widgets import InvTextCtrl19 from invariant_state import InvariantState as IState14 from sans.guiframe.events import StatusEvent 15 from .invariant_details import InvariantDetailsPanel 16 from .invariant_details import InvariantContainer 17 from .invariant_widgets import OutputTextCtrl 18 from .invariant_widgets import InvTextCtrl 19 from .invariant_state import InvariantState as IState 20 20 from sans.guiframe.panel_base import PanelBase 21 21 # The minimum q-value to be used when extrapolating … … 141 141 self.state.data = copy.deepcopy(data) 142 142 self._reset_state_list() 143 143 144 return True 144 145 … … 531 532 532 533 low_q = self.enable_low_cbox.GetValue() 533 high_q = self.enable_high_cbox.GetValue() 534 high_q = self.enable_high_cbox.GetValue() 535 temp_data = copy.deepcopy(self._data) 536 534 537 #set invariant calculator 535 inv = invariant.InvariantCalculator(data= self._data,538 inv = invariant.InvariantCalculator(data=temp_data, 536 539 background=background, 537 540 scale=scale) … … 618 621 wx.PostEvent(self.parent, 619 622 StatusEvent(status='\nFinished invariant computation...')) 620 623 621 624 622 625 def undo(self,event=None): … … 674 677 : param event: report button event 675 678 """ 676 from report_dialog import ReportDialog679 from .report_dialog import ReportDialog 677 680 678 681 self.state.set_report_string() … … 717 720 except: 718 721 pass 719 722 720 723 self.compute_invariant(event=None) 724 721 725 # set the input params at the state at pre_state_num 722 726 for key in current_state:
Note: See TracChangeset
for help on using the changeset viewer.