2014-05-18 15:52:39 +00:00
|
|
|
#include "dsp/channelmarker.h"
|
|
|
|
|
|
|
|
QRgb ChannelMarker::m_colorTable[] = {
|
|
|
|
qRgb(0xc0, 0x00, 0x00),
|
|
|
|
qRgb(0x00, 0xc0, 0x00),
|
|
|
|
qRgb(0x00, 0x00, 0xc0),
|
|
|
|
|
|
|
|
qRgb(0xc0, 0xc0, 0x00),
|
|
|
|
qRgb(0xc0, 0x00, 0xc0),
|
|
|
|
qRgb(0x00, 0xc0, 0xc0),
|
|
|
|
|
|
|
|
qRgb(0xc0, 0x60, 0x00),
|
|
|
|
qRgb(0xc0, 0x00, 0x60),
|
|
|
|
qRgb(0x60, 0x00, 0xc0),
|
|
|
|
|
|
|
|
qRgb(0x60, 0x00, 0x00),
|
|
|
|
qRgb(0x00, 0x60, 0x00),
|
|
|
|
qRgb(0x00, 0x00, 0x60),
|
|
|
|
|
|
|
|
qRgb(0x60, 0x60, 0x00),
|
|
|
|
qRgb(0x60, 0x00, 0x60),
|
|
|
|
qRgb(0x00, 0x60, 0x60),
|
|
|
|
|
|
|
|
0
|
|
|
|
};
|
|
|
|
int ChannelMarker::m_nextColor = 0;
|
|
|
|
|
|
|
|
ChannelMarker::ChannelMarker(QObject* parent) :
|
|
|
|
QObject(parent),
|
|
|
|
m_centerFrequency(0),
|
|
|
|
m_bandwidth(0),
|
2017-03-16 10:49:14 +00:00
|
|
|
m_oppositeBandwidth(0),
|
2015-05-12 19:50:02 +00:00
|
|
|
m_lowCutoff(0),
|
2015-05-11 01:27:31 +00:00
|
|
|
m_sidebands(dsb),
|
2014-05-18 15:52:39 +00:00
|
|
|
m_visible(false),
|
2015-05-11 09:03:01 +00:00
|
|
|
m_highlighted(false),
|
2017-03-15 23:39:49 +00:00
|
|
|
m_color(m_colorTable[m_nextColor]),
|
2017-08-23 21:43:11 +00:00
|
|
|
m_movable(true),
|
2017-08-24 00:26:47 +00:00
|
|
|
m_udpReceivePort(9999),
|
2017-08-26 04:38:28 +00:00
|
|
|
m_udpSendPort(9998),
|
|
|
|
m_fScaleDisplayType(FScaleDisplay_freq)
|
2014-05-18 15:52:39 +00:00
|
|
|
{
|
|
|
|
++m_nextColor;
|
|
|
|
if(m_colorTable[m_nextColor] == 0)
|
|
|
|
m_nextColor = 0;
|
2017-08-26 07:33:04 +00:00
|
|
|
setUDPAddress("127.0.0.1");
|
2014-05-18 15:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ChannelMarker::setTitle(const QString& title)
|
|
|
|
{
|
|
|
|
m_title = title;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ChannelMarker::setCenterFrequency(int centerFrequency)
|
|
|
|
{
|
|
|
|
m_centerFrequency = centerFrequency;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ChannelMarker::setBandwidth(int bandwidth)
|
|
|
|
{
|
|
|
|
m_bandwidth = bandwidth;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
2017-03-16 10:49:14 +00:00
|
|
|
void ChannelMarker::setOppositeBandwidth(int bandwidth)
|
|
|
|
{
|
|
|
|
m_oppositeBandwidth = bandwidth;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
2015-05-12 19:50:02 +00:00
|
|
|
void ChannelMarker::setLowCutoff(int lowCutoff)
|
|
|
|
{
|
|
|
|
m_lowCutoff = lowCutoff;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
2015-05-11 01:27:31 +00:00
|
|
|
void ChannelMarker::setSidebands(sidebands_t sidebands)
|
|
|
|
{
|
|
|
|
m_sidebands = sidebands;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
void ChannelMarker::setVisible(bool visible)
|
|
|
|
{
|
|
|
|
m_visible = visible;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
2015-05-11 09:03:01 +00:00
|
|
|
void ChannelMarker::setHighlighted(bool highlighted)
|
|
|
|
{
|
|
|
|
m_highlighted = highlighted;
|
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
void ChannelMarker::setColor(const QColor& color)
|
|
|
|
{
|
|
|
|
m_color = color;
|
|
|
|
emit changed();
|
|
|
|
}
|
2017-08-23 21:43:11 +00:00
|
|
|
|
|
|
|
void ChannelMarker::setUDPAddress(const QString& udpAddress)
|
|
|
|
{
|
|
|
|
m_udpAddress = udpAddress;
|
2017-08-26 04:38:28 +00:00
|
|
|
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPSendPort()));
|
|
|
|
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPReceivePort()));
|
2017-08-23 21:43:11 +00:00
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
2017-08-24 00:26:47 +00:00
|
|
|
void ChannelMarker::setUDPReceivePort(quint16 port)
|
2017-08-23 21:43:11 +00:00
|
|
|
{
|
2017-08-24 00:26:47 +00:00
|
|
|
m_udpReceivePort = port;
|
2017-08-26 04:38:28 +00:00
|
|
|
m_displayAddressReceive = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPReceivePort()));
|
2017-08-24 00:26:47 +00:00
|
|
|
emit changed();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ChannelMarker::setUDPSendPort(quint16 port)
|
|
|
|
{
|
|
|
|
m_udpSendPort = port;
|
2017-08-26 07:33:04 +00:00
|
|
|
m_displayAddressSend = QString(tr("%1:%2").arg(getUDPAddress()).arg(getUDPSendPort()));
|
2017-08-23 21:43:11 +00:00
|
|
|
emit changed();
|
|
|
|
}
|