NemoInterface.cpp 18.3 KB
Newer Older
1
#include "NemoInterface.h"
2
#include "nemo_interface/SnakeTilesLocal.h"
3 4 5 6 7 8 9 10 11 12 13 14

#include "QGCApplication.h"
#include "QGCLoggingCategory.h"
#include "QGCToolbox.h"
#include "SettingsFact.h"
#include "SettingsManager.h"
#include "WimaSettings.h"

#include <shared_mutex>

#include <QTimer>

15
#include "GenericSingelton.h"
16
#include "geometry/MeasurementArea.h"
17
#include "geometry/geometry.h"
18
#include "nemo_interface/MeasurementTile.h"
19 20
#include "nemo_interface/QNemoHeartbeat.h"
#include "nemo_interface/QNemoProgress.h"
21 22 23 24 25 26 27 28 29 30 31 32 33

#include "ros_bridge/include/messages/geographic_msgs/geopoint.h"
#include "ros_bridge/include/messages/jsk_recognition_msgs/polygon_array.h"
#include "ros_bridge/include/messages/nemo_msgs/heartbeat.h"
#include "ros_bridge/include/messages/nemo_msgs/progress.h"
#include "ros_bridge/include/ros_bridge.h"
#include "ros_bridge/rapidjson/include/rapidjson/document.h"
#include "ros_bridge/rapidjson/include/rapidjson/ostreamwrapper.h"
#include "ros_bridge/rapidjson/include/rapidjson/writer.h"

QGC_LOGGING_CATEGORY(NemoInterfaceLog, "NemoInterfaceLog")

#define EVENT_TIMER_INTERVAL 100 // ms
34
auto constexpr static timeoutInterval = std::chrono::milliseconds(3000);
35 36 37 38 39 40 41 42 43

using ROSBridgePtr = std::unique_ptr<ros_bridge::ROSBridge>;
using JsonDocUPtr = ros_bridge::com_private::JsonDocUPtr;
using UniqueLock = std::unique_lock<std::shared_timed_mutex>;
using SharedLock = std::shared_lock<std::shared_timed_mutex>;
using JsonDocUPtr = ros_bridge::com_private::JsonDocUPtr;

class NemoInterface::Impl {
public:
Valentin Platzgummer's avatar
Valentin Platzgummer committed
44 45 46 47 48 49 50 51 52 53 54 55
  enum class STATE {
    STOPPED,
    RUNNING,
    WEBSOCKET_DETECTED,
    HEARTBEAT_DETECTED,
    TRY_TOPIC_SERVICE_SETUP,
    READY,
    SYNCHRONIZING,
    TIMEOUT,
    INVALID_HEARTBEAT
  }

56 57 58 59 60
  Impl(NemoInterface *p);

  void start();
  void stop();

Valentin Platzgummer's avatar
Valentin Platzgummer committed
61 62
  // Tile editing.
  // 	Functions that require communication to device.
63 64 65 66
  void addTiles(const TilePtrArray &tileArray);
  void addTiles(const TileArray &tileArray);
  void removeTiles(const IDArray &idArray);
  void clearTiles();
Valentin Platzgummer's avatar
Valentin Platzgummer committed
67 68

  // 	Functions that don't require communication to device.
69 70 71 72 73
  TileArray getTiles(const IDArray &idArray);
  TileArray getAllTiles();
  LogicalArray containsTiles(const IDArray &idArray);
  std::size_t size();
  bool empty();
Valentin Platzgummer's avatar
Valentin Platzgummer committed
74 75 76 77

  // Progress.
  ProgressArray getProgress();
  ProgressArray getProgress(const IDArray &idArray);
78 79 80 81 82

  NemoInterface::STATUS status();
  bool running();

private:
Valentin Platzgummer's avatar
Valentin Platzgummer committed
83 84 85 86 87 88 89 90
  typedef std::chrono::time_point<std::chrono::high_resolution_clock> TimePoint;
  typedef std::map<long, MeasurementTile> TileMap;
  typedef ros_bridge::messages::nemo_msgs::heartbeat::Heartbeat Heartbeat;

