1. Use a ComboBox for palette selection.

2. Minor adjustments to position of WideGraph controls.
3. Include the palette files.  The whole directory "Palettes" should
be copied into the install directory.



git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3529 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-08-07 18:59:11 +00:00
parent 67be0a1032
commit 50fcdaf31c
34 changed files with 419 additions and 166 deletions

9
Palettes/banana.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
59; 59; 27
119;119; 59
179;179; 91
227;227;123
235;235;151
239;239;183
247;247;219
255;255;255

9
Palettes/blue1.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 2
0; 0; 64
7; 11;128
39; 47;192
95;115;217
151;179;231
187;203;239
219;227;247
255;255;255

9
Palettes/blue2.pal Normal file
View File

@ -0,0 +1,9 @@
3; 3; 64
7; 11;128
39; 47;192
95;115;217
151;179;231
187;203;239
219;227;247
255;255;255
255;253;108

9
Palettes/blue3.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
31; 31; 31
63; 63; 63
91; 91;167
119;119;191
155;155;219
191;191;191
223;223;223
255;255;255

9
Palettes/brown.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
107; 63; 11
175; 95; 31
199;119; 43
215;163; 63
231;211; 87
243;247;111
247;251;179
255;255;255

9
Palettes/cyan1.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
5; 10; 10
22; 42; 42
52; 99; 99
94;175;175
131;209;209
162;224;224
202;239;239
255;255;255

9
Palettes/cyan2.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
35; 51; 51
75;103;103
115;159;159
155;211;211
183;231;231
203;239;239
227;247;247
255;255;255

9
Palettes/cyan3.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
94;114;114
138;162;162
171;201;201
199;232;232
216;243;243
228;247;247
241;251;251
255;255;255

9
Palettes/default.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 6;136
0; 19;198
0; 32;239
172;167;105
194;198; 49
225;228;107
255;255; 0
255; 51; 0

9
Palettes/digipan.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 0; 64
0; 0;128
0; 0;217
150;147; 92
183;186; 46
225;228;107
255;255; 0
255; 51; 0

9
Palettes/fldigi.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 0;177
3;110;227
0;204;204
223;223;223
0;234; 0
244;244; 0
250;126; 0
244; 0; 0

9
Palettes/gmfsk.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0;256
0; 62;194
0;126;130
0;190; 66
0;254; 2
62;194; 0
126;130; 0
190; 66; 0
254; 2; 0

9
Palettes/gray1.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
69; 69; 69
99; 99; 99
121;121;121
140;140;140
157;157;157
172;172;172
186;186;186
199;199;199

9
Palettes/gray2.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
88; 88; 88
126;126;126
155;155;155
179;179;179
200;200;200
220;220;220
237;237;237
254;254;254

9
Palettes/green1.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 32; 0
0; 64; 0
0; 96; 0
0;128; 0
0;160; 0
0;192; 0
0;224; 0
255;255;255

9
Palettes/green2.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 60; 0
0;102; 0
0;151; 0
0;242; 0
255;255; 89
240;120; 0
255;148; 40
255; 0; 0

9
Palettes/jungle.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
107; 67; 0
223;143; 0
255;123; 27
255; 91; 71
255;195; 95
195;255;111
151;255;151
255;255;255

9
Palettes/linrad.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 0; 87
0; 79;114
0;141; 61
96;158; 0
204;124; 0
253; 50; 17
255;138;138
255;255;255

9
Palettes/negative.pal Normal file
View File

@ -0,0 +1,9 @@
255;255;255
223;223;223
191;191;191
159;159;159
127;127;127
95; 95; 95
63; 63; 63
31; 31; 31
0; 0; 0

9
Palettes/orange.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
63; 27; 0
131; 63; 0
199; 95; 0
251;127; 11
251;155; 71
251;187;131
251;219;191
255;255;255

9
Palettes/pink.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
63; 35; 35
135; 75; 75
203;111;111
255;147;147
255;175;175
255;199;199
255;227;227
255;255;255

