Changeset 339e22b in sasview


Ignore:
Timestamp:
Sep 7, 2018 10:21:37 AM (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.

Location:
src/sas/qtgui
Files:
5 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) 
  • src/sas/qtgui/MainWindow/GuiManager.py

    rf84d793 r339e22b  
    422422        self._workspace.actionExcel.triggered.connect(self.actionExcel) 
    423423        self._workspace.actionLatex.triggered.connect(self.actionLatex) 
    424  
    425424        # View 
    426425        self._workspace.actionShow_Grid_Window.triggered.connect(self.actionShow_Grid_Window) 
     
    452451        self._workspace.actionManage_Custom_Models.triggered.connect(self.actionManage_Custom_Models) 
    453452        self._workspace.actionAddMult_Models.triggered.connect(self.actionAddMult_Models) 
     453        self._workspace.actionEditMask.triggered.connect(self.actionEditMask) 
     454 
    454455        # Window 
    455456        self._workspace.actionCascade.triggered.connect(self.actionCascade) 
     
    781782        self.add_mult_editor.show() 
    782783 
     784    def actionEditMask(self): 
     785 
     786        self.communicate.extMaskEditorSignal.emit() 
     787 
    783788    #============ ANALYSIS ================= 
    784789    def actionFitting(self): 
  • src/sas/qtgui/MainWindow/UI/MainWindowUI.ui

    rdda8f16 r339e22b  
    113113    <addaction name="actionManage_Custom_Models"/> 
    114114    <addaction name="actionAddMult_Models"/> 
     115    <addaction name="separator"/> 
     116    <addaction name="EditMask"/> 
    115117   </widget> 
    116118   <widget class="QMenu" name="menuWindow"> 
     
    413415   </property> 
    414416  </action> 
     417    <action name="EditMask"> 
     418   <property name="text"> 
     419    <string>Edit Mask</string> 
     420   </property> 
     421  </action> 
    415422  <action name="actionCascade"> 
    416423   <property name="text"> 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    rf84d793 r339e22b  
    4848from sas.qtgui.Perspectives.Fitting.ReportPageLogic import ReportPageLogic 
    4949 
    50  
    5150TAB_MAGNETISM = 4 
    5251TAB_POLY = 3 
     
    188187 
    189188        # Overwrite data type descriptor 
     189 
    190190        self.is2D = True if isinstance(self.logic.data, Data2D) else False 
    191191 
     
    32133213        self._poly_model.blockSignals(False) 
    32143214 
     3215 
     3216 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r6da3e3d r339e22b  
    265265    # Mask Editor requested 
    266266    maskEditorSignal = QtCore.pyqtSignal(Data2D) 
     267 
     268    #second Mask Editor for external 
     269    extMaskEditorSignal = QtCore.pyqtSignal() 
    267270 
    268271    # Fitting parameter copy to clipboard 
Note: See TracChangeset for help on using the changeset viewer.