Beispiel #1
0
 def _read_point(self, data, n):
     """
     POINT(6001,60,377)
     """
     s = Struct(self._endian + b'2i3f')
     nentries = (len(data) - n) // 20
     for i in range(nentries):
         edata = data[n:n + 20]  # 5*4
         out = s.unpack(edata)
         # (nid, cid, x1, x2, x3) = out
         if self.is_debug_file:
             self.binary_debug.write('  POINT=%s\n' % str(out))
         point = POINT.add_op2_data(out)
         self._add_point_object(point)
         n += 20
     self.increase_card_count('POINT', nentries)
     return n
Beispiel #2
0
 def _read_point(self, data: bytes, n: int) -> int:
     """
     POINT(6001,60,377)
     """
     s = Struct(self._endian + b'2i3f')
     ntotal = 20 * self.factor
     nentries = (len(data) - n) // ntotal
     for unused_i in range(nentries):
         edata = data[n:n + ntotal]  # 5*4
         out = s.unpack(edata)
         # (nid, cid, x1, x2, x3) = out
         if self.is_debug_file:
             self.binary_debug.write('  POINT=%s\n' % str(out))
         point = POINT.add_op2_data(out)
         self._add_point_object(point)
         n += ntotal
     self.increase_card_count('POINT', nentries)
     return n