  void _addTiles(const TileArray &tileArray);
  void _removeTiles(const IDArray &idArray);
  void _clearTiles();

91 92
  void doTopicServiceSetup();
  void loop();
93

Valentin Platzgummer's avatar
Valentin Platzgummer committed
94 95 96 97
  bool _setState(STATE s);
  static bool _running(STATE s);
  static void _translate(STATE state, NemoInterface::STATUS &status);
  static void _translate(Heartbeat hb, STATE &state);
98 99 100

  TimePoint nextTimeout;
  mutable std::shared_timed_mutex timeoutMutex;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
101 102 103 104 105

  STATE _state;
  ROSBridgePtr _pRosBridge;
  TileMap _tileMap;
  NemoInterface *_parent;
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
};

using StatusMap = std::map<NemoInterface::STATUS, QString>;
static StatusMap statusMap{
    std::make_pair<NemoInterface::STATUS, QString>(
        NemoInterface::STATUS::NOT_CONNECTED, "Not Connected"),
    std::make_pair<NemoInterface::STATUS, QString>(
        NemoInterface::STATUS::HEARTBEAT_DETECTED, "Heartbeat Detected"),
    std::make_pair<NemoInterface::STATUS, QString>(
        NemoInterface::STATUS::TIMEOUT, "Timeout"),
    std::make_pair<NemoInterface::STATUS, QString>(
        NemoInterface::STATUS::INVALID_HEARTBEAT, "Error"),
    std::make_pair<NemoInterface::STATUS, QString>(
        NemoInterface::STATUS::WEBSOCKET_DETECTED, "Websocket Detected")};

NemoInterface::Impl::Impl(NemoInterface *p)
    : nextTimeout(TimePoint::max()), status_(STATUS::NOT_CONNECTED),
Valentin Platzgummer's avatar
Valentin Platzgummer committed
123
      running_(false), topicServiceSetupDone(false), _parent(p) {
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138

  // ROS Bridge.
  WimaSettings *wimaSettings =
      qgcApp()->toolbox()->settingsManager()->wimaSettings();
  auto connectionStringFact = wimaSettings->rosbridgeConnectionString();
  auto setConnectionString = [connectionStringFact, this] {
    auto connectionString = connectionStringFact->rawValue().toString();
    if (ros_bridge::isValidConnectionString(
            connectionString.toLocal8Bit().data())) {
    } else {
      qgcApp()->warningMessageBoxOnMainThread(
          "Nemo Interface",
          "Websocket connection string possibly invalid: " + connectionString +
              ". Trying to connect anyways.");
    }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
139
    this->_pRosBridge.reset(
140 141 142 143 144 145 146 147 148 149 150 151 152
        new ros_bridge::ROSBridge(connectionString.toLocal8Bit().data()));
  };
  connect(connectionStringFact, &SettingsFact::rawValueChanged,
          setConnectionString);
  setConnectionString();

  // Periodic.
  connect(&this->loopTimer, &QTimer::timeout, [this] { this->loop(); });
  this->loopTimer.start(EVENT_TIMER_INTERVAL);
}

void NemoInterface::Impl::start() {
  this->running_ = true;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
153
  emit this->_parent->runningChanged();
154 155 156 157
}

void NemoInterface::Impl::stop() {
  this->running_ = false;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
  emit this->_parent->runningChanged();
}

TileArray NemoInterface::Impl::getTiles(const IDArray &idArray) {
  TileArray tileArray;

  for (const auto &id : idArray) {
    const auto it = _tileMap.find(id);
    if (it != _tileMap.end()) {
      tileArray.append(it->second);
    }
  }

  return tileArray;
}

TileArray NemoInterface::Impl::getAllTiles() {
  TileArray tileArray;

  for (const auto &entry : _tileMap) {
    tileArray.append(entry.second);
  }

  return tileArray;
}

LogicalArray NemoInterface::Impl::containsTiles(const IDArray &idArray) {
  LogicalArray logicalArray;

  for (const auto &id : idArray) {
    const auto &it = _tileMap.find(id);
    logicalArray.append(it != _tileMap.end());
  }

  return logicalArray;
}

