示例#1
0
    def __setBitTypeLLL(self, bit, value):
        value = "%s" % value

        if len(value) > 999:
            raise ValueToLarge(
                'Error: value up to size! Bit[%s] of type %s limit size = %s' %
                (bit, self.getBitType(bit), self.getBitLimit(bit)))
        if len(value) > self.getBitLimit(bit):
            raise ValueToLarge(
                'Error: value up to size! Bit[%s] of type %s limit size = %s' %
                (bit, self.getBitType(bit), self.getBitLimit(bit)))

        size = "%s" % len(value)

        self.BITMAP_VALUES[bit] = "%s%s" % (size.zfill(3), value)
示例#2
0
 def __setIsoContent(self, iso):
     self.BITMAP_VALUES = {}
     offset = 0
     while len(iso) > offset:
         t, l, v, offset = self.__getSubBitVlaue(iso, offset)
         if self.getBitType(t) == 'LL':
             if int(l) > self.getBitLimit(t):
                 raise ValueToLarge(
                     "This bit is larger than the especification!")
             self.BITMAP_VALUES[t] = v[2::]
         if self.getBitType(t) == 'LLL':
             if int(l) > self.getBitLimit(t):
                 raise ValueToLarge(
                     "This bit is larger than the especification!")
             self.BITMAP_VALUES[t] = v[3::]
         if self.getBitType(t) == 'N' or self.getBitType(
                 t) == 'A' or self.getBitType(
                     t) == 'ANS' or self.getBitType(
                         t) == 'B' or self.getBitType(t) == 'AN':
             self.BITMAP_VALUES[t] = v