mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-12 04:29:16 +01:00
OP-1674 Add frequency display and limiting values - Allow channel 250.
This commit is contained in:
parent
c8c3a46735
commit
ada09a8aaa
@ -97,6 +97,11 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget
|
|||||||
|
|
||||||
// Connect the selection changed signals.
|
// Connect the selection changed signals.
|
||||||
connect(m_oplink->PPMOnly, SIGNAL(toggled(bool)), this, SLOT(ppmOnlyChanged()));
|
connect(m_oplink->PPMOnly, SIGNAL(toggled(bool)), this, SLOT(ppmOnlyChanged()));
|
||||||
|
connect(m_oplink->MinimumChannel, SIGNAL(valueChanged(int)), this, SLOT(minChannelChanged()));
|
||||||
|
connect(m_oplink->MaximumChannel, SIGNAL(valueChanged(int)), this, SLOT(maxChannelChanged()));
|
||||||
|
|
||||||
|
m_oplink->MinimumChannel->setKeyboardTracking(false);
|
||||||
|
m_oplink->MaximumChannel->setKeyboardTracking(false);
|
||||||
|
|
||||||
// Request and update of the setting object.
|
// Request and update of the setting object.
|
||||||
settingsUpdated = false;
|
settingsUpdated = false;
|
||||||
@ -318,6 +323,52 @@ void ConfigPipXtremeWidget::ppmOnlyChanged()
|
|||||||
m_oplink->ComSpeed->setEnabled(!is_ppm_only);
|
m_oplink->ComSpeed->setEnabled(!is_ppm_only);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigPipXtremeWidget::minChannelChanged()
|
||||||
|
{
|
||||||
|
ChannelChanged(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigPipXtremeWidget::maxChannelChanged()
|
||||||
|
{
|
||||||
|
ChannelChanged(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigPipXtremeWidget::ChannelChanged(bool isMax)
|
||||||
|
{
|
||||||
|
int minChannel = m_oplink->MinimumChannel->value();
|
||||||
|
int maxChannel = m_oplink->MaximumChannel->value();
|
||||||
|
|
||||||
|
int minimalChannelRange = 10;
|
||||||
|
|
||||||
|
if ((maxChannel - minChannel) < minimalChannelRange) {
|
||||||
|
if (isMax) {
|
||||||
|
minChannel = maxChannel - minimalChannelRange;
|
||||||
|
} else {
|
||||||
|
maxChannel = minChannel + minimalChannelRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (maxChannel > 250) {
|
||||||
|
maxChannel = 250;
|
||||||
|
minChannel = 250 - minimalChannelRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (minChannel < 0) {
|
||||||
|
minChannel = 0;
|
||||||
|
maxChannel = minimalChannelRange;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_oplink->MaximumChannel->setValue(maxChannel);
|
||||||
|
m_oplink->MinimumChannel->setValue(minChannel);
|
||||||
|
|
||||||
|
// Calculate and Display frequency in Mhz
|
||||||
|
float minFrequency = 430 + (minChannel * 0.040);
|
||||||
|
float maxFrequency = 430 + (maxChannel * 0.040);
|
||||||
|
|
||||||
|
m_oplink->MinFreq->setText(QString::number(minFrequency, 'f', 3) + "Mhz");
|
||||||
|
m_oplink->MaxFreq->setText(QString::number(maxFrequency, 'f', 3) + "Mhz");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@}
|
@}
|
||||||
@}
|
@}
|
||||||
|
@ -62,6 +62,9 @@ private slots:
|
|||||||
void disconnected();
|
void disconnected();
|
||||||
void bind();
|
void bind();
|
||||||
void ppmOnlyChanged();
|
void ppmOnlyChanged();
|
||||||
|
void minChannelChanged();
|
||||||
|
void maxChannelChanged();
|
||||||
|
void ChannelChanged(bool isMax);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONFIGTXPIDWIDGET_H
|
#endif // CONFIGTXPIDWIDGET_H
|
||||||
|
@ -49,8 +49,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>810</width>
|
<width>835</width>
|
||||||
<height>575</height>
|
<height>545</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
@ -72,14 +72,14 @@
|
|||||||
<string>Configuration</string>
|
<string>Configuration</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="4" column="3">
|
<item row="4" column="4">
|
||||||
<widget class="QComboBox" name="ComSpeed">
|
<widget class="QComboBox" name="ComSpeed">
|
||||||
<property name="statusTip">
|
<property name="statusTip">
|
||||||
<string>Com speed in bps.</string>
|
<string>Com speed in bps.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="4" column="3">
|
||||||
<widget class="QLabel" name="ComSpeedLabel">
|
<widget class="QLabel" name="ComSpeedLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -95,7 +95,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="2">
|
<item row="9" column="3">
|
||||||
<widget class="QLabel" name="VCPPortLabel">
|
<widget class="QLabel" name="VCPPortLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -111,7 +111,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="3">
|
<item row="7" column="4">
|
||||||
<widget class="QComboBox" name="FlexiPort">
|
<widget class="QComboBox" name="FlexiPort">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -124,7 +124,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="2">
|
<item row="6" column="3">
|
||||||
<widget class="QLabel" name="MainPortLabel">
|
<widget class="QLabel" name="MainPortLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -140,7 +140,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="3">
|
<item row="6" column="4">
|
||||||
<widget class="QComboBox" name="MainPort">
|
<widget class="QComboBox" name="MainPort">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -153,7 +153,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="3">
|
<item row="9" column="4">
|
||||||
|
<widget class="QComboBox" name="VCPPort">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Choose the function for the USB virtual com port</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="4">
|
||||||
<widget class="QComboBox" name="MaxRFTxPower">
|
<widget class="QComboBox" name="MaxRFTxPower">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -172,7 +185,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="3">
|
||||||
<widget class="QLabel" name="MaxRFTxPowerLabel">
|
<widget class="QLabel" name="MaxRFTxPowerLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -188,20 +201,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="3">
|
<item row="10" column="4">
|
||||||
<widget class="QComboBox" name="VCPPort">
|
<widget class="QComboBox" name="FlexiIOPort"/>
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Choose the function for the USB virtual com port</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="2">
|
<item row="10" column="3">
|
||||||
<widget class="QLabel" name="FlexiIOPortLabel">
|
<widget class="QLabel" name="FlexiIOPortLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -217,10 +220,29 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="3">
|
<item row="6" column="1">
|
||||||
<widget class="QComboBox" name="FlexiIOPort"/>
|
<widget class="QSpinBox" name="MaximumChannel">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz.</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>250</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="2">
|
<item row="7" column="3">
|
||||||
<widget class="QLabel" name="FlexiPortLabel">
|
<widget class="QLabel" name="FlexiPortLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
@ -252,22 +274,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QSpinBox" name="MaximumChannel">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>50</weight>
|
|
||||||
<bold>false</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Channel 0 is 430 MHz, channel 249 is 440 MHz, and the channel spacing is 40 KHz.</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>249</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="MinimumChannelLabel">
|
<widget class="QLabel" name="MinimumChannelLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@ -286,6 +292,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QSpinBox" name="MinimumChannel">
|
<widget class="QSpinBox" name="MinimumChannel">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>50</weight>
|
<weight>50</weight>
|
||||||
@ -293,10 +305,10 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Channel 0 is 430 MHz, channel 249 is 440 MHz, and the channel spacing is 40 KHz.</string>
|
<string>Channel 0 is 430 MHz, channel 250 is 440 MHz, and the channel spacing is 40 KHz.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>249</number>
|
<number>250</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -318,6 +330,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="9" column="1">
|
<item row="9" column="1">
|
||||||
<widget class="QSpinBox" name="ChannelSet">
|
<widget class="QSpinBox" name="ChannelSet">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<weight>50</weight>
|
<weight>50</weight>
|
||||||
@ -328,7 +346,7 @@
|
|||||||
<string>Sets the random sequence of channels to use for frequency hopping.</string>
|
<string>Sets the random sequence of channels to use for frequency hopping.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>249</number>
|
<number>250</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -396,6 +414,32 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="6" column="2">
|
||||||
|
<widget class="QLabel" name="MaxFreq">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>105</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>440.000Mhz</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="2">
|
||||||
|
<widget class="QLabel" name="MinFreq">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>105</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>430.000Mhz</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user