std::size_t NemoInterface::Impl::size() { return _tileMap.size(); }

bool NemoInterface::Impl::empty() { return _tileMap.empty(); }

ProgressArray NemoInterface::Impl::getProgress() {
  ProgressArray progressArray;

  for (const auto &entry : _tileMap) {
    progressArray.append(TaggedProgress{entry.first, entry.second.progress()});
  }

  return progressArray;
}

ProgressArray NemoInterface::Impl::getProgress(const IDArray &idArray) {
  ProgressArray progressArray;

  for (const auto &id : idArray) {
    const auto it = _tileMap.find(id);
    if (id != _tileMap.end()) {
      progressArray.append(TaggedProgress{it->first, it->second.progress()});
    }
  }

  return progressArray;
220 221 222 223 224 225 226 227 228 229
}

void NemoInterface::Impl::setTileData(const TileData &tileData) {
  this->tileData = tileData;
  if (tileData.tiles.count() > 0) {
    std::lock(this->ENUOriginMutex, this->tilesENUMutex);
    UniqueLock lk1(this->ENUOriginMutex, std::adopt_lock);
    UniqueLock lk2(this->tilesENUMutex, std::adopt_lock);

    const auto *obj = tileData.tiles[0];
230
    const auto *tile = qobject_cast<const MeasurementTile *>(obj);
231 232 233 234 235 236 237 238
    if (tile != nullptr) {
      if (tile->coordinateList().size() > 0) {
        if (tile->coordinateList().first().isValid()) {
          this->ENUOrigin = tile->coordinateList().first();
          const auto &origin = this->ENUOrigin;
          this->tilesENU.polygons().clear();
          for (int i = 0; i < tileData.tiles.count(); ++i) {
            obj = tileData.tiles[i];
239
            tile = qobject_cast<const MeasurementTile *>(obj);
240 241
            if (tile != nullptr) {
              SnakeTileLocal tileENU;
242 243
              geometry::areaToEnu(origin, tile->coordinateList(),
                                  tileENU.path());
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
              this->tilesENU.polygons().push_back(std::move(tileENU));
            } else {
              qCDebug(NemoInterfaceLog) << "Impl::setTileData(): nullptr.";
              break;
            }
          }
        } else {
          qCDebug(NemoInterfaceLog) << "Impl::setTileData(): Origin invalid.";
        }
      } else {
        qCDebug(NemoInterfaceLog) << "Impl::setTileData(): tile empty.";
      }
    }
  } else {
    this->tileData.clear();

    std::lock(this->ENUOriginMutex, this->tilesENUMutex);
    UniqueLock lk1(this->ENUOriginMutex, std::adopt_lock);
    UniqueLock lk2(this->tilesENUMutex, std::adopt_lock);
    this->ENUOrigin = QGeoCoordinate(0, 0, 0);
    this->tilesENU = SnakeTilesLocal();
  }
}

bool NemoInterface::Impl::hasTileData(const TileData &tileData) const {
  return this->tileData == tileData;
}

void NemoInterface::Impl::publishTileData() {
  std::lock(this->ENUOriginMutex, this->tilesENUMutex);
  UniqueLock lk1(this->ENUOriginMutex, std::adopt_lock);
  UniqueLock lk2(this->tilesENUMutex, std::adopt_lock);

  if (this->tilesENU.polygons().size() > 0 && this->running_ &&
      this->topicServiceSetupDone) {
    this->publishENUOrigin();
    this->publishTilesENU();
  }
}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
284 285 286
NemoInterface::STATUS NemoInterface::Impl::status() {
  return _translate(this->_state);
}
287 288 289 290 291 292

QVector<int> NemoInterface::Impl::progress() {
  SharedLock lk(this->progressMutex);
  return this->qProgress.progress();
}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
293
bool NemoInterface::Impl::running() { return _running(this->_state); }
294 295 296 297 298 299 300

