Changeset 21fa45b in sasview


Ignore:
Timestamp:
Oct 16, 2018 9:26:47 AM (5 years ago)
Author:
Laura Forster <Awork@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
d2007a8
Parents:
fc9d9a3
Message:

Changing error message to include structure factor

If you copy the parameters then change model a popup occurs to alert user that the parameters are different to copied model so not all will copy across. This now includes if model stays the same but structure factor is changed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    rfc9d9a3 r21fa45b  
    34753475        param_list.append(['model_name', str(self.cbModel.currentText())]) 
    34763476 
     3477        try: 
     3478            param_list.append(['structure_factor', str(self.cbStructureFactor.currentText())]) 
     3479        except: 
     3480            pass 
     3481 
    34773482        def gatherParams(row): 
    34783483            """ 
     
    34803485            """ 
    34813486            param_name = str(self._model_model.item(row, 0).text()) 
    3482             param_checked = str(self._model_model.item(row, 0).checkState() == QtCore.Qt.Checked) 
    3483             param_value = str(self._model_model.item(row, 1).text()) 
    3484             param_error = None 
    3485             param_min = None 
    3486             param_max = None 
    3487             column_offset = 0 
    3488             if self.has_error_column: 
    3489                 param_error = str(self._model_model.item(row, 2).text()) 
    3490                 column_offset = 1 
    3491  
    3492             try: 
    3493                 param_min = str(self._model_model.item(row, 2+column_offset).text()) 
    3494                 param_max = str(self._model_model.item(row, 3+column_offset).text()) 
    3495             except: 
    3496                 pass 
    34973487 
    34983488            if param_name == str(self.cbModel.currentText()): 
     
    35013491                pass 
    35023492            else: 
     3493                param_checked = str(self._model_model.item(row, 0).checkState() == QtCore.Qt.Checked) 
     3494                param_value = str(self._model_model.item(row, 1).text()) 
     3495                param_error = None 
     3496                param_min = None 
     3497                param_max = None 
     3498                column_offset = 0 
     3499                if self.has_error_column: 
     3500                    param_error = str(self._model_model.item(row, 2).text()) 
     3501                    column_offset = 1 
     3502 
     3503                try: 
     3504                    param_min = str(self._model_model.item(row, 2 + column_offset).text()) 
     3505                    param_max = str(self._model_model.item(row, 3 + column_offset).text()) 
     3506                except: 
     3507                    pass 
     3508 
    35033509                param_list.append([param_name, param_checked, param_value, param_error, param_min, param_max]) 
    35043510 
     
    35503556            formatted_output = FittingUtilities.formatParameters(param_list) 
    35513557        elif format == "Excel": 
    3552             formatted_output = FittingUtilities.formatParametersExcel(param_list[1:]) 
     3558            formatted_output = FittingUtilities.formatParametersExcel(param_list[2:]) 
    35533559        elif format == "Latex": 
    3554             formatted_output = FittingUtilities.formatParametersLatex(param_list[1:]) 
     3560            formatted_output = FittingUtilities.formatParametersLatex(param_list[2:]) 
    35553561        else: 
    35563562            raise AttributeError("Bad format specifier.") 
     
    35753581 
    35763582        model = lines[1].split(',') 
    3577         print(model) 
    35783583 
    35793584        if model[0] != 'model_name': 
    35803585            return False 
    35813586 
     3587        StrucFac = lines[2].split(',') 
     3588 
     3589        if StrucFac[0] != 'structure_factor': 
     3590            return False 
     3591 
    35823592        context['model_name'] = [model[1]] 
    3583  
    3584         for line in lines[2:-1]: 
     3593        context['structure_factor'] = [StrucFac[1]] 
     3594 
     3595        for line in lines[3:-1]: 
    35853596            if len(line) != 0: 
    35863597                item = line.split(',') 
     
    36123623                        pass 
    36133624 
    3614         if str(self.cbModel.currentText()) != str(context['model_name'][0]): 
     3625        if str(self.cbModel.currentText()) != str(context['model_name'][0]) or \ 
     3626                str(self.cbStructureFactor.currentText()) != str(context['structure_factor'][0]): 
    36153627            msg = QtWidgets.QMessageBox() 
    36163628            msg.setIcon(QtWidgets.QMessageBox.Information) 
Note: See TracChangeset for help on using the changeset viewer.