Ignore:
Timestamp:
Sep 7, 2018 12:21:37 PM (6 years ago)
Author:
Laura Forster <Awork@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
12db2db6
Parents:
dda8f16
Message:

Mask Edit menu item added to Fitting

Mask edit was previously only available via right clicking data before fit, now available on fitting drop down menu option.

File:
1 edited

Legend:

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

    rfd7ef36 r339e22b  
    4242        # Main model for keeping loaded data 
    4343        self.model = QtGui.QStandardItemModel(self) 
    44  
    4544        # Secondary model for keeping frozen data sets 
    4645        self.theory_model = QtGui.QStandardItemModel(self) 
     
    9897        self.communicator.plotUpdateSignal.connect(self.updatePlot) 
    9998        self.communicator.maskEditorSignal.connect(self.showEditDataMask) 
     99        self.communicator.extMaskEditorSignal.connect(self.extShowEditDataMask) 
    100100 
    101101        self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 
     
    10591059        self.new_plot.show() 
    10601060 
     1061    def extShowEditDataMask(self): 
     1062        self.showEditDataMask() 
     1063 
    10611064    def showEditDataMask(self, data=None): 
    10621065        """ 
    10631066        Mask Editor for 2D plots 
    10641067        """ 
    1065         if data is None or not isinstance(data, Data2D): 
    1066             index = self.current_view.selectedIndexes()[0] 
    1067             proxy = self.current_view.model() 
    1068             model = proxy.sourceModel() 
    1069             model_item = model.itemFromIndex(proxy.mapToSource(index)) 
    1070  
    1071             data = GuiUtils.dataFromItem(model_item) 
     1068        try: 
     1069            if data is None or not isinstance(data, Data2D): 
     1070                index = self.current_view.selectedIndexes()[0] 
     1071                proxy = self.current_view.model() 
     1072                model = proxy.sourceModel() 
     1073                model_item = model.itemFromIndex(proxy.mapToSource(index)) 
     1074 
     1075                data = GuiUtils.dataFromItem(model_item) 
     1076 
     1077            if data is None or not isinstance(data, Data2D): 
     1078                msg = QtWidgets.QMessageBox() 
     1079                msg.setIcon(QtWidgets.QMessageBox.Information) 
     1080                msg.setText("Error: cannot apply mask. \ 
     1081                                Please select a 2D dataset.") 
     1082                msg.setStandardButtons(QtWidgets.QMessageBox.Cancel) 
     1083                msg.exec_() 
     1084                return 
     1085        except: 
     1086            msg = QtWidgets.QMessageBox() 
     1087            msg.setIcon(QtWidgets.QMessageBox.Information) 
     1088            msg.setText("Error: No dataset selected. \ 
     1089                            Please select a 2D dataset.") 
     1090            msg.setStandardButtons(QtWidgets.QMessageBox.Cancel) 
     1091            msg.exec_() 
     1092            return 
    10721093 
    10731094        mask_editor = MaskEditor(self, data) 
Note: See TracChangeset for help on using the changeset viewer.