1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

OP-138 Finishing touches to the custom mixer editor (curve reset buttons, value displays, etc.)

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2036 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-10-30 10:16:01 +00:00 committed by edouard
parent c7b6341b21
commit 88a199d20e
3 changed files with 209 additions and 41 deletions

View File

@ -69,7 +69,7 @@
<item>
<widget class="QStackedWidget" name="airframesWidget">
<property name="currentIndex">
<number>1</number>
<number>3</number>
</property>
<widget class="QWidget" name="fixedWing">
<property name="enabled">
@ -1287,13 +1287,48 @@ p, li { white-space: pre-wrap; }
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QLabel" name="label_39">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Throttle Curve 1</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="customReset1">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Reset</string>
</property>
@ -1338,13 +1373,36 @@ p, li { white-space: pre-wrap; }
<layout class="QHBoxLayout" name="horizontalLayout_18">
<item>
<widget class="QLabel" name="label_41">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Throttle Curve 2</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="customReset2">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Reset</string>
</property>
@ -1386,14 +1444,34 @@ p, li { white-space: pre-wrap; }
<item>
<layout class="QFormLayout" name="formLayout_12">
<item row="0" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>FeedForward</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_AA">
<item>
<widget class="QLabel" name="label_CC">
<property name="text">
<string>FeedForward </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="customFeedForwardValue">
<property name="minimumSize">
<size>
<width>30</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>000</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QSlider" name="customFFSlider">
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -1420,11 +1498,22 @@ p, li { white-space: pre-wrap; }
<widget class="QDoubleSpinBox" name="customFFdecel"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_38">
<property name="text">
<string>MaxAccel</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout_SD">
<item>
<widget class="QLabel" name="label_37SDF">
<property name="text">
<string>MaxAccel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_OSD">
<property name="text">
<string>1000</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<widget class="QSlider" name="customFFMaxAccel">
@ -2005,12 +2094,12 @@ p, li { white-space: pre-wrap; }
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>78</x>
<y>111</y>
<x>97</x>
<y>100</y>
</hint>
<hint type="destinationlabel">
<x>78</x>
<y>113</y>
<x>97</x>
<y>100</y>
</hint>
</hints>
</connection>
@ -2021,12 +2110,12 @@ p, li { white-space: pre-wrap; }
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>74</x>
<y>111</y>
<x>93</x>
<y>100</y>
</hint>
<hint type="destinationlabel">
<x>74</x>
<y>113</y>
<x>93</x>
<y>100</y>
</hint>
</hints>
</connection>
@ -2037,12 +2126,12 @@ p, li { white-space: pre-wrap; }
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>493</x>
<y>173</y>
<x>118</x>
<y>91</y>
</hint>
<hint type="destinationlabel">
<x>271</x>
<y>171</y>
<x>118</x>
<y>91</y>
</hint>
</hints>
</connection>
@ -2053,12 +2142,12 @@ p, li { white-space: pre-wrap; }
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>488</x>
<y>262</y>
<x>118</x>
<y>91</y>
</hint>
<hint type="destinationlabel">
<x>249</x>
<y>262</y>
<x>118</x>
<y>91</y>
</hint>
</hints>
</connection>
@ -2069,12 +2158,12 @@ p, li { white-space: pre-wrap; }
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>76</x>
<y>210</y>
<x>95</x>
<y>91</y>
</hint>
<hint type="destinationlabel">
<x>80</x>
<y>149</y>
<x>99</x>
<y>91</y>
</hint>
</hints>
</connection>
@ -2085,12 +2174,12 @@ p, li { white-space: pre-wrap; }
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>119</x>
<y>199</y>
<x>118</x>
<y>91</y>
</hint>
<hint type="destinationlabel">
<x>135</x>
<y>150</y>
<x>118</x>
<y>91</y>
</hint>
</hints>
</connection>
@ -2101,12 +2190,44 @@ p, li { white-space: pre-wrap; }
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>39</x>
<y>217</y>
<x>58</x>
<y>91</y>
</hint>
<hint type="destinationlabel">
<x>43</x>
<y>149</y>
<x>62</x>
<y>91</y>
</hint>
</hints>
</connection>
<connection>
<sender>customFFSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>customFeedForwardValue</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>641</x>
<y>86</y>
</hint>
<hint type="destinationlabel">
<x>584</x>
<y>87</y>
</hint>
</hints>
</connection>
<connection>
<sender>customFFMaxAccel</sender>
<signal>valueChanged(int)</signal>
<receiver>label_OSD</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>664</x>
<y>189</y>
</hint>
<hint type="destinationlabel">
<x>569</x>
<y>191</y>
</hint>
</hints>
</connection>

