Changeset f331852 in sasview for src/sas/qtgui/MainWindow


Ignore:
Timestamp:
Oct 20, 2017 2:45:46 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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.
Message:

Merge remote-tracking branch 'origin/ESS_GUI_SasView245' into ESS_GUI

Location:
src/sas/qtgui/MainWindow
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r7d8bebf r1420066  
    9393        self.communicator.activeGraphName.connect(self.updatePlotName) 
    9494        self.communicator.plotUpdateSignal.connect(self.updatePlot) 
     95 
    9596        self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 
    9697        self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo) 
     
    280281        # Use 'while' so the row count is forced at every iteration 
    281282        deleted_indices = [] 
     283        deleted_names = [] 
    282284        while ind < self.model.rowCount(): 
    283285            ind += 1 
    284286            item = self.model.item(ind) 
     287 
    285288            if item and item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 
    286289                # Delete these rows from the model 
     290                deleted_names.append(str(self.model.item(ind).text())) 
    287291                deleted_indices.append(item) 
     292 
    288293                self.model.removeRow(ind) 
    289294                # Decrement index since we just deleted it 
     
    292297        # Let others know we deleted data 
    293298        self.communicator.dataDeletedSignal.emit(deleted_indices) 
     299 
     300        # update stored_data 
     301        self.manager.update_stored_data(deleted_names) 
    294302 
    295303    def deleteTheory(self, event): 
     
    869877        self.txt_widget.setWindowIcon(QtGui.QIcon(":/res/ball.ico")) 
    870878        self.txt_widget.setWindowTitle("Data Info: %s" % data.filename) 
     879        self.txt_widget.clear() 
    871880        self.txt_widget.insertPlainText(text_to_show) 
    872881 
     
    10121021        self.model.appendRow(checkbox_item) 
    10131022 
    1014  
    10151023    def updateModelFromPerspective(self, model_item): 
    10161024        """ 
  • src/sas/qtgui/MainWindow/DataManager.py

    rdc5ef15 r1420066  
    275275                del self.stored_data[id] 
    276276 
    277  
    278277    def get_by_name(self, name_list=None): 
    279278        """ 
     
    295294                if data_state.data.name == selected_name: 
    296295                    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] 
    297304 
    298305    def get_data_state(self, data_id): 
  • src/sas/qtgui/MainWindow/GuiManager.py

    r01cda57 rf0bb711  
    3131from sas.qtgui.Calculators.GenericScatteringCalculator import GenericScatteringCalculator 
    3232from sas.qtgui.Calculators.ResolutionCalculatorPanel import ResolutionCalculatorPanel 
    33  
     33from sas.qtgui.Calculators.DataOperationUtilityPanel import DataOperationUtilityPanel 
    3434 
    3535# Perspectives 
     
    4747    Main SasView window functionality 
    4848    """ 
     49 
    4950    def __init__(self, parent=None): 
    5051        """ 
     
    142143        self.GENSASCalculator = GenericScatteringCalculator(self) 
    143144        self.ResolutionCalculator = ResolutionCalculatorPanel(self) 
     145        self.DataOperation = DataOperationUtilityPanel(self) 
    144146 
    145147    def statusBarSetup(self): 
     
    337339        self.communicate.updateTheoryFromPerspectiveSignal.connect(self.updateTheoryFromPerspective) 
    338340        self.communicate.plotRequestedSignal.connect(self.showPlot) 
     341        self.communicate.updateModelFromDataOperationPanelSignal.connect(self.updateModelFromDataOperationPanel) 
    339342 
    340343    def addTriggers(self): 
     
    531534        """ 
    532535        """ 
    533         print("actionData_Operation TRIGGERED") 
    534         pass 
     536        self.communicate.sendDataToPanelSignal.emit(self._data_manager.get_all_data()) 
     537 
     538        self.DataOperation.show() 
    535539 
    536540    def actionSLD_Calculator(self): 
     
    731735        self.filesWidget.updateTheoryFromPerspective(index) 
    732736 
     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 
    733750    def showPlot(self, plot): 
    734751        """ 
     
    737754        if hasattr(self, "filesWidget"): 
    738755            self.filesWidget.displayData(plot) 
    739  
Note: See TracChangeset for help on using the changeset viewer.