9
Palettes/rainbow.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0;163
0; 87;191
0;207;219
0;247;139
0;255; 23
95;255; 0
219;255; 0
255;171;155
255;255;255

9
Palettes/scope.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 0;167
0; 79;255
0;239;255
0;255; 75
95;255; 0
255;255; 0
255;127; 0
255; 0; 0

9
Palettes/sunburst.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 0; 59
0; 0;123
131; 0;179
235; 0; 75
255; 43; 43
255;215;111
255;255;183
255;255;255

9
Palettes/vk4bdj.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 32; 0
0;154; 0
0;161; 0
0;177; 0
156;209;144
192;185;183
214;222;224
255;255;255

9
Palettes/yellow1.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
31; 31; 0
63; 63; 0
95; 95; 0
127;127; 0
159;159; 0
191;191; 0
223;223; 0
255;255; 0

9
Palettes/yellow2.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
39; 39; 0
75; 75; 0
111;111; 0
147;147; 0
183;183; 0
219;219; 0
255;255; 0
255;255;255

9
Palettes/yl2kf.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 0;119
7; 11;195
39; 47;159
95;115;203
151;179;255
187;203;255
219;227;255
255;255; 5

9
Palettes/zl2fz.pal Normal file
View File

@ -0,0 +1,9 @@
0; 0; 0
0; 0; 0
0; 0; 0
0; 0; 0
0;255; 0
255;255; 0
255;255; 0
255;255; 0
255; 0; 0

View File

@ -1,4 +1,4 @@
//---------------------------------------------------------------- MainWindow
//--------------------------------------------------------------- MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"

View File

@ -3,7 +3,6 @@
#include <QDateTime>
#include <QAudioDeviceInfo>
#include <QAudioOutput>
#include <QDebug>
bool SoundOutput::audioError () const
@ -69,6 +68,7 @@ bool SoundOutput::start(QAudioDeviceInfo const& device, QIODevice * source)
}
connect (m_stream.data(), &QAudioOutput::stateChanged, this, &SoundOutput::handleStateChanged);
m_stream->setBufferSize(48000);
m_stream->start (source);
if (audioError ()) // start the input stream
{

View File

@ -54,9 +54,22 @@ WideGraph::WideGraph(QWidget *parent) :
ui->widePlot->setStartFreq(settings.value("StartFreq",0).toInt());
ui->fStartSpinBox->setValue(ui->widePlot->startFreq());
m_waterfallPalette=settings.value("WaterfallPalette","default").toString();
ui->labPalette->setText(m_waterfallPalette.mid(0,1).toUpper() +
m_waterfallPalette.mid(1));
settings.endGroup();
QDir recoredDir("Palettes");
QStringList allFiles = recoredDir.entryList(QDir::NoDotAndDotDot |
QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files,
QDir::DirsFirst);
int index=0;
foreach(QString file, allFiles) {
QString t=file.mid(0,file.length()-4);
ui->paletteComboBox->addItem(t);
if(t==m_waterfallPalette) {
ui->paletteComboBox->setCurrentIndex(index);
}
index++;
}
// ui->paletteComboBox->lineEdit()->setAlignment(Qt::AlignHCenter);
readPalette("Palettes/" + m_waterfallPalette + ".pal");
}
@ -320,19 +333,6 @@ void WideGraph::on_fStartSpinBox_valueChanged(int n)
ui->widePlot->setStartFreq(n);
}
void WideGraph::on_pbPalette_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Palette"),
"./Palettes", tr("Files (*.pal)"));
if(fileName!="") readPalette(fileName);
/*
QColor color = QColorDialog::getColor(Qt::yellow, this );
if(color.isValid()) {
qDebug( "ok" );
}
*/
}
void WideGraph::readPalette(QString fileName)
{
QFile f;
@ -357,12 +357,6 @@ void WideGraph::readPalette(QString fileName)
int bb=b[j0] + int((k*(b[j1]-b[j0]))/31 + 0.5);
ui->widePlot->m_ColorTbl[i].setRgb(rr,gg,bb);
}
QFileInfo fileInfo(f);
t=fileInfo.fileName();
int n=t.length();
m_waterfallPalette=t.mid(0,n-4);
ui->labPalette->setText(m_waterfallPalette.mid(0,1).toUpper() +
m_waterfallPalette.mid(1));
} else {
QMessageBox msgBox0;
QString t="Error: Cannot find requested palette file " + fileName;
@ -370,3 +364,8 @@ void WideGraph::readPalette(QString fileName)
msgBox0.exec();
}
}
void WideGraph::on_paletteComboBox_activated(const QString &palette)
{
readPalette("Palettes/" + palette + ".pal");
}

