1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

LP-190: Addes support for OpenLRS receiver protocol to the OPLinkMini. Also updates the OPLink configuration to better support OpenLRS.

This commit is contained in:
Brian Webb 2016-06-30 19:07:13 -07:00
parent aa21761f4c
commit 91ea8966da
13 changed files with 450 additions and 477 deletions

View File

@ -153,10 +153,10 @@ static void systemTask(__attribute__((unused)) void *parameters)
// Get the stats from the radio device // Get the stats from the radio device
struct rfm22b_stats radio_stats; struct rfm22b_stats radio_stats;
PIOS_RFM22B_GetStats(pios_rfm22b_id, &radio_stats); PIOS_RFM22B_GetStats(pios_rfm22b_id, &radio_stats);
oplinkStatus.HeapRemaining = xPortGetFreeHeapSize();
if (pios_rfm22b_id) { if (pios_rfm22b_id) {
// Update the status // Update the status
oplinkStatus.HeapRemaining = xPortGetFreeHeapSize();
oplinkStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id); oplinkStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id);
oplinkStatus.RxGood = radio_stats.rx_good; oplinkStatus.RxGood = radio_stats.rx_good;
oplinkStatus.RxCorrected = radio_stats.rx_corrected; oplinkStatus.RxCorrected = radio_stats.rx_corrected;

View File

