diff --git a/ground/gcs/src/plugins/config/configinputwidget.cpp b/ground/gcs/src/plugins/config/configinputwidget.cpp index f350afcd3..061685593 100644 --- a/ground/gcs/src/plugins/config/configinputwidget.cpp +++ b/ground/gcs/src/plugins/config/configinputwidget.cpp @@ -203,6 +203,10 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : connect(wizardUi->wzCancel, SIGNAL(clicked()), this, SLOT(wzCancel())); connect(wizardUi->wzBack, SIGNAL(clicked()), this, SLOT(wzBack())); + connect(ReceiverActivity::GetInstance(getObjectManager()), SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateReceiverActivityStatus())); + ui->receiverActivityStatus->setStyleSheet("QLabel { background-color: darkGreen; color: rgb(255, 255, 255); \ + border: 1px solid grey; border-radius: 5; margin:1px; font:bold;}"); + ui->stackedWidget->setCurrentIndex(0); QList widgets = QList() << ui->fmsModePos1 << ui->fmsModePos2 << ui->fmsModePos3 << ui->fmsModePos4 << ui->fmsModePos5 << ui->fmsModePos6; @@ -2117,6 +2121,32 @@ void ConfigInputWidget::forceOneFlightMode() manualSettingsObj->setData(manualSettingsData); } +void ConfigInputWidget::updateReceiverActivityStatus() +{ + ReceiverActivity *receiverActivity = ReceiverActivity::GetInstance(getObjectManager()); + + Q_ASSERT(receiverActivity); + + UAVObjectField *activeGroup = receiverActivity->getField(QString("ActiveGroup")); + Q_ASSERT(activeGroup); + + UAVObjectField *activeChannel = receiverActivity->getField(QString("ActiveChannel")); + Q_ASSERT(activeChannel); + + QString activeGroupText = activeGroup->getValue().toString(); + QString activeChannelText = activeChannel->getValue().toString(); + + if (activeGroupText != "None") { + ui->receiverActivityStatus->setText(tr("%1 input - Channel %2").arg(activeGroupText).arg(activeChannelText)); + ui->receiverActivityStatus->setStyleSheet("QLabel { background-color: green; color: rgb(255, 255, 255); \ + border: 1px solid grey; border-radius: 5; margin:1px; font:bold;}"); + } else { + ui->receiverActivityStatus->setText(tr("No activity")); + ui->receiverActivityStatus->setStyleSheet("QLabel { background-color: darkGreen; color: rgb(255, 255, 255); \ + border: 1px solid grey; border-radius: 5; margin:1px; font:bold;}"); + } +} + void ConfigInputWidget::failsafeFlightModeChanged(int index) { ui->failsafeFlightMode->setEnabled(index != -1); diff --git a/ground/gcs/src/plugins/config/configinputwidget.h b/ground/gcs/src/plugins/config/configinputwidget.h index a9bfaeca9..a110d62c3 100644 --- a/ground/gcs/src/plugins/config/configinputwidget.h +++ b/ground/gcs/src/plugins/config/configinputwidget.h @@ -230,6 +230,7 @@ private slots: void resetFlightModeSettings(); void resetActuatorSettings(); void forceOneFlightMode(); + void updateReceiverActivityStatus(); void failsafeFlightModeChanged(int index); void failsafeFlightModeCbToggled(bool checked); diff --git a/ground/gcs/src/plugins/config/input.ui b/ground/gcs/src/plugins/config/input.ui index f2421b745..dd45d70bf 100644 --- a/ground/gcs/src/plugins/config/input.ui +++ b/ground/gcs/src/plugins/config/input.ui @@ -136,7 +136,7 @@ 6 - + Input Channel Configuration @@ -281,114 +281,171 @@ - - - Calibration and Configuration Options + + + 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 210 - 0 - - - - Start Transmitter Setup Wizard - - - false - - - false - - - false - - - false - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - true - - - - 0 - 0 - - - - - 210 - 0 - - - - false - - - Start Manual Calibration - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + + + Calibration and Configuration Options + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 240 + 0 + + + + Start Transmitter Setup Wizard + + + false + + + false + + + false + + + false + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + + 0 + 0 + + + + + 240 + 0 + + + + false + + + Start Manual Calibration + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Receiver Activity + + + + + + true + + + + 300 + 30 + + + + Show receiver activity, input and channel +while moving one stick or switch at once. + + + border: 1px solid grey; +border-radius: 5; +margin:1px; +font:bold; + + + No activity + + + Qt::AlignCenter + + + + + + +