Exemple #1
0
def printStoredParameters():
    """    --------------------------------------------------------------------------------------------------------
     routine:  printStoredParameters
     
     purpose: print the values of the current dsgrid control parameters in c code. The call
                   to the method function rgrd will change them to the instance values.
     
     usage:    import sh
               sh.printStoredParameters() 
     
     passed:   nothing 
     
     returned: None
     
     definition: printStoredParameters():
--------------------------------------------------------------------------------------------------------"""

    names = ['ncl', 'nfl', 'nls']

    typeDict = {
        'dmv': 'float',
        'dmx': 'float',
        'erf': 'char',
        'exp': 'float',
        'shd': 'int'
    }

    for item in names:
        print '   %s = %d' % (item, shgridmodule.shgeti(item))

    return None
Exemple #2
0
def printStoredParameters():
    """    --------------------------------------------------------------------------------------------------------
     routine:  printStoredParameters
     
     purpose: print the values of the current dsgrid control parameters in c code. The call
                   to the method function rgrd will change them to the instance values.
     
     usage:    import sh
               sh.printStoredParameters() 
     
     passed:   nothing 
     
     returned: None
     
     definition: printStoredParameters():
--------------------------------------------------------------------------------------------------------""" 

    names = ['ncl', 'nfl', 'nls']

    typeDict = { 'dmv':'float', 'dmx':'float', 'erf':'char', 'exp':'float', 'shd':'int' }

    for item in names:
        print '   %s = %d' % (item, shgridmodule.shgeti(item))

    return None      
Exemple #3
0
    def __getattr__(self, name):
        #---------------------------------------------------------------------------------
        #
        #   purpose:  '__getattr__' is called only if a referenced attribute can not be found
        #             in the instance. It gets the attribute from shgridmodule if possible.
        #
        #   usage:    x.name  -- name is the oject and not a string repr
        #
        #   passed :  name
        #
        #   returned: x.name
        #
        #---------------------------------------------------------------------------------

        names = Shgrid.parameterNames(self)
        names = names[2:]

        if name in names:
            value = shgridmodule.shgeti(name)

        else:
            value = self.__dict__[name]

        return value
Exemple #4
0
    def __getattr__(self, name):
        #---------------------------------------------------------------------------------
        #
        #   purpose:  '__getattr__' is called only if a referenced attribute can not be found
        #             in the instance. It gets the attribute from shgridmodule if possible.
        #
        #   usage:    x.name  -- name is the oject and not a string repr   
        #
        #   passed :  name 
        #
        #   returned: x.name 
        #
        #---------------------------------------------------------------------------------

        names = Shgrid.parameterNames(self)
        names = names[2:]

        if name in names:
            value = shgridmodule.shgeti(name)

        else:
            value = self.__dict__[name]

        return value