void NemoInterface::Impl::doTopicServiceSetup() {
  using namespace ros_bridge::messages;

  // snake tiles.
  {
    SharedLock lk(this->tilesENUMutex);
Valentin Platzgummer's avatar
Valentin Platzgummer committed
301
    this->_pRosBridge->advertiseTopic(
302 303 304 305 306 307 308
        "/snake/tiles",
        jsk_recognition_msgs::polygon_array::messageType().c_str());
  }

  // snake origin.
  {
    SharedLock lk(this->ENUOriginMutex);
Valentin Platzgummer's avatar
Valentin Platzgummer committed
309
    this->_pRosBridge->advertiseTopic(
310 311 312 313
        "/snake/origin", geographic_msgs::geo_point::messageType().c_str());
  }

  // Subscribe nemo progress.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
314
  this->_pRosBridge->subscribe(
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
      "/nemo/progress",
      /* callback */ [this](JsonDocUPtr pDoc) {
        std::lock(this->progressMutex, this->tilesENUMutex,
                  this->ENUOriginMutex);
        UniqueLock lk1(this->progressMutex, std::adopt_lock);
        UniqueLock lk2(this->tilesENUMutex, std::adopt_lock);
        UniqueLock lk3(this->ENUOriginMutex, std::adopt_lock);

        int requiredSize = this->tilesENU.polygons().size();
        auto &progressMsg = this->qProgress;
        if (!nemo_msgs::progress::fromJson(*pDoc, progressMsg) ||
            progressMsg.progress().size() !=
                requiredSize) { // Some error occured.
          progressMsg.progress().clear();
          qgcApp()->informationMessageBoxOnMainThread(
              "Nemo Interface", "Invalid progress message received.");
        }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
332
        emit this->_parent->progressChanged();
333 334 335 336 337 338 339

        lk1.unlock();
        lk2.unlock();
        lk3.unlock();
      });

  // Subscribe /nemo/heartbeat.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
340
  this->_pRosBridge->subscribe(
341 342 343 344 345
      "/nemo/heartbeat",
      /* callback */ [this](JsonDocUPtr pDoc) {
        //        auto start = std::chrono::high_resolution_clock::now();
        nemo_msgs::heartbeat::Heartbeat heartbeatMsg;
        if (!nemo_msgs::heartbeat::fromJson(*pDoc, heartbeatMsg)) {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
346
          this->_setState(STATUS::INVALID_HEARTBEAT);
347
        } else {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
348
          this->_setState(heartbeatToStatus(heartbeatMsg));
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
        }
        if (this->status_ == STATUS::INVALID_HEARTBEAT) {
          UniqueLock lk(this->timeoutMutex);
          this->nextTimeout = TimePoint::max();
        } else if (this->status_ == STATUS::HEARTBEAT_DETECTED) {
          UniqueLock lk(this->timeoutMutex);
          this->nextTimeout =
              std::chrono::high_resolution_clock::now() + timeoutInterval;
        }

        //        auto delta =
        //        std::chrono::duration_cast<std::chrono::milliseconds>(
        //            std::chrono::high_resolution_clock::now() - start);
        //        std::cout << "/nemo/heartbeat callback time: " <<
        //        delta.count() << " ms"
        //                  << std::endl;
      });

  // Advertise /snake/get_origin.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
368
  this->_pRosBridge->advertiseService(
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
      "/snake/get_origin", "snake_msgs/GetOrigin",
      [this](JsonDocUPtr) -> JsonDocUPtr {
        using namespace ros_bridge::messages;
        SharedLock lk(this->ENUOriginMutex);

        JsonDocUPtr pDoc(
            std::make_unique<rapidjson::Document>(rapidjson::kObjectType));
        auto &origin = this->ENUOrigin;
        rapidjson::Value jOrigin(rapidjson::kObjectType);
        lk.unlock();
        if (geographic_msgs::geo_point::toJson(origin, jOrigin,
                                               pDoc->GetAllocator())) {
          lk.unlock();
          pDoc->AddMember("origin", jOrigin, pDoc->GetAllocator());
        } else {
          lk.unlock();
          qCWarning(NemoInterfaceLog)
              << "/snake/get_origin service: could not create json document.";
        }

        return pDoc;
      });

  // Advertise /snake/get_tiles.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
393
  this->_pRosBridge->advertiseService(
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
      "/snake/get_tiles", "snake_msgs/GetTiles",
      [this](JsonDocUPtr) -> JsonDocUPtr {
        SharedLock lk(this->tilesENUMutex);

        JsonDocUPtr pDoc(
            std::make_unique<rapidjson::Document>(rapidjson::kObjectType));
        rapidjson::Value jSnakeTiles(rapidjson::kObjectType);

        if (jsk_recognition_msgs::polygon_array::toJson(
                this->tilesENU, jSnakeTiles, pDoc->GetAllocator())) {
          lk.unlock();
          pDoc->AddMember("tiles", jSnakeTiles, pDoc->GetAllocator());
        } else {
          lk.unlock();
          qCWarning(NemoInterfaceLog)
              << "/snake/get_tiles service: could not create json document.";
        }

        return pDoc;
      });
}

