Exemplo n.º 1
0
 def _read_cord2c(self, data, n):
     """
     (2001,20,9) - the marker for Record 4
     """
     s = Struct(self._endian + b'4i9f')
     nentries = (len(data) - n) // 52
     for i in range(nentries):
         edata = data[n:n + 52]  # 13*4
         out = s.unpack(edata)
         (cid, two1, two2, rid, a1, a2, a3, b1, b2, b3, c1, c2, c3) = out
         assert two1 == 2, two1
         assert two2 == 2, two2
         data_in = [cid, rid, a1, a2, a3, b1, b2, b3, c1, c2, c3]
         coord = CORD2C.add_op2_data(data_in)
         if self.is_debug_file:
             self.binary_debug.write('  CORD2C=%s\n' % str(out))
         self._add_coord_object(coord, allow_overwrites=True)
         n += 52
     self.increase_card_count('CORD2C', nentries)
     return n
Exemplo n.º 2
0
 def _read_cord2c(self, data, n):
     """
     (2001,20,9) - the marker for Record 4
     """
     s = Struct(b(self._endian + '4i9f'))
     nentries = (len(data) - n) // 52
     for i in range(nentries):
         edata = data[n:n + 52]  # 13*4
         out = s.unpack(edata)
         (cid, two1, two2, rid, a1, a2, a3, b1, b2, b3, c1, c2, c3) = out
         assert two1 == 2, two1
         assert two2 == 2, two2
         data_in = [cid, rid, a1, a2, a3, b1, b2, b3, c1, c2, c3]
         coord = CORD2C.add_op2_data(data_in)
         if self.is_debug_file:
             self.binary_debug.write('  CORD2C=%s\n' % str(out))
         self.add_coord(coord, allow_overwrites=True)
         n += 52
     self._increase_card_count('CORD2C', nentries)
     return n
Exemplo n.º 3
0
 def _read_cord2c(self, data, n):
     """
     (2001,20,9) - the marker for Record 4
     """
     ntotal = 52 * self.factor # 13*4
     s = Struct(mapfmt(self._endian + b'4i9f', self.size))
     nentries = (len(data) - n) // ntotal
     for unused_i in range(nentries):
         edata = data[n:n + ntotal]
         out = s.unpack(edata)
         (cid, two1, two2, rid, a1, a2, a3, b1, b2, b3, c1, c2, c3) = out
         assert two1 == 2, two1
         assert two2 == 2, two2
         data_in = [cid, rid, a1, a2, a3, b1, b2, b3, c1, c2, c3]
         coord = CORD2C.add_op2_data(data_in)
         if self.is_debug_file:
             self.binary_debug.write('  CORD2C=%s\n' % str(out))
         self._add_coord_object(coord, allow_overwrites=False)
         n += ntotal
     self.increase_card_count('CORD2C', nentries)
     return n