- Timestamp:
- Oct 22, 2018 9:48:54 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:
- d00475d
- Parents:
- b8dccb8
- Location:
- src/sas/qtgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r2eeda93 ra3c59503 268 268 self.communicator.statusBarUpdateSignal.emit("Saving Project... %s\n" % os.path.basename(filename)) 269 269 270 with open(filename, 'w') as outfile: 271 self.saveDataToFile(outfile) 270 return filename 272 271 273 272 def saveAsAnalysisFile(self, tab_id=1): … … 318 317 is_checked = item.checkState() 319 318 properties['checked'] = is_checked 320 other_datas = GuiUtils.plotsFromFilename(filename, model) 319 other_datas = [] 320 # no need to save other_datas - things will be refit on read 321 #other_datas = GuiUtils.plotsFromFilename(filename, model) 321 322 # skip the main plot 322 other_datas = list(other_datas.values())[1:]323 #other_datas = list(other_datas.values())[1:] 323 324 all_data[data.id] = [data, properties, other_datas] 324 325 return all_data … … 375 376 with open(filename, 'r') as infile: 376 377 all_data = GuiUtils.readDataFromFile(infile) 377 items = self.updateModelFromData(all_data) 378 379 for key, value in all_data.items(): 380 data_dict = {key:value['fit_data']} 381 items = self.updateModelFromData(data_dict) 382 # send newly created item to its perspective 383 if 'fit_params' in value: 384 self.sendItemToPerspective(items[0]) 385 # Make the perspective read the rest of the read data 386 self._perspective().updateFromParameters(value['fit_params']) 378 387 379 388 pass # debugger -
src/sas/qtgui/MainWindow/GuiManager.py
r2eeda93 ra3c59503 554 554 Menu Save Project 555 555 """ 556 self.filesWidget.saveProject() 556 filename = self.filesWidget.saveProject() 557 558 # datasets 559 all_data = self.filesWidget.getAllData() 560 561 # fit tabs 562 params = self.perspective().serializeAllFitpage() 563 564 # project dictionary structure: 565 # analysis[data.id] = [{"fit_data":[data, checkbox, child data], 566 # "fit_params":[fitpage_state]} 567 # "fit_params" not present if dataset not sent to fitting 568 analysis = {} 569 570 for id, data in all_data.items(): 571 data_content = {"fit_data":data} 572 if id in params.keys(): 573 # this dataset is represented also by the fit tab. Add to it. 574 data_content["fit_params"] = params[id] 575 analysis[id] = data_content 576 577 with open(filename, 'w') as outfile: 578 GuiUtils.saveData(outfile, analysis) 557 579 558 580 def actionSave_Analysis(self): … … 564 586 return 565 587 # get fit page serialization 566 params = per. getSerializedFitpage()588 params = per.serializeCurrentFitpage() 567 589 data_id = per.currentTabDataId() 568 590 tab_id = per.currentTab.tab_id -
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
r2eeda93 ra3c59503 113 113 self.currentTab.onCopyToClipboard("Latex") 114 114 115 def getSerializedFitpage(self): 115 def serializeAllFitpage(self): 116 # serialize all active fitpages and return 117 # a dictionary: {data_id: fitpage_state} 118 params = {} 119 for i, tab in enumerate(self.tabs): 120 tab_data = self.getSerializedFitpage(tab) 121 if tab.tab_id is None: continue 122 id = tab_data['data_id'][0] 123 params[id] = tab_data 124 return params 125 126 def serializeCurrentFitpage(self): 116 127 # serialize current(active) fitpage 117 fitpage_state = self.currentTab.getFitPage() 118 fitpage_state += self.currentTab.getFitModel() 128 return self.getSerializedFitpage(self.currentTab) 129 130 def getSerializedFitpage(self, tab): 131 """ 132 get serialize requested fit tab 133 """ 134 fitpage_state = tab.getFitPage() 135 fitpage_state += tab.getFitModel() 119 136 # put the text into dictionary 120 137 line_dict = {}
Note: See TracChangeset
for help on using the changeset viewer.