def __init__(self, bytes): if bytes: self.instNr = b2i(bytes[0:2]) self.depNr = b2i(bytes[2:4]) self.devId = b2i(bytes[4:4]) self.devType = b2i(bytes[6:6]) self.model = bdecode(bytes[9:14])
def __init__(self, bytes): self._print = False if bytes: # in minutes self.offset = b2i(bytes[0:2]) self.index = b2i(bytes[2:4]) self.desc = bdecode(bytes[4:]) self._print = True
def __init__(self, bytes): self.value = '' if bytes and len(bytes) > 2: # H:m:s h = b2i(bytes[0:1]) m = b2i(bytes[1:2]) s = b2i(bytes[2:3]) self.value = '{0}:{1}:{2}'.format( str(h).zfill(2), str(m).zfill(2), str(s).zfill(2))
def __init__(self, bytes): self.lookup = { 0: 'Unspecified', 1: 'cm', 2: 'inch', 3: 'mm' } self.text = '' if bytes: height = b2i(bytes[0:1]) unit = b2i(bytes[2:3]) self.text = '{0} {1}'.format(height, self.lookup[unit])
def __init__(self, bytes): self.lookup = { 0: 'Unspecified', 1: 'kg', 2: 'g', 3: 'Pound', 4: 'Ounce' } self.text = '' if bytes: weight = b2i(bytes[0:1]) unit = b2i(bytes[2:3]) self.text = '{0} {1}'.format(weight, self.lookup[unit])
def __init__(self, bytes): self.lookup = { 0: 'Unspecified', 1: 'Caucasian', 2: 'Black', 3: 'Oriental' } # 1 byte if bytes: value = b2i(bytes) self.text = self.lookup[value] else: self.text = ''
def __init__(self, bytes): self.lookup = { 0: 'Not Known', 1: 'Male', 2: 'Female', 9: 'Unspecified' } self.text = '' if bytes: key = b2i(bytes) if key in self.lookup: self.text = self.lookup[key] else: self.text = key
def __init__(self, bytes): self.value = '' self.lookup = { 0: '60Hz notch filter', 1: '50Hz notch filter', 2: 'Artifact filter', 3: 'Basefilter filter' } if bytes: v = b2i(bytes) if v in self.lookup: self.value = self.lookup[v] else: self.value = v
def __init__(self, bytes): if bytes and len(bytes) > 2: self.text = '{0}/{1}/{2}'.format( b2i(bytes[0:2]), b2i(bytes[2:3]), b2i(bytes[3:4])) else: self.text = ''
def __init__(self, bytes): self.value = '' if bytes and len(bytes) > 3: # y/m/d self.value = '{0}/{1}/{2}'.format( b2i(bytes[0:2]), b2i(bytes[2:3]), b2i(bytes[3:4]))
def __init__(self, bytes): self.value = '' if bytes and len(bytes) > 2: self.value = b2i(bytes[0:2])
def __init__(self, bytes): self._print = False if bytes and len(bytes) > 1: self.value1 = b2i(bytes[0:1]) self.value2 = b2i(bytes[1:2]) self._print = True
def format_tag_int(self, tag, start, end): for _tag in self.tags: if _tag.tag == tag: return b2i(_tag.data[start:end]) return ''