Beispiel #1
0
    def __init__(self, type, uid, locale):
        '''
        @param type:   String type of the Id
        @param uid:    Unique integer identifier for the Id
        @param locale: Locale layout object used to decode used to decode uid
        '''
        Id.__init__(self)
        Schedule.__init__(self)
        self.type = type
        self.uid = uid
        self.locale = locale
        self.locale_type = self.type_locale[self.type]

        # Set secondary type
        self.second_type = self.secondary_types[self.type]

        # Set kll type
        self.kll_type = self.kll_types[self.type]

        # Determine hex_str padding
        self.padding = 2
        if self.type == 'ConsCode':
            self.padding = 3

        # Validate uid is in locale based on what type of HID field it is
        if self.hex_str() not in self.locale.json()[self.locale_type].keys():
            print("{} Unknown HID({}) UID('{}') in locale '{}'".format(
                WARNING, self.type, self.uid, self.locale.name()))
Beispiel #2
0
    def __init__(self, type, uid, locale):
        '''
        @param type:   String type of the Id
        @param uid:    Unique integer identifier for the Id
        @param locale: Locale layout object used to decode used to decode uid
        '''
        Id.__init__(self)
        Schedule.__init__(self)
        self.type = type
        self.uid = uid
        self.locale = locale
        self.locale_type = self.type_locale[self.type]

        # Set secondary type
        self.second_type = self.secondary_types[self.type]

        # Set kll type
        self.kll_type = self.kll_types[self.type]

        # Determine hex_str padding
        self.padding = 2
        if self.type == 'ConsCode':
            self.padding = 3

        # Validate uid is in locale based on what type of HID field it is
        if self.hex_str() not in self.locale.json()[self.locale_type].keys():
            print("{} Unknown HID({}) UID('{}') in locale '{}'".format(
                WARNING,
                self.type,
                self.uid,
                self.locale.name()
            ))
Beispiel #3
0
 def __init__(self, name, state=None):
     Id.__init__(self)
     Schedule.__init__(self)
     AnimationModifierList.__init__(self)
     self.name = name
     self.type = 'Animation'
     self.second_type = 'A'
     self.state = state
Beispiel #4
0
 def __init__(self, name, state=None):
     Id.__init__(self)
     Schedule.__init__(self)
     AnimationModifierList.__init__(self)
     self.name = name
     self.type = 'Animation'
     self.second_type = 'A'
     self.state = state
Beispiel #5
0
    def __init__(self, uid):
        Id.__init__(self)
        Schedule.__init__(self)
        Position.__init__(self)
        self.type = 'ScanCode'
        self.uid = uid

        # This uid is used for any post-processing of the uid
        # The original uid is maintained in case it is needed
        self.updated_uid = None
Beispiel #6
0
    def __init__(self, uid):
        Id.__init__(self)
        Schedule.__init__(self)
        Position.__init__(self)
        self.type = 'ScanCode'
        self.uid = uid

        # This uid is used for any post-processing of the uid
        # The original uid is maintained in case it is needed
        self.updated_uid = None
Beispiel #7
0
    def __init__(self, ustr):
        '''
        @param ustr: UTF-8 string
        '''
        Id.__init__(self)
        Schedule.__init__(self)

        # Select the type based on the length of the UTF-8 string
        if len(ustr) == 1:
            # Single character
            self.type = 'UTF8State'
        else:
            self.type = 'UTF8Text'
        self.uid = ustr
Beispiel #8
0
 def __init__(self, idcode, uid):
     Id.__init__(self)
     Schedule.__init__(self)
     self.type = 'GenericTrigger'
     self.uid = uid
     self.idcode = idcode
Beispiel #9
0
 def __init__(self, type, layer):
     Id.__init__(self)
     Schedule.__init__(self)
     self.type = type
     self.uid = layer
Beispiel #10
0
 def __init__(self, idcode, uid):
     Id.__init__(self)
     Schedule.__init__(self)
     self.type = 'GenericTrigger'
     self.uid = uid
     self.idcode = idcode
Beispiel #11
0
 def __init__(self, type, layer):
     Id.__init__(self)
     Schedule.__init__(self)
     self.type = type
     self.uid = layer