#include "WimaBridge.h"
#include "GenericSingelton.h"

WimaBridge::WimaBridge(QObject *parent) : QObject(parent) {}

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

WimaBridge::~WimaBridge() {}

WimaBridge *WimaBridge::instance() {
  return GenericSingelton<WimaBridge>::instance(WimaBridge::createInstance);
}

const WimaPlanData &WimaBridge::planData() const { return this->planData_; }

const QVector<int> &WimaBridge::progress() const { return this->progress_; }

void WimaBridge::setProgress(const QVector<int> &p) {
  if (this->progress_ != p) {
    this->progress_ = p;
    emit progressChanged();
  }
}

void WimaBridge::setPlanData(const WimaPlanData &planData) {
  if (this->planData_ != planData) {
    this->planData_ = planData;
    emit planDataChanged();
  }
}
