Changeset 13dd7d2 in sasview for src/sas


Ignore:
Timestamp:
Sep 9, 2018 6:46:30 AM (6 years ago)
Author:
piotr
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:
f3cc979
Parents:
daf7c9c
git-author:
rozyczko <piotr.rozyczko@…> (09/09/18 06:44:20)
git-committer:
rozyczko <piotr.rozyczko@…> (09/09/18 06:46:30)
Message:

Improved multishell control. Added min/max to row display, used
parameter values for min/max. SASVIEW-1057

File:
1 edited

Legend:

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

    rdaf7c9c r13dd7d2  
    27962796 
    27972797        func = QtWidgets.QComboBox() 
    2798         # Available range of shells displayed in the combobox 
    2799         func.addItems([str(i) for i in range(param_length+1)]) 
    2800  
    2801         # Respond to index change 
    2802         func.currentIndexChanged.connect(self.modifyShellsInList) 
    28032798 
    28042799        # cell 2: combobox 
    28052800        item2 = QtGui.QStandardItem() 
    2806         self._model_model.appendRow([item1, item2]) 
     2801 
     2802        # cell 3: min value 
     2803        item3 = QtGui.QStandardItem() 
     2804 
     2805        # cell 4: max value 
     2806        item4 = QtGui.QStandardItem() 
     2807 
     2808        self._model_model.appendRow([item1, item2, item3, item4]) 
    28072809 
    28082810        # Beautify the row:  span columns 2-4 
     
    28232825            logger.error("Could not find %s in kernel parameters.", param_name) 
    28242826        default_shell_count = shell_par.default 
     2827        shell_min = 0 
     2828        shell_max = 0 
     2829        try: 
     2830            shell_min = int(shell_par.limits[0]) 
     2831            shell_max = int(shell_par.limits[1]) 
     2832        except IndexError as ex: 
     2833            # no info about limits 
     2834            pass 
     2835        item3.setText(str(shell_min)) 
     2836        item4.setText(str(shell_max)) 
     2837 
     2838        # Respond to index change 
     2839        func.currentTextChanged.connect(self.modifyShellsInList) 
     2840 
     2841        # Available range of shells displayed in the combobox 
     2842        func.addItems([str(i) for i in range(shell_min, shell_max+1)]) 
    28252843 
    28262844        # Add default number of shells to the model 
    2827         func.setCurrentIndex(default_shell_count) 
    2828  
    2829     def modifyShellsInList(self, index): 
     2845        func.setCurrentText(str(default_shell_count)) 
     2846 
     2847    def modifyShellsInList(self, text): 
    28302848        """ 
    28312849        Add/remove additional multishell parameters 
     
    28342852        first_row = self._n_shells_row + 1 
    28352853        remove_rows = self._num_shell_params 
     2854        try: 
     2855            index = int(text) 
     2856        except ValueError: 
     2857            # bad text on the control! 
     2858            index = 0 
     2859            logger.error("Multiplicity incorrect! Setting to 0") 
    28362860 
    28372861        if remove_rows > 1: 
Note: See TracChangeset for help on using the changeset viewer.