2 ******************************************************************************
4 * @file flightdatamodel.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup OPMapPlugin OpenPilot Map Plugin
10 * @brief The OpenPilot Map plugin
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef FLIGHTDATAMODEL_H
28 #define FLIGHTDATAMODEL_H
29 #include <QAbstractTableModel>
30 #include "opmapcontrol/opmapcontrol.h"
33 QString wpDescritption
;
38 double altitudeRelative
;
45 float condition_params
[4];
52 class flightDataModel
: public QAbstractTableModel
{
55 enum pathPlanDataEnum
{
56 WPDESCRITPTION
, LATPOSITION
, LNGPOSITION
, DISRELATIVE
, BEARELATIVE
, ALTITUDERELATIVE
, ISRELATIVE
, ALTITUDE
,
57 VELOCITY
, MODE
, MODE_PARAMS0
, MODE_PARAMS1
, MODE_PARAMS2
, MODE_PARAMS3
,
58 CONDITION
, CONDITION_PARAMS0
, CONDITION_PARAMS1
, CONDITION_PARAMS2
, CONDITION_PARAMS3
,
59 COMMAND
, JUMPDESTINATION
, ERRORDESTINATION
, LOCKED
61 flightDataModel(QObject
*parent
);
62 int rowCount(const QModelIndex
&parent
= QModelIndex()) const;
63 int columnCount(const QModelIndex
&parent
= QModelIndex()) const;
64 QVariant
data(const QModelIndex
&index
, int role
= Qt::DisplayRole
) const;
65 QVariant
headerData(int section
, Qt::Orientation orientation
, int role
) const;
67 bool setData(const QModelIndex
& index
, const QVariant
& value
, int role
= Qt::EditRole
);
68 Qt::ItemFlags
flags(const QModelIndex
& index
) const;
69 bool insertRows(int row
, int count
, const QModelIndex
& parent
= QModelIndex());
70 bool removeRows(int row
, int count
, const QModelIndex
& parent
= QModelIndex());
71 bool writeToFile(QString filename
);
72 void readFromFile(QString fileName
);
74 QList
<pathPlanData
*> dataStorage
;
75 QVariant
getColumnByIndex(const pathPlanData
*row
, const int index
) const;
76 bool setColumnByIndex(pathPlanData
*row
, const int index
, const QVariant value
);
79 #endif // FLIGHTDATAMODEL_H