NemoInterface.cpp 17.8 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

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

Valentin Platzgummer's avatar
Valentin Platzgummer committed
82 83 84 85 86 87
private slots:
  void _addTilesLocal(const TileArray &tileArray);
  void _removeTilesLocal(const IDArray &idArray);
  void _clearTilesLocal();
  void _updateProgress(ProgressArray progressArray);

88
private:
Valentin Platzgummer's avatar
Valentin Platzgummer committed
89 90 91 92
  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;

93 94
  void doTopicServiceSetup();
  void loop();
95

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

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

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

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
125
      running_(false), topicServiceSetupDone(false), _parent(p) {
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140

  // 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
141
    this->_pRosBridge.reset(
142 143 144 145 146 147 148 149 150 151 152 153 154
        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
155
  emit this->_parent->runningChanged();
156 157 158 159
}

void NemoInterface::Impl::stop() {
  this->running_ = false;
Valentin Platzgummer's avatar
Valentin Platzgummer committed
160 161 162
  emit this->_parent->runningChanged();
}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
163 164
void NemoInterface::Impl::addTiles(const TilePtrArray &tileArray) {}

Valentin Platzgummer's avatar
Valentin Platzgummer committed
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 220 221 222 223
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;
224 225 226 227 228 229 230 231 232 233
}

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];
234
    const auto *tile = qobject_cast<const MeasurementTile *>(obj);
235 236 237 238 239 240 241 242
    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];
243
            tile = qobject_cast<const MeasurementTile *>(obj);
244 245
            if (tile != nullptr) {
              SnakeTileLocal tileENU;
246 247
              geometry::areaToEnu(origin, tile->coordinateList(),
                                  tileENU.path());
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 284 285 286 287
              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
288 289 290
NemoInterface::STATUS NemoInterface::Impl::status() {
  return _translate(this->_state);
}
291 292 293 294 295 296

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

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

Valentin Platzgummer's avatar
Valentin Platzgummer committed
299 300
void NemoInterface::Impl::_addTilesLocal(const TileArray &tileArray) {
  bool anyChanges = false;
301

Valentin Platzgummer's avatar
Valentin Platzgummer committed
302 303 304 305 306 307 308 309 310 311 312 313
  for (const auto &tile : tileArray) {
    const auto id = tile.id();
    const auto it = _tileMap.find(id);
    if (Q_LIKELY(it == _tileMap.end())) {
      auto ret = _tileMap.insert(std::make_pair(id, tile));
      anyChanges = true;
      Q_ASSERT(ret.second == true);
      Q_UNUSED(ret);
    } else {
      qCDebug(NemoInterfaceLog)
          << "_addTilesLocal(): tile with id " << id << " already inserted.";
    }
314 315
  }

Valentin Platzgummer's avatar
Valentin Platzgummer committed
316 317
  if (anyChanges) {
    emit _parent->tilesChanged();
318
  }
Valentin Platzgummer's avatar
Valentin Platzgummer committed
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
}

void NemoInterface::Impl::_removeTilesLocal(const IDArray &idArray) {
  bool anyChanges = false;
  for (const auto &id : idArray) {
    const auto it = _tileMap.find(id);
    if (Q_LIKELY(it != _tileMap.end())) {
      _tileMap.erase(it);
      anyChanges = true;
    } else {
      qCDebug(NemoInterfaceLog)
          << "_removeTilesLocal(): tile with id " << id << " not found.";
    }
  }

  if (anyChanges) {
    emit _parent->tilesChanged();
  }
}

void NemoInterface::Impl::_clearTilesLocal() {
  if (!_tileMap.empty()) {
    _tileMap.clear();
    emit _parent->tilesChanged();
  }
}

void NemoInterface::Impl::_updateProgress(ProgressArray progressArray) {
  for (auto itPair = progressArray.begin(); itPair != progressArray.end();) {

    const auto &id = itPair->first;
    auto it = _tileMap.find(id);

    if (Q_LIKELY(it != _tileMap.end())) {
      const auto &progress = itPair->second;
      it->second.setProgress(progress);
      ++itPair;
    } else {
      qCDebug(NemoInterfaceLog)
          << "_updateProgress(): tile with id " << id << " not found.";
      itPair = progressArray.erase(itPair);
    }
  }

  emit _parent->progressChanged(progressArray);
}

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

  // Subscribe nemo progress.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
370
  this->_pRosBridge->subscribe(
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
      "/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
388
        emit this->_parent->progressChanged();
389 390 391 392 393 394 395

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

  // Subscribe /nemo/heartbeat.
Valentin Platzgummer's avatar
Valentin Platzgummer committed
396
  this->_pRosBridge->subscribe(
397 398 399 400
      "/nemo/heartbeat",
      /* callback */ [this](JsonDocUPtr pDoc) {
        nemo_msgs::heartbeat::Heartbeat heartbeatMsg;
        if (!nemo_msgs::heartbeat::fromJson(*pDoc, heartbeatMsg)) {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
401
          this->_setState(STATUS::INVALID_HEARTBEAT);
402
        } else {
Valentin Platzgummer's avatar
Valentin Platzgummer committed
403
          this->_setState(heartbeatToStatus(heartbeatMsg));
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
        }
        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;
        }
      });
}

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(); }