#include "MeasurementPlanCreator.h"
#include "MeasurementComplexItem.h"
#include "PlanMasterController.h"

MeasurementPlanCreator::MeasurementPlanCreator(
    PlanMasterController *planMasterController, QObject *parent)
    : PlanCreator(
          planMasterController, MeasurementComplexItem::name,
          QStringLiteral("/qmlimages/PlanCreator/MeasurementPlanCreator.png"),
          parent) {}

void MeasurementPlanCreator::createPlan(const QGeoCoordinate &mapCenterCoord) {
  _planMasterController->removeAll();
  VisualMissionItem *takeoffItem =
      _missionController->insertTakeoffItem(mapCenterCoord, -1);
  _missionController->insertComplexMissionItem(MeasurementComplexItem::name,
                                               mapCenterCoord, -1);
  _missionController->insertLandItem(mapCenterCoord, -1);
  _missionController->setCurrentPlanViewSeqNum(takeoffItem->sequenceNumber(),
                                               true);
}
