示例#1
0
 def _read_cord1r(self, data, n):
     """
     (1801,18,5) - the marker for Record 2
     """
     struct_6i = Struct(self._endian + b'6i')
     nentries = (len(data) - n) // 24
     for i in range(nentries):
         edata = data[n:n + 24]  # 6*4
         out = struct_6i.unpack(edata)
         (cid, one1, one2, g1, g2, g3) = out
         if self.is_debug_file:
             self.binary_debug.write('  CORD1R=%s\n' % str(out))
         assert one1 == 1, one1
         assert one2 == 1, one2
         data_in = [cid, g1, g2, g3]
         coord = CORD1R.add_op2_data(data_in)
         self._add_coord_object(coord)
         n += 24
     self.increase_card_count('CORD1R', nentries)
     return n
示例#2
0
 def _read_cord1r(self, data, n):
     """
     (1801,18,5) - the marker for Record 2
     """
     s = Struct(b(self._endian + '6i'))
     nentries = (len(data) - n) // 24
     for i in range(nentries):
         edata = data[n:n + 24]  # 6*4
         out = s.unpack(edata)
         (cid, one1, one2, g1, g2, g3) = out
         if self.is_debug_file:
             self.binary_debug.write('  CORD1R=%s\n' % str(out))
         assert one1 == 1, one1
         assert one2 == 1, one2
         data_in = [cid, g1, g2, g3]
         coord = CORD1R.add_op2_data(data_in)
         self.add_coord(coord)
         n += 24
     self._increase_card_count('CORD1R', nentries)
     return n
示例#3
0
 def _read_cord1r(self, data, n):
     """
     (1801,18,5) - the marker for Record 2
     """
     ntotal = 24 * self.factor  # 6*4
     struct_6i = Struct(mapfmt(self._endian + b'6i', self.size))
     nentries = (len(data) - n) // ntotal
     for unused_i in range(nentries):
         edata = data[n:n + ntotal]
         out = struct_6i.unpack(edata)
         (cid, one1, one2, g1, g2, g3) = out
         if self.is_debug_file:
             self.binary_debug.write('  CORD1R=%s\n' % str(out))
         assert one1 == 1, one1
         assert one2 == 1, one2
         data_in = [cid, g1, g2, g3]
         coord = CORD1R.add_op2_data(data_in)
         self._add_coord_object(coord)
         n += ntotal
     self.increase_card_count('CORD1R', nentries)
     return n