Changeset 6f1f129 in sasview
- Timestamp:
- May 25, 2009 4:52:15 PM (16 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:
- f68b14a
- Parents:
- 5d98370
- Location:
- prview/perspectives/pr
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
prview/perspectives/pr/pr.py
rff7acff r6f1f129 85 85 self._default_Iq = {} 86 86 87 # Associate the inversion state reader with .prv files 88 from DataLoader.loader import Loader 89 from inversion_state import Reader 90 91 reader = Reader(self.set_state) 92 l = Loader() 93 l.associate_file_reader('.prv', reader) 94 87 95 # Log startup 88 96 logging.info("Pr(r) plug-in started") 89 97 90 98 def set_state(self, state): 99 """ 100 Call-back method for the inversion state reader. 101 This method is called when a .prv file is loaded. 102 103 @param state: InversionState object 104 """ 105 self.control_panel.set_state(state) 106 #print state 91 107 92 108 def populate_menu(self, id, owner): … … 332 348 333 349 334 def choose_file(self ):350 def choose_file(self, path=None): 335 351 """ 336 352 337 353 """ 338 354 #TODO: this should be in a common module 339 return self.parent.choose_file( )355 return self.parent.choose_file(path=path) 340 356 341 357 … … 374 390 wx.PostEvent(self.parent, StatusEvent(status=msg)) 375 391 else: 392 if dataread is None: 393 return x, y, err 376 394 raise RuntimeError, "This tool can only read 1D data" 377 395 … … 774 792 try: 775 793 pr = self._create_file_pr(path) 794 795 # If the file contains nothing, just return 796 if pr is None: 797 return 798 776 799 self.pr = pr 777 800 except: … … 930 953 wx.PostEvent(self.parent, StatusEvent(status='')) 931 954 x, y, err = self.load(path) 955 956 # If the file contains no data, just return 957 #TODO: clean this up: we need a way to recognize that not all P(r) files are data 958 if x is None: 959 return None 932 960 933 961 # If we have not errors, add statistical errors
Note: See TracChangeset
for help on using the changeset viewer.