From 57b4d8c720730676fdf84346e0bf93d92e65760a Mon Sep 17 00:00:00 2001 From: Brian Webb Date: Thu, 31 Jan 2013 13:37:03 +0000 Subject: [PATCH] RFM22: Added support for binding to multiple remove OPLinks. --- flight/Modules/PipXtreme/pipxtrememod.c | 2 - .../Modules/RadioComBridge/RadioComBridge.c | 17 +- flight/PiOS/Common/pios_rfm22b.c | 123 +- flight/PiOS/inc/pios_rfm22b.h | 4 +- flight/PiOS/inc/pios_rfm22b_priv.h | 4 + flight/PipXtreme/System/pios_board.c | 84 +- .../plugins/config/configpipxtremewidget.cpp | 150 +- .../plugins/config/configpipxtremewidget.h | 15 +- .../src/plugins/config/pipxtreme.ui | 2237 ++++++++--------- shared/uavobjectdefinition/oplinksettings.xml | 10 +- 10 files changed, 1309 insertions(+), 1337 deletions(-) diff --git a/flight/Modules/PipXtreme/pipxtrememod.c b/flight/Modules/PipXtreme/pipxtrememod.c index 77f61109f..269b46156 100644 --- a/flight/Modules/PipXtreme/pipxtrememod.c +++ b/flight/Modules/PipXtreme/pipxtrememod.c @@ -155,9 +155,7 @@ static void systemTask(void *parameters) // Update the PipXstatus UAVO OPLinkStatusData oplinkStatus; - uint32_t pairID; OPLinkStatusGet(&oplinkStatus); - OPLinkSettingsPairIDGet(&pairID); // Get the other device stats. PIOS_RFM2B_GetPairStats(pios_rfm22b_id, oplinkStatus.PairIDs, oplinkStatus.PairSignalStrengths, OPLINKSTATUS_PAIRIDS_NUMELEM); diff --git a/flight/Modules/RadioComBridge/RadioComBridge.c b/flight/Modules/RadioComBridge/RadioComBridge.c index adda6cd60..905d08888 100644 --- a/flight/Modules/RadioComBridge/RadioComBridge.c +++ b/flight/Modules/RadioComBridge/RadioComBridge.c @@ -489,20 +489,20 @@ static void configureComCallback(OPLinkSettingsOutputConnectionOptions com_port, */ static void updateSettings() { - // Get the settings. OPLinkSettingsData oplinkSettings; OPLinkSettingsGet(&oplinkSettings); - bool is_coordinator = (oplinkSettings.Coordinator == OPLINKSETTINGS_COORDINATOR_TRUE); + // Set the bindings. + PIOS_RFM22B_SetBindings(pios_rfm22b_id, oplinkSettings.Bindings); + + //bool is_coordinator = (oplinkSettings.PairID != 0); + bool is_coordinator = PIOS_RFM22B_IsCoordinator(pios_rfm22b_id); if (is_coordinator) { // Set the remote com configuration parameters PIOS_RFM22B_SetRemoteComConfig(pios_rfm22b_id, oplinkSettings.OutputConnection, oplinkSettings.ComSpeed); - // Configure the RFM22B device as coordinator or not - PIOS_RFM22B_SetCoordinator(pios_rfm22b_id, true); - // Set the frequencies. PIOS_RFM22B_SetFrequencyRange(pios_rfm22b_id, oplinkSettings.MinFrequency, oplinkSettings.MaxFrequency); @@ -534,9 +534,6 @@ static void updateSettings() PIOS_RFM22B_SetTxPower(pios_rfm22b_id, RFM22_tx_pwr_txpow_7); break; } - - // Set the radio destination ID. - PIOS_RFM22B_SetDestinationId(pios_rfm22b_id, oplinkSettings.PairID); } // Determine what com ports we're using. @@ -600,4 +597,8 @@ static void updateSettings() if (PIOS_COM_TELEMETRY) PIOS_COM_ChangeBaud(PIOS_COM_TELEMETRY, 115200); break; } + + // Reinitilize the modem. + if (is_coordinator) + PIOS_RFM22B_Reinit(pios_rfm22b_id); } diff --git a/flight/PiOS/Common/pios_rfm22b.c b/flight/PiOS/Common/pios_rfm22b.c index 306e96062..bb2301515 100644 --- a/flight/PiOS/Common/pios_rfm22b.c +++ b/flight/PiOS/Common/pios_rfm22b.c @@ -564,7 +564,6 @@ int32_t PIOS_RFM22B_Init(uint32_t *rfm22b_id, uint32_t spi_id, uint32_t slave_nu rfm22b_dev->spi_id = spi_id; // Initialize our configuration parameters - rfm22b_dev->coordinator = false; rfm22b_dev->send_ppm = false; rfm22b_dev->datarate = RFM22B_DEFAULT_RX_DATARATE; @@ -586,6 +585,11 @@ int32_t PIOS_RFM22B_Init(uint32_t *rfm22b_id, uint32_t spi_id, uint32_t slave_nu rfm22b_dev->stats.link_quality = 0; rfm22b_dev->stats.rssi = 0; + // Initialize the bindings. + for (uint32_t i = 0; i < OPLINKSETTINGS_BINDINGS_NUMELEM; ++i) + rfm22b_dev->bindings[i] = 0; + rfm22b_dev->coordinator = false; + // Create the event queue rfm22b_dev->eventQueue = xQueueCreate(EVENT_QUEUE_SIZE, sizeof(enum pios_rfm22b_event)); @@ -630,6 +634,16 @@ int32_t PIOS_RFM22B_Init(uint32_t *rfm22b_id, uint32_t spi_id, uint32_t slave_nu return(0); } +/** + * Re-initialize the modem after a configuration change. + */ +void PIOS_RFM22B_Reinit(uint32_t rfm22b_id) +{ + struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id; + if (PIOS_RFM22B_validate(rfm22b_dev)) + PIOS_RFM22B_InjectEvent(rfm22b_dev, RFM22B_EVENT_INITIALIZE, false); +} + /** * The RFM22B external interrupt routine. */ @@ -688,6 +702,20 @@ uint32_t PIOS_RFM22B_DeviceID(uint32_t rfm22b_id) return 0; } +/** + * Returns true if the modem is configured as a coordinator. + * \param[in] rfm22b_id The RFM22B device index. + * \return True if the modem is configured as a coordinator. + */ +bool PIOS_RFM22B_IsCoordinator(uint32_t rfm22b_id) +{ + struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id; + if (PIOS_RFM22B_validate(rfm22b_dev)) + return rfm22b_dev->coordinator; + else + return false; +} + /** * Sets the radio device transmit power. * \param[in] rfm22b_id The RFM22B device index. @@ -717,40 +745,6 @@ void PIOS_RFM22B_SetFrequencyRange(uint32_t rfm22b_id, uint32_t min_frequency, u rfm22_setNominalCarrierFrequency(rfm22b_dev, (max_frequency - min_frequency) / 2); } -/** - * Sets the radio destination ID. - * \param[in] rfm22b_id The RFM22B device index. - * \param[in] dest_id The destination ID. - */ -void PIOS_RFM22B_SetDestinationId(uint32_t rfm22b_id, uint32_t dest_id) -{ - struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id; - if (!PIOS_RFM22B_validate(rfm22b_dev)) - return; - rfm22b_dev->destination_id = (dest_id == 0) ? 0xffffffff : dest_id; - // The first slot is reserved for our current pairID - rfm22b_dev->pair_stats[0].pairID = dest_id; - rfm22b_dev->pair_stats[0].rssi = -127; - rfm22b_dev->pair_stats[0].afc_correction = 0; - rfm22b_dev->pair_stats[0].lastContact = 0; -} - -/** - * Configures the radio as a coordinator or not. - * \param[in] rfm22b_id The RFM22B device index. - * \param[in] coordinator Sets as coordinator if true. - */ -void PIOS_RFM22B_SetCoordinator(uint32_t rfm22b_id, bool coordinator) -{ - struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id; - if (!PIOS_RFM22B_validate(rfm22b_dev)) - return; - rfm22b_dev->coordinator = coordinator; - - // Re-initialize the radio device. - PIOS_RFM22B_InjectEvent(rfm22b_dev, RFM22B_EVENT_INITIALIZE, false); -} - /** * Set the remote com port configuration parameters. * \param[in] rfm22b_id The rfm22b device. @@ -779,6 +773,25 @@ void PIOS_RFM22B_SetComConfigCallback(uint32_t rfm22b_id, PIOS_RFM22B_ComConfigC rfm22b_dev->com_config_cb = cb; } +/** + * Set the list of modems that this modem will bind with. + * \param[in] rfm22b_id The rfm22b device. + * \param[in] bindings The array of bindings. + */ +void PIOS_RFM22B_SetBindings(uint32_t rfm22b_id, const uint32_t bindings[]) +{ + struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id; + if(!PIOS_RFM22B_validate(rfm22b_dev)) + return; + // This modem will be considered a coordinator if any bindings have been set. + rfm22b_dev->coordinator = false; + for (uint32_t i = 0; i < OPLINKSETTINGS_BINDINGS_NUMELEM; ++i) + { + rfm22b_dev->bindings[i] = bindings[i]; + rfm22b_dev->coordinator |= (rfm22b_dev->bindings[i] != 0); + } +} + /** * Returns the device statistics RFM22B device. * \param[in] rfm22b_id The RFM22B device index. @@ -1029,9 +1042,6 @@ void PIOS_RFM22B_SetDatarate(uint32_t rfm22b_id, enum rfm22b_datarate datarate, if(!PIOS_RFM22B_validate(rfm22b_dev)) return; rfm22b_dev->datarate = datarate; - - // Re-initialize the radio device. - PIOS_RFM22B_InjectEvent(rfm22b_dev, RFM22B_EVENT_INITIALIZE, false); } // ************************************ @@ -1477,8 +1487,8 @@ static enum pios_rfm22b_event rfm22_txStart(struct pios_rfm22b_dev *rfm22b_dev) static void rfm22_sendStatus(struct pios_rfm22b_dev *rfm22b_dev) { - // Only send status if we're connected - if (rfm22b_dev->stats.link_state != OPLINKSTATUS_LINKSTATE_CONNECTED) + // Don't send status if we're the coordinator. + if (rfm22b_dev->coordinator) return; // Update the link quality metric. @@ -1991,6 +2001,18 @@ static enum pios_rfm22b_event rfm22_receiveNack(struct pios_rfm22b_dev *rfm22b_d // Resend the previous TX packet. rfm22b_dev->tx_packet = rfm22b_dev->prev_tx_packet; rfm22b_dev->prev_tx_packet = NULL; + + // Go to the next binding, if the previous tx packet was a connection request + if (rfm22b_dev->tx_packet->header.type == PACKET_TYPE_CON_REQUEST) + { + // Increment the current binding index, and make sure that we didn't run off the end of the buffer, or past the last nonzero ID + if ((++(rfm22b_dev->cur_binding) >= OPLINKSETTINGS_BINDINGS_NUMELEM) || (rfm22b_dev->bindings[rfm22b_dev->cur_binding] == 0)) + rfm22b_dev->cur_binding = 0; + rfm22b_dev->destination_id = rfm22b_dev->bindings[rfm22b_dev->cur_binding]; + rfm22b_dev->tx_packet->header.destination_id = rfm22b_dev->destination_id; + } + + // Increment the reset packet counter if we're connected. if (rfm22b_dev->stats.link_state == OPLINKSTATUS_LINKSTATE_CONNECTED) rfm22b_add_rx_status(rfm22b_dev, RFM22B_RESENT_TX_PACKET); rfm22b_dev->time_to_send = true; @@ -2007,8 +2029,9 @@ static enum pios_rfm22b_event rfm22_receiveStatus(struct pios_rfm22b_dev *rfm22b int8_t rssi = rfm22b_dev->rssi_dBm; int8_t afc = rfm22b_dev->afc_correction_Hz; uint32_t id = status->header.source_id; - bool found = false; + // Have we seen this device recently? + bool found = false; uint8_t id_idx = 0; for ( ; id_idx < OPLINKSTATUS_PAIRIDS_NUMELEM; ++id_idx) if(rfm22b_dev->pair_stats[id_idx].pairID == id) @@ -2026,19 +2049,16 @@ static enum pios_rfm22b_event rfm22_receiveStatus(struct pios_rfm22b_dev *rfm22b } // If we haven't seen it, find a slot to put it in. - if (!found) + else { uint8_t min_idx = 0; - if(id != rfm22b_dev->destination_id) + int8_t min_rssi = rfm22b_dev->pair_stats[0].rssi; + for (id_idx = 1; id_idx < OPLINKSTATUS_PAIRIDS_NUMELEM; ++id_idx) { - int8_t min_rssi = rfm22b_dev->pair_stats[0].rssi; - for (id_idx = 1; id_idx < OPLINKSTATUS_PAIRIDS_NUMELEM; ++id_idx) + if(rfm22b_dev->pair_stats[id_idx].rssi < min_rssi) { - if(rfm22b_dev->pair_stats[id_idx].rssi < min_rssi) - { - min_rssi = rfm22b_dev->pair_stats[id_idx].rssi; - min_idx = id_idx; - } + min_rssi = rfm22b_dev->pair_stats[id_idx].rssi; + min_idx = id_idx; } } rfm22b_dev->pair_stats[min_idx].pairID = id; @@ -2066,6 +2086,7 @@ static enum pios_rfm22b_event rfm22_requestConnection(struct pios_rfm22b_dev *rf rfm22b_dev->stats.link_state = OPLINKSTATUS_LINKSTATE_CONNECTING; // Fill in the connection request + rfm22b_dev->destination_id = rfm22b_dev->bindings[rfm22b_dev->cur_binding]; cph->header.destination_id = rfm22b_dev->destination_id; cph->header.type = PACKET_TYPE_CON_REQUEST; cph->header.data_size = PH_CONNECTION_DATA_SIZE(&(rfm22b_dev->con_packet)); @@ -2110,7 +2131,7 @@ static enum pios_rfm22b_event rfm22_acceptConnection(struct pios_rfm22b_dev *rfm memcpy((uint8_t*)lcph, (uint8_t*)cph, PH_PACKET_SIZE((PHPacketHandle)cph)); // Set the destination ID to the source of the connection request message. - PIOS_RFM22B_SetDestinationId((uint32_t)rfm22b_dev, cph->header.source_id); + rfm22b_dev->destination_id = cph->header.source_id; return RFM22B_EVENT_CONNECTION_ACCEPTED; } diff --git a/flight/PiOS/inc/pios_rfm22b.h b/flight/PiOS/inc/pios_rfm22b.h index 1511c9884..5a2c96bca 100644 --- a/flight/PiOS/inc/pios_rfm22b.h +++ b/flight/PiOS/inc/pios_rfm22b.h @@ -100,14 +100,16 @@ typedef void (*PIOS_RFM22B_ComConfigCallback)(OPLinkSettingsOutputConnectionOpti /* Public Functions */ extern int32_t PIOS_RFM22B_Init(uint32_t *rfb22b_id, uint32_t spi_id, uint32_t slave_num, const struct pios_rfm22b_cfg *cfg); +extern void PIOS_RFM22B_Reinit(uint32_t rfb22b_id); extern void PIOS_RFM22B_SetFrequencyRange(uint32_t rfm22b_id, uint32_t min_frequency, uint32_t max_frequency); extern void PIOS_RFM22B_SetTxPower(uint32_t rfm22b_id, enum rfm22b_tx_power tx_pwr); extern void PIOS_RFM22B_SetDatarate(uint32_t rfm22b_id, enum rfm22b_datarate datarate, bool data_whitening); extern void PIOS_RFM22B_SetDestinationId(uint32_t rfm22b_id, uint32_t dest_id); -extern void PIOS_RFM22B_SetCoordinator(uint32_t rfm22b_id, bool coordinator); extern void PIOS_RFM22B_SetRemoteComConfig(uint32_t rfm22b_id, OPLinkSettingsOutputConnectionOptions com_port, OPLinkSettingsComSpeedOptions com_speed); extern void PIOS_RFM22B_SetComConfigCallback(uint32_t rfm22b_id, PIOS_RFM22B_ComConfigCallback cb); +extern void PIOS_RFM22B_SetBindings(uint32_t rfm22b_id, const uint32_t bindings[]); extern uint32_t PIOS_RFM22B_DeviceID(uint32_t rfb22b_id); +extern bool PIOS_RFM22B_IsCoordinator(uint32_t rfb22b_id); extern void PIOS_RFM22B_GetStats(uint32_t rfm22b_id, struct rfm22b_stats *stats); extern uint8_t PIOS_RFM2B_GetPairStats(uint32_t rfm22b_id, uint32_t *device_ids, int8_t *RSSIs, uint8_t max_pairs); extern bool PIOS_RFM22B_LinkStatus(uint32_t rfm22b_id); diff --git a/flight/PiOS/inc/pios_rfm22b_priv.h b/flight/PiOS/inc/pios_rfm22b_priv.h index 27883311c..e771bf6d3 100644 --- a/flight/PiOS/inc/pios_rfm22b_priv.h +++ b/flight/PiOS/inc/pios_rfm22b_priv.h @@ -659,6 +659,10 @@ struct pios_rfm22b_dev { // The destination ID uint32_t destination_id; + // The list of bound radios. + uint32_t bindings[OPLINKSETTINGS_BINDINGS_NUMELEM]; + uint8_t cur_binding; + // Is this device a coordinator? bool coordinator; diff --git a/flight/PipXtreme/System/pios_board.c b/flight/PipXtreme/System/pios_board.c index 5dd59dc3d..8f2febd95 100644 --- a/flight/PipXtreme/System/pios_board.c +++ b/flight/PipXtreme/System/pios_board.c @@ -199,45 +199,6 @@ void PIOS_Board_Init(void) { } #endif - /* Configure PPM input */ - switch (oplinkSettings.PPM) { -#if defined(PIOS_INCLUDE_PPM) - case OPLINKSETTINGS_PPM_INPUT: - { - uint32_t pios_ppm_id; - PIOS_PPM_Init(&pios_ppm_id, &pios_ppm_cfg); - - if (PIOS_RCVR_Init(&pios_ppm_rcvr_id, &pios_ppm_rcvr_driver, pios_ppm_id)) - PIOS_Assert(0); - break; - } -#endif /* PIOS_INCLUDE_PPM */ - -#if defined(PIOS_INCLUDE_PPM_OUT) - case OPLINKSETTINGS_PPM_OUTPUT: - PIOS_PPM_Out_Init(&pios_ppm_out_id, &pios_ppm_out_cfg); - break; -#endif /* PIOS_INCLUDE_PPM_OUT */ - - default: - { - /* Configure the flexi serial port if PPM not selected */ - uint32_t pios_usart3_id; - if (PIOS_USART_Init(&pios_usart3_id, &pios_usart_telem_flexi_cfg)) { - PIOS_Assert(0); - } - uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_TELEM_RX_BUF_LEN); - uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_TELEM_TX_BUF_LEN); - PIOS_Assert(rx_buffer); - PIOS_Assert(tx_buffer); - if (PIOS_COM_Init(&pios_com_telem_uart_flexi_id, &pios_usart_com_driver, pios_usart3_id, - rx_buffer, PIOS_COM_TELEM_RX_BUF_LEN, - tx_buffer, PIOS_COM_TELEM_TX_BUF_LEN)) { - PIOS_Assert(0); - } - } - } - /* Initalize the RFM22B radio COM device. */ #if defined(PIOS_INCLUDE_RFM22B) { @@ -260,6 +221,51 @@ void PIOS_Board_Init(void) { } #endif /* PIOS_INCLUDE_RFM22B */ + /* Configure PPM input */ + bool is_coordinator = PIOS_RFM22B_IsCoordinator(pios_rfm22b_id); + switch (oplinkSettings.PPM) { +#if defined(PIOS_INCLUDE_PPM) + case OPLINKSETTINGS_PPM_PPM: + case OPLINKSETTINGS_PPM_PPMTELEMETRY: + { + /* PPM input is configured on the coordinator modem and output on the remote modem. */ + if (is_coordinator) + { + uint32_t pios_ppm_id; + PIOS_PPM_Init(&pios_ppm_id, &pios_ppm_cfg); + + if (PIOS_RCVR_Init(&pios_ppm_rcvr_id, &pios_ppm_rcvr_driver, pios_ppm_id)) + PIOS_Assert(0); + } +#if defined(PIOS_INCLUDE_PPM_OUT) + else + { + PIOS_PPM_Out_Init(&pios_ppm_out_id, &pios_ppm_out_cfg); + } +#endif /* PIOS_INCLUDE_PPM_OUT */ + break; + } +#endif /* PIOS_INCLUDE_PPM */ + + default: + { + /* Configure the flexi serial port if PPM not selected */ + uint32_t pios_usart3_id; + if (PIOS_USART_Init(&pios_usart3_id, &pios_usart_telem_flexi_cfg)) { + PIOS_Assert(0); + } + uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_TELEM_RX_BUF_LEN); + uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_TELEM_TX_BUF_LEN); + PIOS_Assert(rx_buffer); + PIOS_Assert(tx_buffer); + if (PIOS_COM_Init(&pios_com_telem_uart_flexi_id, &pios_usart_com_driver, pios_usart3_id, + rx_buffer, PIOS_COM_TELEM_RX_BUF_LEN, + tx_buffer, PIOS_COM_TELEM_TX_BUF_LEN)) { + PIOS_Assert(0); + } + } + } + /* Remap AFIO pin */ GPIO_PinRemapConfig( GPIO_Remap_SWJ_NoJTRST, ENABLE); diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index 86f72df64..f6e457690 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -46,7 +46,7 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget } // Connect to the OPLinkSettings object updates - oplinkSettingsObj = dynamic_cast(objManager->getObject("OPLinkSettings")); + oplinkSettingsObj = dynamic_cast(objManager->getObject("OPLinkSettings")); if (oplinkSettingsObj != NULL ) { connect(oplinkSettingsObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateSettings(UAVObject*))); } else { @@ -55,7 +55,6 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget autoLoadWidgets(); addApplySaveButtons(m_oplink->Apply, m_oplink->Save); - addUAVObjectToWidgetRelation("OPLinkSettings", "Coordinator", m_oplink->Coordinator); addUAVObjectToWidgetRelation("OPLinkSettings", "UAVTalk", m_oplink->UAVTalk); addUAVObjectToWidgetRelation("OPLinkSettings", "PPM", m_oplink->PPM); addUAVObjectToWidgetRelation("OPLinkSettings", "InputConnection", m_oplink->InputConnection); @@ -88,11 +87,19 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget addUAVObjectToWidgetRelation("OPLinkStatus", "TXRate", m_oplink->TXRate); // Connect to the pair ID radio buttons. - connect(m_oplink->PairSelectB, SIGNAL(toggled(bool)), this, SLOT(pairBToggled(bool))); - connect(m_oplink->PairSelect1, SIGNAL(toggled(bool)), this, SLOT(pair1Toggled(bool))); - connect(m_oplink->PairSelect2, SIGNAL(toggled(bool)), this, SLOT(pair2Toggled(bool))); - connect(m_oplink->PairSelect3, SIGNAL(toggled(bool)), this, SLOT(pair3Toggled(bool))); - connect(m_oplink->PairSelect4, SIGNAL(toggled(bool)), this, SLOT(pair4Toggled(bool))); + connect(m_oplink->PairSelect1, SIGNAL(toggled(bool)), this, SLOT(pairIDToggled(bool))); + connect(m_oplink->PairSelect2, SIGNAL(toggled(bool)), this, SLOT(pairIDToggled(bool))); + connect(m_oplink->PairSelect3, SIGNAL(toggled(bool)), this, SLOT(pairIDToggled(bool))); + connect(m_oplink->PairSelect4, SIGNAL(toggled(bool)), this, SLOT(pairIDToggled(bool))); + + // Connect to the binding buttons. + connect(m_oplink->BindingAdd, SIGNAL(pressed()), this, SLOT(addBinding())); + connect(m_oplink->BindingRemove, SIGNAL(pressed()), this, SLOT(removeBinding())); + m_oplink->BindingAdd->setEnabled(false); + m_oplink->BindingRemove->setEnabled(false); + + // Connect to changes to the bindings widgets. + connect(m_oplink->Bindings, SIGNAL(itemSelectionChanged()), this, SLOT(bindingsSelectionChanged())); //Add scroll bar when necessary QScrollArea *scroll = new QScrollArea; @@ -131,7 +138,6 @@ void ConfigPipXtremeWidget::applySettings() pairID = m_oplink->PairID3->text().toUInt(&okay, 16); else if (m_oplink->PairSelect4->isChecked()) pairID = m_oplink->PairID4->text().toUInt(&okay, 16); - oplinkSettingsData.PairID = pairID; oplinkSettings->setData(oplinkSettingsData); } @@ -153,10 +159,8 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) oplinkSettingsObj->requestUpdate(); // Get the current pairID - OPLinkSettings *oplinkSettings = OPLinkSettings::GetInstance(getObjectManager()); + //OPLinkSettings *oplinkSettings = OPLinkSettings::GetInstance(getObjectManager()); quint32 pairID = 0; - if (oplinkSettings) - pairID = oplinkSettings->getPairID(); // Update the detected devices. UAVObjectField* pairIdField = object->getField("PairIDs"); @@ -253,9 +257,6 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) qDebug() << "PipXtremeGadgetWidget: Count not read DeviceID field."; } - // Update the PairID field - m_oplink->PairID->setText(QString::number(pairID, 16).toUpper()); - // Update the link state UAVObjectField* linkField = object->getField("LinkState"); if (linkField) { @@ -270,13 +271,16 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) */ void ConfigPipXtremeWidget::updateSettings(UAVObject *object) { - Q_UNUSED(object); + Q_UNUSED(object); - if (!settingsUpdated) - { - settingsUpdated = true; - enableControls(true); - } + if (!settingsUpdated) + { + settingsUpdated = true; + enableControls(true); + + // Refresh the list widget. + refreshBindingsList(); + } } void ConfigPipXtremeWidget::disconnected() @@ -288,52 +292,88 @@ void ConfigPipXtremeWidget::disconnected() } } -void ConfigPipXtremeWidget::pairIDToggled(bool checked, quint8 idx) +void ConfigPipXtremeWidget::pairIDToggled(bool checked) { - if(checked) - { - OPLinkStatus *oplinkStatus = OPLinkStatus::GetInstance(getObjectManager()); - OPLinkSettings *oplinkSettings = OPLinkSettings::GetInstance(getObjectManager()); + bool enabled = (m_oplink->PairSelect1->isChecked() || m_oplink->PairSelect2->isChecked() || m_oplink->PairSelect3->isChecked() || m_oplink->PairSelect4->isChecked()); + m_oplink->BindingAdd->setEnabled(enabled); +} - if (oplinkStatus && oplinkSettings) - { - if (idx == 4) - { - oplinkSettings->setPairID(0); - } - else - { - quint32 pairID = oplinkStatus->getPairIDs(idx); - if (pairID) - oplinkSettings->setPairID(pairID); - } - } +void ConfigPipXtremeWidget::bindingsSelectionChanged() +{ + bool enabled = (m_oplink->Bindings->selectedItems().size() > 0); + m_oplink->BindingRemove->setEnabled(enabled); +} + +void ConfigPipXtremeWidget::refreshBindingsList() +{ + m_oplink->Bindings->clear(); + for (quint32 slot = 0; slot < OPLinkSettings::BINDINGS_NUMELEM; ++slot) + { + quint32 id = oplinkSettingsObj->getBindings(slot); + if (id != 0) + m_oplink->Bindings->addItem(QString::number(id, 16).toUpper()); } } -void ConfigPipXtremeWidget::pair1Toggled(bool checked) +void ConfigPipXtremeWidget::addBinding() { - pairIDToggled(checked, 0); + + // Get the pair ID out of the selection widget + quint32 pairID = 0; + bool okay; + if (m_oplink->PairSelect1->isChecked()) + pairID = m_oplink->PairID1->text().toUInt(&okay, 16); + else if (m_oplink->PairSelect2->isChecked()) + pairID = m_oplink->PairID2->text().toUInt(&okay, 16); + else if (m_oplink->PairSelect3->isChecked()) + pairID = m_oplink->PairID3->text().toUInt(&okay, 16); + else if (m_oplink->PairSelect4->isChecked()) + pairID = m_oplink->PairID4->text().toUInt(&okay, 16); + + // Find a slot for this pair ID in the binding list. + quint32 slot = 0; + for ( ; slot < OPLinkSettings::BINDINGS_NUMELEM - 1; ++slot) + { + quint32 id = oplinkSettingsObj->getBindings(slot); + + // Is this ID already in the list? + if (id == pairID) + return; + + // Is this slot empty? + if (id == 0) + break; + } + + // Store the ID in the first open slot (or the last slot if all are full). + oplinkSettingsObj->setBindings(slot, pairID); + + // Refresh the list widget. + refreshBindingsList(); } -void ConfigPipXtremeWidget::pair2Toggled(bool checked) +void ConfigPipXtremeWidget::removeBinding() { - pairIDToggled(checked, 1); -} + // Get the selected rows from the bindings list widget. + QList selected = m_oplink->Bindings->selectedItems(); -void ConfigPipXtremeWidget::pair3Toggled(bool checked) -{ - pairIDToggled(checked, 2); -} + // Zero out the selected rows in the bindings list. + for (int i = 0; i < selected.size(); ++i) + oplinkSettingsObj->setBindings(m_oplink->Bindings->row(selected[i]), 0); -void ConfigPipXtremeWidget::pair4Toggled(bool checked) -{ - pairIDToggled(checked, 3); -} - -void ConfigPipXtremeWidget::pairBToggled(bool checked) -{ - pairIDToggled(checked, 4); + // Refresh the list widget and compact the bindings list. + m_oplink->Bindings->clear(); + quint32 outSlot = 0; + for (quint32 slot = 0; slot < OPLinkSettings::BINDINGS_NUMELEM; ++slot) + { + quint32 id = oplinkSettingsObj->getBindings(slot); + if (id != 0) { + oplinkSettingsObj->setBindings(outSlot++, id); + m_oplink->Bindings->addItem(QString::number(id, 16).toUpper()); + } + } + for ( ; outSlot < OPLinkSettings::BINDINGS_NUMELEM; ++outSlot) + oplinkSettingsObj->setBindings(outSlot, 0); } /** diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h index 1243c5b65..29e67ccba 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h @@ -27,6 +27,8 @@ #ifndef CONFIGPIPXTREMEWIDGET_H #define CONFIGPIPXTREMEWIDGET_H +#include + #include "ui_pipxtreme.h" #include "configtaskwidget.h" @@ -41,6 +43,7 @@ public: public slots: void updateStatus(UAVObject *object1); void updateSettings(UAVObject *object1); + void refreshBindingsList(); private: Ui_PipXtremeWidget *m_oplink; @@ -49,7 +52,7 @@ private: UAVDataObject* oplinkStatusObj; // The OPLink ssettins UAVObject - UAVDataObject* oplinkSettingsObj; + OPLinkSettings* oplinkSettingsObj; bool settingsUpdated; @@ -58,12 +61,10 @@ private slots: void applySettings(); void saveSettings(); void disconnected(); - void pairIDToggled(bool checked, quint8 idx); - void pair1Toggled(bool checked); - void pair2Toggled(bool checked); - void pair3Toggled(bool checked); - void pair4Toggled(bool checked); - void pairBToggled(bool checked); + void pairIDToggled(bool checked); + void addBinding(); + void removeBinding(); + void bindingsSelectionChanged(); }; #endif // CONFIGTXPIDWIDGET_H diff --git a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui index 2ccf5b6bf..6d7f36b8f 100644 --- a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui +++ b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui @@ -23,7 +23,7 @@ QFrame::Raised - + @@ -52,7 +52,7 @@ - + @@ -139,235 +139,15 @@ - - + + QFrame::StyledPanel QFrame::Raised - - - - - - 75 - true - - - - Pairing - - - - - - - - - - - - - false - - - - 100 - 16777215 - - - - Broadcast - - - - - - - Broadcast Address - - - - - - - - - - - - - - - 100 - 16777215 - - - - 12345678 - - - - - - - -127 - - - 0 - - - -127 - - - false - - - %v dBm - - - - - - - -100dB - - - - - - - - - - - - - - - 100 - 16777215 - - - - - - - - -127 - - - 0 - - - 0 - - - false - - - %v dBm - - - - - - - -100dB - - - - - - - - - - - - - - - 100 - 16777215 - - - - - - - - -127 - - - 0 - - - 0 - - - false - - - %v dBm - - - - - - - -100dB - - - - - - - - - - - - - - - 100 - 16777215 - - - - - - - - -127 - - - 0 - - - 0 - - - false - - - %v dBm - - - - - - - -100dB - - - - - - + @@ -418,13 +198,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } false @@ -479,13 +259,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } true @@ -530,13 +310,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } false @@ -552,426 +332,6 @@ - - - - Pair ID - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - 90ABCDEF - - - - - - - Link State - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The modems current state - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 3px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - Disconnected - - - - - - - Link Quality - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - false - - - true - - - - - - - RSSI - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - true - - - - - - - AFC Corr. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - true - - - - - - - TX Seq. No. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - false - - - true - - - - - - - TX Rate (B/s) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - false - - - true - - - - - - - RX Seq. No. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - false - - - true - - - - - - - RX Rate (B/s) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} - - - false - - - true - - - @@ -1013,13 +373,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1029,6 +389,66 @@ + + + + Link State + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 75 + true + + + + The modems current state + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 3px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + Disconnected + + + @@ -1070,13 +490,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1086,6 +506,48 @@ + + + + Link Quality + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + false + + + true + + + @@ -1121,13 +583,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1137,6 +599,51 @@ + + + + RSSI + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + true + + + @@ -1178,13 +685,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1194,6 +701,45 @@ + + + + AFC Corr. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + true + + + @@ -1235,13 +781,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1251,6 +797,54 @@ + + + + TX Seq. No. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + false + + + true + + + @@ -1286,13 +880,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1302,6 +896,54 @@ + + + + TX Rate (B/s) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + false + + + true + + + @@ -1337,13 +979,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -1353,6 +995,54 @@ + + + + RX Seq. No. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + false + + + true + + + @@ -1379,13 +1069,55 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + false + + + true + + + + + + + RX Rate (B/s) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } false @@ -1421,13 +1153,55 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + false + + + true + + + + + + + Timeouts + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 75 + true + + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } false @@ -1469,13 +1243,13 @@ QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } false @@ -1485,62 +1259,358 @@ - - + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Configuration + + + + - Timeouts + UAVTalk + + + + + + + PPM Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + - 101 + 16777215 16777215 - - - 75 - true - + + Choose the PPM function - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); -/* background: transparent; */ -/* selection-background-color: darkgray;*/ -} + + + + + + Input Connection - - false + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + + + + + + + 16777215 + 16777215 + + + + Choose which port to communicate over on this modem + + + + + + + Output Connection + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + Choose which port to communicate over on the remote modem + + + + + + + COM Speed + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + Set the telemetry port speed + + + + + + + Max RF Tx Power(mW) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + Set the maximum TX output power the modem will use + + + Qt::LeftToRight + + + 0 + + + + + + + Send Timeout (ms) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Set the send timeout + + true + + 255 + + + + + + + Min Packet Size + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Set the minimum packet size + + + true + + + 255 + + + + + + + Frequency Calibration + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Calibrate the modems RF carrier frequency + + + true + + + 255 + + + + + + + Min. Frequency (Hz) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Set the modems minimum RF carrier frequency + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + 400000000 + + + 1000000000 + + + 100000 + + + + + + + Max. Frequency (Hz) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Set the modems maximum RF carrier frequency + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + 400000000 + + + 1000000000 + + + 100000 + + groupBox + groupBox_3 - - - - - 0 - 0 - - + + 75 @@ -1548,418 +1618,263 @@ - Configuration + Bindings - - - - - Coordinator - - - - - - - UAVTalk - - - - - - - PPM - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose the PPM function - - - - - - - Input Connection - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose which port to communicate over on this modem - - - - - - - Output Connection - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose which port to communicate over on the remote modem - - - - - - - COM Speed - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Set the telemetry port speed - - - - - - - Max RF Tx Power(mW) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Set the maximum TX output power the modem will use - - - Qt::LeftToRight - - - 0 - - - - - - - Send Timeout (ms) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Set the send timeout - - - true - - - 255 - - - - - - - Min Packet Size - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Set the minimum packet size - - - true - - - 255 - - - - - - - Frequency Calibration - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Calibrate the modems RF carrier frequency - - - true - - - 255 - - - - - - - Min. Frequency (Hz) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Set the modems minimum RF carrier frequency - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - 400000000 - - - 1000000000 - - - 100000 - - - - - - - Max. Frequency (Hz) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Set the modems maximum RF carrier frequency - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - 400000000 - - - 1000000000 - - - 100000 - - - - - - - AES Encryption - - - - - - - Courier New - 9 - + + + + + + + + - - The AES encryption key - has to be the same key on the remote modem. + + + + + + -100dB - - + + + + + + -127 - - 32 + + 0 - - true + + 0 - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + false + + + %v dBm + + + + + + + -100dB + + + + + + + + 100 + 16777215 + + + + + + + + -127 + + + 0 + + + 0 + + + false + + + %v dBm + + + + + + + -100dB + + + + + + + -127 + + + 0 + + + -127 + + + false + + + %v dBm + + + + + + + + 100 + 16777215 + + + + + + + + -100dB + + + + + + + + 100 + 16777215 + + + + 12345678 - - - - 0 - 0 - - - - Radomise the AES encryption key - + - Rand + + + + + + + + -127 + + + 0 + + + 0 + + + false + + + %v dBm + + + + + + + - - - - 75 - true - - - - Enable/Disable AES encryption - - - Qt::RightToLeft - - - Enable + + + + 100 + 16777215 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - - - - Qt::Vertical + + + + + 0 + 0 + - + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Add >> + + + + + + + Remove + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 0 + 0 + + + - 20 - 40 + 200 + 16777215 - + @@ -1982,29 +1897,15 @@ SerialNumber DeviceID LinkState - RxAFC - Retries Errors UAVTalkErrors Resets TXRate RXRate - TelemPortConfig - TelemPortSpeed - FlexiPortConfig - FlexiPortSpeed - VCPConfig - VCPSpeed - MaxRFDatarate MaxRFTxPower SendTimeout MinPacketSize FrequencyCalibration - Frequency - ScanSpectrum - AESKey - AESKeyRandom - AESEnable graphicsView_Spectrum Apply Save diff --git a/shared/uavobjectdefinition/oplinksettings.xml b/shared/uavobjectdefinition/oplinksettings.xml index 5ee05bd0e..f24bba648 100644 --- a/shared/uavobjectdefinition/oplinksettings.xml +++ b/shared/uavobjectdefinition/oplinksettings.xml @@ -1,11 +1,10 @@ OPLink configurations options. - - - - - + + + + @@ -14,7 +13,6 @@ -