Changeset be74751 in sasview
- Timestamp:
- Nov 7, 2018 6:47:25 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- ebcdb02
- Parents:
- 490e230
- Location:
- src/sas/qtgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r490e230 rbe74751 266 266 filename = QtWidgets.QFileDialog.getOpenFileName(**kwargs)[0] 267 267 if filename: 268 self.read Analysis(filename)268 self.readProject(filename) 269 269 270 270 def saveProject(self): … … 414 414 if 'svs' in ext.lower(): 415 415 # backward compatibility mode. 416 datasets = GuiUtils.readProjectFromSVS(filename) 417 #[[item_1, state_1], [item_2, state_2],...] 418 416 try: 417 datasets = GuiUtils.readProjectFromSVS(filename) 418 except Exception as ex: 419 # disregard malformed SVS and try to recover whatever 420 # is available 421 msg = "Error while reading the project file: "+str(ex) 422 logging.error(msg) 423 pass 419 424 # Convert fitpage properties and update the dict 420 425 try: … … 422 427 except Exception as ex: 423 428 # disregard malformed SVS and try to recover regardless 424 msg = "Error while reading the project file: "+str(ex)429 msg = "Error while converting the project file: "+str(ex) 425 430 logging.error(msg) 426 431 pass 427 432 else: 428 433 with open(filename, 'r') as infile: 429 all_data = GuiUtils.readDataFromFile(infile) 430 434 try: 435 all_data = GuiUtils.readDataFromFile(infile) 436 except Exception as ex: 437 logging.error("Project load failed with " + str(ex)) 438 return 431 439 for key, value in all_data.items(): 432 440 if key=='is_batch': … … 489 497 self._perspective().updateFromParameters(page) 490 498 pass # debugger 491 492 def readAnalysis(self, filename):493 """494 Read out a single dataset and fitpage from file495 """496 with open(filename, 'r') as infile:497 all_data = GuiUtils.readDataFromFile(infile)498 499 # send newly created items to the perspective500 self.updatePerspectiveWithProperties(1, all_data)501 499 502 500 def updateModelFromData(self, data): -
src/sas/qtgui/MainWindow/GuiManager.py
r17e2d502 rbe74751 600 600 # get fit page serialization 601 601 params = per.serializeCurrentFitpage() 602 # Find dataset ids for the current tab 603 # (can be multiple, if batch) 602 604 data_id = per.currentTabDataId() 603 605 tab_id = per.currentTab.tab_id 604 data = self.filesWidget.getDataForID(data_id)605 606 analysis = {} 606 analysis['fit_data'] = data 607 analysis['fit_params'] = params 607 for id in data_id: 608 an = {} 609 data_for_id = self.filesWidget.getDataForID(id) 610 an['fit_data'] = data_for_id 611 an['fit_params'] = [params] 612 analysis[id] = an 608 613 609 614 self.filesWidget.saveAnalysis(analysis, tab_id) 610 611 pass612 615 613 616 def actionQuit(self): -
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
r17e2d502 rbe74751 10 10 import sas.qtgui.Utilities.LocalConfig as LocalConfig 11 11 import sas.qtgui.Utilities.ObjectLibrary as ObjectLibrary 12 import sas.qtgui.Utilities.GuiUtils as GuiUtils 12 13 13 14 from sas.qtgui.Perspectives.Fitting.FittingWidget import FittingWidget … … 157 158 Returns the data ID of the current tab 158 159 """ 159 tab_id = None 160 if self.currentTab.data: 161 tab_id = self.currentTab.data.id 160 tab_id = [] 161 if not self.currentTab.data: 162 return tab_id 163 for item in self.currentTab.all_data: 164 data = GuiUtils.dataFromItem(item) 165 tab_id.append(data.id) 166 162 167 return tab_id 163 168
Note: See TracChangeset
for help on using the changeset viewer.