void NemoInterface::Impl::loop() {
  // Check ROS Bridge status and do setup if necessary.
  if (this->running_) {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
419 420
    if (!this->_pRosBridge->isRunning()) {
      this->_pRosBridge->start();
421
      this->loop();
Valentin Platzgummer's avatar
Valentin Platzgummer committed
422 423
    } else if (this->_pRosBridge->isRunning() &&
               this->_pRosBridge->connected() && !this->topicServiceSetupDone) {
424 425 426
      this->doTopicServiceSetup();
      this->topicServiceSetupDone = true;

Valentin Platzgummer's avatar
Valentin Platzgummer committed
427 428 429 430 431
      this->_setState(STATUS::WEBSOCKET_DETECTED);
    } else if (this->_pRosBridge->isRunning() &&
               !this->_pRosBridge->connected() && this->topicServiceSetupDone) {
      this->_pRosBridge->reset();
      this->_pRosBridge->start();
432 433
      this->topicServiceSetupDone = false;

Valentin Platzgummer's avatar
Valentin Platzgummer committed
434
      this->_setState(STATUS::TIMEOUT);
435
    }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
436 437
  } else if (this->_pRosBridge->isRunning()) {
    this->_pRosBridge->reset();
438 439 440 441 442 443 444 445 446
    this->topicServiceSetupDone = false;
  }

  // Check if heartbeat timeout occured.
  if (this->running_ && this->topicServiceSetupDone) {
    UniqueLock lk(this->timeoutMutex);
    if (this->nextTimeout != TimePoint::max() &&
        this->nextTimeout < std::chrono::high_resolution_clock::now()) {
      lk.unlock();
Valentin Platzgummer's avatar
Valentin Platzgummer committed
447 448
      if (this->_pRosBridge->isRunning() && this->_pRosBridge->connected()) {
        this->_setState(STATUS::WEBSOCKET_DETECTED);
449
      } else {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
450
        this->_setState(STATUS::TIMEOUT);
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
      }
    }
  }
}

NemoInterface::STATUS NemoInterface::Impl::heartbeatToStatus(
    const ros_bridge::messages::nemo_msgs::heartbeat::Heartbeat &hb) {
  if (STATUS(hb.status()) == STATUS::HEARTBEAT_DETECTED)
    return STATUS::HEARTBEAT_DETECTED;
  else
    return STATUS::INVALID_HEARTBEAT;
}

void NemoInterface::Impl::publishTilesENU() {
  using namespace ros_bridge::messages;
  JsonDocUPtr jSnakeTiles(
      std::make_unique<rapidjson::Document>(rapidjson::kObjectType));
  if (jsk_recognition_msgs::polygon_array::toJson(
          this->tilesENU, *jSnakeTiles, jSnakeTiles->GetAllocator())) {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
470
    this->_pRosBridge->publish(std::move(jSnakeTiles), "/snake/tiles");
471 472 473 474 475 476 477 478 479 480 481 482
  } else {
    qCWarning(NemoInterfaceLog)
        << "Impl::publishTilesENU: could not create json document.";
  }
}

