| 91 | |
| 92 | |
| 93 | void MbReader::ready(PointTableRef table) |
| 94 | { |
| 95 | int verbose = 0; |
| 96 | int pings = 0; // Perhaps an argument for this? |
| 97 | int lonflip = 0; // Longitude -180 -> 180 |
| 98 | double bounds[4] { -180, 180, -90, 90 }; |
| 99 | int btime_i[7] { 0, 0, 0, 0, 0, 0, 0 }; |
| 100 | int etime_i[7] { (std::numeric_limits<int>::max)(), 0, 0, 0, 0, 0 }; |
| 101 | char *mbio_ptr; |
| 102 | double btime_d; |
| 103 | double etime_d; |
| 104 | int beams_bath; |
| 105 | int beams_amp; |
| 106 | int pixels_ss; |
| 107 | int error; |
| 108 | |
| 109 | mb_read_init(verbose, const_cast<char *>(m_filename.data()), |
| 110 | (int)m_format, pings, lonflip, bounds, btime_i, etime_i, |
| 111 | m_speedmin, m_timegap, &m_ctx, &btime_d, &etime_d, |
| 112 | &beams_bath, &beams_amp, &pixels_ss, &error); |
| 113 | if (error > 0) |
| 114 | throwError("Can't initialize mb-system reader: " + |
| 115 | MbError::text(error)); |
| 116 | |
| 117 | mb_register_array(verbose, m_ctx, 1, sizeof(double), |
| 118 | (void **)&m_bath, &error); |
| 119 | mb_register_array(verbose, m_ctx, 1, sizeof(double), |
| 120 | (void **)&m_bathlon, &error); |
| 121 | mb_register_array(verbose, m_ctx, 1, sizeof(double), |
| 122 | (void **)&m_bathlat, &error); |
| 123 | mb_register_array(verbose, m_ctx, 1, sizeof(char), |
| 124 | (void **)&m_bathflag, &error); |
| 125 | mb_register_array(verbose, m_ctx, 2, sizeof(double), |
| 126 | (void **)&m_amp, &error); |
| 127 | mb_register_array(verbose, m_ctx, 3, sizeof(double), |
| 128 | (void **)&m_ss, &error); |
| 129 | mb_register_array(verbose, m_ctx, 3, sizeof(double), |
| 130 | (void **)&m_sslon, &error); |
| 131 | mb_register_array(verbose, m_ctx, 3, sizeof(double), |
| 132 | (void **)&m_sslat, &error); |
| 133 | } |
| 134 | |
| 135 | namespace |
| 136 | { |