33 #include "ui_integratedradio.h"
51 connect(ui->rb_tx, &QRadioButton::toggled,
this,
52 &ConfigRadioWidget::roleChanged);
53 connect(ui->rb_rx, &QRadioButton::toggled,
this,
54 &ConfigRadioWidget::roleChanged);
55 connect(ui->rb_disabled, &QRadioButton::toggled,
this,
56 &ConfigRadioWidget::roleChanged);
65 QWidget::resizeEvent(event);
73 void ConfigRadioWidget::roleChanged(
bool ignored)
77 if (ui->rb_tx->isChecked()) {
78 ui->groupTxSettings->setEnabled(
true);
79 ui->groupRxSettings->setEnabled(
false);
80 }
else if (ui->rb_rx->isChecked()) {
81 ui->groupTxSettings->setEnabled(
false);
82 ui->groupRxSettings->setEnabled(
true);
84 ui->groupTxSettings->setEnabled(
false);
85 ui->groupRxSettings->setEnabled(
false);
89 void ConfigRadioWidget::refreshWidgetsValues(
UAVObject *obj)
95 OpenLRS::DataFields openlrs = olrsObj->getData();
97 switch (openlrs.role) {
98 case OpenLRS::ROLE_DISABLED:
100 ui->rb_disabled->setChecked(
true);
102 case OpenLRS::ROLE_RX:
103 ui->rb_rx->setChecked(
true);
105 case OpenLRS::ROLE_TX:
106 ui->rb_tx->setChecked(
true);
113 void ConfigRadioWidget::updateObjectsFromWidgets()
117 if (ui->rb_tx->isChecked()) {
118 olrsObj->setrole(OpenLRS::ROLE_TX);
119 }
else if (ui->rb_rx->isChecked()) {
120 olrsObj->setrole(OpenLRS::ROLE_RX);
122 olrsObj->setrole(OpenLRS::ROLE_DISABLED);
void resizeEvent(QResizeEvent *event)
virtual void enableControls(bool enable)
ConfigRadioWidget(QWidget *parent=nullptr)