void NemoInterface::Impl::publishENUOrigin() {
  using namespace ros_bridge::messages;
  JsonDocUPtr jOrigin(
      std::make_unique<rapidjson::Document>(rapidjson::kObjectType));
  if (geographic_msgs::geo_point::toJson(this->ENUOrigin, *jOrigin,
                                         jOrigin->GetAllocator())) {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
483
    this->_pRosBridge->publish(std::move(jOrigin), "/snake/origin");
484 485 486 487 488 489
  } else {
    qCWarning(NemoInterfaceLog)
        << "Impl::publishENUOrigin: could not create json document.";
  }
}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
490
bool NemoInterface::Impl::_setState(STATE s) {
491 492
  if (s != this->status_) {
    this->status_ = s;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
493
    emit this->_parent->statusChanged();
494 495 496 497 498 499 500 501
    return true;
  } else {
    return false;
  }
}

// ===============================================================
// NemoInterface
502 503 504 505 506 507 508 509 510
NemoInterface::NemoInterface()
    : QObject(), pImpl(std::make_unique<NemoInterface::Impl>(this)) {}

NemoInterface *NemoInterface::createInstance() { return new NemoInterface(); }

NemoInterface *NemoInterface::instance() {
  return GenericSingelton<NemoInterface>::instance(
      NemoInterface::createInstance);
}
511 512 513 514 515 516 517

NemoInterface::~NemoInterface() {}

void NemoInterface::start() { this->pImpl->start(); }

void NemoInterface::stop() { this->pImpl->stop(); }

518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
void NemoInterface::addTiles(const NemoInterface::TilePtrArray &tileArray) {
  this->pImpl -
}

void NemoInterface::addTiles(const TileArray &tileArray) {
  TilePtrArray ptrArray;
  for (const auto &tile : tileArray) {
    ptrArray.append(&tile);
  }
  addTiles(ptrArray);
}

void NemoInterface::removeTiles(const IDArray &idArray) {
  this->pImpl->removeTiles(idArray);
}

void NemoInterface::clearTiles() { this->pImpl->clearTiles(); }

TileArray NemoInterface::getTiles(const IDArray &idArray) {
  return this->pImpl->getTiles(idArray);
}

TileArray NemoInterface::getAllTiles() {
  return this->pImpl->getTiles(idArray);
}

LogicalArray NemoInterface::containsTiles(const IDArray &idArray) {
  return this->pImpl->containsTiles(idArray);
}

std::size_t NemoInterface::size() { return this->pImpl->size(); }

bool NemoInterface::empty() { return this->pImpl->empty(); }

Valentin Platzgummer's avatar
Valentin Platzgummer committed
552 553 554 555 556 557 558 559
ProgressArray NemoInterface::getProgress() {
  return this->pImpl->getProgress();
}

ProgressArray NemoInterface::getProgress(const IDArray &idArray) {
  return this->pImpl->getProgress(idArray);
}

560 561 562 563 564 565 566 567 568 569 570 571 572 573
void NemoInterface::publishTileData() { this->pImpl->publishTileData(); }

void NemoInterface::requestProgress() {
  qCWarning(NemoInterfaceLog) << "requestProgress(): dummy.";
}

void NemoInterface::setTileData(const TileData &tileData) {
  this->pImpl->setTileData(tileData);
}

bool NemoInterface::hasTileData(const TileData &tileData) const {
  return this->pImpl->hasTileData(tileData);
}

574
NemoInterface::STATUS NemoInterface::status() const {
575 576 577 578 579 580 581 582 583 584 585 586 587 588
  return this->pImpl->status();
}

QString NemoInterface::statusString() const {
  return statusMap.at(this->pImpl->status());
}

QVector<int> NemoInterface::progress() const { return this->pImpl->progress(); }

QString NemoInterface::editorQml() {
  return QStringLiteral("NemoInterface.qml");
}

bool NemoInterface::running() { return this->pImpl->running(); }