@ -266,6 +266,7 @@ static void systemTask(__attribute__((unused)) void *parameters)
// Update the OPLinkStatus UAVO // Update the OPLinkStatus UAVO
OPLinkStatusData oplinkStatus; OPLinkStatusData oplinkStatus;
OPLinkStatusGet(&oplinkStatus); OPLinkStatusGet(&oplinkStatus);
oplinkStatus.HeapRemaining = xPortGetFreeHeapSize();
if (pios_rfm22b_id) { if (pios_rfm22b_id) {
// Get the other device stats. // Get the other device stats.
@ -282,7 +283,6 @@ static void systemTask(__attribute__((unused)) void *parameters)
static uint16_t prev_tx_seq = 0; static uint16_t prev_tx_seq = 0;
static uint16_t prev_rx_seq = 0; static uint16_t prev_rx_seq = 0;
oplinkStatus.HeapRemaining = xPortGetFreeHeapSize();
oplinkStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id); oplinkStatus.DeviceID = PIOS_RFM22B_DeviceID(pios_rfm22b_id);
oplinkStatus.RxGood = radio_stats.rx_good; oplinkStatus.RxGood = radio_stats.rx_good;
oplinkStatus.RxCorrected = radio_stats.rx_corrected; oplinkStatus.RxCorrected = radio_stats.rx_corrected;

View File

@ -272,7 +272,8 @@ int32_t TelemetryInitialize(void)
OPLinkSettingsData data; OPLinkSettingsData data;
OPLinkSettingsGet(&data); OPLinkSettingsGet(&data);
if (data.PPMOnly) { bool ppm_only = (data.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL);
if (ppm_only) {
radio_port = 0; radio_port = 0;
} else { } else {
radio_port = PIOS_COM_RF; radio_port = PIOS_COM_RF;

View File

@ -726,7 +726,7 @@ static uint8_t pios_openlrs_bind_receive(struct pios_openlrs_dev *openlrs_dev, u
binding.version = openlrs_dev->bind_data.version; binding.version = openlrs_dev->bind_data.version;
binding.serial_baudrate = openlrs_dev->bind_data.serial_baudrate; binding.serial_baudrate = openlrs_dev->bind_data.serial_baudrate;
binding.rf_frequency = openlrs_dev->bind_data.rf_frequency; binding.rf_frequency = openlrs_dev->bind_data.rf_frequency;
binding.rf_magic = openlrs_dev->bind_data.rf_magic; binding.CoordID = openlrs_dev->bind_data.rf_magic;
binding.rf_power = openlrs_dev->bind_data.rf_power; binding.rf_power = openlrs_dev->bind_data.rf_power;
binding.rf_channel_spacing = openlrs_dev->bind_data.rf_channel_spacing; binding.rf_channel_spacing = openlrs_dev->bind_data.rf_channel_spacing;
binding.modem_params = openlrs_dev->bind_data.modem_params; binding.modem_params = openlrs_dev->bind_data.modem_params;
@ -1180,7 +1180,7 @@ int32_t PIOS_OpenLRS_Init(uint32_t *openlrs_id, uint32_t spi_id,
openlrs_dev->bind_data.version = binding.version; openlrs_dev->bind_data.version = binding.version;
openlrs_dev->bind_data.serial_baudrate = binding.serial_baudrate; openlrs_dev->bind_data.serial_baudrate = binding.serial_baudrate;
openlrs_dev->bind_data.rf_frequency = binding.rf_frequency; openlrs_dev->bind_data.rf_frequency = binding.rf_frequency;
openlrs_dev->bind_data.rf_magic = binding.rf_magic; openlrs_dev->bind_data.rf_magic = binding.CoordID;
openlrs_dev->bind_data.rf_power = binding.rf_power; openlrs_dev->bind_data.rf_power = binding.rf_power;
openlrs_dev->bind_data.rf_channel_spacing = binding.rf_channel_spacing; openlrs_dev->bind_data.rf_channel_spacing = binding.rf_channel_spacing;
openlrs_dev->bind_data.modem_params = binding.modem_params; openlrs_dev->bind_data.modem_params = binding.modem_params;

View File

@ -40,7 +40,7 @@
// 6-byte (32-bit) preamble .. alternating 0's & 1's // 6-byte (32-bit) preamble .. alternating 0's & 1's
// 4-byte (32-bit) sync // 4-byte (32-bit) sync
// 1-byte packet length (number of data bytes to follow) // 1-byte packet length (number of data bytes to follow)
// 0 to 255 user data bytes // 0 to 251 user data bytes
// 4 byte ECC // 4 byte ECC
// //
// OR in PPM only mode: // OR in PPM only mode:
@ -437,7 +437,7 @@ int32_t PIOS_RFM22B_Init(uint32_t *rfm22b_id, uint32_t spi_id, uint32_t slave_nu
// Initialize the channels. // Initialize the channels.
PIOS_RFM22B_SetChannelConfig(*rfm22b_id, RFM22B_DEFAULT_RX_DATARATE, RFM22B_DEFAULT_MIN_CHANNEL, PIOS_RFM22B_SetChannelConfig(*rfm22b_id, RFM22B_DEFAULT_RX_DATARATE, RFM22B_DEFAULT_MIN_CHANNEL,
RFM22B_DEFAULT_MAX_CHANNEL, false, false, false, false); RFM22B_DEFAULT_MAX_CHANNEL, false, true, false);
// Create the event queue // Create the event queue
rfm22b_dev->eventQueue = xQueueCreate(EVENT_QUEUE_SIZE, sizeof(enum pios_radio_event)); rfm22b_dev->eventQueue = xQueueCreate(EVENT_QUEUE_SIZE, sizeof(enum pios_radio_event));
@ -591,18 +591,18 @@ void PIOS_RFM22B_SetTxPower(uint32_t rfm22b_id, enum rfm22b_tx_power tx_pwr)
* @param[in] min_chan The minimum channel. * @param[in] min_chan The minimum channel.
* @param[in] max_chan The maximum channel. * @param[in] max_chan The maximum channel.
* @param[in] coordinator Is this modem an coordinator. * @param[in] coordinator Is this modem an coordinator.
* @param[in] data_mode Should this modem send/receive data packets?
* @param[in] ppm_mode Should this modem send/receive ppm packets? * @param[in] ppm_mode Should this modem send/receive ppm packets?
* @param[in] oneway Only the coordinator can send packets if true.
* @param[in] ppm_only Should this modem run in ppm only mode?
*/ */
void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datarate, uint8_t min_chan, uint8_t max_chan, bool coordinator, bool oneway, bool ppm_mode, bool ppm_only) void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datarate, uint8_t min_chan, uint8_t max_chan, bool coordinator, bool data_mode, bool ppm_mode)
{ {
struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id; struct pios_rfm22b_dev *rfm22b_dev = (struct pios_rfm22b_dev *)rfm22b_id;
bool ppm_only = ppm_mode && !data_mode;
if (!PIOS_RFM22B_Validate(rfm22b_dev)) { if (!PIOS_RFM22B_Validate(rfm22b_dev)) {
return; return;
} }
ppm_mode = ppm_mode || ppm_only; ppm_mode = ppm_mode;
rfm22b_dev->coordinator = coordinator; rfm22b_dev->coordinator = coordinator;
rfm22b_dev->ppm_send_mode = ppm_mode && coordinator; rfm22b_dev->ppm_send_mode = ppm_mode && coordinator;
rfm22b_dev->ppm_recv_mode = ppm_mode && !coordinator; rfm22b_dev->ppm_recv_mode = ppm_mode && !coordinator;
@ -615,7 +615,7 @@ void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datar
datarate = RFM22B_PPM_ONLY_DATARATE; datarate = RFM22B_PPM_ONLY_DATARATE;
rfm22b_dev->datarate = RFM22B_PPM_ONLY_DATARATE; rfm22b_dev->datarate = RFM22B_PPM_ONLY_DATARATE;
} else { } else {
rfm22b_dev->one_way_link = oneway; rfm22b_dev->one_way_link = false;
rfm22b_dev->datarate = datarate; rfm22b_dev->datarate = datarate;
} }
rfm22b_dev->packet_time = (ppm_mode ? packet_time_ppm[datarate] : packet_time[datarate]); rfm22b_dev->packet_time = (ppm_mode ? packet_time_ppm[datarate] : packet_time[datarate]);

View File

@ -104,7 +104,7 @@ struct rfm22b_stats {
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 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_Reinit(uint32_t rfb22b_id);
extern void PIOS_RFM22B_SetTxPower(uint32_t rfm22b_id, enum rfm22b_tx_power tx_pwr); extern void PIOS_RFM22B_SetTxPower(uint32_t rfm22b_id, enum rfm22b_tx_power tx_pwr);
extern void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datarate, uint8_t min_chan, uint8_t max_chan, bool coordinator, bool oneway, bool ppm_mode, bool ppm_only); extern void PIOS_RFM22B_SetChannelConfig(uint32_t rfm22b_id, enum rfm22b_datarate datarate, uint8_t min_chan, uint8_t max_chan, bool coordinator, bool ppm_mode, bool ppm_only);
extern void PIOS_RFM22B_SetCoordinatorID(uint32_t rfm22b_id, uint32_t coord_id); extern void PIOS_RFM22B_SetCoordinatorID(uint32_t rfm22b_id, uint32_t coord_id);
extern void PIOS_RFM22B_SetDeviceID(uint32_t rfm22b_id, uint32_t device_id); extern void PIOS_RFM22B_SetDeviceID(uint32_t rfm22b_id, uint32_t device_id);
extern uint32_t PIOS_RFM22B_DeviceID(uint32_t rfb22b_id); extern uint32_t PIOS_RFM22B_DeviceID(uint32_t rfb22b_id);

View File

@ -227,8 +227,11 @@ void PIOS_Board_Init(void)
OPLinkSettingsGet(&oplinkSettings); OPLinkSettingsGet(&oplinkSettings);
bool is_coordinator = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPLINKCOORDINATOR); bool is_coordinator = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPLINKCOORDINATOR);
bool openlrs = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPENLRS); bool openlrs = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPENLRS);
bool is_oneway = (oplinkSettings.OneWay == OPLINKSETTINGS_ONEWAY_TRUE); bool ppm_only = (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL);
bool ppm_only = (oplinkSettings.PPMOnly == OPLINKSETTINGS_PPMONLY_TRUE); bool data_mode = ((oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATA) ||
(oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATAANDCONTROL));
bool is_enabled = ((oplinkSettings.Protocol != OPLINKSETTINGS_PROTOCOL_DISABLED) &&
((oplinkSettings.MaxRFPower != OPLINKSETTINGS_MAXRFPOWER_0) || openlrs));
bool ppm_mode = false; bool ppm_mode = false;
bool servo_main = false; bool servo_main = false;
bool servo_flexi = false; bool servo_flexi = false;
@ -366,7 +369,7 @@ void PIOS_Board_Init(void)
oplinkStatus.BoardRevision = bdinfo->board_rev; oplinkStatus.BoardRevision = bdinfo->board_rev;
/* Initalize the RFM22B radio COM device. */ /* Initalize the RFM22B radio COM device. */
if (oplinkSettings.MaxRFPower != OPLINKSETTINGS_MAXRFPOWER_0) { if (is_enabled) {
if (openlrs) { if (openlrs) {
#if defined(PIOS_INCLUDE_OPENLRS) #if defined(PIOS_INCLUDE_OPENLRS)
const struct pios_openlrs_cfg *openlrs_cfg = PIOS_BOARD_HW_DEFS_GetOpenLRSCfg(bdinfo->board_rev); const struct pios_openlrs_cfg *openlrs_cfg = PIOS_BOARD_HW_DEFS_GetOpenLRSCfg(bdinfo->board_rev);
@ -454,7 +457,7 @@ void PIOS_Board_Init(void)
// Set the radio configuration parameters. // Set the radio configuration parameters.
PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID); PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID);
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID); PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only); PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, data_mode, ppm_mode);
/* Set the PPM callback if we should be receiving PPM. */ /* Set the PPM callback if we should be receiving PPM. */
if (ppm_mode || (ppm_only && !is_coordinator)) { if (ppm_mode || (ppm_only && !is_coordinator)) {

View File

@ -851,10 +851,14 @@ void PIOS_Board_Init(void)
/* Is the radio turned on? */ /* Is the radio turned on? */
bool is_coordinator = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPLINKCOORDINATOR); bool is_coordinator = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPLINKCOORDINATOR);
bool openlrs = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPENLRS); bool openlrs = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPENLRS);
bool is_oneway = (oplinkSettings.OneWay == OPLINKSETTINGS_ONEWAY_TRUE); bool data_mode = ((oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATA) ||
bool ppm_mode = (oplinkSettings.PPM == OPLINKSETTINGS_PPM_TRUE); (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATAANDCONTROL));
bool ppm_only = (oplinkSettings.PPMOnly == OPLINKSETTINGS_PPMONLY_TRUE); bool ppm_mode = ((oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL) ||
if (oplinkSettings.MaxRFPower != OPLINKSETTINGS_MAXRFPOWER_0) { (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATAANDCONTROL));
bool ppm_only = (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL);
bool is_enabled = ((oplinkSettings.Protocol != OPLINKSETTINGS_PROTOCOL_DISABLED) &&
((oplinkSettings.MaxRFPower != OPLINKSETTINGS_MAXRFPOWER_0) || openlrs));
if (is_enabled) {
if (openlrs) { if (openlrs) {
#if defined(PIOS_INCLUDE_OPENLRS_RCVR) #if defined(PIOS_INCLUDE_OPENLRS_RCVR)
const struct pios_openlrs_cfg *openlrs_cfg = PIOS_BOARD_HW_DEFS_GetOpenLRSCfg(bdinfo->board_rev); const struct pios_openlrs_cfg *openlrs_cfg = PIOS_BOARD_HW_DEFS_GetOpenLRSCfg(bdinfo->board_rev);
@ -917,7 +921,7 @@ void PIOS_Board_Init(void)
/* Set the radio configuration parameters. */ /* Set the radio configuration parameters. */
PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID); PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID);
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID); PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only); PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, data_mode, ppm_mode);
/* Set the PPM callback if we should be receiving PPM. */ /* Set the PPM callback if we should be receiving PPM. */
if (ppm_mode || (ppm_only && !is_coordinator)) { if (ppm_mode || (ppm_only && !is_coordinator)) {

View File

@ -791,10 +791,14 @@ void PIOS_Board_Init(void)
/* Is the radio turned on? */ /* Is the radio turned on? */
bool is_coordinator = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPLINKCOORDINATOR); bool is_coordinator = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPLINKCOORDINATOR);
bool openlrs = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPENLRS); bool openlrs = (oplinkSettings.Protocol == OPLINKSETTINGS_PROTOCOL_OPENLRS);
bool is_oneway = (oplinkSettings.OneWay == OPLINKSETTINGS_ONEWAY_TRUE); bool data_mode = ((oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATA) ||
bool ppm_mode = (oplinkSettings.PPM == OPLINKSETTINGS_PPM_TRUE); (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATAANDCONTROL));
bool ppm_only = (oplinkSettings.PPMOnly == OPLINKSETTINGS_PPMONLY_TRUE); bool ppm_mode = ((oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL) ||
if (oplinkSettings.MaxRFPower != OPLINKSETTINGS_MAXRFPOWER_0) { (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_DATAANDCONTROL));
bool ppm_only = (oplinkSettings.LinkType == OPLINKSETTINGS_LINKTYPE_CONTROL);
bool is_enabled = ((oplinkSettings.Protocol != OPLINKSETTINGS_PROTOCOL_DISABLED) &&
((oplinkSettings.MaxRFPower != OPLINKSETTINGS_MAXRFPOWER_0) || openlrs));
if (is_enabled) {
if (openlrs) { if (openlrs) {
#if defined(PIOS_INCLUDE_OPENLRS_RCVR) #if defined(PIOS_INCLUDE_OPENLRS_RCVR)
const struct pios_openlrs_cfg *openlrs_cfg = PIOS_BOARD_HW_DEFS_GetOpenLRSCfg(); const struct pios_openlrs_cfg *openlrs_cfg = PIOS_BOARD_HW_DEFS_GetOpenLRSCfg();
@ -857,7 +861,7 @@ void PIOS_Board_Init(void)
/* Set the radio configuration parameters. */ /* Set the radio configuration parameters. */
PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID); PIOS_RFM22B_SetDeviceID(pios_rfm22b_id, oplinkSettings.CustomDeviceID);
PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID); PIOS_RFM22B_SetCoordinatorID(pios_rfm22b_id, oplinkSettings.CoordID);
PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, is_oneway, ppm_mode, ppm_only); PIOS_RFM22B_SetChannelConfig(pios_rfm22b_id, datarate, oplinkSettings.MinChannel, oplinkSettings.MaxChannel, is_coordinator, data_mode, ppm_mode);
/* Set the PPM callback if we should be receiving PPM. */ /* Set the PPM callback if we should be receiving PPM. */
if (ppm_mode || (ppm_only && !is_coordinator)) { if (ppm_mode || (ppm_only && !is_coordinator)) {

View File

@ -26,6 +26,8 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include <iostream>
#include "configoplinkwidget.h" #include "configoplinkwidget.h"
#include "ui_oplink.h" #include "ui_oplink.h"
@ -76,9 +78,7 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren
addWidgetBinding("OPLinkSettings", "MaxChannel", m_oplink->MaximumChannel); addWidgetBinding("OPLinkSettings", "MaxChannel", m_oplink->MaximumChannel);
addWidgetBinding("OPLinkSettings", "CoordID", m_oplink->CoordID); addWidgetBinding("OPLinkSettings", "CoordID", m_oplink->CoordID);
addWidgetBinding("OPLinkSettings", "Protocol", m_oplink->Protocol); addWidgetBinding("OPLinkSettings", "Protocol", m_oplink->Protocol);
addWidgetBinding("OPLinkSettings", "OneWay", m_oplink->OneWayLink); addWidgetBinding("OPLinkSettings", "LinkType", m_oplink->LinkType);
addWidgetBinding("OPLinkSettings", "PPMOnly", m_oplink->PPMOnly);
addWidgetBinding("OPLinkSettings", "PPM", m_oplink->PPM);
addWidgetBinding("OPLinkSettings", "ComSpeed", m_oplink->ComSpeed); addWidgetBinding("OPLinkSettings", "ComSpeed", m_oplink->ComSpeed);
addWidgetBinding("OPLinkSettings", "CustomDeviceID", m_oplink->CustomDeviceID); addWidgetBinding("OPLinkSettings", "CustomDeviceID", m_oplink->CustomDeviceID);
@ -104,11 +104,15 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren
addWidgetBinding("OPLinkStatus", "TXPacketRate", m_oplink->TXPacketRate); addWidgetBinding("OPLinkStatus", "TXPacketRate", m_oplink->TXPacketRate);
// Connect the selection changed signals. // Connect the selection changed signals.
connect(m_oplink->PPMOnly, SIGNAL(toggled(bool)), this, SLOT(ppmOnlyChanged())); connect(m_oplink->Protocol, SIGNAL(valueChanged(int)), this, SLOT(protocolChanged()));
connect(m_oplink->LinkType, SIGNAL(valueChanged(int)), this, SLOT(linkTypeChanged()));
connect(m_oplink->MinimumChannel, SIGNAL(valueChanged(int)), this, SLOT(minChannelChanged())); connect(m_oplink->MinimumChannel, SIGNAL(valueChanged(int)), this, SLOT(minChannelChanged()));
connect(m_oplink->MaximumChannel, SIGNAL(valueChanged(int)), this, SLOT(maxChannelChanged())); connect(m_oplink->MaximumChannel, SIGNAL(valueChanged(int)), this, SLOT(maxChannelChanged()));
connect(m_oplink->CustomDeviceID, SIGNAL(editingFinished()), this, SLOT(updateCustomDeviceID())); connect(m_oplink->CustomDeviceID, SIGNAL(editingFinished()), this, SLOT(updateCustomDeviceID()));
// Connect the Unbind button
connect(m_oplink->UnbindButton, SIGNAL(released()), this, SLOT(unbind()));
m_oplink->CustomDeviceID->setInputMask("HHHHHHHH"); m_oplink->CustomDeviceID->setInputMask("HHHHHHHH");
m_oplink->CoordID->setInputMask("HHHHHHHH"); m_oplink->CoordID->setInputMask("HHHHHHHH");
@ -214,9 +218,7 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object)
m_oplink->FlexiPortLabel->setVisible(false); m_oplink->FlexiPortLabel->setVisible(false);
m_oplink->VCPPort->setVisible(false); m_oplink->VCPPort->setVisible(false);
m_oplink->VCPPortLabel->setVisible(false); m_oplink->VCPPortLabel->setVisible(false);
m_oplink->FlexiIOPort->setVisible(false); m_oplink->LinkType->setEnabled(true);
m_oplink->FlexiIOPortLabel->setVisible(false);
m_oplink->PPM->setEnabled(true);
break; break;
case 0x03: // OPLinkMini case 0x03: // OPLinkMini
m_oplink->MainPort->setVisible(true); m_oplink->MainPort->setVisible(true);
@ -225,24 +227,7 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object)
m_oplink->FlexiPortLabel->setVisible(true); m_oplink->FlexiPortLabel->setVisible(true);
m_oplink->VCPPort->setVisible(true); m_oplink->VCPPort->setVisible(true);
m_oplink->VCPPortLabel->setVisible(true); m_oplink->VCPPortLabel->setVisible(true);
m_oplink->FlexiIOPort->setVisible(false); m_oplink->LinkType->setEnabled(true);
m_oplink->FlexiIOPortLabel->setVisible(false);
m_oplink->PPM->setEnabled(false);
connect(m_oplink->MainPort, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePPMOptions()));
connect(m_oplink->FlexiPort, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePPMOptions()));
break;
case 0x0a: // OPLink? (No. This is wrong. 0x0A is gpsplatinum.)
m_oplink->MainPort->setVisible(true);
m_oplink->MainPortLabel->setVisible(true);
m_oplink->FlexiPort->setVisible(true);
m_oplink->FlexiPortLabel->setVisible(true);
m_oplink->VCPPort->setVisible(true);
m_oplink->VCPPortLabel->setVisible(true);
m_oplink->FlexiIOPort->setVisible(true);
m_oplink->FlexiIOPortLabel->setVisible(true);
m_oplink->PPM->setEnabled(false);
connect(m_oplink->MainPort, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePPMOptions()));
connect(m_oplink->FlexiPort, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePPMOptions()));
break; break;
default: default:
// This shouldn't happen. // This shouldn't happen.
@ -255,10 +240,9 @@ void ConfigOPLinkWidget::updateSettings(UAVObject *object)
void ConfigOPLinkWidget::updateEnableControls() void ConfigOPLinkWidget::updateEnableControls()
{ {
enableControls(true); enableControls(true);
updatePPMOptions();
updateCustomDeviceID(); updateCustomDeviceID();
updateCoordID(); updateCoordID();
ppmOnlyChanged(); protocolChanged();
} }
void ConfigOPLinkWidget::disconnected() void ConfigOPLinkWidget::disconnected()
@ -268,47 +252,32 @@ void ConfigOPLinkWidget::disconnected()
} }
} }
void ConfigOPLinkWidget::updatePPMOptions() void ConfigOPLinkWidget::protocolChanged()
{ {
bool is_oplm = m_oplink->MainPort->isVisible(); bool is_enabled = !isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_DISABLED);
if (!is_oplm) {
return;
}
bool is_coordinator = isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPLINKCOORDINATOR); bool is_coordinator = isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPLINKCOORDINATOR);
bool is_ppm_active = ((isComboboxOptionSelected(m_oplink->MainPort, OPLinkSettings::MAINPORT_PPM)) || bool is_receiver = isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPLINKRECEIVER);
(isComboboxOptionSelected(m_oplink->FlexiPort, OPLinkSettings::FLEXIPORT_PPM))); bool is_openlrs = isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPENLRS);
bool is_ppm_only = isComboboxOptionSelected(m_oplink->LinkType, OPLinkSettings::LINKTYPE_CONTROL);
bool is_oplm = m_oplink->MainPort->isVisible();
bool is_bound = (m_oplink->CoordID->text() != "");
m_oplink->PPM->setEnabled(false); m_oplink->ComSpeed->setEnabled(!is_ppm_only && is_oplm && !is_openlrs && is_enabled);
m_oplink->PPM->setChecked(is_ppm_active); m_oplink->CoordID->setEnabled(is_receiver & is_enabled);
m_oplink->PPMOnly->setEnabled(is_ppm_active); m_oplink->UnbindButton->setEnabled(is_bound && !is_coordinator && is_enabled);
m_oplink->CustomDeviceID->setEnabled(is_coordinator);
if (!is_ppm_active) { m_oplink->MinimumChannel->setEnabled(is_receiver || is_coordinator);
m_oplink->PPMOnly->setChecked(false); m_oplink->MaximumChannel->setEnabled(is_receiver || is_coordinator);
QString selectPort = tr("Please select a port for PPM function."); m_oplink->MainPort->setEnabled((is_receiver || is_coordinator) && is_oplm);
m_oplink->PPMOnly->setToolTip(selectPort); m_oplink->FlexiPort->setEnabled((is_receiver || is_coordinator) && is_oplm);
m_oplink->PPM->setToolTip(selectPort); m_oplink->VCPPort->setEnabled((is_receiver || is_coordinator) && is_oplm);
} else { m_oplink->LinkType->setEnabled(is_enabled && !is_openlrs);
if (is_coordinator) { m_oplink->MaxRFTxPower->setEnabled(is_enabled && !is_openlrs);
m_oplink->PPMOnly->setToolTip(tr("Only PPM packets will be transmitted and baudrate set to 9600 bauds by default."));
m_oplink->PPM->setToolTip(tr("PPM packets will be transmitted by this modem."));
} else {
m_oplink->PPMOnly->setToolTip(tr("Only PPM packets will be received and baudrate set to 9600 bauds by default."));
m_oplink->PPM->setToolTip(tr("PPM packets will be received by this modem."));
}
}
} }
void ConfigOPLinkWidget::linkTypeChanged()
void ConfigOPLinkWidget::ppmOnlyChanged()
{ {
bool is_ppm_only = m_oplink->PPMOnly->isChecked(); protocolChanged();
bool is_oplm = m_oplink->MainPort->isVisible();
m_oplink->PPM->setEnabled(!is_ppm_only && !is_oplm);
m_oplink->OneWayLink->setEnabled(!is_ppm_only);
m_oplink->ComSpeed->setEnabled(!is_ppm_only);
} }
void ConfigOPLinkWidget::minChannelChanged() void ConfigOPLinkWidget::minChannelChanged()
@ -357,13 +326,11 @@ void ConfigOPLinkWidget::channelChanged(bool isMax)
void ConfigOPLinkWidget::updateCoordID() void ConfigOPLinkWidget::updateCoordID()
{ {
bool is_coordinator = isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPLINKCOORDINATOR);
bool coordinatorNotSet = (m_oplink->CoordID->text() == "0"); bool coordinatorNotSet = (m_oplink->CoordID->text() == "0");
if (settingsUpdated && coordinatorNotSet) { if (settingsUpdated && coordinatorNotSet) {
m_oplink->CoordID->clear(); m_oplink->CoordID->clear();
} }
m_oplink->CoordID->setEnabled(!is_coordinator);
} }
void ConfigOPLinkWidget::updateCustomDeviceID() void ConfigOPLinkWidget::updateCustomDeviceID()
@ -375,6 +342,26 @@ void ConfigOPLinkWidget::updateCustomDeviceID()
m_oplink->CustomDeviceID->setPlaceholderText("AutoGen"); m_oplink->CustomDeviceID->setPlaceholderText("AutoGen");
} }
} }
void ConfigOPLinkWidget::unbind()
{
if (settingsUpdated) {
// Clear the coordinator ID
oplinkSettingsObj->getField("CoordID")->setValue(0);
m_oplink->CoordID->setText("0");
// Clear the OpenLRS settings
oplinkSettingsObj->getField("version")->setValue(0);
oplinkSettingsObj->getField("serial_baudrate")->setValue(0);
oplinkSettingsObj->getField("rf_frequency")->setValue(0);
oplinkSettingsObj->getField("rf_power")->setValue(0);
oplinkSettingsObj->getField("rf_channel_spacing")->setValue(0);
oplinkSettingsObj->getField("modem_params")->setValue(0);
oplinkSettingsObj->getField("flags")->setValue(0);
}
}
/** /**
@} @}
@} @}

View File

@ -62,12 +62,13 @@ protected:
private slots: private slots:
void disconnected(); void disconnected();
void updatePPMOptions(); void linkTypeChanged();
void ppmOnlyChanged(); void protocolChanged();
void minChannelChanged(); void minChannelChanged();
void maxChannelChanged(); void maxChannelChanged();
void updateCoordID(); void updateCoordID();
void updateCustomDeviceID(); void updateCustomDeviceID();
void unbind();
void channelChanged(bool isMax); void channelChanged(bool isMax);
}; };

View File

@ -49,8 +49,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>812</width> <width>947</width>
<height>566</height> <height>575</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_5"> <layout class="QGridLayout" name="gridLayout_5">
@ -1295,31 +1295,8 @@
<string>Configuration</string> <string>Configuration</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="7"> <item row="1" column="1">
<widget class="QComboBox" name="ComSpeed"> <widget class="QComboBox" name="LinkType">
<property name="toolTip">
<string>Com speed in bps.</string>
</property>
</widget>
</item>
<item row="18" column="6">
<widget class="QLabel" name="FlexiIOPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>FlexiIO Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QComboBox" name="MainPort">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
@ -1327,21 +1304,7 @@
</size> </size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Choose the function for the main port.</string> <string>Configure what type of packets will be sent over the link</string>
</property>
</widget>
</item>
<item row="0" column="7">
<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 (mW)
0 to disable the modem.</string>
</property> </property>
<property name="layoutDirection"> <property name="layoutDirection">
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
@ -1351,199 +1314,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="6"> <item row="3" column="1">
<widget class="QLabel" name="MainPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Main Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="18" column="7">
<widget class="QComboBox" name="FlexiIOPort"/>
</item>
<item row="0" column="6">
<widget class="QLabel" name="MaxRFTxPowerLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Power</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QLabel" name="ComSpeedLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Com Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="PPMOnly">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Only PPM packets will be transmitted and baudrate set to 9600bauds by default.</string>
</property>
<property name="text">
<string>PPM Only</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="PPM">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>PPM packets will be received by this modem.
Must be selected if Coordinator modem is configured for PPM.</string>
</property>
<property name="text">
<string>PPM</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="CoordIDLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>Coordinator ID</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="customDeviceIDLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Device ID</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="CustomDeviceID">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="toolTip">
<string>Enter your custom ID for this device as a hexadecimal value,
this allows device clones. Be sure only one device with this
ID transmits at the same time!
Leave blank to use autogenerated Device ID.</string>
</property>
<property name="maxLength">
<number>8</number>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>AA00FF99</string>
</property>
<property name="cursorMoveStyle">
<enum>Qt::LogicalMoveStyle</enum>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="CoordID"> <widget class="QLineEdit" name="CoordID">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@ -1580,165 +1351,26 @@ The device must be rebooted for the binding to take place.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="3" column="0">
<widget class="QCheckBox" name="OneWayLink"> <widget class="QLabel" name="CoordIDLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight> <weight>50</weight>
<bold>false</bold> <bold>false</bold>
</font> </font>
</property> </property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="toolTip">
<string>If selected, data will only be transmitted from the coordinator to the Rx modem.</string>
</property>
<property name="text">
<string>One-Way</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="Protocol">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the modem protocol</string>
</property>
<property name="layoutDirection"> <property name="layoutDirection">
<enum>Qt::LeftToRight</enum> <enum>Qt::LeftToRight</enum>
</property> </property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="3" column="7">
<widget class="QComboBox" name="FlexiPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the flexi port.</string>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QLabel" name="FlexiPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text"> <property name="text">
<string>Flexi Port</string> <string>Coordinator ID</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="7"> <item row="5" column="1">
<widget class="QComboBox" name="VCPPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the USB virtual com port.</string>
</property>
</widget>
</item>
<item row="4" column="6">
<widget class="QLabel" name="VCPPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>VCP Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="MaximumChannelLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="MinimumChannelLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Min Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<widget class="QSpinBox" name="MinimumChannel"> <widget class="QSpinBox" name="MinimumChannel">
@ -1789,7 +1421,109 @@ The device must be rebooted for the binding to take place.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="1" colspan="2"> <item row="2" column="0">
<widget class="QLabel" name="CustomDeviceIDLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Device ID</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="CustomDeviceID">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Enter your custom ID for this device as a hexadecimal value,
this allows device clones. Be sure only one device with this
ID transmits at the same time!
Leave blank to use autogenerated Device ID.</string>
</property>
<property name="maxLength">
<number>8</number>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="placeholderText">
<string>AA00FF99</string>
</property>
<property name="cursorMoveStyle">
<enum>Qt::LogicalMoveStyle</enum>
</property>
<property name="clearButtonEnabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="MinimumChannelLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Min Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QSpinBox" name="MaximumChannel"> <widget class="QSpinBox" name="MaximumChannel">
@ -1840,6 +1574,186 @@ The device must be rebooted for the binding to take place.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="MaximumChannelLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Chan</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="7">
<widget class="QComboBox" name="ComSpeed">
<property name="toolTip">
<string>Com speed in bps.</string>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QComboBox" name="MainPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the main port.</string>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QLabel" name="MainPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Main Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="MaxRFTxPowerLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Max Power</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="7">
<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 (mW)
0 to disable the modem.</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QLabel" name="ComSpeedLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Com Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QLabel" name="FlexiPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Flexi Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="7">
<widget class="QComboBox" name="VCPPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the USB virtual com port.</string>
</property>
</widget>
</item>
<item row="4" column="6">
<widget class="QLabel" name="VCPPortLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>VCP Port</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="7">
<widget class="QComboBox" name="FlexiPort">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Choose the function for the flexi port.</string>
</property>
</widget>
</item>
<item row="1" column="5"> <item row="1" column="5">
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">
@ -1853,6 +1767,67 @@ The device must be rebooted for the binding to take place.</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="1">
<widget class="QComboBox" name="Protocol">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the modem protocol</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="LinkTypeLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Link Type</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="ProtocolLabel">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Protocol</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="UnbindButton">
<property name="toolTip">
<string>Clear the binding/coordinator ID</string>
</property>
<property name="text">
<string>Unbind</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -1,10 +1,8 @@
<xml> <xml>
<object name="OPLinkSettings" singleinstance="true" settings="true" category="System"> <object name="OPLinkSettings" singleinstance="true" settings="true" category="System">
<description>OPLink configurations options.</description> <description>OPLink configurations options.</description>
<field name="Protocol" units="" type="enum" elements="1" options="OPLinkReceiver,OPLinkCoordinator,OpenLRS" defaultvalue="OPLinkReceiver"/> <field name="Protocol" units="" type="enum" elements="1" options="Disabled,OPLinkReceiver,OPLinkCoordinator,OpenLRS" defaultvalue="Disabled"/>
<field name="OneWay" units="" type="enum" elements="1" options="False,True" defaultvalue="False"/> <field name="LinkType" units="" type="enum" elements="1" options="Data,Control,DataAndControl" defaultvalue="Data"/>
<field name="PPM" units="" type="enum" elements="1" options="False,True" defaultvalue="False"/>
<field name="PPMOnly" units="" type="enum" elements="1" options="False,True" defaultvalue="False"/>
<field name="CoordID" units="hex" type="uint32" elements="1" defaultvalue="0"/> <field name="CoordID" units="hex" type="uint32" elements="1" defaultvalue="0"/>
<field name="MainPort" units="" type="enum" elements="1" options="Disabled,Telemetry,Serial,PPM,PWM" defaultvalue="Disabled"/> <field name="MainPort" units="" type="enum" elements="1" options="Disabled,Telemetry,Serial,PPM,PWM" defaultvalue="Disabled"/>
<field name="FlexiPort" units="" type="enum" elements="1" options="Disabled,Telemetry,Serial,PPM,PWM" defaultvalue="Disabled"/> <field name="FlexiPort" units="" type="enum" elements="1" options="Disabled,Telemetry,Serial,PPM,PWM" defaultvalue="Disabled"/>
@ -19,7 +17,7 @@
<field name="version" units="" type="uint8" elements="1" defaultvalue="0"/> <field name="version" units="" type="uint8" elements="1" defaultvalue="0"/>
<field name="serial_baudrate" units="" type="uint32" elements="1" defaultvalue="0"/> <field name="serial_baudrate" units="" type="uint32" elements="1" defaultvalue="0"/>
<field name="rf_frequency" units="" type="uint32" elements="1" defaultvalue="0"/> <field name="rf_frequency" units="" type="uint32" elements="1" defaultvalue="0"/>
<field name="rf_magic" units="" type="uint32" elements="1" defaultvalue="0"/> <!-- rf_magic === CoordID -->
<field name="rf_power" units="" type="uint8" elements="1" defaultvalue="0"/> <field name="rf_power" units="" type="uint8" elements="1" defaultvalue="0"/>
<field name="rf_channel_spacing" units="" type="uint8" elements="1" defaultvalue="0"/> <field name="rf_channel_spacing" units="" type="uint8" elements="1" defaultvalue="0"/>
<field name="hopchannel" units="" type="uint8" elements="24" defaultvalue="0"/> <field name="hopchannel" units="" type="uint8" elements="24" defaultvalue="0"/>