View File

@ -62,7 +62,7 @@ private slots:
void on_fMinSpinBox_valueChanged(int n);
void on_slopeSpinBox_valueChanged(double d);
void on_fStartSpinBox_valueChanged(int n);
void on_pbPalette_clicked();
void on_paletteComboBox_activated(const QString &palette);
private:
double m_slope;

View File

@ -65,7 +65,110 @@
</property>
</spacer>
</item>
<item row="0" column="1">
<item row="0" column="3">
<widget class="QSpinBox" name="waterfallAvgSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>38</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Number of FFTs averaged (controls waterfall scrolling rate)</string>
</property>
<property name="prefix">
<string>N Avg </string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>20</number>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QDoubleSpinBox" name="slopeSpinBox">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="prefix">
<string>Slope </string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-2.000000000000000</double>
</property>
<property name="maximum">
<double>2.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="0" column="7">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="5">
<widget class="QSpinBox" name="zeroSpinBox">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>38</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Constant offset applied to waterfall data</string>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string>Zero </string>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="fStartSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -93,7 +196,7 @@
</property>
</widget>
</item>
<item row="0" column="2">
<item row="0" column="1">
<widget class="QSpinBox" name="freqSpanSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -136,138 +239,7 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QSpinBox" name="waterfallAvgSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>38</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Number of FFTs averaged (controls waterfall scrolling rate)</string>
</property>
<property name="prefix">
<string>N Avg </string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>20</number>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QSpinBox" name="gainSpinBox">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>38</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Scaling (dB) applied to spectra before plotting</string>
</property>
<property name="prefix">
<string>Gain </string>
</property>
<property name="minimum">
<number>-20</number>
</property>
<property name="maximum">
<number>20</number>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QSpinBox" name="zeroSpinBox">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>38</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Constant offset applied to waterfall data</string>
</property>
<property name="suffix">
<string/>
</property>
<property name="prefix">
<string>Zero </string>
</property>
<property name="minimum">
<number>-100</number>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QDoubleSpinBox" name="slopeSpinBox">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="prefix">
<string>Slope </string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-2.000000000000000</double>
</property>
<property name="maximum">
<double>2.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="0" column="7">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<item row="1" column="1">
<widget class="QSpinBox" name="fMinSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -304,7 +276,7 @@
</property>
</widget>
</item>
<item row="1" column="3">
<item row="1" column="2">
<widget class="QComboBox" name="spec2dComboBox">
<property name="toolTip">
<string>Select data for display curve</string>
@ -324,17 +296,38 @@
</item>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="pbPalette">
<property name="text">
<string>Palette</string>
<item row="1" column="3">
<widget class="QComboBox" name="paletteComboBox">
<property name="toolTip">
<string>Select waterfall palette</string>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QLabel" name="labPalette">
<property name="text">
<string>Linrad</string>
<widget class="QSpinBox" name="gainSpinBox">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>38</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Scaling (dB) applied to spectra before plotting</string>
</property>
<property name="prefix">
<string>Gain </string>
</property>
<property name="minimum">
<number>-20</number>
</property>
<property name="maximum">
<number>20</number>
</property>
</widget>
</item>