from Ft.Ods import Enumeration

TYPEID=-103

class DirectionElement(Enumeration.EnumElement):
    nameMapping={0:'mode_in',
                 1:'mode_out',
                 2:'mode_inout',
                 }
    def __init__(self,db,value):
        if value == None: value = 0
        if type(value) == type(()):
            value = value[0]
        Enumeration.EnumElement.__init__(self,db,self.nameMapping[value],value,'Direction',TYPEID)




mode_in = DirectionElement(None,0)
mode_out = DirectionElement(None,1)
mode_inout = DirectionElement(None,2)


class DirectionEnum(Enumeration.Enumeration):
    def __init__(self):
        Enumeration.Enumeration.__init__(self,
                                         "Direction",
                                         TYPEID,
                                         [mode_in,
                                          mode_out,
                                          mode_inout,
                                          ])


Direction = DirectionEnum()



