28 #include "ui_pathplanner.h"
29 #include <QFileDialog>
31 #include <QStringList>
34 #include <QVBoxLayout>
35 #include <QPushButton>
44 ui =
new Ui_PathPlanner();
46 ui->statusTL->setVisible(
false);
51 QItemSelectionModel *selection = pm->getObject<QItemSelectionModel>();
66 this->selection = selection;
68 ui->tableView->setModel(model);
69 ui->tableView->setSelectionModel(selection);
70 ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
73 ui->tableView->resizeColumnsToContents();
75 ui->tableView->resizeColumnsToContents();
78 &PathPlannerGadgetWidget::on_waypointSendProgress);
81 void PathPlannerGadgetWidget::on_tbAdd_clicked()
83 ui->tableView->model()->insertRow(ui->tableView->model()->rowCount());
86 void PathPlannerGadgetWidget::on_tbDelete_clicked()
89 ui->tableView->model()->removeRow(ui->tableView->selectionModel()->currentIndex().row());
92 void PathPlannerGadgetWidget::on_tbInsert_clicked()
94 ui->tableView->model()->insertRow(ui->tableView->selectionModel()->currentIndex().row());
97 void PathPlannerGadgetWidget::on_tbReadFromFile_clicked()
101 QString fileName = QFileDialog::getOpenFileName(
this, tr(
"Open File"));
105 void PathPlannerGadgetWidget::on_tbSaveToFile_clicked()
109 QString fileName = QFileDialog::getSaveFileName(
this, tr(
"Save File"));
118 void PathPlannerGadgetWidget::on_tbDetails_clicked()
134 void PathPlannerGadgetWidget::on_tbSendToUAV_clicked()
136 enableButtons(
false);
137 ui->statusTL->setVisible(
false);
138 ui->statusPB->setValue(0);
142 ui->statusTL->setText(
"All waypoints were sent successfully");
144 ui->statusTL->setText(
"WARNING: Not all waypoints were sent successfully");
145 ui->statusTL->setVisible(
true);
153 void PathPlannerGadgetWidget::on_tbFetchFromUAV_clicked()
156 ui->tableView->resizeColumnsToContents();
162 void PathPlannerGadgetWidget::on_tbFilletPath_clicked()
186 void PathPlannerGadgetWidget::on_tbUnfilletPath_clicked()
192 void PathPlannerGadgetWidget::on_waypointSendProgress(
int value)
194 ui->statusPB->setValue(value);
197 void PathPlannerGadgetWidget::enableButtons(
bool enable)
200 foreach (QToolButton *button, blist) {
201 button->setEnabled(enable);
virtual bool configure(QWidget *callingUi=nullptr)=0
Core plugin system that manages the plugins, their life cycle and their registered objects...
void sendPathPlanToUavProgress(int percent)
bool writeToFile(QString filename)
FlightDataModel::writeToFile Write the waypoints to an xml file.
virtual bool processPath(FlightDataModel *model)=0
The WaypointDialog class creates a dialog for editing the properties of a single waypoint.
bool modelToObjects()
Cast from the internal representation to the UAVOs.
void readFromFile(QString fileName)
FlightDataModel::readFromFile Read into the model from a flight plan xml file.
The WaypointDelegate class is used to handle updating the values in the mode combo box to the data mo...
bool replaceData(FlightDataModel *newModel)
Replace a model data with another model.
~PathPlannerGadgetWidget()
void setModel(FlightDataModel *model, QItemSelectionModel *selection)
PathPlannerGadgetWidget(QWidget *parent=nullptr)
virtual bool verifyPath(FlightDataModel *model, QString &err)=0
void objectsToModel()
Cast from the UAVOs to the internal representation.
Algorithm to add filtets to path.