mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Merge branch 'next' into revo
This commit is contained in:
commit
71e14a691e
@ -1,5 +1,12 @@
|
||||
Short summary of changes. For a complete list see the git log.
|
||||
|
||||
2012-05-26
|
||||
Revert some UI changes that didn't work consistently between OSX and Windows.
|
||||
|
||||
2012-05-24
|
||||
Merged the updated firmware for the PipXtreme, thanks to Brian for a lot of
|
||||
work on this.
|
||||
|
||||
2012-05-04
|
||||
Support for CC3D. This involved changes to various things such as the sensors
|
||||
being split from AttitudeRaw to Accels,Gyros,Magnetometer. A single firmware
|
||||
|
@ -122,6 +122,7 @@ static const struct flashfs_cfg flashfs_w25x_cfg = {
|
||||
.obj_table_start = 0x00000010,
|
||||
.obj_table_end = 0x00001000,
|
||||
.sector_size = 0x00001000,
|
||||
.chip_size = 0x00080000,
|
||||
};
|
||||
|
||||
static const struct pios_flash_jedec_cfg flash_w25x_cfg = {
|
||||
@ -135,6 +136,7 @@ static const struct flashfs_cfg flashfs_m25p_cfg = {
|
||||
.obj_table_start = 0x00000010,
|
||||
.obj_table_end = 0x00010000,
|
||||
.sector_size = 0x00010000,
|
||||
.chip_size = 0x00200000,
|
||||
};
|
||||
|
||||
static const struct pios_flash_jedec_cfg flash_m25p_cfg = {
|
||||
|
@ -215,7 +215,7 @@ static void objectUpdatedCb(UAVObjEvent * ev)
|
||||
// Get object data
|
||||
ObjectPersistenceGet(&objper);
|
||||
|
||||
int retval = -1;
|
||||
int retval = 1;
|
||||
// Execute action
|
||||
if (objper.Operation == OBJECTPERSISTENCE_OPERATION_LOAD) {
|
||||
if (objper.Selection == OBJECTPERSISTENCE_SELECTION_SINGLEOBJECT) {
|
||||
@ -242,6 +242,13 @@ static void objectUpdatedCb(UAVObjEvent * ev)
|
||||
}
|
||||
// Save selected instance
|
||||
retval = UAVObjSave(obj, objper.InstanceID);
|
||||
|
||||
// Not sure why this is needed
|
||||
vTaskDelay(10);
|
||||
|
||||
// Verify saving worked
|
||||
if (retval == 0)
|
||||
retval = UAVObjLoad(obj, objper.InstanceID);
|
||||
} else if (objper.Selection == OBJECTPERSISTENCE_SELECTION_ALLSETTINGS
|
||||
|| objper.Selection == OBJECTPERSISTENCE_SELECTION_ALLOBJECTS) {
|
||||
retval = UAVObjSaveSettings();
|
||||
@ -271,9 +278,17 @@ static void objectUpdatedCb(UAVObjEvent * ev)
|
||||
retval = PIOS_FLASHFS_Format();
|
||||
#endif
|
||||
}
|
||||
if(retval == 0) {
|
||||
objper.Operation = OBJECTPERSISTENCE_OPERATION_COMPLETED;
|
||||
ObjectPersistenceSet(&objper);
|
||||
switch(retval) {
|
||||
case 0:
|
||||
objper.Operation = OBJECTPERSISTENCE_OPERATION_COMPLETED;
|
||||
ObjectPersistenceSet(&objper);
|
||||
break;
|
||||
case -1:
|
||||
objper.Operation = OBJECTPERSISTENCE_OPERATION_ERROR;
|
||||
ObjectPersistenceSet(&objper);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,6 +186,7 @@ static int32_t PIOS_FLASHFS_GetObjAddress(uint32_t objId, uint16_t instId)
|
||||
* @retval -2 No room in object table
|
||||
* @retval -3 Unable to write entry into object table
|
||||
* @retval -4 FS not initialized
|
||||
* @retval -5
|
||||
*/
|
||||
int32_t PIOS_FLASHFS_GetNewAddress(uint32_t objId, uint16_t instId)
|
||||
{
|
||||
@ -206,6 +207,10 @@ int32_t PIOS_FLASHFS_GetNewAddress(uint32_t objId, uint16_t instId)
|
||||
if((addr + sizeof(header)) > cfg->obj_table_end)
|
||||
return -2;
|
||||
|
||||
// Verify the address is within the chip
|
||||
if((addr + cfg->sector_size) > cfg->chip_size)
|
||||
return -5;
|
||||
|
||||
if(PIOS_Flash_Jedec_WriteData(addr, (uint8_t *) &header, sizeof(header)) != 0)
|
||||
return -3;
|
||||
|
||||
|
@ -37,6 +37,7 @@ struct flashfs_cfg {
|
||||
uint32_t obj_table_start;
|
||||
uint32_t obj_table_end;
|
||||
uint32_t sector_size;
|
||||
uint32_t chip_size;
|
||||
};
|
||||
|
||||
int32_t PIOS_FLASHFS_Init(const struct flashfs_cfg * cfg);
|
||||
|
@ -277,6 +277,7 @@ static const struct flashfs_cfg flashfs_m25p_cfg = {
|
||||
.obj_table_start = 0x00000010,
|
||||
.obj_table_end = 0x00010000,
|
||||
.sector_size = 0x00010000,
|
||||
.chip_size = 0x00200000,
|
||||
};
|
||||
|
||||
static const struct pios_flash_jedec_cfg flash_m25p_cfg = {
|
||||
|
@ -74,8 +74,8 @@ typedef enum {
|
||||
*
|
||||
* Bit(s) Name Meaning
|
||||
* ------ ---- -------
|
||||
* 0 access Defines the access level for the local transactions (readonly=0 and readwrite=1)
|
||||
* 1 gcsAccess Defines the access level for the local GCS transactions (readonly=0 and readwrite=1), not used in the flight s/w
|
||||
* 0 access Defines the access level for the local transactions (readonly=1 and readwrite=0)
|
||||
* 1 gcsAccess Defines the access level for the local GCS transactions (readonly=1 and readwrite=0), not used in the flight s/w
|
||||
* 2 telemetryAcked Defines if an ack is required for the transactions of this object (1:acked, 0:not acked)
|
||||
* 3 gcsTelemetryAcked Defines if an ack is required for the transactions of this object (1:acked, 0:not acked)
|
||||
* 4-5 telemetryUpdateMode Update mode used by the telemetry module (UAVObjUpdateMode)
|
||||
|
@ -721,10 +721,11 @@ int32_t UAVObjLoad(UAVObjHandle obj, uint16_t instId)
|
||||
return -1;
|
||||
|
||||
// Fire event on success
|
||||
if (PIOS_FLASHFS_ObjLoad(obj, instId, instEntry->data) == 0)
|
||||
int32_t retval;
|
||||
if ((retval = PIOS_FLASHFS_ObjLoad(obj, instId, instEntry->data)) == 0)
|
||||
sendEvent(objEntry, instId, EV_UNPACKED);
|
||||
else
|
||||
return -1;
|
||||
return retval;
|
||||
#endif
|
||||
|
||||
#if defined(PIOS_INCLUDE_SDCARD)
|
||||
|
@ -97,6 +97,9 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget
|
||||
// Request and update of the setting object.
|
||||
settingsUpdated = false;
|
||||
pipxSettingsObj->requestUpdate();
|
||||
|
||||
disableMouseWheelEvents();
|
||||
|
||||
}
|
||||
|
||||
ConfigPipXtremeWidget::~ConfigPipXtremeWidget()
|
||||
|
@ -23,6 +23,96 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QGraphicsView" name="graphicsView_Spectrum">
|
||||
<property name="backgroundBrush">
|
||||
<brush brushstyle="NoBrush">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</property>
|
||||
<property name="foregroundBrush">
|
||||
<brush brushstyle="NoBrush">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</property>
|
||||
<property name="interactive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="message">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="submitButtons">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Apply">
|
||||
<property name="toolTip">
|
||||
<string>Send settings to the board but do not save to the non-volatile memory</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Save">
|
||||
<property name="toolTip">
|
||||
<string>Send settings to the board and save to the non-volatile memory</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
@ -1216,106 +1306,54 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QGraphicsView" name="graphicsView_Spectrum">
|
||||
<property name="backgroundBrush">
|
||||
<brush brushstyle="NoBrush">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</property>
|
||||
<property name="foregroundBrush">
|
||||
<brush brushstyle="NoBrush">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</property>
|
||||
<property name="interactive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="message">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="submitButtons">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Apply">
|
||||
<property name="toolTip">
|
||||
<string>Send settings to the board but do not save to the non-volatile memory</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="Save">
|
||||
<property name="toolTip">
|
||||
<string>Send settings to the board and save to the non-volatile memory</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>frame_2</zorder>
|
||||
<zorder>groupBox</zorder>
|
||||
<zorder>layoutWidget</zorder>
|
||||
<zorder>layoutWidget_2</zorder>
|
||||
<zorder>graphicsView_Spectrum</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>PairSelect1</tabstop>
|
||||
<tabstop>PairID1</tabstop>
|
||||
<tabstop>PairSelect2</tabstop>
|
||||
<tabstop>PairID2</tabstop>
|
||||
<tabstop>PairSelect3</tabstop>
|
||||
<tabstop>PairID3</tabstop>
|
||||
<tabstop>PairSelect4</tabstop>
|
||||
<tabstop>PairID4</tabstop>
|
||||
<tabstop>FirmwareVersion</tabstop>
|
||||
<tabstop>SerialNumber</tabstop>
|
||||
<tabstop>DeviceID</tabstop>
|
||||
<tabstop>MinFrequency</tabstop>
|
||||
<tabstop>MaxFrequency</tabstop>
|
||||
<tabstop>FrequencyStepSize</tabstop>
|
||||
<tabstop>LinkState</tabstop>
|
||||
<tabstop>RxAFC</tabstop>
|
||||
<tabstop>Retries</tabstop>
|
||||
<tabstop>Errors</tabstop>
|
||||
<tabstop>UAVTalkErrors</tabstop>
|
||||
<tabstop>Resets</tabstop>
|
||||
<tabstop>TXRate</tabstop>
|
||||
<tabstop>RXRate</tabstop>
|
||||
<tabstop>TelemPortConfig</tabstop>
|
||||
<tabstop>TelemPortSpeed</tabstop>
|
||||
<tabstop>FlexiPortConfig</tabstop>
|
||||
<tabstop>FlexiPortSpeed</tabstop>
|
||||
<tabstop>VCPConfig</tabstop>
|
||||
<tabstop>VCPSpeed</tabstop>
|
||||
<tabstop>MaxRFDatarate</tabstop>
|
||||
<tabstop>MaxRFTxPower</tabstop>
|
||||
<tabstop>SendTimeout</tabstop>
|
||||
<tabstop>MinPacketSize</tabstop>
|
||||
<tabstop>FrequencyCalibration</tabstop>
|
||||
<tabstop>Frequency</tabstop>
|
||||
<tabstop>ScanSpectrum</tabstop>
|
||||
<tabstop>AESKey</tabstop>
|
||||
<tabstop>AESKeyRandom</tabstop>
|
||||
<tabstop>AESEnable</tabstop>
|
||||
<tabstop>graphicsView_Spectrum</tabstop>
|
||||
<tabstop>Apply</tabstop>
|
||||
<tabstop>Save</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -124,6 +124,17 @@ void ModeManager::activateMode(const QString &id)
|
||||
m_modeStack->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
void ModeManager::activateModeByWorkspaceName(const QString &id)
|
||||
{
|
||||
for (int i = 0; i < m_modes.count(); ++i) {
|
||||
if (m_modes.at(i)->name() == id)
|
||||
{
|
||||
m_modeStack->setCurrentIndex(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ModeManager::objectAdded(QObject *obj)
|
||||
{
|
||||
IMode *mode = Aggregation::query<IMode>(obj);
|
||||
|
@ -80,6 +80,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void activateMode(const QString &id);
|
||||
void activateModeByWorkspaceName(const QString &id);
|
||||
void setFocusToCurrentMode();
|
||||
|
||||
private slots:
|
||||
|
@ -256,7 +256,10 @@ void NotifyPluginOptionsPage::addDynamicField(UAVObjectField* objField)
|
||||
_dynamicFieldCondition->removeItem(smaller);
|
||||
_dynamicFieldCondition->removeItem(bigger);
|
||||
}
|
||||
_dynamicFieldCondition->setCurrentIndex(_dynamicFieldCondition->findText(NotifyPluginOptionsPage::conditionValues.at(_selectedNotification->getCondition())));
|
||||
int cond=_selectedNotification->getCondition();
|
||||
if(cond<0)
|
||||
return;
|
||||
_dynamicFieldCondition->setCurrentIndex(_dynamicFieldCondition->findText(NotifyPluginOptionsPage::conditionValues.at(cond)));
|
||||
|
||||
connect(_dynamicFieldCondition, SIGNAL(currentIndexChanged(QString)),
|
||||
this, SLOT(on_changedIndex_rangeValue(QString)));
|
||||
@ -434,8 +437,10 @@ void NotifyPluginOptionsPage::updateConfigView(NotificationItem* notification)
|
||||
_optionsPage->SoundCollectionList->setCurrentIndex(_optionsPage->SoundCollectionList->findText("default"));
|
||||
_optionsPage->Sound3->setCurrentIndex(_optionsPage->Sound3->findText(notification->getSound3()));
|
||||
}
|
||||
|
||||
_dynamicFieldCondition->setCurrentIndex(_dynamicFieldCondition->findText(NotifyPluginOptionsPage::conditionValues.at(notification->getCondition())));
|
||||
int cond=notification->getCondition();
|
||||
if(cond<0)
|
||||
return;
|
||||
_dynamicFieldCondition->setCurrentIndex(_dynamicFieldCondition->findText(NotifyPluginOptionsPage::conditionValues.at(cond)));
|
||||
|
||||
_sayOrder->setCurrentIndex(notification->getSayOrder());
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
#include <objectpersistence.h>
|
||||
#include <firmwareiapobj.h>
|
||||
|
||||
// ******************************
|
||||
// constructor/destructor
|
||||
@ -199,25 +200,63 @@ void UAVObjectUtilManager::objectPersistenceOperationFailed()
|
||||
*/
|
||||
void UAVObjectUtilManager::objectPersistenceUpdated(UAVObject * obj)
|
||||
{
|
||||
qDebug() << "objectPersistenceUpdated: " << obj->getField("Operation")->getValue().toString();
|
||||
Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0);
|
||||
if(saveState == AWAITING_COMPLETED) {
|
||||
failureTimer.stop();
|
||||
// Check flight is saying it completed. This is the only thing flight should do to trigger an update.
|
||||
Q_ASSERT( obj->getField("Operation")->getValue().toString().compare(QString("Completed")) == 0 );
|
||||
Q_ASSERT(obj);
|
||||
Q_ASSERT(obj->getObjID() == ObjectPersistence::OBJID);
|
||||
ObjectPersistence::DataFields objectPersistence = ((ObjectPersistence *)obj)->getData();
|
||||
|
||||
if(saveState == AWAITING_COMPLETED && objectPersistence.Operation == ObjectPersistence::OPERATION_ERROR) {
|
||||
failureTimer.stop();
|
||||
objectPersistenceOperationFailed();
|
||||
} else if (saveState == AWAITING_COMPLETED &&
|
||||
objectPersistence.Operation == ObjectPersistence::OPERATION_COMPLETED) {
|
||||
failureTimer.stop();
|
||||
// Check right object saved
|
||||
UAVObject* savingObj = queue.head();
|
||||
Q_ASSERT( obj->getField("ObjectID")->getValue() == savingObj->getObjID() );
|
||||
if(objectPersistence.ObjectID != savingObj->getObjID() ) {
|
||||
objectPersistenceOperationFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
obj->disconnect(this);
|
||||
queue.dequeue(); // We can now remove the object, it's done.
|
||||
saveState = IDLE;
|
||||
emit saveCompleted(obj->getField("ObjectID")->getValue().toInt(), true);
|
||||
|
||||
emit saveCompleted(objectPersistence.ObjectID, true);
|
||||
saveNextObject();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function that makes sure FirmwareIAP is updated and then returns the data
|
||||
*/
|
||||
FirmwareIAPObj::DataFields UAVObjectUtilManager::getFirmwareIap()
|
||||
{
|
||||
FirmwareIAPObj::DataFields dummy;
|
||||
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
Q_ASSERT(pm);
|
||||
if (!pm)
|
||||
return dummy;
|
||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
||||
Q_ASSERT(om);
|
||||
if (!om)
|
||||
return dummy;
|
||||
|
||||
FirmwareIAPObj *firmwareIap = FirmwareIAPObj::GetInstance(om);
|
||||
Q_ASSERT(firmwareIap);
|
||||
if (!firmwareIap)
|
||||
return dummy;
|
||||
|
||||
// The code below will ask for the object update and wait for the updated to be received,
|
||||
// or the timeout of the timer, set to 1 second.
|
||||
QEventLoop loop;
|
||||
connect(firmwareIap, SIGNAL(objectUpdated(UAVObject*)), &loop, SLOT(quit()));
|
||||
QTimer::singleShot(1000, &loop, SLOT(quit())); // Create a timeout
|
||||
firmwareIap->requestUpdate();
|
||||
loop.exec();
|
||||
|
||||
return firmwareIap->getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the UAV Board model, for anyone interested. Return format is:
|
||||
@ -225,25 +264,8 @@ void UAVObjectUtilManager::objectPersistenceUpdated(UAVObject * obj)
|
||||
*/
|
||||
int UAVObjectUtilManager::getBoardModel()
|
||||
{
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
if (!pm)
|
||||
return 0;
|
||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
||||
if (!om)
|
||||
return 0;
|
||||
|
||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("FirmwareIAPObj")));
|
||||
// The code below will ask for the object update and wait for the updated to be received,
|
||||
// or the timeout of the timer, set to 1 second.
|
||||
QEventLoop loop;
|
||||
connect(obj, SIGNAL(objectUpdated(UAVObject*)), &loop, SLOT(quit()));
|
||||
QTimer::singleShot(1000, &loop, SLOT(quit())); // Create a timeout
|
||||
obj->requestUpdate();
|
||||
loop.exec();
|
||||
|
||||
int boardType = (obj->getField("BoardType")->getValue().toInt()) << 8;
|
||||
boardType += obj->getField("BoardRevision")->getValue().toInt();
|
||||
return boardType;
|
||||
FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
|
||||
return (firmwareIapData.BoardType << 8) + firmwareIapData.BoardRevision;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -252,54 +274,18 @@ int UAVObjectUtilManager::getBoardModel()
|
||||
QByteArray UAVObjectUtilManager::getBoardCPUSerial()
|
||||
{
|
||||
QByteArray cpuSerial;
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
if (!pm)
|
||||
return 0;
|
||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
||||
if (!om)
|
||||
return 0;
|
||||
FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
|
||||
|
||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("FirmwareIAPObj")));
|
||||
// The code below will ask for the object update and wait for the updated to be received,
|
||||
// or the timeout of the timer, set to 1 second.
|
||||
QEventLoop loop;
|
||||
connect(obj, SIGNAL(objectUpdated(UAVObject*)), &loop, SLOT(quit()));
|
||||
QTimer::singleShot(1000, &loop, SLOT(quit())); // Create a timeout
|
||||
obj->requestUpdate();
|
||||
loop.exec();
|
||||
for (int i = 0; i < FirmwareIAPObj::CPUSERIAL_NUMELEM; i++)
|
||||
cpuSerial.append(firmwareIapData.CPUSerial[i]);
|
||||
|
||||
UAVObjectField* cpuField = obj->getField("CPUSerial");
|
||||
for (uint i = 0; i < cpuField->getNumElements(); ++i) {
|
||||
cpuSerial.append(cpuField->getValue(i).toUInt());
|
||||
}
|
||||
return cpuSerial;
|
||||
}
|
||||
|
||||
quint32 UAVObjectUtilManager::getFirmwareCRC()
|
||||
{
|
||||
quint32 fwCRC;
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
if (!pm)
|
||||
return 0;
|
||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
||||
if (!om)
|
||||
return 0;
|
||||
|
||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("FirmwareIAPObj")));
|
||||
obj->getField("crc")->setValue(0);
|
||||
obj->updated();
|
||||
// The code below will ask for the object update and wait for the updated to be received,
|
||||
// or the timeout of the timer, set to 1 second.
|
||||
QEventLoop loop;
|
||||
connect(obj, SIGNAL(objectUpdated(UAVObject*)), &loop, SLOT(quit()));
|
||||
QTimer::singleShot(1000, &loop, SLOT(quit())); // Create a timeout
|
||||
obj->requestUpdate();
|
||||
loop.exec();
|
||||
|
||||
UAVObjectField* fwCRCField = obj->getField("crc");
|
||||
|
||||
fwCRC=(quint32)fwCRCField->getValue().toLongLong();
|
||||
return fwCRC;
|
||||
FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
|
||||
return firmwareIapData.crc;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -308,27 +294,11 @@ quint32 UAVObjectUtilManager::getFirmwareCRC()
|
||||
QByteArray UAVObjectUtilManager::getBoardDescription()
|
||||
{
|
||||
QByteArray ret;
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
if (!pm)
|
||||
return 0;
|
||||
UAVObjectManager *om = pm->getObject<UAVObjectManager>();
|
||||
if (!om)
|
||||
return 0;
|
||||
FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap();
|
||||
|
||||
UAVDataObject *obj = dynamic_cast<UAVDataObject *>(om->getObject(QString("FirmwareIAPObj")));
|
||||
// The code below will ask for the object update and wait for the updated to be received,
|
||||
// or the timeout of the timer, set to 1 second.
|
||||
QEventLoop loop;
|
||||
connect(obj, SIGNAL(objectUpdated(UAVObject*)), &loop, SLOT(quit()));
|
||||
QTimer::singleShot(1000, &loop, SLOT(quit())); // Create a timeout
|
||||
obj->requestUpdate();
|
||||
loop.exec();
|
||||
for (int i = 0; i < FirmwareIAPObj::DESCRIPTION_NUMELEM; i++)
|
||||
ret.append(firmwareIapData.Description[i]);
|
||||
|
||||
UAVObjectField* descriptionField = obj->getField("Description");
|
||||
// Description starts with an offset of
|
||||
for (uint i = 0; i < descriptionField->getNumElements(); ++i) {
|
||||
ret.append(descriptionField->getValue(i).toInt());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include <QQueue>
|
||||
#include <QComboBox>
|
||||
#include <QDateTime>
|
||||
#include <firmwareiapobj.h>
|
||||
|
||||
class UAVOBJECTUTIL_EXPORT UAVObjectUtilManager: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -69,6 +71,8 @@ public:
|
||||
static bool descriptionToStructure(QByteArray desc,deviceDescriptorStruct * struc);
|
||||
UAVObjectManager* getObjectManager();
|
||||
void saveObjectToSD(UAVObject *obj);
|
||||
protected:
|
||||
FirmwareIAPObj::DataFields getFirmwareIap();
|
||||
|
||||
signals:
|
||||
void saveCompleted(int objectID, bool status);
|
||||
|
@ -51,37 +51,37 @@ Rectangle {
|
||||
WelcomePageButton {
|
||||
baseIconName: "flightdata"
|
||||
label: "Flight Data"
|
||||
onClicked: welcomePlugin.openPage("Mode1")
|
||||
onClicked: welcomePlugin.openPage("Flight data")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "config"
|
||||
label: "Configuration"
|
||||
onClicked: welcomePlugin.openPage("Mode2")
|
||||
onClicked: welcomePlugin.openPage("Configuration")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "planner"
|
||||
label: "Flight Planner"
|
||||
onClicked: welcomePlugin.openPage("Mode3")
|
||||
onClicked: welcomePlugin.openPage("Flight Planner")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "scopes"
|
||||
label: "Scopes"
|
||||
onClicked: welcomePlugin.openPage("Mode4")
|
||||
onClicked: welcomePlugin.openPage("Scopes")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "hitl"
|
||||
label: "HIL"
|
||||
onClicked: welcomePlugin.openPage("Mode5")
|
||||
label: "HITL"
|
||||
onClicked: welcomePlugin.openPage("HITL")
|
||||
}
|
||||
|
||||
WelcomePageButton {
|
||||
baseIconName: "firmware"
|
||||
label: "Firmware"
|
||||
onClicked: welcomePlugin.openPage("Mode6")
|
||||
onClicked: welcomePlugin.openPage("Firmware")
|
||||
}
|
||||
} //icons grid
|
||||
} // images row
|
||||
|
@ -124,7 +124,7 @@ void WelcomeMode::openUrl(const QString &url)
|
||||
|
||||
void WelcomeMode::openPage(const QString &page)
|
||||
{
|
||||
Core::ModeManager::instance()->activateMode(page);
|
||||
Core::ModeManager::instance()->activateModeByWorkspaceName(page);
|
||||
}
|
||||
|
||||
} // namespace Welcome
|
||||
|
@ -1,7 +1,7 @@
|
||||
<xml>
|
||||
<object name="ObjectPersistence" singleinstance="true" settings="false">
|
||||
<description>Someone who knows please enter this</description>
|
||||
<field name="Operation" units="" type="enum" elements="1" options="NOP,Load,Save,Delete,FullErase,Completed"/>
|
||||
<field name="Operation" units="" type="enum" elements="1" options="NOP,Load,Save,Delete,FullErase,Completed,Error"/>
|
||||
<field name="Selection" units="" type="enum" elements="1" options="SingleObject,AllSettings,AllMetaObjects,AllObjects"/>
|
||||
<field name="ObjectID" units="" type="uint32" elements="1"/>
|
||||
<field name="InstanceID" units="" type="uint32" elements="1"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user