dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavobjectutilmanager.cpp
Go to the documentation of this file.
1 
15 /*
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful, but
22  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24  * for more details.
25  *
26  * You should have received a copy of the GNU General Public License along
27  * with this program; if not, see <http://www.gnu.org/licenses/>
28  *
29  * Additional note on redistribution: The copyright and license notices above
30  * must be maintained in each individual source file that is a derivative work
31  * of this source file; otherwise redistribution is prohibited.
32  */
33 
34 #include "uavobjectutilmanager.h"
35 #include "physical_constants.h"
36 #include "utils/homelocationutil.h"
37 
38 #include <QDebug>
39 #include <QEventLoop>
40 #include <QTimer>
41 #include <QRegularExpression>
42 #include <objectpersistence.h>
43 
44 #include "firmwareiapobj.h"
45 #include "homelocation.h"
46 #include "gpsposition.h"
47 #include "actuatorsettings.h"
48 
50 
51 #ifdef UAVOBJECTUTIL_DEBUG
52 #define UAVOBJECTUTIL_QXTLOG_DEBUG(...) qDebug() << __VA_ARGS__
53 #else // UAVOBJECTUTIL_DEBUG
54 #define UAVOBJECTUTIL_QXTLOG_DEBUG(...)
55 #endif // UAVOBJECTUTIL_DEBUG
56 
58 {
59  saveState = IDLE;
60  failureTimer.stop();
61  failureTimer.setSingleShot(true);
62  failureTimer.setInterval(1000);
63  connect(&failureTimer, SIGNAL(timeout()), this, SLOT(objectPersistenceOperationFailed()));
64 
65  obm = NULL;
66 
67  pm = ExtensionSystem::PluginManager::instance();
68  if (pm) {
69  obm = pm->getObject<UAVObjectManager>();
70  }
71 }
72 
74 {
75  disconnect();
76 }
77 
79 {
80  Q_ASSERT(obm);
81  return obm;
82 }
83 
84 // ******************************
85 // Flash memory saving
86 //
87 
112 {
113  // Add to queue
114  queue.enqueue(obj);
115  UAVOBJECTUTIL_QXTLOG_DEBUG(QString("Enqueue object:%0").arg(obj->getName()));
116 
117  // If queue length is one, then start sending (call sendNextObject)
118  // Otherwise, do nothing, because we are already sending.
119  if (queue.length() == 1)
120  saveNextObject();
121 }
122 
128 void UAVObjectUtilManager::saveNextObject()
129 {
130  if (queue.isEmpty()) {
131  return;
132  }
133 
134  Q_ASSERT(saveState == IDLE);
135 
136  // Get next object from the queue (don't dequeue yet)
137  UAVObject *obj = queue.head();
138  Q_ASSERT(obj);
139  UAVOBJECTUTIL_QXTLOG_DEBUG(QString("Send save object request to board %0").arg(obj->getName()));
140 
141  ObjectPersistence *objectPersistence = ObjectPersistence::GetInstance(getObjectManager());
142  Q_ASSERT(objectPersistence);
143 
144  // "transactionCompleted" is emitted once the objectPersistence object is sent over the
145  // telemetry link.
146  // Since its metadata state that it should be ACK'ed on flight telemetry, the
147  // transactionCompleted signal
148  // will be triggered once the GCS telemetry manager receives an ACK from the flight controller,
149  // or times
150  // out. the success value will reflect success or failure.
151  connect(objectPersistence, SIGNAL(transactionCompleted(UAVObject *, bool)), this,
152  SLOT(objectPersistenceTransactionCompleted(UAVObject *, bool)), Qt::UniqueConnection);
153  // After we update the objectPersistence UAVO, we need to listen to its "objectUpdated" event,
154  // which will occur
155  // once the flight controller sends this object back to the GCS, with the "Operation" field set
156  // to "Completed"
157  // or "Error".
158  connect(objectPersistence, SIGNAL(objectUpdated(UAVObject *)), this,
159  SLOT(objectPersistenceUpdated(UAVObject *)), Qt::UniqueConnection);
160  saveState = AWAITING_ACK;
161  UAVOBJECTUTIL_QXTLOG_DEBUG(QString("[saveObjectToFlash] Moving on to AWAITING_ACK"));
162 
163  ObjectPersistence::DataFields data;
164  data.Operation = ObjectPersistence::OPERATION_SAVE;
165  data.ObjectID = obj->getObjID();
166  data.InstanceID = obj->getInstID();
167  objectPersistence->setData(data);
168  objectPersistence->updated();
169  // Now: we are going to get the following:
170  // - two "objectUpdated" messages (one coming from GCS, one coming from Flight, which will
171  // confirm the object
172  // was properly received by both sides). This is because the metadata of objectPersistence has
173  // "FlightUpdateOnChange"
174  // set to true.
175  // - then one "transactionCompleted" indicating that the Flight side did not only receive the
176  // object but it did
177  // receive it without error (that message will be triggered by reception of the ACK).
178  // - Last we will get one last "objectUpdated" message coming from flight side, where we'll get
179  // the results of
180  // the objectPersistence operation we asked for (saved, other).
181 }
182 
193 void UAVObjectUtilManager::objectPersistenceTransactionCompleted(UAVObject *obj, bool success)
194 {
195  if (success) {
196  Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0);
197  Q_ASSERT(saveState == AWAITING_ACK);
198  // Two things can happen then:
199  // Either the Object Save Request did actually go through, and then we should get in
200  // "AWAITING_COMPLETED" mode, or the Object Save Request did _not_ go through, for example
201  // because the object does not exist and then we will never get a subsequent update - the
202  // flight firmware
203  // does not update the objectPersistence UAVO with "Error", it just ignores the request.
204  // For this reason, we will arm a 1 second timer to make provision for this and not block
205  // the queue:
206  saveState = AWAITING_COMPLETED;
207  UAVOBJECTUTIL_QXTLOG_DEBUG(QString("[saveObjectToFlash] Moving on to AWAITING_COMPLETED"));
208  disconnect(obj, SIGNAL(transactionCompleted(UAVObject *, bool)), this,
209  SLOT(objectPersistenceTransactionCompleted(UAVObject *, bool)));
210  failureTimer.start(2000); // Create a timeout
211  } else {
212  // Can be caused by timeout errors on sending. Forget it and send next.
213  UAVOBJECTUTIL_QXTLOG_DEBUG(QString("objectPersistenceTranscationCompleted (error))"));
214  ObjectPersistence *objectPersistence = ObjectPersistence::GetInstance(getObjectManager());
215  Q_ASSERT(objectPersistence);
216 
217  objectPersistence->disconnect(this);
218  queue.dequeue(); // We can now remove the object, it failed anyway.
219  saveState = IDLE;
220  // Careful below: objectPersistence contains a field 'ObjectID' that corresponds to
221  // the objectID we wanted to save. Don't confuse with the OBJID of the Objectpersistence
222  // UAVO itself!
223  emit saveCompleted(objectPersistence->getObjectID(), false);
224  saveNextObject();
225  }
226 }
227 
232 void UAVObjectUtilManager::objectPersistenceOperationFailed()
233 {
234  if (saveState == AWAITING_COMPLETED) {
235 
236  ObjectPersistence *objectPersistence = ObjectPersistence::GetInstance(getObjectManager());
237  Q_ASSERT(objectPersistence);
238 
239  UAVObject *obj = queue.dequeue(); // We can now remove the object, it failed anyway.
240  Q_ASSERT(obj);
241 
242  objectPersistence->disconnect(this);
243 
244  saveState = IDLE;
245  emit saveCompleted(obj->getObjID(), false);
246 
247  saveNextObject();
248  }
249 }
250 
256 void UAVObjectUtilManager::objectPersistenceUpdated(UAVObject *obj)
257 {
258  Q_ASSERT(obj);
259  Q_ASSERT(obj->getObjID() == ObjectPersistence::OBJID);
260 
261  if (saveState != AWAITING_COMPLETED) {
262  // We'll get two of those before we're in AWAITING_COMPLETED state...
263  return;
264  }
265 
266  ObjectPersistence::DataFields objectPersistence =
267  (static_cast<ObjectPersistence *>(obj))->getData();
268 
269  if (objectPersistence.Operation == ObjectPersistence::OPERATION_ERROR) {
270  failureTimer.stop();
271  objectPersistenceOperationFailed();
272  } else if (objectPersistence.Operation == ObjectPersistence::OPERATION_COMPLETED) {
273  failureTimer.stop();
274  // Check right object saved
275  UAVObject *savingObj = queue.head();
276  if (objectPersistence.ObjectID != savingObj->getObjID()) {
277  objectPersistenceOperationFailed();
278  return;
279  }
280 
281  obj->disconnect(this);
282  queue.dequeue(); // We can now remove the object, it's done.
283  saveState = IDLE;
284  UAVOBJECTUTIL_QXTLOG_DEBUG(QString("[saveObjectToFlash] Object save succeeded"));
285  emit saveCompleted(objectPersistence.ObjectID, true);
286  saveNextObject();
287  }
288 }
289 
295 QMap<QString, UAVObject::Metadata> UAVObjectUtilManager::readAllNonSettingsMetadata()
296 {
298 }
299 
305 QMap<QString, UAVObject::Metadata>
307 {
308  QMap<QString, UAVObject::Metadata> metaDataList;
309 
310  // Save all metadata objects.
311  UAVObjectManager *objManager = getObjectManager();
312  QVector<QVector<UAVDataObject *>> objList = objManager->getDataObjectsVector();
313  foreach (QVector<UAVDataObject *> list, objList) {
314  foreach (UAVDataObject *obj, list) {
315  bool updateMetadataFlag = false;
316  switch (metadataReadType) {
317  case ALL_METADATA:
318  updateMetadataFlag = true;
319  break;
321  if (obj->isSettings()) {
322  updateMetadataFlag = true;
323  }
324  break;
326  if (!obj->isSettings()) {
327  updateMetadataFlag = true;
328  }
329  break;
330  }
331 
332  if (updateMetadataFlag) {
333  metaDataList.insert(obj->getName(), obj->getMetadata());
334  }
335  }
336  }
337 
338  return metaDataList;
339 }
340 
348  QMap<QString, UAVObject::Metadata> metaDataList)
349 {
350  metadataSetEnum metadataSetType = NONSETTINGS_METADATA_ONLY;
351  setMetadata(metaDataList, metadataSetType);
352 
353  return true;
354 }
355 
363 bool UAVObjectUtilManager::setMetadata(QMap<QString, UAVObject::Metadata> metaDataSetList,
364  metadataSetEnum metadataSetType)
365 {
366  if (!metadataSendlist.isEmpty())
367  return false;
368  // Load all metadata objects.
369  UAVObjectManager *objManager = getObjectManager();
370  foreach (QString str, metaDataSetList.keys()) {
371  UAVDataObject *obj = dynamic_cast<UAVDataObject *>(objManager->getObject(str));
372  bool updateMetadataFlag = false;
373  switch (metadataSetType) {
374  case ALL_METADATA:
375  updateMetadataFlag = true;
376  break;
378  if (obj->isSettings()) {
379  updateMetadataFlag = true;
380  }
381  break;
383  if (!obj->isSettings()) {
384  updateMetadataFlag = true;
385  }
386  break;
387  }
388 
389  // Only enqueue objects that are present on hardware. If session
390  // management is disabled this will always return true.
391  if (updateMetadataFlag && obj->getIsPresentOnHardware()) {
392  UAVOBJECTUTIL_QXTLOG_DEBUG(QString("Enqueued %0").arg(obj->getName()));
393  metadataSendlist.insert(obj, metaDataSetList.value(str));
394  }
395  }
396  metadataSendSuccess = true;
397  if (metadataSendlist.isEmpty()) {
398  emit completedMetadataWrite(true);
399  return true;
400  }
401  UAVDataObject *obj = metadataSendlist.keys().first();
402 
403  // Connect transaction and timeout timers before making the request
404  connect(obj->getMetaObject(), SIGNAL(transactionCompleted(UAVObject *, bool)), this,
405  SLOT(metadataTransactionCompleted(UAVObject *, bool)), Qt::UniqueConnection);
406  obj->setMetadata(metadataSendlist.value(obj));
407 
408  return true;
409 }
410 
416 {
417  QMap<QString, UAVObject::Metadata> metaDataList;
418 
419  // Load all metadata object defaults
420  UAVObjectManager *objManager = getObjectManager();
421  QVector<QVector<UAVDataObject *>> objList = objManager->getDataObjectsVector();
422  foreach (QVector<UAVDataObject *> list, objList) {
423  foreach (UAVDataObject *obj, list) {
424  metaDataList.insert(obj->getName(), obj->getDefaultMetadata());
425  }
426  }
427 
428  // Save metadata
429  metadataSetEnum metadataSetType = ALL_METADATA;
430  bool ret = setMetadata(metaDataList, metadataSetType);
431 
432  return ret;
433 }
434 
441 void UAVObjectUtilManager::metadataTransactionCompleted(UAVObject *uavoObject, bool success)
442 {
443  UAVMetaObject *mobj = dynamic_cast<UAVMetaObject *>(uavoObject);
444  UAVDataObject *dobj = dynamic_cast<UAVDataObject *>(mobj->getParentObject());
445  Q_ASSERT(mobj);
446  Q_ASSERT(dobj);
447  if (metadataSendlist.contains(dobj)) {
448  if (success) {
449  UAVOBJECTUTIL_QXTLOG_DEBUG(
450  QString("Writing metadata succeded on %0").arg(uavoObject->getName()));
451  } else {
452  // If unsuccessful
453  metadataSendSuccess = false;
454  UAVOBJECTUTIL_QXTLOG_DEBUG(
455  QString("metadata send failed").arg(metadataSendlist.keys().first()->getName()));
456  }
457  disconnect(mobj, SIGNAL(transactionCompleted(UAVObject *, bool)), this,
458  SLOT(metadataTransactionCompleted(UAVObject *, bool)));
459  metadataSendlist.take(dobj);
460  if (!metadataSendlist.keys().isEmpty()) {
461  metadataSendlist.keys().first()->setMetadata(
462  metadataSendlist.value(metadataSendlist.keys().first()));
463  connect(metadataSendlist.keys().first()->getMetaObject(),
464  SIGNAL(transactionCompleted(UAVObject *, bool)), this,
465  SLOT(metadataTransactionCompleted(UAVObject *, bool)), Qt::UniqueConnection);
466  return;
467  } else {
468  emit completedMetadataWrite(metadataSendSuccess);
469  }
470  }
471 }
472 
476 FirmwareIAPObj::DataFields UAVObjectUtilManager::getFirmwareIap()
477 {
478  FirmwareIAPObj::DataFields dummy = {};
479 
480  FirmwareIAPObj *firmwareIap = FirmwareIAPObj::GetInstance(obm);
481  Q_ASSERT(firmwareIap);
482  if (!firmwareIap)
483  return dummy;
484 
485  return firmwareIap->getData();
486 }
487 
496 {
497  FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
498  int ret = firmwareIapData.BoardType << 8;
499  ret = ret + firmwareIapData.BoardRevision;
500  return ret;
501 }
502 
505 {
506  FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
507  int ret = firmwareIapData.BoardRevision;
508  return ret;
509 }
510 
513 {
514  int boardTypeNum = (getBoardModel() >> 8) & 0x00ff;
515  QList<Core::IBoardType *> boards = pm->getObjects<Core::IBoardType>();
516  foreach (Core::IBoardType *board, boards) {
517  if (board->getBoardType() == boardTypeNum)
518  return board;
519  }
520  return NULL;
521 }
522 
527 {
528  QByteArray cpuSerial;
529  FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
530 
531  for (unsigned int i = 0; i < FirmwareIAPObj::CPUSERIAL_NUMELEM; i++)
532  cpuSerial.append(firmwareIapData.CPUSerial[i]);
533 
534  return cpuSerial;
535 }
536 
538 {
539  FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
540  return firmwareIapData.crc;
541 }
542 
547 {
548  QByteArray ret;
549  FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
550 
551  for (unsigned int i = 0; i < FirmwareIAPObj::DESCRIPTION_NUMELEM; i++)
552  ret.append(firmwareIapData.Description[i]);
553 
554  return ret;
555 }
556 
557 // ******************************
558 // HomeLocation
559 
560 int UAVObjectUtilManager::setHomeLocation(double LLA[3], bool save_to_sdcard)
561 {
562  double Be[3];
563 
564  int retval = Utils::HomeLocationUtil().getDetails(LLA, Be);
565  Q_ASSERT(retval >= 0);
566 
567  if (retval < 0)
568  return -1;
569 
570  // ******************
571  // save the new settings
572 
573  HomeLocation *homeLocation = HomeLocation::GetInstance(obm);
574  Q_ASSERT(homeLocation != NULL);
575 
576  HomeLocation::DataFields homeLocationData = homeLocation->getData();
577  homeLocationData.Latitude = LLA[0] * 1e7;
578  homeLocationData.Longitude = LLA[1] * 1e7;
579  homeLocationData.Altitude = LLA[2];
580 
581  homeLocationData.Be[0] = Be[0];
582  homeLocationData.Be[1] = Be[1];
583  homeLocationData.Be[2] = Be[2];
584 
585  homeLocationData.Set = HomeLocation::SET_TRUE;
586 
587  homeLocation->setData(homeLocationData);
588 
589  if (save_to_sdcard)
590  saveObjectToFlash(homeLocation);
591 
592  return 0;
593 }
594 
596 {
597  HomeLocation *homeLocation = HomeLocation::GetInstance(obm);
598  Q_ASSERT(homeLocation != NULL);
599 
600  HomeLocation::DataFields homeLocationData = homeLocation->getData();
601 
602  set = homeLocationData.Set;
603 
604  LLA[0] = homeLocationData.Latitude * 1e-7;
605  LLA[1] = homeLocationData.Longitude * 1e-7;
606  LLA[2] = homeLocationData.Altitude;
607 
608  if (LLA[0] != LLA[0])
609  LLA[0] = 0; // nan detection
610  else if (LLA[0] > 90)
611  LLA[0] = 90;
612  else if (LLA[0] < -90)
613  LLA[0] = -90;
614 
615  if (LLA[1] != LLA[1])
616  LLA[1] = 0; // nan detection
617  else if (LLA[1] > 180)
618  LLA[1] = 180;
619  else if (LLA[1] < -180)
620  LLA[1] = -180;
621 
622  if (LLA[2] != LLA[2])
623  LLA[2] = 0; // nan detection
624 
625  return 0; // OK
626 }
627 
628 // ******************************
629 // GPS
630 
632 {
633  GPSPosition *gpsPosition = GPSPosition::GetInstance(obm);
634  Q_ASSERT(gpsPosition != NULL);
635 
636  GPSPosition::DataFields gpsPositionData = gpsPosition->getData();
637 
638  LLA[0] = gpsPositionData.Latitude;
639  LLA[1] = gpsPositionData.Longitude;
640  LLA[2] = gpsPositionData.Altitude;
641 
642  if (LLA[0] != LLA[0])
643  LLA[0] = 0; // nan detection
644  else if (LLA[0] > 90)
645  LLA[0] = 90;
646  else if (LLA[0] < -90)
647  LLA[0] = -90;
648 
649  if (LLA[1] != LLA[1])
650  LLA[1] = 0; // nan detection
651  else if (LLA[1] > 180)
652  LLA[1] = 180;
653  else if (LLA[1] < -180)
654  LLA[1] = -180;
655 
656  if (LLA[2] != LLA[2])
657  LLA[2] = 0; // nan detection
658 
659  return 0; // OK
660 }
661 
663 {
664  bool ret = descriptionToStructure(getBoardDescription(), device);
665  return ret;
666 }
667 
669 {
670  if (desc.startsWith("TlFw") || desc.startsWith("OpFw")) {
671  /*
672  * This looks like a binary with a description at the end
673  * 4 bytes: header: "TlFw"
674  * 4 bytes: git commit hash (short version of SHA1)
675  * 4 bytes: Unix timestamp of last git commit
676  * 2 bytes: target platform. Should follow same rule as BOARD_TYPE and BOARD_REVISION in
677  * board define files.
678  * 26 bytes: commit tag if it is there, otherwise "Unreleased". Zero-padded
679  * 20 bytes: SHA1 sum of the firmware.
680  * 20 bytes: SHA1 sum of the UAVO definition files.
681  * 8 bytes: git commit hash of common ancestor of the firmware with next
682  * 12 bytes: user defined string
683  */
684 
685  // Note: the ARM binary is big-endian:
686  quint32 gitCommitHash = desc.at(7) & 0xFF;
687  for (int i = 0; i < 4; i++) {
688  gitCommitHash = gitCommitHash << 8;
689  gitCommitHash += desc.at(7 - i) & 0xFF;
690  }
691  struc.gitHash = QString("%1").arg(gitCommitHash, 8, 16, QChar('0'));
692 
693  quint64 gitAncestorHash = 0;
694  for (int i = 0; i < 8; i++) {
695  gitAncestorHash = gitAncestorHash << 8;
696  gitAncestorHash += desc.at(87 - i) & 0xFF;
697  }
698  struc.nextAncestor = QString("%1").arg(gitAncestorHash, 16, 16, QChar('0'));
699 
700  quint32 gitDate = desc.at(11) & 0xFF;
701  for (int i = 1; i < 4; i++) {
702  gitDate = gitDate << 8;
703  gitDate += desc.at(11 - i) & 0xFF;
704  }
705  struc.gitDate = QDateTime::fromTime_t(gitDate).toUTC().toString("yyyyMMdd HH:mm");
706 
707  QString gitTag = QString(desc.mid(14, 26));
708  struc.gitTag = gitTag;
709 
710  // TODO: check platform compatibility
711  QByteArray targetPlatform = desc.mid(12, 2);
712  struc.boardType = (int)targetPlatform.at(0);
713  struc.boardRevision = (int)targetPlatform.at(1);
714  struc.fwHash = desc.mid(40, 20);
715  struc.uavoHash = desc.mid(60, 20);
716 
717  // The git tag format used for releases is Release-yyyymmdd, optionally with a suffix
718  // .[0-9] to allow multiple tags on the same day e.g. if a bug is discovered immediately
719  QRegularExpression certifiedPattern("^Release-20[0-9]{6}(\\.[0-9])?$");
720  if (certifiedPattern.match(struc.gitTag).hasMatch())
721  struc.certified = true;
722  else
723  struc.certified = false;
724  struc.userDefined = desc.mid(88, 12);
725 
726  return true;
727  }
728  return false;
729 }
730 
732 {
734  if (getBoardDescriptionStruct(dev))
735  return dev.gitHash;
736  return QString();
737 }
738 
740 {
742 }
743 
749 {
750  return getFirmwareHash().toLower() == getGcsHash().toLower();
751 }
752 
759 {
760  auto actuatorSettings = ActuatorSettings::GetInstance(obm);
761  if (!actuatorSettings)
762  return true; // this might seem odd, but matches the API description
763 
764  if (!actuatorSettings->getIsPresentOnHardware())
765  return true; // Maybe pipx, maybe mismatched fw ver...
766 
767  auto minField = actuatorSettings->getField("ChannelMin");
768  auto maxField = actuatorSettings->getField("ChannelMax");
769  if (!minField || !maxField)
770  return true;
771 
772  for (auto i = 0; i < maxField->getNumElements(); i++) {
773  if (maxField->getValue(i).toInt() > 0)
774  return true;
775  }
776 
777  for (auto i = 0; i < minField->getNumElements(); i++) {
778  if (minField->getValue(i).toInt() > 0)
779  return true;
780  }
781 
782  return false;
783 }
784 
785 // ******************************
virtual Metadata getDefaultMetadata()=0
void completedMetadataWrite(bool)
QMap< QString, UAVObject::Metadata > readMetadata(metadataSetEnum metadataReadType)
UAVObjectUtilManager::readMetadata Get metadata for UAVOs.
void setMetadata(const Metadata &mdata)
UAVObject * getParentObject()
bool resetMetadataToDefaults()
UAVObjectUtilManager::resetMetadata Resets all metadata to defaults (from XML definitions) ...
for i
Definition: OPPlots.m:140
int getBoardType()
Get the board type number.
Definition: iboardtype.h:147
QMap< QString, UAVObject::Metadata > readAllNonSettingsMetadata()
UAVObjectUtilManager::readAllNonSettingsMetadata Convenience function for calling readMetadata...
quint32 getInstID()
Definition: uavobject.cpp:115
DataFields data
const char *const GCS_REVISION_SHORT_STR
Definition: coreconstants.h:58
UAVMetaObject * getMetaObject()
bool setAllNonSettingsMetadata(QMap< QString, UAVObject::Metadata >)
UAVObjectUtilManager::setAllNonSettingsMetadata Convenience function for calling setMetadata.
bool setMetadata(QMap< QString, UAVObject::Metadata >, metadataSetEnum metadataUpdateType)
UAVObjectUtilManager::setMetadata Sets the metadata for all metadata in QMap.
void saveObjectToFlash(UAVObject *obj)
UAVObjectUtilManager::saveObjectToSD Add a new object to save in the queue.
bool firmwareHashMatchesGcs()
Check if firmware version hash matches GCS version hash.
int getGPSPosition(double LLA[3])
UAVObjectManager * getObjectManager()
bool getIsPresentOnHardware() const
quint32 getObjID()
Definition: uavobject.cpp:107
static bool descriptionToStructure(QByteArray desc, deviceDescriptorStruct &struc)
QString getName()
Definition: uavobject.cpp:131
Metadata getMetadata()
int setHomeLocation(double LLA[3], bool save_to_sdcard)
void saveCompleted(int objectID, bool status)
int getDetails(double LLA[3], double Be[3])
Get local magnetic field.
LLA
Definition: OPPlots.m:34
bool getBoardDescriptionStruct(deviceDescriptorStruct &device)
FirmwareIAPObj::DataFields getFirmwareIap()
UAVObject * getObject(const QString &name, quint32 instId=0)
QVector< QVector< UAVDataObject * > > getDataObjectsVector()
Core::IBoardType * getBoardType()
Get the IBoardType corresponding to the connected board.
bool boardConfigured()
Check if the board has been configured for flight The heuristic is whether one or more actuators are ...
e
Definition: OPPlots.m:99
int getBoardRevision()
Get the connected board hardware revision.
int getHomeLocation(bool &set, double LLA[3])