2 ******************************************************************************
4 * @file uavobjectmanager.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @see The GNU Public License (GPL) Version 3
7 * @addtogroup GCSPlugins GCS Plugins
9 * @addtogroup UAVObjectsPlugin UAVObjects Plugin
11 * @brief The UAVUObjects GCS plugin
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef UAVOBJECTUTILMANAGER_H
30 #define UAVOBJECTUTILMANAGER_H
32 #include "uavobjectutil_global.h"
34 #include "extensionsystem/pluginmanager.h"
35 #include "uavobjectmanager.h"
36 #include "uavobject.h"
37 #include "devicedescriptorstruct.h"
39 #include "objectpersistence.h"
40 #include "firmwareiapobj.h"
49 class UAVOBJECTUTIL_EXPORT UAVObjectUtilManager
: public QObject
{
53 UAVObjectUtilManager();
54 ~UAVObjectUtilManager();
56 int setHomeLocation(double LLA
[3], bool set
);
57 int getHomeLocation(bool &set
, double LLA
[3]);
59 int getGPSPositionSensor(double LLA
[3]);
62 int getBootloaderRevision();
63 QByteArray
getBoardCPUSerial();
64 quint32
getFirmwareCRC();
65 QByteArray
getBoardDescription();
66 QString
getBoardDescriptionString();
67 deviceDescriptorStruct
getBoardDescriptionStruct();
68 static bool descriptionToStructure(QByteArray desc
, deviceDescriptorStruct
& struc
);
69 UAVObjectManager
*getObjectManager();
70 void saveObjectToSD(UAVObject
*obj
);
72 FirmwareIAPObj::DataFields
getFirmwareIap();
75 void saveCompleted(int objectID
, bool status
);
79 QQueue
<UAVObject
*> queue
;
80 enum { IDLE
, AWAITING_ACK
, AWAITING_COMPLETED
} saveState
;
81 void saveNextObject();
84 ExtensionSystem::PluginManager
*pm
;
85 UAVObjectManager
*obm
;
86 UAVObjectUtilManager
*obum
;
89 // void transactionCompleted(UAVObject *obj, bool success);
90 void objectPersistenceTransactionCompleted(UAVObject
*obj
, bool success
);
91 void objectPersistenceUpdated(UAVObject
*obj
);
92 void objectPersistenceOperationFailed();
96 #endif // ifndef UAVOBJECTUTILMANAGER_H