예제 #1
0
def idForm2Val_Split(id):
    '''
    Convert Form ID to value
    '''
    out = 0

    if id == 1:
        out = "yes"
    elif id == 2:
        out = "no"
    else:
        pError("(idForm2Val_Split)  Wrong id value: {0} !! ".format(id))
        out = 0
    return (out)
예제 #2
0
def val2IdForm_Baud(val):
    '''
    Convert value to Form ID
    '''
    out = 0

    if val == "n":
        out = 1
    elif val == "f":
        out = 2
    else:
        pError("(val2IdForm_Baud)  Wrong value: {0} !! ".format(val))
        out = 0
    return (out)
예제 #3
0
def idForm2Val_Baud(id):
    '''
    Convert Form ID to value
    '''
    out = 0

    if id == 1:
        out = "n"
    elif id == 2:
        out = "f"
    else:
        pError("(idForm2Val_Baud)  Wrong id value: {0} !! ".format(id))
        out = 0
    return (out)
예제 #4
0
def val2IdForm_Split(val):
    '''
    Convert value to Form ID
    '''
    out = 0

    if val == "Yes":
        out = 1
    elif val == "y":
        out = 1
    elif val == "no":
        out = 2
    elif val == ",":
        out = 2
    else:
        pError("(val2IdForm_Split)  Wrong value: {0} !! ".format(val))
        out = 0
    return (out)
예제 #5
0
def val2IdForm_Frequence(val):
    '''
    Convert value to Form ID
    '''
    out = 0

    if val == 4:
        out = 1
    elif val == 8:
        out = 2
    elif val == 11:
        out = 3
    elif val == 44:
        out = 4
    else:
        pError("(val2IdForm_Frequence)  Wrong value: {0} !! ".format(val))
        out = 0
    return (out)
예제 #6
0
def idForm2Val_Frequence(id):
    '''
    Convert Form ID to value
    '''
    out = 0

    if id == 1:
        out = 4
    elif id == 2:
        out = 8
    elif id == 3:
        out = 11
    elif id == 4:
        out = 44
    else:
        pError("(idForm2Val_Frequence)  Wrong id value: {0} !! ".format(id))
        out = 0
    return (out)