summaryrefslogtreecommitdiffstats
path: root/sdrbase/dsp
diff options
context:
space:
mode:
authorChristian Daniel <cd@maintech.de>2013-09-27 23:17:53 +0200
committerChristian Daniel <cd@maintech.de>2013-09-27 23:17:53 +0200
commit391e47fed54d1f21252824531d15d3388d5d38a1 (patch)
tree5be316fe199ad0561f9e0c60b546e9890bb6d2c3 /sdrbase/dsp
parent4db5f20216fd18469f286be8fa7b6508f644fb46 (diff)
RollupWidget, GLWidget, etc: automatic channel color assignment
Diffstat (limited to 'sdrbase/dsp')
-rw-r--r--sdrbase/dsp/channelmarker.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/sdrbase/dsp/channelmarker.cpp b/sdrbase/dsp/channelmarker.cpp
index a39ae63..97d1e73 100644
--- a/sdrbase/dsp/channelmarker.cpp
+++ b/sdrbase/dsp/channelmarker.cpp
@@ -1,12 +1,40 @@
#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),
m_visible(false),
- m_color(Qt::red)
+ m_color(m_colorTable[m_nextColor])
{
+ ++m_nextColor;
+ if(m_colorTable[m_nextColor] == 0)
+ m_nextColor = 0;
}
void ChannelMarker::setTitle(const QString& title)