1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-20 05:52:11 +01:00

Mostly complete PipX configuration GUI.

This commit is contained in:
Brian Webb 2012-05-11 17:51:18 -07:00
parent 513c014f5a
commit 1f5dbcf57c
13 changed files with 655 additions and 396 deletions

View File

@ -100,6 +100,10 @@ typedef struct {
uint32_t radioTxErrors;
uint32_t radioTxRetries;
uint32_t radioRxErrors;
uint32_t UAVTalkErrors;
uint32_t packetErrors;
uint16_t txBytes;
uint16_t rxBytes;
// The destination ID
uint32_t destination_id;
@ -214,6 +218,8 @@ static int32_t RadioComBridgeInitialize(void)
data->comTxErrors = 0;
data->comTxRetries = 0;
data->comRxErrors = 0;
data->UAVTalkErrors = 0;
data->packetErrors = 0;
// Register the callbacks with the packet handler
PHRegisterOutputStream(pios_packet_handler, transmitPacket);
@ -236,6 +242,7 @@ static int32_t RadioComBridgeInitialize(void)
// Configure our UAVObjects for updates.
UAVObjConnectQueue(UAVObjGetByName("PipXStatus"), data->objEventQueue, EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATE_REQ);
UAVObjConnectQueue(UAVObjGetByName("GCSReceiver"), data->objEventQueue, EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATE_REQ);
UAVObjConnectQueue(UAVObjGetByName("ObjectPersistence"), data->objEventQueue, EV_UPDATED | EV_UPDATED_MANUAL);
return 0;
}
@ -270,6 +277,7 @@ static void comUAVTalkTask(void *parameters)
uint8_t rx_byte;
if(!BufferedRead(f, &rx_byte, MAX_PORT_DELAY))
continue;
data->txBytes++;
// Get a TX packet from the packet handler if required.
if (p == NULL)
@ -307,61 +315,76 @@ static void comUAVTalkTask(void *parameters)
UAVTalkRxState state = UAVTalkProcessInputStreamQuiet(data->inUAVTalkCon, rx_byte);
UAVTalkConnectionData *connection = (UAVTalkConnectionData*)(data->inUAVTalkCon);
UAVTalkInputProcessor *iproc = &(connection->iproc);
if (state == UAVTALK_STATE_COMPLETE) {
// Is this a local UAVObject?
if (iproc->obj != NULL)
{
// We treat the ObjectPersistance object differently
// We treat the ObjectPersistence object differently
if(iproc->objId == OBJECTPERSISTENCE_OBJID)
{
// Unpack object, if the instance does not exist it will be created!
UAVObjUnpack(iproc->obj, iproc->instId, connection->rxBuffer);
// Get the ObjectPersistance object.
// Get the ObjectPersistence object.
ObjectPersistenceData obj_per;
ObjectPersistenceGet(&obj_per);
// Is this concerning or setting object?
if (obj_per.ObjectID == PIPXSETTINGS_OBJID)
{
// Queue up the ACK.
UAVObjEvent ev;
ev.obj = iproc->obj;
ev.instId = 0;
ev.instId = iproc->instId;
ev.event = EV_SEND_ACK;
xQueueSend(data->objEventQueue, &ev, MAX_PORT_DELAY);
// Is this a save, load, or delete?
bool success = true;
switch (obj_per.Operation)
{
case OBJECTPERSISTENCE_OPERATION_LOAD:
DEBUG_PRINTF(2, "Load\n\r");
break;
case OBJECTPERSISTENCE_OPERATION_SAVE:
#if defined(PIOS_INCLUDE_FLASH_EEPROM)
{
#if defined(PIOS_INCLUDE_FLASH_EEPROM)
// Load the settings.
PipXSettingsData pipxSettings;
if (PIOS_EEPROM_Load((uint8_t*)&pipxSettings, sizeof(PipXSettingsData)) == 0)
PipXSettingsSet(&pipxSettings);
else
success = false;
#endif
break;
}
case OBJECTPERSISTENCE_OPERATION_SAVE:
{
#if defined(PIOS_INCLUDE_FLASH_EEPROM)
// Save the settings.
PipXSettingsData pipxSettings;
PipXSettingsGet(&pipxSettings);
if (PIOS_EEPROM_Save((uint8_t*)&pipxSettings, sizeof(PipXSettingsData)) != 0)
ev.event = EV_SEND_NACK;
int32_t ret = PIOS_EEPROM_Save((uint8_t*)&pipxSettings, sizeof(PipXSettingsData));
if (ret != 0)
success = false;
#endif
break;
}
#endif
case OBJECTPERSISTENCE_OPERATION_DELETE:
DEBUG_PRINTF(2, "Delete\n\r");
break;
default:
DEBUG_PRINTF(2, "Other\n\r");
break;
}
if (success == true)
{
obj_per.Operation = OBJECTPERSISTENCE_OPERATION_COMPLETED;
ObjectPersistenceSet(&obj_per);
}
// Queue up the ACK/NACK
xQueueSend(data->objEventQueue, &ev, MAX_PORT_DELAY);
// Release the packet, since we don't need it.
PHReleaseTXPacket(pios_packet_handler, p);
}
else {
else
{
// Otherwise, queue the packet for transmission.
xQueueSend(data->sendPacketQueue, &p, MAX_PORT_DELAY);
p = NULL;
}
}
else
@ -381,36 +404,48 @@ static void comUAVTalkTask(void *parameters)
xQueueSend(data->objEventQueue, &ev, MAX_PORT_DELAY);
break;
case UAVTALK_TYPE_OBJ_ACK:
if (UAVObjUnpack(iproc->obj, iproc->instId, connection->rxBuffer) == 0)
{
// Queue up an ACK
ev.event = EV_SEND_ACK;
UAVObjUnpack(iproc->obj, iproc->instId, connection->rxBuffer);
xQueueSend(data->objEventQueue, &ev, MAX_PORT_DELAY);
}
break;
}
// Release the packet, since we don't need it.
PHReleaseTXPacket(pios_packet_handler, p);
}
}
else
{
// Queue the packet for transmission.
xQueueSend(data->sendPacketQueue, &p, MAX_PORT_DELAY);
p = NULL;
}
p = NULL;
} else if(state == UAVTALK_STATE_ERROR) {
DEBUG_PRINTF(1, "UAVTalk FAILED!\n\r");
data->UAVTalkErrors++;
// Send a NACK if required.
if((iproc->obj) && (iproc->type == UAVTALK_TYPE_OBJ_ACK))
{
// Queue up a NACK
UAVObjEvent ev;
ev.obj = iproc->obj;
ev.event = EV_SEND_NACK;
xQueueSend(data->objEventQueue, &ev, MAX_PORT_DELAY);
// Release the packet and start over again.
PHReleaseTXPacket(pios_packet_handler, p);
p = NULL;
// Send a NACK if required.
if((iproc->obj) && (iproc->type == UAVTALK_TYPE_ACK))
{
UAVObjEvent ev;
ev.obj = iproc->obj;
// Queue up a NACK
ev.event = EV_SEND_NACK;
xQueueSend(data->objEventQueue, &ev, MAX_PORT_DELAY);
}
else
{
// Transmit the packet anyway...
xQueueSend(data->sendPacketQueue, &p, MAX_PORT_DELAY);
}
p = NULL;
}
}
}
@ -445,6 +480,7 @@ static void radioReceiveTask(void *parameters)
rx_bytes = PIOS_COM_ReceiveBuffer(data->radio_port, (uint8_t*)p, PIOS_PH_MAX_PACKET, MAX_PORT_DELAY);
if(rx_bytes == 0)
continue;
data->rxBytes += rx_bytes;
// Verify that the packet is valid and pass it on.
if(PHVerifyPacket(pios_packet_handler, p, rx_bytes) > 0) {
@ -453,7 +489,10 @@ static void radioReceiveTask(void *parameters)
ev.event = EV_PACKET_RECEIVED;
xQueueSend(data->objEventQueue, &ev, portMAX_DELAY);
} else
{
data->packetErrors++;
PHReceivePacket(pios_packet_handler, p, false);
}
p = NULL;
}
}
@ -632,6 +671,12 @@ static void radioStatusTask(void *parameters)
pipxStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id);
pipxStatus.RSSI = PIOS_RFM22B_RSSI(pios_rfm22b_id);
pipxStatus.Resets = PIOS_RFM22B_Resets(pios_rfm22b_id);
pipxStatus.Errors = data->packetErrors;
pipxStatus.UAVTalkErrors = data->UAVTalkErrors;
pipxStatus.TXRate = (uint16_t)((float)(data->txBytes * 1000) / STATS_UPDATE_PERIOD_MS);
data->txBytes = 0;
pipxStatus.RXRate = (uint16_t)((float)(data->rxBytes * 1000) / STATS_UPDATE_PERIOD_MS);
data->rxBytes = 0;
// Update the potential pairing contacts
for (uint8_t i = 0; i < PIPXSTATUS_PAIRIDS_NUMELEM; ++i)
@ -678,7 +723,7 @@ static int32_t transmitData(uint8_t *buf, int32_t length)
if (PIOS_USB_CheckAvailable(0) && PIOS_COM_TELEM_USB)
outputPort = PIOS_COM_TELEM_USB;
#endif /* PIOS_INCLUDE_USB */
return PIOS_COM_SendBufferNonBlocking(outputPort, buf, length);
return PIOS_COM_SendBuffer(outputPort, buf, length);
}
/**

View File

@ -73,7 +73,7 @@ int32_t PIOS_EEPROM_Save(uint8_t *data, uint32_t len)
// See if we have to write the data.
if ((memcmp(data, (uint8_t*)config.base_address, len) == 0) &&
(memcmp((uint8_t*)crc, (uint8_t*)config.base_address + size - 4, 4) == 0))
(memcmp((uint8_t*)&crc, (uint8_t*)config.base_address + size - 4, 4) == 0))
return 0;
// TODO: Check that the area isn't already erased

View File

@ -180,7 +180,13 @@ void PIOS_Board_Init(void) {
#endif /* PIOS_INCLUDE_USB */
/* Configure USART1 */
/* Configure USART1 (telemetry port) */
switch (pipxSettings.TelemetryConfig)
{
case PIPXSETTINGS_TELEMETRYCONFIG_SERIAL:
case PIPXSETTINGS_TELEMETRYCONFIG_UAVTALK:
case PIPXSETTINGS_TELEMETRYCONFIG_DEBUG:
case PIPXSETTINGS_TELEMETRYCONFIG_DISABLED:
{
uint32_t pios_usart1_id;
if (PIOS_USART_Init(&pios_usart1_id, &pios_usart_serial_cfg)) {
@ -196,9 +202,20 @@ void PIOS_Board_Init(void) {
tx_buffer, PIOS_COM_SERIAL_TX_BUF_LEN)) {
PIOS_Assert(0);
}
break;
}
case PIPXSETTINGS_TELEMETRYCONFIG_PPM_IN:
case PIPXSETTINGS_TELEMETRYCONFIG_PPM_OUT:
case PIPXSETTINGS_TELEMETRYCONFIG_RSSI:
break;
}
/* Configure USART3 */
switch (pipxSettings.FlexiConfig)
{
case PIPXSETTINGS_FLEXICONFIG_SERIAL:
case PIPXSETTINGS_FLEXICONFIG_UAVTALK:
case PIPXSETTINGS_FLEXICONFIG_DEBUG:
{
uint32_t pios_usart3_id;
if (PIOS_USART_Init(&pios_usart3_id, &pios_usart_telem_flexi_cfg)) {
@ -213,6 +230,13 @@ void PIOS_Board_Init(void) {
tx_buffer, PIOS_COM_FLEXI_TX_BUF_LEN)) {
PIOS_Assert(0);
}
break;
}
case PIPXSETTINGS_FLEXICONFIG_PPM_IN:
case PIPXSETTINGS_FLEXICONFIG_PPM_OUT:
case PIPXSETTINGS_FLEXICONFIG_RSSI:
case PIPXSETTINGS_FLEXICONFIG_DISABLED:
break;
}
#if defined(PIOS_INCLUDE_RFM22B)

