Changeset 04972ea in sasview


Ignore:
Timestamp:
Aug 3, 2018 8:31:45 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
97df8a9
Parents:
8e2cd79 (diff), 46f59ba (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 branch 'ESS_GUI' of https://github.com/SasView/sasview into ESS_GUI

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • installers/sasview_qt5_osx.spec

    r2ae3edb r46f59ba  
    5454datas.append(('../src/sas/logger_config.py','.')) 
    5555datas.append(('../src/sas/logging.ini','.')) 
     56datas.append(('../src/sas/sasview/custom_config.py','sas/sasview')) 
     57datas.append(('../src/sas/sasview/local_config.py','sas/sasview')) 
    5658 
    5759# pyinstaller gets mightily confused by upper/lower case, 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r8e2cd79 r04972ea  
    148148        item.append([item1, item2, item4, item5, item6]) 
    149149    return item 
     150 
     151def markParameterDisabled(model, row): 
     152    """Given the QModel row number, format to show it is not available for fitting""" 
     153 
     154    # If an error column is present, there are a total of 6 columns. 
     155    items = [model.item(row, c) for c in range(6)] 
     156 
     157    model.blockSignals(True) 
     158 
     159    for item in items: 
     160        if item is None: 
     161            continue 
     162        item.setEditable(False) 
     163        item.setCheckable(False) 
     164 
     165    item = items[0] 
     166 
     167    font = QtGui.QFont() 
     168    font.setItalic(True) 
     169    item.setFont(font) 
     170    item.setForeground(QtGui.QBrush(QtGui.QColor(100, 100, 100))) 
     171    item.setToolTip("This parameter cannot be fitted.") 
     172 
     173    model.blockSignals(False) 
    150174 
    151175def addCheckedListToModel(model, param_list): 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r8e2cd79 r04972ea  
    1414from PyQt5 import QtWidgets 
    1515 
    16 from sasmodels import product 
    1716from sasmodels import generate 
    1817from sasmodels import modelinfo 
    1918from sasmodels.sasview_model import load_standard_models 
     19from sasmodels.sasview_model import MultiplicationModel 
    2020from sasmodels.weights import MODELS as POLYDISPERSITY_MODELS 
    2121 
     
    14041404        param_dict = self.paramDictFromResults(res) 
    14051405 
     1406        if param_dict is None: 
     1407            return 
     1408 
    14061409        elapsed = result[1] 
    14071410        if self.calc_fit._interrupting: 
     
    16451648            return 
    16461649 
     1650        def iterateOverMagnetModel(func): 
     1651            """ 
     1652            Take func and throw it inside the magnet model row loop 
     1653            """ 
     1654            for row_i in range(self._magnet_model.rowCount()): 
     1655                func(row_i) 
     1656 
    16471657        def updateFittedValues(row): 
    16481658            # Utility function for main model update 
     
    19611971        structure_module = generate.load_kernel_module(structure_factor) 
    19621972        structure_parameters = modelinfo.make_parameter_table(getattr(structure_module, 'parameters', [])) 
     1973 
    19631974        structure_kernel = self.models[structure_factor]() 
    1964  
    1965         self.kernel_module._model_info = product.make_product_info(self.kernel_module._model_info, structure_kernel._model_info) 
     1975        form_kernel = self.kernel_module 
     1976 
     1977        self.kernel_module = MultiplicationModel(form_kernel, structure_kernel) 
    19661978 
    19671979        new_rows = FittingUtilities.addSimpleParametersToModel(structure_parameters, self.is2D) 
    19681980        for row in new_rows: 
    19691981            self._model_model.appendRow(row) 
     1982            # disable fitting of parameters not listed in self.kernel_module (probably radius_effective) 
     1983            if row[0].text() not in self.kernel_module.params.keys(): 
     1984                row_num = self._model_model.rowCount() - 1 
     1985                FittingUtilities.markParameterDisabled(self._model_model, row_num) 
     1986 
    19701987        # Update the counter used for multishell display 
    19711988        self._last_model_row = self._model_model.rowCount() 
  • src/sas/qtgui/MainWindow/GuiManager.py

    re4335ae r8e2cd79  
    520520    def actionCopy(self): 
    521521        """ 
    522         """ 
    523         print("actionCopy TRIGGERED") 
     522        Send a signal to the fitting perspective so parameters 
     523        can be saved to the clipboard 
     524        """ 
     525        self.communicate.copyFitParamsSignal.emit("") 
    524526        pass 
    525527 
    526528    def actionPaste(self): 
    527529        """ 
    528         """ 
    529         print("actionPaste TRIGGERED") 
    530         pass 
     530        Send a signal to the fitting perspective so parameters 
     531        from the clipboard can be used to modify the fit state 
     532        """ 
     533        self.communicate.pasteFitParamsSignal.emit() 
    531534 
    532535    def actionReport(self): 
     
    555558    def actionExcel(self): 
    556559        """ 
    557         """ 
    558         print("actionExcel TRIGGERED") 
    559         pass 
     560        Send a signal to the fitting perspective so parameters 
     561        can be saved to the clipboard 
     562        """ 
     563        self.communicate.copyFitParamsSignal.emit("Excel") 
    560564 
    561565    def actionLatex(self): 
    562566        """ 
    563         """ 
    564         print("actionLatex TRIGGERED") 
    565         pass 
     567        Send a signal to the fitting perspective so parameters 
     568        can be saved to the clipboard 
     569        """ 
     570        self.communicate.copyFitParamsSignal.emit("Latex") 
    566571 
    567572    #============ VIEW ================= 
  • src/sas/qtgui/Perspectives/Fitting/ViewDelegate.py

    rcf8d6c9 r8e2cd79  
    288288            rect = textRect.topLeft() 
    289289            y = rect.y() 
    290             y += 5.0 # magic value for rendering nice display in the table 
     290            y += 6.0 # magic value for rendering nice display in the table 
    291291            rect.setY(y) 
    292292            painter.translate(rect) 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r6ff103a r8e2cd79  
    254254    # Mask Editor requested 
    255255    maskEditorSignal = QtCore.pyqtSignal(Data2D) 
     256 
     257    # Fitting parameter copy to clipboard 
     258    copyFitParamsSignal = QtCore.pyqtSignal(str) 
     259 
     260    # Fitting parameter paste from clipboard 
     261    pasteFitParamsSignal = QtCore.pyqtSignal() 
    256262 
    257263def updateModelItemWithPlot(item, update_data, name=""): 
Note: See TracChangeset for help on using the changeset viewer.