Changes in src/sas/qtgui/MainWindow/GuiManager.py [67346f9:e5ae812] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/GuiManager.py
r67346f9 re5ae812 255 255 if self._current_perspective: 256 256 self._current_perspective.setClosable() 257 #self._workspace.workspace.removeSubWindow(self._current_perspective)258 257 self._current_perspective.close() 259 258 self._workspace.workspace.removeSubWindow(self._current_perspective) … … 471 470 self._workspace.actionOpen_Project.triggered.connect(self.actionOpen_Project) 472 471 self._workspace.actionOpen_Analysis.triggered.connect(self.actionOpen_Analysis) 473 self._workspace.actionSave.triggered.connect(self.actionSave )472 self._workspace.actionSave.triggered.connect(self.actionSave_Project) 474 473 self._workspace.actionSave_Analysis.triggered.connect(self.actionSave_Analysis) 475 474 self._workspace.actionQuit.triggered.connect(self.actionQuit) … … 561 560 """ 562 561 """ 563 print("actionOpen_Analysis TRIGGERED")564 pass 565 566 def actionSave (self):562 self.filesWidget.loadAnalysis() 563 pass 564 565 def actionSave_Project(self): 567 566 """ 568 567 Menu Save Project 569 568 """ 570 self.filesWidget.saveProject() 569 filename = self.filesWidget.saveProject() 570 571 # datasets 572 all_data = self.filesWidget.getAllData() 573 574 # fit tabs 575 params={} 576 perspective = self.perspective() 577 if hasattr(perspective, 'isSerializable') and perspective.isSerializable(): 578 params = perspective.serializeAllFitpage() 579 580 # project dictionary structure: 581 # analysis[data.id] = [{"fit_data":[data, checkbox, child data], 582 # "fit_params":[fitpage_state]} 583 # "fit_params" not present if dataset not sent to fitting 584 analysis = {} 585 586 for id, data in all_data.items(): 587 if id=='is_batch': 588 analysis['is_batch'] = data 589 continue 590 data_content = {"fit_data":data} 591 if id in params.keys(): 592 # this dataset is represented also by the fit tab. Add to it. 593 data_content["fit_params"] = params[id] 594 analysis[id] = data_content 595 596 # standalone constraint pages 597 for keys, values in params.items(): 598 if not 'is_constraint' in values[0]: 599 continue 600 analysis[keys] = values[0] 601 602 with open(filename, 'w') as outfile: 603 GuiUtils.saveData(outfile, analysis) 571 604 572 605 def actionSave_Analysis(self): … … 574 607 Menu File/Save Analysis 575 608 """ 576 self.communicate.saveAnalysisSignal.emit() 609 per = self.perspective() 610 if not isinstance(per, FittingWindow): 611 return 612 # get fit page serialization 613 params = per.serializeCurrentFitpage() 614 # Find dataset ids for the current tab 615 # (can be multiple, if batch) 616 data_id = per.currentTabDataId() 617 tab_id = per.currentTab.tab_id 618 analysis = {} 619 for id in data_id: 620 an = {} 621 data_for_id = self.filesWidget.getDataForID(id) 622 an['fit_data'] = data_for_id 623 an['fit_params'] = [params] 624 analysis[id] = an 625 626 self.filesWidget.saveAnalysis(analysis, tab_id) 577 627 578 628 def actionQuit(self): … … 1056 1106 """ 1057 1107 self._workspace.actionReport.setEnabled(False) 1108 self._workspace.actionOpen_Analysis.setEnabled(False) 1109 self._workspace.actionSave_Analysis.setEnabled(False) 1110 if hasattr(perspective, 'isSerializable') and perspective.isSerializable(): 1111 self._workspace.actionOpen_Analysis.setEnabled(True) 1112 self._workspace.actionSave_Analysis.setEnabled(True) 1113 1058 1114 if isinstance(perspective, Perspectives.PERSPECTIVES["Fitting"]): 1059 1115 self.checkAnalysisOption(self._workspace.actionFitting) … … 1127 1183 out_f.write("#Application appearance custom configuration\n") 1128 1184 for key, item in config.__dict__.items(): 1129 if key[:2] != "__": 1130 if isinstance(item, str): 1131 item = '"' + item + '"' 1132 out_f.write("%s = %s\n" % (key, str(item))) 1185 if key[:2] == "__": 1186 continue 1187 if isinstance(item, str): 1188 item = '"' + item + '"' 1189 out_f.write("%s = %s\n" % (key, str(item))) 1133 1190 pass # debugger anchor
Note: See TracChangeset
for help on using the changeset viewer.