Esempio n. 1
0
 def _read_seqgp(self, data, n):
     """(5301,53,4) - the marker for Record 27"""
     struct_2i = Struct(self._endian + b'2i')
     nentries = (len(data) - n) // 8
     for i in range(nentries):
         edata = data[n:n + 8]  # 2*4
         out = struct_2i.unpack(edata)
         # (nid, seid) = out
         if self.is_debug_file:
             self.binary_debug.write('  SEQGP=%s\n' % str(out))
         seqgp = SEQGP.add_op2_data(out)
         self._add_seqgp_object(seqgp)
         n += 8
     self.increase_card_count('SEQGP', nentries)
     return n
Esempio n. 2
0
 def _read_seqgp(self, data: bytes, n: int) -> int:
     """(5301,53,4) - the marker for Record 27"""
     ntotal = 8 * self.factor
     struct_2i = Struct(self._endian + b'2i')
     nentries = (len(data) - n) // ntotal
     for unused_i in range(nentries):
         edata = data[n:n + ntotal]  # 2*4
         out = struct_2i.unpack(edata)
         # (nid, seid) = out
         if self.is_debug_file:
             self.binary_debug.write('  SEQGP=%s\n' % str(out))
         seqgp = SEQGP.add_op2_data(out)
         self._add_seqgp_object(seqgp)
         n += ntotal
     self.increase_card_count('SEQGP', nentries)
     return n