Fixed mode select bug. Added some preliminary hooks for changing the

theme to dark.
merge-requests/1/merge
Elliott Liggett 2018-06-19 23:45:56 -07:00 zatwierdzone przez Elliott Liggett
rodzic 4d86ab11cc
commit 24c8ec5a09
5 zmienionych plików z 44 dodań i 4 usunięć

Wyświetl plik

@ -20,7 +20,6 @@ commHandler::commHandler()
openPort();
connect(port, SIGNAL(readyRead()), this, SLOT(receiveDataIn()));
}
commHandler::~commHandler()

Wyświetl plik

@ -106,7 +106,7 @@ void rigCommander::setScopeSpan(char span)
// See ICD, page 165, "19-12".
// 2.5k = 0
// 5k = 2, etc.
if((span <1 ) || (span >7))
if((span <0 ) || (span >7))
return;
QByteArray payload;
@ -172,7 +172,7 @@ void rigCommander::setFrequency(double freq)
cmdPayload.append(freqPayload);
cmdPayload.prepend('\x00');
printHex(cmdPayload, false, true);
//printHex(cmdPayload, false, true);
prepDataAndSend(cmdPayload);
}

Wyświetl plik

@ -8,8 +8,17 @@ wfmain::wfmain(QWidget *parent) :
ui(new Ui::wfmain)
{
ui->setupUi(this);
theParent = parent;
plot = ui->plot; // rename it waterfall.
wf = ui->waterfall;
tracer = new QCPItemTracer(plot);
//tracer->setGraphKey(5.5);
tracer->setInterpolating(true);
tracer->setStyle(QCPItemTracer::tsPlus);
tracer->setPen(QPen(Qt::green));
tracer->setBrush(Qt::green);
tracer->setSize(7);
spectWidth = 475; // fixed for now
wfLength = 160; // fixed for now
@ -37,6 +46,8 @@ wfmain::wfmain(QWidget *parent) :
edges << "1" << "2" << "3"; // yep
ui->scopeEdgeCombo->insertItems(0,edges);
ui->splitter->setHandleWidth(5);
// comm = new commHandler();
rig = new rigCommander();
rigThread = new QThread(this);
@ -72,6 +83,7 @@ wfmain::wfmain(QWidget *parent) :
ui->plot->addGraph(); // primary
ui->plot->addGraph(0, 0); // secondary, peaks, same axis as first?
ui->waterfall->addGraph();
tracer->setGraph(plot->graph(0));
@ -105,6 +117,7 @@ wfmain::wfmain(QWidget *parent) :
delayedCommand->setSingleShot(true);
connect(delayedCommand, SIGNAL(timeout()), this, SLOT(runDelayedCommand()));
}
wfmain::~wfmain()
@ -113,6 +126,11 @@ wfmain::~wfmain()
delete ui;
}
void wfmain::setDarkTheme(bool dark)
{
//theParent->setStyle();
}
void wfmain::runDelayedCommand()
{
// switch case on enum
@ -133,6 +151,7 @@ void wfmain::receiveFreq(double freqMhz)
{
//qDebug() << "Frequency: " << freqMhz;
ui->freqLabel->setText(QString("%1").arg(freqMhz, 0, 'f'));
this->freqMhz = freqMhz;
}
void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double endFreq)
@ -186,6 +205,10 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
//ui->qcp->addGraph();
plot->graph(0)->setData(x,y);
if((freqMhz < endFreq) && (freqMhz > startFreq))
{
tracer->setGraphKey(freqMhz);
}
if(drawPeaks)
{
plot->graph(1)->setData(x,y2); // peaks

Wyświetl plik

@ -98,7 +98,11 @@ private:
Ui::wfmain *ui;
QCustomPlot *plot; // line plot
QCustomPlot *wf; // waterfall image
QCPItemTracer * tracer; // marker of current frequency
//commHandler *comm;
void setDarkTheme(bool dark);
QWidget * theParent;
rigCommander * rig;
QThread * rigThread;
QCPColorMap * colorMap;
@ -127,6 +131,7 @@ private:
double oldLowerFreq;
double oldUpperFreq;
double freqMhz;
enum cmds {cmdGetFreq, cmdGetMode, cmdGetDataMode};
cmds cmdOut;

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -916,6 +916,19 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<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>