Changeset f331852 in sasview for src/sas/qtgui/MainWindow
- Timestamp:
- Oct 20, 2017 2:45:46 AM (7 years ago)
- Branches:
- 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
- Children:
- 7d9c83c
- Parents:
- 44880ac (diff), 1420066 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- src/sas/qtgui/MainWindow
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r7d8bebf r1420066 93 93 self.communicator.activeGraphName.connect(self.updatePlotName) 94 94 self.communicator.plotUpdateSignal.connect(self.updatePlot) 95 95 96 self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 96 97 self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo) … … 280 281 # Use 'while' so the row count is forced at every iteration 281 282 deleted_indices = [] 283 deleted_names = [] 282 284 while ind < self.model.rowCount(): 283 285 ind += 1 284 286 item = self.model.item(ind) 287 285 288 if item and item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 286 289 # Delete these rows from the model 290 deleted_names.append(str(self.model.item(ind).text())) 287 291 deleted_indices.append(item) 292 288 293 self.model.removeRow(ind) 289 294 # Decrement index since we just deleted it … … 292 297 # Let others know we deleted data 293 298 self.communicator.dataDeletedSignal.emit(deleted_indices) 299 300 # update stored_data 301 self.manager.update_stored_data(deleted_names) 294 302 295 303 def deleteTheory(self, event): … … 869 877 self.txt_widget.setWindowIcon(QtGui.QIcon(":/res/ball.ico")) 870 878 self.txt_widget.setWindowTitle("Data Info: %s" % data.filename) 879 self.txt_widget.clear() 871 880 self.txt_widget.insertPlainText(text_to_show) 872 881 … … 1012 1021 self.model.appendRow(checkbox_item) 1013 1022 1014 1015 1023 def updateModelFromPerspective(self, model_item): 1016 1024 """ -
src/sas/qtgui/MainWindow/DataManager.py
rdc5ef15 r1420066 275 275 del self.stored_data[id] 276 276 277 278 277 def get_by_name(self, name_list=None): 279 278 """ … … 295 294 if data_state.data.name == selected_name: 296 295 del self.stored_data[id] 296 297 def update_stored_data(self, name_list=None): 298 """ update stored data after deleting files in Data Explorer """ 299 for selected_name in name_list: 300 for idx in self.stored_data.keys(): 301 if str(selected_name) in str(idx): 302 print selected_name, idx 303 del self.stored_data[idx] 297 304 298 305 def get_data_state(self, data_id): -
src/sas/qtgui/MainWindow/GuiManager.py
r01cda57 rf0bb711 31 31 from sas.qtgui.Calculators.GenericScatteringCalculator import GenericScatteringCalculator 32 32 from sas.qtgui.Calculators.ResolutionCalculatorPanel import ResolutionCalculatorPanel 33 33 from sas.qtgui.Calculators.DataOperationUtilityPanel import DataOperationUtilityPanel 34 34 35 35 # Perspectives … … 47 47 Main SasView window functionality 48 48 """ 49 49 50 def __init__(self, parent=None): 50 51 """ … … 142 143 self.GENSASCalculator = GenericScatteringCalculator(self) 143 144 self.ResolutionCalculator = ResolutionCalculatorPanel(self) 145 self.DataOperation = DataOperationUtilityPanel(self) 144 146 145 147 def statusBarSetup(self): … … 337 339 self.communicate.updateTheoryFromPerspectiveSignal.connect(self.updateTheoryFromPerspective) 338 340 self.communicate.plotRequestedSignal.connect(self.showPlot) 341 self.communicate.updateModelFromDataOperationPanelSignal.connect(self.updateModelFromDataOperationPanel) 339 342 340 343 def addTriggers(self): … … 531 534 """ 532 535 """ 533 print("actionData_Operation TRIGGERED") 534 pass 536 self.communicate.sendDataToPanelSignal.emit(self._data_manager.get_all_data()) 537 538 self.DataOperation.show() 535 539 536 540 def actionSLD_Calculator(self): … … 731 735 self.filesWidget.updateTheoryFromPerspective(index) 732 736 737 def updateModelFromDataOperationPanel(self, new_item, new_datalist_item): 738 """ 739 :param new_item: item to be added to list of loaded files 740 :param new_datalist_item: 741 """ 742 if not isinstance(new_item, QtGui.QStandardItem) or \ 743 not isinstance(new_datalist_item, dict): 744 msg = "Wrong data type returned from calculations." 745 raise AttributeError, msg 746 747 self.filesWidget.model.appendRow(new_item) 748 self._data_manager.add_data(new_datalist_item) 749 733 750 def showPlot(self, plot): 734 751 """ … … 737 754 if hasattr(self, "filesWidget"): 738 755 self.filesWidget.displayData(plot) 739
Note: See TracChangeset
for help on using the changeset viewer.