dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavdataobject.h
Go to the documentation of this file.
1 
14 /*
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  * for more details.
24  *
25  * You should have received a copy of the GNU General Public License along
26  * with this program; if not, see <http://www.gnu.org/licenses/>
27  */
28 #ifndef UAVDATAOBJECT_H
29 #define UAVDATAOBJECT_H
30 
32 #include "uavobjects/uavobject.h"
35 #include <QList>
36 
37 class UAVOBJECTS_EXPORT UAVDataObject : public UAVObject
38 {
39  Q_OBJECT
40  Q_PROPERTY(bool isPresentOnHardware READ getIsPresentOnHardware WRITE setIsPresentOnHardware NOTIFY presentOnHardwareChanged)
41 public:
42  UAVDataObject(quint32 objID, bool isSingleInst, bool isSet, const QString &name);
43  void initialize(quint32 instID, UAVMetaObject *mobj);
44  void initialize(UAVMetaObject *mobj);
45  bool isSettings();
46  void setMetadata(const Metadata &mdata);
47  Metadata getMetadata();
48  UAVMetaObject *getMetaObject();
49  virtual UAVDataObject *clone(quint32 instID = 0) = 0;
50  virtual UAVDataObject *dirtyClone() = 0;
51 
52  bool getIsPresentOnHardware() const;
53  bool getPresenceKnown() const;
54  void setReceived();
55  bool getReceived();
56  void setIsPresentOnHardware(bool value = true);
57  void resetIsPresentOnHardware();
58 
59 signals:
60  void presentOnHardwareChanged(UAVDataObject *);
61  void presentOnHardwareChanged(bool present);
62 
63 private:
64  UAVMetaObject *mobj;
65  bool isSet;
66 
67  enum presence { notPresent, unknownPresent, isPresent, isPresentAndReceived }
68  isPresentOnHardware;
69 };
70 
71 #endif // UAVDATAOBJECT_H
virtual void setMetadata(const Metadata &mdata)=0
UAVDataObject * dirtyClone()
virtual Metadata getMetadata()=0
void initialize(quint32 instID)
Definition: uavobject.cpp:71
UAVDataObject * clone(quint32 instID)