Ignore:
Timestamp:
Nov 23, 2018 6:48:03 AM (5 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
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:
9c05f22
Parents:
72651df
Message:

Added polydisp. and magnetic parameters to the Report Result page.
SASVIEW-1190

File:
1 edited

Legend:

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

    r7f41584 r9817207  
    673673        unit = "" 
    674674        if model.item(row, 4+column_shift) is not None: 
    675             unit = model.item(row, 4+column_shift).text() 
    676  
     675            u = model.item(row, 4+column_shift).text() 
     676            # This isn't a unit if it is a number (polyd./magn.) 
     677            unit = "" if isNumber(u) else u 
    677678        param.append([checkbox_state, param_name, value, "", 
    678                         [error_state, error_value], 
    679                         [min_state, min_value], 
    680                         [max_state, max_value], unit]) 
     679                     [error_state, error_value], 
     680                     [min_state, min_value], 
     681                     [max_state, max_value], unit]) 
    681682 
    682683    return param 
     684 
     685def isNumber(s): 
     686    """ 
     687    Checks if string 's' is an int/float 
     688    """ 
     689    if s.isdigit(): 
     690        # check int 
     691        return True 
     692    else: 
     693        try: 
     694            # check float 
     695            _ = float(s) 
     696        except ValueError: 
     697            return False 
     698    return True 
    683699 
    684700def getOrientationParam(kernel_module=None): 
Note: See TracChangeset for help on using the changeset viewer.