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

OP-1660 Allow realtime monitoring of inputs

This commit is contained in:
Laurent Lalanne 2014-12-25 17:49:19 +01:00
parent e734e2876b
commit b82b10e832
3 changed files with 166 additions and 159 deletions

View File

@ -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("<p align='center'>Arming Settings are now set to 'Always Disarmed' for your safety.\n"
"<b>Stop Manual Calibration</b> when done</p>"));
msgBox.setText(tr("<p>Arming Settings are now set to 'Always Disarmed' for your safety.</p>"
"<p>Be sure your receiver is powered with an external source and Transmitter is on.</p>"
"<p align='center'><b>Stop Manual Calibration</b> when done</p>"));
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<ManualControlCommand *>(object) == 0;
}

View File

@ -66,6 +66,8 @@ public:
}
void enableControls(bool enable);
bool shouldObjectBeSaved(UAVObject *object);
private:
bool growing;
bool reverse[ManualControlSettings::CHANNELNEUTRAL_NUMELEM];

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>923</width>
<height>51</height>
<height>57</height>
</rect>
</property>
<property name="windowTitle">
@ -215,7 +215,7 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="1" column="9">
<item row="1" column="11">
<widget class="QSpinBox" name="channelResponseTime">
<property name="enabled">
<bool>true</bool>
@ -311,7 +311,7 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="0" column="7">
<item row="0" column="9">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -343,7 +343,7 @@ margin:1px;</string>
</property>
</spacer>
</item>
<item row="1" column="7">
<item row="1" column="9">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -359,8 +359,8 @@ margin:1px;</string>
</property>
</spacer>
</item>
<item row="0" column="8">
<widget class="QLabel" name="legend6">
<item row="0" column="10">
<widget class="QLabel" name="legend7">
<property name="enabled">
<bool>true</bool>
</property>
@ -408,8 +408,8 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="0" column="9">
<widget class="QLabel" name="legend7">
<item row="0" column="11">
<widget class="QLabel" name="legend8">
<property name="enabled">
<bool>true</bool>
</property>
@ -457,8 +457,8 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="legend5">
<item row="0" column="8">
<widget class="QLabel" name="legend6">
<property name="enabled">
<bool>true</bool>
</property>
@ -506,52 +506,6 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="legend4">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<pointsize>-1</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Channel neutral</string>
</property>
<property name="styleSheet">
<string notr="true">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;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string>Neutral</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="legend3">
<property name="enabled">
@ -644,7 +598,7 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="1" column="6">
<item row="1" column="8">
<widget class="QSpinBox" name="channelMax">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@ -684,105 +638,7 @@ margin:1px;</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<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>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QSlider" name="channelNeutral">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="neutralValue">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<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>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="8">
<item row="1" column="10">
<widget class="QFrame" name="frame_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -846,6 +702,143 @@ margin:1px;</string>
</layout>
</widget>
</item>
<item row="1" column="7">
<widget class="QSpinBox" name="neutralValue">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<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>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QSlider" name="channelNeutral">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="accessibleName">
<string/>
</property>
<property name="accessibleDescription">
<string/>
</property>
<property name="inputMethodHints">
<set>Qt::ImhNone</set>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
</property>
<property name="tickInterval">
<number>50</number>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="legend4">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<pointsize>-1</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Channel value</string>
</property>
<property name="styleSheet">
<string notr="true">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;</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string>Channel Value</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QLabel" name="legend5">
<property name="toolTip">
<string>Channel neutral</string>
</property>
<property name="styleSheet">
<string notr="true">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;</string>
</property>
<property name="text">
<string>Neutral</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>