mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
Added frequency scale display option to channel marker
This commit is contained in:
parent
e0014867a7
commit
480257a5dd
@ -38,11 +38,14 @@ ChannelMarker::ChannelMarker(QObject* parent) :
|
||||
m_movable(true),
|
||||
m_udpAddress("127.0.0.1"),
|
||||
m_udpReceivePort(9999),
|
||||
m_udpSendPort(9998)
|
||||
m_udpSendPort(9998),
|
||||
m_fScaleDisplayType(FScaleDisplay_freq)
|
||||
{
|
||||
++m_nextColor;
|
||||
if(m_colorTable[m_nextColor] == 0)
|
||||
m_nextColor = 0;
|
||||
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPSendPort()));
|
||||
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPReceivePort()));
|
||||
}
|
||||
|
||||
void ChannelMarker::setTitle(const QString& title)
|
||||
@ -102,17 +105,21 @@ void ChannelMarker::setColor(const QColor& color)
|
||||
void ChannelMarker::setUDPAddress(const QString& udpAddress)
|
||||
{
|
||||
m_udpAddress = udpAddress;
|
||||
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPSendPort()));
|
||||
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPReceivePort()));
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void ChannelMarker::setUDPReceivePort(quint16 port)
|
||||
{
|
||||
m_udpReceivePort = port;
|
||||
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPReceivePort()));
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void ChannelMarker::setUDPSendPort(quint16 port)
|
||||
{
|
||||
m_udpSendPort = port;
|
||||
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPSendPort()));
|
||||
emit changed();
|
||||
}
|
||||
|
@ -18,6 +18,14 @@ public:
|
||||
vlsb //!< LSB with vestigial USB
|
||||
} sidebands_t;
|
||||
|
||||
typedef enum frequencyScaleDisplay_e
|
||||
{
|
||||
FScaleDisplay_freq,
|
||||
FScaleDisplay_title,
|
||||
FScaleDisplay_addressSend,
|
||||
FScaleDisplay_addressReceive,
|
||||
} frequencyScaleDisplay_t;
|
||||
|
||||
ChannelMarker(QObject* parent = NULL);
|
||||
|
||||
void setTitle(const QString& title);
|
||||
@ -59,12 +67,19 @@ public:
|
||||
void setUDPSendPort(quint16 port);
|
||||
quint16 getUDPSendPort() const { return m_udpSendPort; }
|
||||
|
||||
void setFrequencyScaleDisplayType(frequencyScaleDisplay_t type) { m_fScaleDisplayType = type; }
|
||||
frequencyScaleDisplay_t getFrequencyScaleDisplayType() const { return m_fScaleDisplayType; }
|
||||
|
||||
const QString& getDisplayAddressSend() const { return m_displayAddressSend; }
|
||||
const QString& getDisplayAddressReceive() const { return m_displayAddressReceive; }
|
||||
|
||||
protected:
|
||||
static QRgb m_colorTable[];
|
||||
static int m_nextColor;
|
||||
|
||||
QString m_title;
|
||||
QString m_displayAddressSend;
|
||||
QString m_displayAddressReceive;
|
||||
int m_centerFrequency;
|
||||
int m_bandwidth;
|
||||
int m_oppositeBandwidth;
|
||||
@ -77,6 +92,7 @@ protected:
|
||||
QString m_udpAddress;
|
||||
quint16 m_udpReceivePort;
|
||||
quint16 m_udpSendPort;
|
||||
frequencyScaleDisplay_t m_fScaleDisplayType;
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
@ -74,5 +74,7 @@ void BasicChannelSettingsDialog::accept()
|
||||
|
||||
m_channelMarker->setUDPSendPort(udpPort);
|
||||
|
||||
m_channelMarker->setFrequencyScaleDisplayType((ChannelMarker::frequencyScaleDisplay_t) ui->fScaleDisplayType->currentIndex());
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
@ -70,6 +70,50 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="fScaleDisplayTypeLabel">
|
||||
<property name="text">
|
||||
<string>FScale</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fScaleDisplayType">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Freq</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>AdSnd</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>AdRcv</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -1472,7 +1472,25 @@ void GLSpectrum::applyChanges()
|
||||
int shift;
|
||||
//ChannelMarker::sidebands_t sidebands = dv->m_channelMarker->getSidebands();
|
||||
xc = m_centerFrequency + dv->m_channelMarker->getCenterFrequency(); // marker center frequency
|
||||
QString ftext = QString::number((m_centerFrequency + dv->m_channelMarker->getCenterFrequency())/1e6, 'f', 6);
|
||||
QString ftext;
|
||||
switch (dv->m_channelMarker->getFrequencyScaleDisplayType())
|
||||
{
|
||||
case ChannelMarker::FScaleDisplay_freq:
|
||||
ftext = QString::number((m_centerFrequency + dv->m_channelMarker->getCenterFrequency())/1e6, 'f', 6); // TODO
|
||||
break;
|
||||
case ChannelMarker::FScaleDisplay_title:
|
||||
ftext = dv->m_channelMarker->getTitle();
|
||||
break;
|
||||
case ChannelMarker::FScaleDisplay_addressSend:
|
||||
ftext = dv->m_channelMarker->getDisplayAddressSend();
|
||||
break;
|
||||
case ChannelMarker::FScaleDisplay_addressReceive:
|
||||
ftext = dv->m_channelMarker->getDisplayAddressReceive();
|
||||
break;
|
||||
default:
|
||||
ftext = QString::number((m_centerFrequency + dv->m_channelMarker->getCenterFrequency())/1e6, 'f', 6);
|
||||
break;
|
||||
}
|
||||
if (dv->m_channelMarker->getCenterFrequency() < 0) { // left half of scale
|
||||
ftext = " " + ftext;
|
||||
shift = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user