View File

@ -45,9 +45,45 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget
qDebug() << "Error: Object is unknown (PipXStatus).";
}
// Connect to the PipXSettings object updates
pipxSettingsObj = dynamic_cast<UAVDataObject*>(objManager->getObject("PipXSettings"));
if (pipxSettingsObj != NULL ) {
connect(pipxSettingsObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateSettings(UAVObject*)));
} else {
qDebug() << "Error: Object is unknown (PipXSettings).";
}
addApplySaveButtons(m_pipx->Apply, m_pipx->Save);
connect(m_pipx->Apply, SIGNAL(clicked()), this, SLOT(applySettings()));
connect(m_pipx->Save, SIGNAL(clicked()), this, SLOT(saveSettings()));
//connect(m_pipx->Apply, SIGNAL(clicked()), this, SLOT(applySettings()));
//connect(m_pipx->Save, SIGNAL(clicked()), this, SLOT(saveSettings()));
addUAVObjectToWidgetRelation("PipXSettings", "TelemetryConfig", m_pipx->TelemPortConfig);
addUAVObjectToWidgetRelation("PipXSettings", "TelemetrySpeed", m_pipx->TelemPortSpeed);
addUAVObjectToWidgetRelation("PipXSettings", "FlexiConfig", m_pipx->FlexiPortConfig);
addUAVObjectToWidgetRelation("PipXSettings", "FlexiSpeed", m_pipx->FlexiPortSpeed);
addUAVObjectToWidgetRelation("PipXSettings", "VCPConfig", m_pipx->VCPConfig);
addUAVObjectToWidgetRelation("PipXSettings", "VCPSpeed", m_pipx->VCPSpeed);
addUAVObjectToWidgetRelation("PipXSettings", "RFSpeed", m_pipx->MaxRFDatarate);
addUAVObjectToWidgetRelation("PipXSettings", "MaxRFPower", m_pipx->MaxRFTxPower);
addUAVObjectToWidgetRelation("PipXSettings", "SendTimeout", m_pipx->SendTimeout);
addUAVObjectToWidgetRelation("PipXSettings", "MinPacketSize", m_pipx->MinPacketSize);
addUAVObjectToWidgetRelation("PipXSettings", "FrequencyCalibration", m_pipx->FrequencyCalibration);
addUAVObjectToWidgetRelation("PipXSettings", "Frequency", m_pipx->Frequency);
addUAVObjectToWidgetRelation("PipXStatus", "MinFrequency", m_pipx->MinFrequency);
addUAVObjectToWidgetRelation("PipXStatus", "MaxFrequency", m_pipx->MaxFrequency);
addUAVObjectToWidgetRelation("PipXStatus", "FrequencyStepSize", m_pipx->FrequencyStepSize);
addUAVObjectToWidgetRelation("PipXStatus", "AFC", m_pipx->RxAFC);
addUAVObjectToWidgetRelation("PipXStatus", "Retries", m_pipx->Retries);
addUAVObjectToWidgetRelation("PipXStatus", "Errors", m_pipx->Errors);
addUAVObjectToWidgetRelation("PipXStatus", "UAVTalkErrors", m_pipx->UAVTalkErrors);
addUAVObjectToWidgetRelation("PipXStatus", "Resets", m_pipx->Resets);
addUAVObjectToWidgetRelation("PipXStatus", "RXRate", m_pipx->RXRate);
addUAVObjectToWidgetRelation("PipXStatus", "TXRate", m_pipx->TXRate);
// Request and update of the setting object.
settingsUpdated = false;
pipxSettingsObj->requestUpdate();
}
ConfigPipXtremeWidget::~ConfigPipXtremeWidget()
@ -81,7 +117,7 @@ void ConfigPipXtremeWidget::applySettings()
void ConfigPipXtremeWidget::saveSettings()
{
applySettings();
//applySettings();
UAVObject *obj = PipXSettings::GetInstance(getObjectManager());
saveObjectToSD(obj);
}
@ -91,9 +127,9 @@ void ConfigPipXtremeWidget::saveSettings()
*/
void ConfigPipXtremeWidget::updateStatus(UAVObject *object) {
// Get the settings object.
PipXSettings *pipxSettings = PipXSettings::GetInstance(getObjectManager());
PipXSettings::DataFields pipxSettingsData = pipxSettings->getData();
// Request and update of the setting object if we haven't received it yet.
if (!settingsUpdated)
pipxSettingsObj->requestUpdate();
// Update the detected devices.
UAVObjectField* pairIdField = object->getField("PairIDs");
@ -101,22 +137,22 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) {
quint32 pairid1 = pairIdField->getValue(0).toUInt();
m_pipx->PairID1->setText(QString::number(pairid1, 16).toUpper());
m_pipx->PairID1->setEnabled(false);
m_pipx->PairSelect1->setChecked(pipxSettingsData.PairID == pairid1);
m_pipx->PairSelect1->setChecked(pairID == pairid1);
m_pipx->PairSelect1->setEnabled(pairid1);
quint32 pairid2 = pairIdField->getValue(1).toUInt();
m_pipx->PairID2->setText(QString::number(pairIdField->getValue(1).toUInt(), 16).toUpper());
m_pipx->PairID2->setEnabled(false);
m_pipx->PairSelect2->setChecked(pipxSettingsData.PairID == pairid2);
m_pipx->PairSelect2->setChecked(pairID == pairid2);
m_pipx->PairSelect2->setEnabled(pairid2);
quint32 pairid3 = pairIdField->getValue(2).toUInt();
m_pipx->PairID3->setText(QString::number(pairIdField->getValue(2).toUInt(), 16).toUpper());
m_pipx->PairID3->setEnabled(false);
m_pipx->PairSelect3->setChecked(pipxSettingsData.PairID == pairid3);
m_pipx->PairSelect3->setChecked(pairID == pairid3);
m_pipx->PairSelect3->setEnabled(pairid3);
quint32 pairid4 = pairIdField->getValue(3).toUInt();
m_pipx->PairID4->setText(QString::number(pairIdField->getValue(3).toUInt(), 16).toUpper());
m_pipx->PairID4->setEnabled(false);
m_pipx->PairSelect4->setChecked(pipxSettingsData.PairID == pairid4);
m_pipx->PairSelect4->setChecked(pairID == pairid4);
m_pipx->PairSelect4->setEnabled(pairid4);
} else {
qDebug() << "PipXtremeGadgetWidget: Count not read PairID field.";
@ -187,32 +223,20 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) {
} else {
qDebug() << "PipXtremeGadgetWidget: Count not read link state field.";
}
// Update the Retries field
UAVObjectField* retriesField = object->getField("Retries");
if (retriesField) {
m_pipx->Retries->setText(QString::number(retriesField->getValue().toUInt()));
} else {
qDebug() << "PipXtremeGadgetWidget: Count not read Retries field.";
}
// Update the Errors field
UAVObjectField* errorsField = object->getField("Errors");
if (errorsField) {
m_pipx->Errors->setText(QString::number(errorsField->getValue().toUInt()));
} else {
qDebug() << "PipXtremeGadgetWidget: Count not read Errors field.";
}
// Update the Resets field
UAVObjectField* resetsField = object->getField("Resets");
if (resetsField) {
m_pipx->Retries->setText(QString::number(resetsField->getValue().toUInt()));
} else {
qDebug() << "PipXtremeGadgetWidget: Count not read Resets field.";
}
}
/*!
\brief Called by updates to @PipXSettings
*/
void ConfigPipXtremeWidget::updateSettings(UAVObject *object) {
settingsUpdated = true;
enableControls(true);
// Get the settings object.
PipXSettings *pipxSettings = PipXSettings::GetInstance(getObjectManager());
PipXSettings::DataFields pipxSettingsData = pipxSettings->getData();
pairID = pipxSettingsData.PairID;
}
/**
@}

View File

@ -40,6 +40,7 @@ public:
public slots:
void updateStatus(UAVObject *object1);
void updateSettings(UAVObject *object1);
private:
Ui_PipXtremeWidget *m_pipx;
@ -47,6 +48,12 @@ private:
// The PipXtreme status UAVObject
UAVDataObject* pipxStatusObj;
// The PipXtreme ssettins UAVObject
UAVDataObject* pipxSettingsObj;
bool settingsUpdated;
quint32 pairID;
private slots:
void refreshValues();
void applySettings();

759
ground/openpilotgcs/src/plugins/config/pipxtreme.ui Normal file → Executable file
View File

@ -270,16 +270,6 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Frequency Band</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Min Frequency</string>
@ -289,7 +279,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="4" column="1">
<widget class="QLineEdit" name="MinFrequency">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -330,7 +320,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Max Frequency</string>
@ -340,7 +330,7 @@
</property>
</widget>
</item>
<item row="6" column="1">
<item row="5" column="1">
<widget class="QLineEdit" name="MaxFrequency">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -381,7 +371,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Frequency Step Size</string>
@ -391,7 +381,7 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="6" column="1">
<widget class="QLineEdit" name="FrequencyStepSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -432,7 +422,7 @@
</property>
</widget>
</item>
<item row="8" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Link State</string>
@ -442,7 +432,7 @@
</property>
</widget>
</item>
<item row="8" column="1">
<item row="7" column="1">
<widget class="QLineEdit" name="LinkState">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -483,7 +473,7 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Rx AFC</string>
@ -493,7 +483,7 @@
</property>
</widget>
</item>
<item row="9" column="1">
<item row="8" column="1">
<widget class="QLineEdit" name="RxAFC">
<property name="font">
<font>
@ -516,7 +506,7 @@
</property>
</widget>
</item>
<item row="10" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Retries</string>
@ -526,7 +516,7 @@
</property>
</widget>
</item>
<item row="10" column="1">
<item row="9" column="1">
<widget class="QLineEdit" name="Retries">
<property name="font">
<font>
@ -552,48 +542,7 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="FrequencyBand">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>The modems frequency band</string>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 8px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="11" column="1">
<item row="10" column="1">
<widget class="QLineEdit" name="Errors">
<property name="font">
<font>
@ -619,7 +568,7 @@
</property>
</widget>
</item>
<item row="11" column="0">
<item row="10" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Errors</string>
@ -629,6 +578,150 @@
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="UAVTalkErrorsLabel">
<property name="text">
<string>UAVTalk Errors</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLineEdit" name="UAVTalkErrors">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 8px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="ResetsLabel">
<property name="text">
<string>Resets</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QLineEdit" name="Resets">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 8px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="TXRateLabel">
<property name="text">
<string>TX Rate (B/s)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QLineEdit" name="TXRate">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 8px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="RXRateLabel">
<property name="text">
<string>RX Rate (B/s)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QLineEdit" name="RXRate">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 8px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="frame">
<bool>false</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="DeviceID">
<property name="font">
@ -683,10 +776,235 @@
<string>Configuration</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="9" column="0">
<widget class="QLabel" name="label_5">
<item row="0" column="0">
<widget class="QLabel" name="TelemPortConfigLabel">
<property name="text">
<string>Frequency (MHz)</string>
<string>Telemetry Port Configuration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="TelemPortConfig">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the telemetry port configuration</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="TelemPortSpeedLabel">
<property name="text">
<string>Telemetry Port Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="TelemPortSpeed">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the telemetry port speed</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="FlexiPortConfigLabel">
<property name="text">
<string>Flexi Port Configuration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="FlexiPortConfig">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the flexi port configuration</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="FlexiPortSpeedConfig">
<property name="text">
<string>Flexi Port Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="FlexiPortSpeed">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the flexi port speed</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="VCPConfigLabel">
<property name="text">
<string>VCP Configuration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="VCPConfig">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the virtual serial port configuration</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="VCPSpeedLabel">
<property name="text">
<string>VCP Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="VCPSpeed">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the virtual serial port speed</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="MaxRFDatarateLabel">
<property name="text">
<string>Max RF Datarate (bits/s)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="MaxRFDatarate">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the maximum RF datarate/channel bandwidth the modem will use</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="MaxRFTxPowerLabel">
<property name="text">
<string>Max RF Tx Power(mW)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="MaxRFTxPower">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the maximum TX output power the modem will use</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="SendTimeoutLabel">
<property name="text">
<string>Send Timeout (ms)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="SendTimeout">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Calibrate the modems RF carrier frequency</string>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="MinPacketSizeLabel">
<property name="text">
<string>Min Packet Size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@ -694,7 +1012,77 @@
</widget>
</item>
<item row="9" column="1">
<widget class="QDoubleSpinBox" name="Frequency">
<widget class="QSpinBox" name="MinPacketSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Calibrate the modems RF carrier frequency</string>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="FreqCalLabel">
<property name="text">
<string>Frequency Calibration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QSpinBox" name="FrequencyCalibration">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Calibrate the modems RF carrier frequency</string>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Frequency (Hz)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QSpinBox" name="Frequency">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -716,148 +1104,14 @@
<property name="accelerated">
<bool>true</bool>
</property>
<property name="decimals">
<number>8</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
<double>0</double>
</property>
<property name="maximum">
<double>1000.000000000000000</double>
<double>1000000000</double>
</property>
<property name="singleStep">
<double>0.000001000000000</double>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="SerialPortSpeed">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the modems serial port speed</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Serial Port Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="MaxRFDatarate">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the maximum RF datarate/channel bandwidth the modem will use</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Max RF Datarate (bits/s)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="MaxRFTxPower">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the maximum TX output power the modem will use</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Max RF Tx Power(mW)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Send Timeout (ms)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Flexi Port Configuration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="FlexiPortSpeed">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the modems serial port speed</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="FlexiPortConfig">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the modems serial port speed</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Flexi Port Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<double>100000</double>
</property>
</widget>
</item>
@ -953,101 +1207,6 @@
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="SendTimeout">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Calibrate the modems RF carrier frequency</string>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_21">
<property name="text">
<string>Min Packet Size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="MinPacketSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Calibrate the modems RF carrier frequency</string>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="FrequencyCalibration">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Calibrate the modems RF carrier frequency</string>
</property>
<property name="accelerated">
<bool>true</bool>
</property>
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Frequency Calibration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -150,7 +150,7 @@ void UAVObjectUtilManager::objectPersistenceTransactionCompleted(UAVObject* obj,
// the queue:
saveState = AWAITING_COMPLETED;
disconnect(obj, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool)));
failureTimer.start(1000); // Create a timeout
failureTimer.start(2000); // Create a timeout
} else {
// Can be caused by timeout errors on sending. Forget it and send next.
qDebug() << "objectPersistenceTranscationCompleted (error)";

View File

@ -26,12 +26,13 @@
*/
#include "configtaskwidget.h"
#include <QtGui/QWidget>
#include <QtGui/QLineEdit>
#include "uavsettingsimportexport/uavsettingsimportexportfactory.h"
/**
* Constructor
*/
ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);"),timeOut(NULL)
ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);")
{
pm = ExtensionSystem::PluginManager::instance();
objManager = pm->getObject<UAVObjectManager>();
@ -126,7 +127,7 @@ void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString fiel
Q_ASSERT(obj);
objectUpdates.insert(obj,true);
connect(obj, SIGNAL(objectUpdated(UAVObject*)),this, SLOT(objectUpdated(UAVObject*)));
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues()));
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*)));
}
if(!field.isEmpty() && obj)
_field = obj->getField(QString(field));
@ -175,10 +176,6 @@ ConfigTaskWidget::~ConfigTaskWidget()
if(oTw)
delete oTw;
}
if(timeOut)
{
delete timeOut;
}
}
void ConfigTaskWidget::saveObjectToSD(UAVObject *obj)
@ -255,7 +252,7 @@ void ConfigTaskWidget::populateWidgets()
* object field added to the framework pool
* Overwrite this if you need to change the default behavior
*/
void ConfigTaskWidget::refreshWidgetsValues()
void ConfigTaskWidget::refreshWidgetsValues(UAVObject * obj)
{
bool dirtyBack=dirty;
emit refreshWidgetsValuesRequested();
@ -267,8 +264,8 @@ void ConfigTaskWidget::refreshWidgetsValues()
}
else
{
if(ow->object==obj || obj==NULL)
setWidgetFromField(ow->widget,ow->field,ow->index,ow->scale,ow->isLimited);
}
}
@ -465,7 +462,7 @@ void ConfigTaskWidget::enableObjUpdates()
foreach(objectToWidget * obj,objOfInterest)
{
if(obj->object)
connect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues()));
connect(obj->object, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshWidgetsValues(UAVObject*)));
}
}
/**
@ -784,7 +781,7 @@ void ConfigTaskWidget::reloadButtonClicked()
if(!list)
return;
ObjectPersistence* objper = dynamic_cast<ObjectPersistence*>( getObjectManager()->getObject(ObjectPersistence::NAME) );
timeOut=new QTimer(this);
QTimer * timeOut=new QTimer(this);
QEventLoop * eventLoop=new QEventLoop(this);
connect(timeOut, SIGNAL(timeout()),eventLoop,SLOT(quit()));
connect(objper, SIGNAL(objectUpdated(UAVObject*)), eventLoop, SLOT(quit()));
@ -803,22 +800,13 @@ void ConfigTaskWidget::reloadButtonClicked()
eventLoop->exec();
if(timeOut->isActive())
{
oTw->object->requestUpdate();
setWidgetFromField(oTw->widget,oTw->field,oTw->index,oTw->scale,oTw->isLimited);
}
timeOut->stop();
}
}
if(eventLoop)
{
delete eventLoop;
eventLoop=NULL;
}
if(timeOut)
{
delete timeOut;
timeOut=NULL;
}
}
/**
@ -1004,6 +992,14 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, dou
cb->setChecked(bvalue);
return true;
}
else if(QLineEdit * cb=qobject_cast<QLineEdit *>(widget))
{
if(scale==0)
cb->setText(value.toString());
else
cb->setText(QString::number((value.toDouble()/scale)));
return true;
}
else
return false;
}

View File

@ -164,14 +164,13 @@ private:
void disconnectWidgetUpdatesToSlot(QWidget *widget, const char *function);
void loadWidgetLimits(QWidget *widget, UAVObjectField *field, int index, bool hasLimits, double sclale);
QString outOfLimitsStyle;
QTimer * timeOut;
protected slots:
virtual void disableObjUpdates();
virtual void enableObjUpdates();
virtual void clearDirty();
virtual void widgetsContentsChanged();
virtual void populateWidgets();
virtual void refreshWidgetsValues();
virtual void refreshWidgetsValues(UAVObject * obj=NULL);
virtual void updateObjectsFromWidgets();
virtual void helpButtonPressed();
protected:

View File

@ -87,7 +87,7 @@ void smartSaveButton::processOperation(QPushButton * button,bool save)
connect(obj,SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(transaction_finished(UAVObject*, bool)));
connect(&timer,SIGNAL(timeout()),&loop,SLOT(quit()));
obj->updated();
timer.start(1000);
timer.start(2000);
//qDebug()<<"begin loop";
loop.exec();
//qDebug()<<"end loop";
@ -113,7 +113,7 @@ void smartSaveButton::processOperation(QPushButton * button,bool save)
connect(utilMngr,SIGNAL(saveCompleted(int,bool)),this,SLOT(saving_finished(int,bool)));
connect(&timer,SIGNAL(timeout()),&loop,SLOT(quit()));
utilMngr->saveObjectToSD(obj);
timer.start(1000);
timer.start(2000);
loop.exec();
timer.stop();
disconnect(utilMngr,SIGNAL(saveCompleted(int,bool)),this,SLOT(saving_finished(int,bool)));

4
ground/openpilotgcs/src/plugins/uavtalk/telemetry.cpp Normal file → Executable file
View File

@ -27,6 +27,8 @@
#include "telemetry.h"
#include "qxtlogger.h"
#include "pipxsettings.h"
#include "objectpersistence.h"
#include <QTime>
#include <QtGlobal>
#include <stdlib.h>
@ -393,7 +395,7 @@ void Telemetry::processObjectQueue()
if ( gcsStats.Status != GCSTelemetryStats::STATUS_CONNECTED )
{
objQueue.clear();
if ( objInfo.obj->getObjID() != GCSTelemetryStats::OBJID )
if ( objInfo.obj->getObjID() != GCSTelemetryStats::OBJID && objInfo.obj->getObjID() != PipXSettings::OBJID && objInfo.obj->getObjID() != ObjectPersistence::OBJID )
{
objInfo.obj->emitTransactionCompleted(false);
return;

View File

@ -2,14 +2,14 @@
<object name="PipXSettings" singleinstance="true" settings="true">
<description>PipXtreme configurations options.</description>
<field name="PairID" units="" type="uint32" elements="1" defaultvalue="0"/>
<field name="TelemetryConfig" units="function" type="enum" elements="1" options="Disabled,Serial,UAVTalk,RSSI" defaultvalue="UAVTalk"/>
<field name="TelemetryConfig" units="function" type="enum" elements="1" options="Disabled,Serial,UAVTalk,PPM_In,PPM_Out,RSSI,Debug" defaultvalue="UAVTalk"/>
<field name="TelemetrySpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/>
<field name="FlexiConfig" units="function" type="enum" elements="1" options="Disabled,Serial,UAVTalk,PPM,RSSI" defaultvalue="Disabled"/>
<field name="FlexiConfig" units="function" type="enum" elements="1" options="Disabled,Serial,UAVTalk,PPM_In,PPM_Out,RSSI,Debug" defaultvalue="Disabled"/>
<field name="FlexiSpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/>
<field name="VCPConfig" units="function" type="enum" elements="1" options="Disabled,Serial,UAVTalk" defaultvalue="Disabled"/>
<field name="VCPSpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="57600"/>
<field name="RFSpeed" units="bps" type="enum" elements="1" options="2400,4800,9600,19200,38400,57600,115200" defaultvalue="115200"/>
<field name="MaxRFPower" units="mW" type="enum" elements="1" options="1.25,1.6,3.16,6.3,12.6,25,50,100" defaultvalue="1.25"/>
<field name="MaxRFPower" units="mW" type="enum" elements="1" options="1.25,1.6,3.16,6.3,12.6,25,50,100" defaultvalue="100"/>
<field name="SendTimeout" units="ms" type="uint16" elements="1" defaultvalue="50"/>
<field name="MinPacketSize" units="bytes" type="uint8" elements="1" defaultvalue="50"/>
<field name="FrequencyCalibration" units="" type="uint8" elements="1" defaultvalue="127"/>

View File

@ -13,7 +13,10 @@
<field name="AFC" units="" type="int32" elements="1" defaultvalue="0"/>
<field name="Retries" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="Errors" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="UAVTalkErrors" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="Resets" units="" type="uint16" elements="1" defaultvalue="0"/>
<field name="TXRate" units="Bps" type="uint16" elements="1" defaultvalue="0"/>
<field name="RXRate" units="Bps" type="uint16" elements="1" defaultvalue="0"/>
<field name="RSSI" units="dBm" type="int8" elements="1" defaultvalue="0"/>
<field name="LinkState" units="function" type="enum" elements="1" options="Disconnected,Connecting,Connected" defaultvalue="Disconnected"/>
<field name="PairIDs" units="" type="uint32" elements="4" defaultvalue="0"/>