| 222 | } // namespace |
| 223 | |
| 224 | bool MbReader::loadData() |
| 225 | { |
| 226 | int verbose = 0; |
| 227 | int kind; |
| 228 | int pings; |
| 229 | int pingTime[7]; |
| 230 | double pingTimeT; |
| 231 | double lon; |
| 232 | double lat; |
| 233 | double speed; |
| 234 | double heading; |
| 235 | double distance; |
| 236 | double altitude; |
| 237 | double sonarDepth; |
| 238 | int numBath; |
| 239 | int numAmp; |
| 240 | int numSs; |
| 241 | char comment[MB_COMMENT_MAXLINE]; |
| 242 | int error; |
| 243 | |
| 244 | while (true) |
| 245 | { |
| 246 | int status = mb_read(verbose, m_ctx, &kind, &pings, pingTime, |
| 247 | &pingTimeT, &lon, &lat, &speed, &heading, &distance, &altitude, |
| 248 | &sonarDepth, &numBath, &numAmp, &numSs, m_bathflag, m_bath, |
| 249 | m_amp, m_bathlon, m_bathlat, m_ss, m_sslon, m_sslat, comment, |
| 250 | &error); |
| 251 | |
| 252 | double gpsTime = timeconvert(pingTime); |
| 253 | |
| 254 | if (status == 0) |
| 255 | { |
| 256 | if (error > 0 && error != MB_ERROR_EOF) |
| 257 | throwError("Error reading data: " + MbError::text(error)); |
| 258 | return false; |
| 259 | } |
| 260 | |
| 261 | if (kind == 1) |
| 262 | { |
| 263 | bool ok(false); |
| 264 | if (m_dataType == DataType::Multibeam) |
| 265 | ok = extractMultibeam(numBath, numAmp, gpsTime); |
| 266 | else |
| 267 | ok = extractSidescan(numSs, gpsTime); |
| 268 | if (ok) |
| 269 | break; |
| 270 | } |
| 271 | } |
| 272 | return true; |
| 273 | } |
| 274 | |
| 275 | |
| 276 | bool MbReader::extractMultibeam(int numBath, int numAmp, double gpsTime) |
nothing calls this directly
no test coverage detected