View File

@ -171,8 +171,12 @@ ConfigAirframeWidget::ConfigAirframeWidget(QWidget *parent) : ConfigTaskWidget(p
connect(m_aircraft->fwThrottleReset, SIGNAL(clicked()), this, SLOT(resetFwMixer()));
connect(m_aircraft->mrThrottleCurveReset, SIGNAL(clicked()), this, SLOT(resetMrMixer()));
connect(m_aircraft->customReset1, SIGNAL(clicked()), this, SLOT(resetCt1Mixer()));
connect(m_aircraft->customReset2, SIGNAL(clicked()), this, SLOT(resetCt2Mixer()));
connect(m_aircraft->fixedWingThrottle, SIGNAL(curveUpdated(QList<double>,double)), this, SLOT(updateFwThrottleCurveValue(QList<double>,double)));
connect(m_aircraft->multiThrottleCurve, SIGNAL(curveUpdated(QList<double>,double)), this, SLOT(updateMrThrottleCurveValue(QList<double>,double)));
connect(m_aircraft->customThrottle1Curve, SIGNAL(curveUpdated(QList<double>,double)), this, SLOT(updateCustomThrottle1CurveValue(QList<double>,double)));
connect(m_aircraft->customThrottle2Curve, SIGNAL(curveUpdated(QList<double>,double)), this, SLOT(updateCustomThrottle2CurveValue(QList<double>,double)));
// connect(m_aircraft->fwAileron1Channel, SIGNAL(currentIndexChanged(int)), this, SLOT(toggleAileron2(int)));
// connect(m_aircraft->fwElevator1Channel, SIGNAL(currentIndexChanged(int)), this, SLOT(toggleElevator2(int)));
@ -342,6 +346,27 @@ void ConfigAirframeWidget::resetMrMixer()
resetMixer(m_aircraft->multiThrottleCurve, field->getNumElements());
}
/**
Resets Custom throttle 1 mixer
*/
void ConfigAirframeWidget::resetCt1Mixer()
{
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("MixerSettings")));
UAVObjectField* field = obj->getField(QString("ThrottleCurve1"));
resetMixer(m_aircraft->customThrottle1Curve, field->getNumElements());
}
/**
Resets Custom throttle 2 mixer
*/
void ConfigAirframeWidget::resetCt2Mixer()
{
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("MixerSettings")));
UAVObjectField* field = obj->getField(QString("ThrottleCurve2"));
resetMixer(m_aircraft->customThrottle2Curve, field->getNumElements());
}
/**
Resets a mixer curve
*/
@ -373,6 +398,24 @@ void ConfigAirframeWidget::updateMrThrottleCurveValue(QList<double> list, double
m_aircraft->mrThrottleCurveItemValue->setText(QString().sprintf("Val: %.2f",value));
}
/**
Updates the currently moved throttle curve item value (Custom throttle 1)
*/
void ConfigAirframeWidget::updateCustomThrottle1CurveValue(QList<double> list, double value)
{
Q_UNUSED(list);
m_aircraft->customThrottleCurve1Value->setText(QString().sprintf("Val: %.2f",value));
}
/**
Updates the currently moved throttle curve item value (Custom throttle 2)
*/
void ConfigAirframeWidget::updateCustomThrottle2CurveValue(QList<double> list, double value)
{
Q_UNUSED(list);
m_aircraft->customThrottleCurve2Value->setText(QString().sprintf("Val: %.2f",value));
}
/**************************
* Aircraft settings

View File

@ -81,8 +81,12 @@ private slots:
void switchAirframeType(int index);
void resetFwMixer();
void resetMrMixer();
void resetCt1Mixer();
void resetCt2Mixer();
void updateFwThrottleCurveValue(QList<double> list, double value);
void updateMrThrottleCurveValue(QList<double> list, double value);
void updateCustomThrottle1CurveValue(QList<double> list, double value);
void updateCustomThrottle2CurveValue(QList<double> list, double value);
void enableFFTest();
protected: