1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

FlightMode GUI: remove ugly right slider

This commit is contained in:
Oleg Semyonov 2012-07-04 07:46:38 +03:00
parent dd398e9bd5
commit 954cd9febc
2 changed files with 4 additions and 64 deletions

View File

@ -103,7 +103,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent)
addUAVObjectToWidgetRelation("ManualControlSettings","Arming",m_config->armControl);
addUAVObjectToWidgetRelation("ManualControlSettings","ArmedTimeout",m_config->armTimeout,0,1000);
connect( ManualControlCommand::GetInstance(getObjectManager()),SIGNAL(objectUpdated(UAVObject*)),this,SLOT(moveFMSlider()));
connect( ManualControlSettings::GetInstance(getObjectManager()),SIGNAL(objectUpdated(UAVObject*)),this,SLOT(moveFMSlider()));
connect( ManualControlSettings::GetInstance(getObjectManager()),SIGNAL(objectUpdated(UAVObject*)),this,SLOT(updatePositionSlider()));
enableControls(false);
@ -1154,13 +1153,6 @@ void ConfigInputWidget::moveFMSlider()
if (valueScaled > 1.0)
valueScaled = 1.0;
// Display current channel value for tuning (in percents)
float scaledFlightMode = (valueScaled + 1.0) / 2.0;
m_config->fmsChannelSlider->setValue(scaledFlightMode * 100.0
/ ManualControlSettings::FLIGHTMODEPOSITION_NUMELEM * manualSettingsDataPriv.FlightModeNumber);
m_config->fmsChannelSlider->setToolTip(
"Current flight mode channel value: " + QString::number(scaledFlightMode * 100.0, 'f', 0) + '%');
// Convert flightMode value into the switch position in the range [0..N-1]
// This uses the same optimized computation as flight code to be consistent
uint8_t pos = ((int16_t)(valueScaled * 256) + 256) * manualSettingsDataPriv.FlightModeNumber >> 9;

View File

@ -632,7 +632,7 @@ Setup the flight mode channel on the RC Input tab if you have not done so alread
<widget class="QSpinBox" name="fmsPosNum">
<property name="geometry">
<rect>
<x>440</x>
<x>458</x>
<y>20</y>
<width>61</width>
<height>20</height>
@ -661,21 +661,21 @@ channel value for each flight mode.</string>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>305</x>
<x>277</x>
<y>22</y>
<width>141</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>Number of modes:</string>
<string>Number of flight modes:</string>
</property>
</widget>
<widget class="QLabel" name="label_15">
<property name="geometry">
<rect>
<x>310</x>
<y>90</y>
<y>120</y>
<width>191</width>
<height>30</height>
</rect>
@ -693,58 +693,6 @@ channel value for each flight mode.</string>
<bool>true</bool>
</property>
</widget>
<widget class="QSlider" name="fmsChannelSlider">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>265</x>
<y>16</y>
<width>20</width>
<height>181</height>
</rect>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>This slider shows the real value of your remote channel.</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>10</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="sliderPosition">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="invertedAppearance">
<bool>true</bool>
</property>
<property name="invertedControls">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
<property name="tickInterval">
<number>1</number>
</property>
</widget>
</widget>
<zorder>groupBox_2</zorder>
<zorder>groupBox</zorder>