From b82b10e83218178799fd3f925e3420ab939b388f Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 25 Dec 2014 17:49:19 +0100 Subject: [PATCH] OP-1660 Allow realtime monitoring of inputs --- .../src/plugins/config/configinputwidget.cpp | 18 +- .../src/plugins/config/configinputwidget.h | 2 + .../src/plugins/config/inputchannelform.ui | 305 +++++++++--------- 3 files changed, 166 insertions(+), 159 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index bea144d7e..8985f72c7 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -96,6 +96,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : Q_ASSERT(index < ManualControlSettings::CHANNELGROUPS_NUMELEM); InputChannelForm *form = new InputChannelForm(index, this); form->setName(name); + form->moveTo(*(ui->channelLayout)); // The order of the following binding calls is important. Since the values will be populated @@ -104,7 +105,9 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : // will not be set correctly. addWidgetBinding("ManualControlSettings", "ChannelNumber", form->ui->channelNumber, index); addWidgetBinding("ManualControlSettings", "ChannelGroups", form->ui->channelGroup, index); - addWidgetBinding("ManualControlSettings", "ChannelNeutral", form->ui->channelNeutral, index); + // Slider position based on real time Rcinput (allow monitoring) + addWidgetBinding("ManualControlCommand", "Channel", form->ui->channelNeutral, index); + // Neutral value stored on board (SpinBox) addWidgetBinding("ManualControlSettings", "ChannelNeutral", form->ui->neutralValue, index); addWidgetBinding("ManualControlSettings", "ChannelMax", form->ui->channelMax, index); addWidgetBinding("ManualControlSettings", "ChannelMin", form->ui->channelMin, index); @@ -1567,8 +1570,9 @@ void ConfigInputWidget::simpleCalibration(bool enable) ui->runCalibration->setText(tr("Stop Manual Calibration")); QMessageBox msgBox; - msgBox.setText(tr("

Arming Settings are now set to 'Always Disarmed' for your safety.\n" - "Stop Manual Calibration when done

")); + msgBox.setText(tr("

Arming Settings are now set to 'Always Disarmed' for your safety.

" + "

Be sure your receiver is powered with an external source and Transmitter is on.

" + "

Stop Manual Calibration when done

")); msgBox.setDetailedText(tr("You will have to reconfigure the arming settings manually when the manual calibration is finished.")); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); @@ -1631,3 +1635,11 @@ void ConfigInputWidget::adjustSpecialNeutrals() ((manualSettingsData.ChannelMax[ManualControlSettings::CHANNELMAX_THROTTLE] - manualSettingsData.ChannelMin[ManualControlSettings::CHANNELMIN_THROTTLE]) * 0.04); } + +bool ConfigInputWidget::shouldObjectBeSaved(UAVObject *object) +{ + // ManualControlCommand no need to be saved + return dynamic_cast(object) == 0; + +} + diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index cbd28022c..0cb0b34cc 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -66,6 +66,8 @@ public: } void enableControls(bool enable); + bool shouldObjectBeSaved(UAVObject *object); + private: bool growing; bool reverse[ManualControlSettings::CHANNELNEUTRAL_NUMELEM]; diff --git a/ground/openpilotgcs/src/plugins/config/inputchannelform.ui b/ground/openpilotgcs/src/plugins/config/inputchannelform.ui index 0a3fc987e..156d653ac 100644 --- a/ground/openpilotgcs/src/plugins/config/inputchannelform.ui +++ b/ground/openpilotgcs/src/plugins/config/inputchannelform.ui @@ -7,7 +7,7 @@ 0 0 923 - 51 + 57 @@ -215,7 +215,7 @@ margin:1px; - + true @@ -311,7 +311,7 @@ margin:1px; - + Qt::Horizontal @@ -343,7 +343,7 @@ margin:1px; - + Qt::Horizontal @@ -359,8 +359,8 @@ margin:1px; - - + + true @@ -408,8 +408,8 @@ margin:1px; - - + + true @@ -457,8 +457,8 @@ margin:1px; - - + + true @@ -506,52 +506,6 @@ margin:1px; - - - - true - - - - 0 - 0 - - - - - 0 - 20 - - - - - -1 - 75 - false - true - - - - Channel neutral - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font: bold 12px; -margin:1px; - - - QFrame::StyledPanel - - - Neutral - - - Qt::AlignCenter - - - @@ -644,7 +598,7 @@ margin:1px; - + @@ -684,105 +638,7 @@ margin:1px; - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - QFrame::NoFrame - - - QFrame::Plain - - - - 2 - - - 0 - - - 2 - - - 0 - - - - - - 0 - 0 - - - - - 50 - 0 - - - - Qt::StrongFocus - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - 9999 - - - 1000 - - - - - - - + @@ -846,6 +702,143 @@ margin:1px; + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + + + 9999 + + + 1000 + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + Qt::StrongFocus + + + + + + + + + Qt::ImhNone + + + Qt::Horizontal + + + QSlider::TicksBothSides + + + 50 + + + + + + + true + + + + 0 + 0 + + + + + 0 + 20 + + + + + -1 + 75 + false + true + + + + Channel value + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + QFrame::StyledPanel + + + Channel Value + + + Qt::AlignCenter + + + + + + + Channel neutral + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font: bold 12px; +margin:1px; + + + Neutral + + + Qt::AlignCenter + + +