kopia lustrzana https://gitlab.com/eliggett/wfview
Porównaj commity
28 Commity
f710913950
...
9b6030a01f
Autor | SHA1 | Data |
---|---|---|
Phil Taylor | 9b6030a01f | |
Phil Taylor | b6496b1eea | |
Elliott Liggett | 7c3dd56baa | |
Elliott Liggett | 07fa675bb6 | |
Elliott Liggett | af0196c5b9 | |
Phil Taylor | 67a0d57bfe | |
Elliott Liggett | 7f411a29f8 | |
Elliott Liggett | 562ce95971 | |
Elliott Liggett | 40af2c5c5e | |
Elliott Liggett | b7459b8f0b | |
Elliott Liggett | 5f7e39ebb5 | |
Elliott Liggett | 3c7e19174c | |
Elliott Liggett | fb22829e92 | |
Elliott Liggett | 81a82fc467 | |
Elliott Liggett | 06642dcd5e | |
Elliott Liggett | b37dfe201b | |
Elliott Liggett | fbbeef67cc | |
Elliott Liggett | d731dafc1e | |
Elliott Liggett | 335351c133 | |
Elliott Liggett | b0a3716a45 | |
Elliott Liggett | 3ca1dc38e9 | |
Elliott Liggett | be79aea7c0 | |
Phil Taylor | 641ef6e398 | |
Phil Taylor | 029c15eac1 | |
Elliott Liggett | 30eff79f13 | |
Elliott Liggett | 09cc775094 | |
Elliott Liggett | 60a5ed885b | |
Phil Taylor | 16063c07f8 |
|
@ -21,7 +21,7 @@ cachingQueue *cachingQueue::getInstance(QObject* parent)
|
|||
connect (instance, SIGNAL(finished()),instance, SLOT(deleteLater()));
|
||||
instance->start(QThread::HighPriority);
|
||||
}
|
||||
qInfo() << "Returning instance of cachingQueue() to calling process:" << ((parent != Q_NULLPTR) ? parent->objectName(): "<unknown>");
|
||||
qDebug() << "Returning instance of cachingQueue() to calling process:" << ((parent != Q_NULLPTR) ? parent->objectName(): "<unknown>");
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ void cachingQueue::add(queuePriority prio ,queueItem item)
|
|||
queueItem it=item;
|
||||
it.recurring=false;
|
||||
queue.insert(queue.cend(),priorityHighest, it);
|
||||
qInfo() << "adding" << funcString[item.command] << "recurring" << item.recurring << "priority" << prio << "vfo" << item.vfo;
|
||||
qDebug() << "adding" << funcString[item.command] << "recurring" << item.recurring << "priority" << prio << "vfo" << item.vfo;
|
||||
}
|
||||
queue.insert(prio, item);
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ void cachingQueue::addUnique(queuePriority prio ,queueItem item)
|
|||
while (it != queue.end()) {
|
||||
if (it.value().command == item.command && it.value().recurring == item.recurring && it.value().vfo == item.vfo && it.value().param.isValid() == item.param.isValid())
|
||||
{
|
||||
//qInfo() << "deleting" << it.value().id << funcString[it.value().command] << "vfo" << it.value().vfo << "recurring" << it.value().recurring ;
|
||||
qDebug() << "deleting" << it.value().id << funcString[it.value().command] << "VFO" << it.value().vfo << "recurring" << it.value().recurring ;
|
||||
it = queue.erase(it);
|
||||
}
|
||||
else
|
||||
|
@ -172,7 +172,7 @@ void cachingQueue::addUnique(queuePriority prio ,queueItem item)
|
|||
queueItem it = item;
|
||||
it.recurring=false;
|
||||
queue.insert(queue.cend(),priorityHighest, it);
|
||||
qInfo() << "adding unique" << funcString[item.command] << "recurring" << item.recurring << "priority" << prio << "vfo" << item.vfo;
|
||||
qDebug() << "adding unique" << funcString[item.command] << "recurring" << item.recurring << "priority" << prio << "vfo" << item.vfo;
|
||||
}
|
||||
queue.insert(prio, item);
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ void cachingQueue::del(funcs func, uchar vfo)
|
|||
qInfo() << "recurring command" << funcString[func] << "vfo" << vfo << "not found in queue";
|
||||
while (it != queue.end()) {
|
||||
if (it.value().command == func && it.value().vfo == vfo) {
|
||||
//qInfo() << "deleting" << funcString[it.value().command] << "sub" << it.value().sub << "recurring" << it.value().recurring;
|
||||
qDebug() << "deleting" << funcString[it.value().command] << "VFO" << it.value().vfo << "recurring" << it.value().recurring;
|
||||
it = queue.erase(it);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "ui_memories.h"
|
||||
|
||||
memories::memories(rigCapabilities rigCaps, bool slowLoad, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
QWidget(parent),
|
||||
slowLoad(slowLoad),
|
||||
rigCaps(rigCaps),
|
||||
ui(new Ui::memories)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MEMORIES_H
|
||||
#define MEMORIES_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QWidget>
|
||||
#include <QItemDelegate>
|
||||
#include <QStandardItem>
|
||||
#include <QStandardItemModel>
|
||||
|
@ -24,7 +24,7 @@ namespace Ui {
|
|||
class memories;
|
||||
}
|
||||
|
||||
class memories : public QDialog
|
||||
class memories : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>memories</class>
|
||||
<widget class="QDialog" name="memories">
|
||||
<widget class="QWidget" name="memories">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
|
179
meter.cpp
179
meter.cpp
|
@ -46,6 +46,30 @@ meter::meter(QWidget *parent) : QWidget(parent)
|
|||
avgLevels.resize(averageBalisticLength, 0);
|
||||
peakLevels.resize(peakBalisticLength, 0);
|
||||
|
||||
combo = new QComboBox(this);
|
||||
combo->blockSignals(true);
|
||||
combo->addItem("None", meterNone);
|
||||
combo->addItem("SWR", meterSWR);
|
||||
combo->addItem("ALC", meterALC);
|
||||
combo->addItem("Compression", meterComp);
|
||||
combo->addItem("Voltage", meterVoltage);
|
||||
combo->addItem("Current", meterCurrent);
|
||||
combo->addItem("Center", meterCenter);
|
||||
combo->addItem("TxRxAudio", meterAudio);
|
||||
combo->addItem("RxAudio", meterRxAudio);
|
||||
combo->addItem("TxAudio", meterTxMod);
|
||||
combo->blockSignals(false);
|
||||
|
||||
connect(combo, SIGNAL(activated(int)), this, SLOT(acceptComboItem(int)));
|
||||
//connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(acceptComboItem(int)));
|
||||
|
||||
combo->hide();
|
||||
this->installEventFilter(this);
|
||||
|
||||
}
|
||||
|
||||
void meter::setCompReverse(bool reverse) {
|
||||
this->reverseCompMeter = reverse;
|
||||
}
|
||||
|
||||
void meter::setColors(QColor current, QColor peakScale, QColor peakLevel,
|
||||
|
@ -111,6 +135,16 @@ void meter::setMeterType(meter_t type)
|
|||
this->clearMeter();
|
||||
}
|
||||
|
||||
void meter::blockMeterType(meter_t mtype) {
|
||||
// TODO: Code to block off duplicate meter types from the selection menu
|
||||
enableAllComboBoxItems(combo);
|
||||
qDebug() << "Asked to block meter of type: " << getMeterDebug(mtype);
|
||||
if(mtype != meterNone) {
|
||||
int m_index = combo->findData(mtype);
|
||||
setComboBoxItemEnabled(combo, m_index, false);
|
||||
}
|
||||
}
|
||||
|
||||
meter_t meter::getMeterType()
|
||||
{
|
||||
return meterType;
|
||||
|
@ -126,8 +160,41 @@ QString meter::getMeterShortString()
|
|||
return meterShortString;
|
||||
}
|
||||
|
||||
void meter::acceptComboItem(int item) {
|
||||
qDebug() << "Meter selected combo item number: " << item;
|
||||
|
||||
meter_t meterTypeRequested = static_cast<meter_t>(combo->itemData(item).toInt());
|
||||
if(meterType != meterTypeRequested) {
|
||||
qDebug() << "Changing meter to type: " << getMeterDebug(meterTypeRequested) << ", with item index: " << item;
|
||||
emit configureMeterSignal(meterTypeRequested);
|
||||
}
|
||||
|
||||
combo->hide();
|
||||
freezeDrawing = false;
|
||||
}
|
||||
|
||||
void meter::handleDoubleClick() {
|
||||
freezeDrawing = true;
|
||||
combo->show();
|
||||
}
|
||||
|
||||
bool meter::eventFilter(QObject *object, QEvent *event) {
|
||||
if(event->type() == QEvent::MouseButtonDblClick) {
|
||||
qDebug() << "Mouse double click event in meter widget";
|
||||
if( !(meterType == meterS || meterType == meterPower)) {
|
||||
handleDoubleClick();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
(void)object;
|
||||
return false;
|
||||
}
|
||||
|
||||
void meter::paintEvent(QPaintEvent *)
|
||||
{
|
||||
if(freezeDrawing)
|
||||
return;
|
||||
|
||||
QPainter painter(this);
|
||||
// This next line sets up a canvis within the
|
||||
// space of the widget, and gives it coordinates.
|
||||
|
@ -179,7 +246,11 @@ void meter::paintEvent(QPaintEvent *)
|
|||
case meterComp:
|
||||
label = "CMP(dB)";
|
||||
peakRedLevel = 100;
|
||||
drawScaleComp(&painter);
|
||||
if(reverseCompMeter) {
|
||||
drawScaleCompInverted(&painter);
|
||||
} else {
|
||||
drawScaleComp(&painter);
|
||||
}
|
||||
break;
|
||||
case meterNone:
|
||||
return;
|
||||
|
@ -241,6 +312,7 @@ void meter::paintEvent(QPaintEvent *)
|
|||
int logAverage = (int)((1-audiopot[255-average])*255);
|
||||
int logPeak = (int)((1-audiopot[255-peak])*255);
|
||||
|
||||
// Current value:
|
||||
// X, Y, Width, Height
|
||||
painter.drawRect(mXstart,mYstart,logCurrent,barHeight);
|
||||
|
||||
|
@ -262,15 +334,22 @@ void meter::paintEvent(QPaintEvent *)
|
|||
|
||||
} else {
|
||||
|
||||
|
||||
// Current value:
|
||||
// X, Y, Width, Height
|
||||
painter.drawRect(mXstart,mYstart,current,barHeight);
|
||||
if(meterType==meterComp && reverseCompMeter) {
|
||||
painter.drawRect(255+mXstart,mYstart,-current,barHeight);
|
||||
} else {
|
||||
painter.drawRect(mXstart,mYstart,current,barHeight);
|
||||
}
|
||||
|
||||
// Average:
|
||||
painter.setPen(averageColor);
|
||||
painter.setBrush(averageColor);
|
||||
painter.drawRect(mXstart+average-1,mYstart,1,barHeight); // bar is 1 pixel wide, height = meter start?
|
||||
|
||||
if(meterType==meterComp && reverseCompMeter) {
|
||||
painter.drawRect(255+mXstart-average,mYstart,-1,barHeight); // bar is 1 pixel wide, height = meter start?
|
||||
} else {
|
||||
painter.drawRect(mXstart+average-1,mYstart,1,barHeight); // bar is 1 pixel wide, height = meter start?
|
||||
}
|
||||
// Peak:
|
||||
painter.setPen(peakColor);
|
||||
painter.setBrush(peakColor);
|
||||
|
@ -279,13 +358,18 @@ void meter::paintEvent(QPaintEvent *)
|
|||
painter.setBrush(Qt::red);
|
||||
painter.setPen(Qt::red);
|
||||
}
|
||||
|
||||
painter.drawRect(mXstart+peak-1,mYstart,2,barHeight);
|
||||
if(meterType==meterComp && reverseCompMeter) {
|
||||
painter.drawRect(255+mXstart-peak+1,mYstart,-1,barHeight);
|
||||
} else {
|
||||
painter.drawRect(mXstart+peak-1,mYstart,2,barHeight);
|
||||
}
|
||||
}
|
||||
|
||||
if(drawLabels)
|
||||
{
|
||||
drawLabel(&painter);
|
||||
}
|
||||
haveUpdatedData = false;
|
||||
}
|
||||
|
||||
void meter::drawLabel(QPainter *qp)
|
||||
|
@ -317,6 +401,7 @@ void meter::setLevel(int current)
|
|||
this->peak = peakLevels.at(i);
|
||||
}
|
||||
|
||||
haveUpdatedData = true;
|
||||
this->update();
|
||||
}
|
||||
|
||||
|
@ -333,7 +418,8 @@ void meter::setLevels(int current, int peak)
|
|||
}
|
||||
this->average = sum / std::min(avgPosition, (int)avgLevels.size());
|
||||
|
||||
this->update();
|
||||
haveUpdatedData = true;
|
||||
this->update(); // place repaint event on the event queue
|
||||
}
|
||||
|
||||
void meter::setLevels(int current, int peak, int average)
|
||||
|
@ -342,7 +428,8 @@ void meter::setLevels(int current, int peak, int average)
|
|||
this->peak = peak;
|
||||
this->average = average;
|
||||
|
||||
this->update();
|
||||
haveUpdatedData = true;
|
||||
this->update(); // place repaint event on the event queue
|
||||
}
|
||||
|
||||
void meter::updateDrawing(int num)
|
||||
|
@ -603,6 +690,56 @@ void meter::drawScaleComp(QPainter *qp)
|
|||
qp->drawLine(peakRedLevel+mXstart,scaleLineYstart,255+mXstart,scaleLineYstart);
|
||||
}
|
||||
|
||||
void meter::drawScaleCompInverted(QPainter *qp) {
|
||||
// inverted scale
|
||||
//
|
||||
// 0000=0 dB, 0130=15 dB,0241=30 dB
|
||||
//
|
||||
// rev DN : 255 ------------------------------------- 0
|
||||
// Geometry: 0---mXstart------------------------------------255+mXstart-----
|
||||
// norm DN : 0 -------------------------------------255
|
||||
|
||||
qp->setPen(lowTextColor);
|
||||
|
||||
int midPointDn = 130;
|
||||
int midPointdB = 15;
|
||||
|
||||
int highPointDn = 241;
|
||||
int highPointdB = 30;
|
||||
float dBperDn = (float)(highPointdB-midPointdB) / float(highPointDn-midPointDn);
|
||||
|
||||
int i=mXstart;
|
||||
//i+=midPointDn/4; // skip the 0 for cleaner label space
|
||||
|
||||
// Vertical graticules and text
|
||||
|
||||
// drawLine expects two sets of coordinates dictating start and end position.
|
||||
|
||||
// numbers 0-14:
|
||||
for(; i<mXstart+midPointDn; i+=midPointDn/4)
|
||||
{
|
||||
qp->drawText(255+mXstart-i+(midPointDn/4),scaleTextYstart, QString("%1").arg( (int)((i-mXstart) * (float(midPointdB) / float(midPointDn)) )) );
|
||||
qp->drawLine(255+mXstart-i+(midPointDn/4),scaleTextYstart, 255+mXstart-i+(midPointDn/4), scaleTextYstart+5);
|
||||
}
|
||||
|
||||
// numbers 19-30
|
||||
i = midPointDn+60;
|
||||
// The "-30" blocks the last digit which runs over the label text
|
||||
for(; i<mXstart+255-30; i+= 30)
|
||||
{
|
||||
qp->drawText(255+mXstart+32-i,scaleTextYstart, QString("%1").arg( (int) std::round( ((i-mXstart-midPointDn) * (dBperDn) ) + (midPointdB) )));
|
||||
qp->drawLine(255+mXstart+32-i,scaleTextYstart, 255+mXstart+32-i, scaleTextYstart+5);
|
||||
}
|
||||
|
||||
// Now the lines:
|
||||
qp->setPen(lowLineColor);
|
||||
|
||||
// Line: X1, Y1 -->to--> X2, Y2
|
||||
qp->drawLine(255+mXstart,scaleLineYstart,255-peakRedLevel+mXstart,scaleLineYstart);
|
||||
qp->setPen(highLineColor);
|
||||
qp->drawLine(255-peakRedLevel+mXstart,scaleLineYstart,mXstart,scaleLineYstart);
|
||||
}
|
||||
|
||||
void meter::drawScaleSWR(QPainter *qp)
|
||||
{
|
||||
// From the manual:
|
||||
|
@ -714,3 +851,27 @@ void meter::drawScaleS(QPainter *qp)
|
|||
qp->setPen(highLineColor);
|
||||
qp->drawLine(peakRedLevel+mXstart,scaleLineYstart,255+mXstart,scaleLineYstart);
|
||||
}
|
||||
|
||||
void meter::muteSingleComboItem(QComboBox *comboBox, int index) {
|
||||
enableAllComboBoxItems(comboBox);
|
||||
setComboBoxItemEnabled(comboBox, index, false);
|
||||
}
|
||||
|
||||
void meter::enableAllComboBoxItems(QComboBox *combobox) {
|
||||
for(int i=0; i < combobox->count(); i++) {
|
||||
setComboBoxItemEnabled(combobox, i, true);
|
||||
}
|
||||
}
|
||||
|
||||
void meter::setComboBoxItemEnabled(QComboBox * comboBox, int index, bool enabled)
|
||||
{
|
||||
auto * model = qobject_cast<QStandardItemModel*>(comboBox->model());
|
||||
assert(model);
|
||||
if(!model) return;
|
||||
|
||||
auto * item = model->item(index);
|
||||
assert(item);
|
||||
if(!item) return;
|
||||
item->setEnabled(enabled);
|
||||
}
|
||||
|
||||
|
|
19
meter.h
19
meter.h
|
@ -1,6 +1,9 @@
|
|||
#ifndef METER_H
|
||||
#define METER_H
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStandardItemModel>
|
||||
#include <QComboBox>
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include <vector>
|
||||
|
@ -18,6 +21,7 @@ public:
|
|||
explicit meter(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void configureMeterSignal(meter_t type);
|
||||
|
||||
public slots:
|
||||
void paintEvent(QPaintEvent *);
|
||||
|
@ -26,6 +30,7 @@ public slots:
|
|||
void setLevels(int current, int peak, int average);
|
||||
void setLevels(int current, int peak); // calculate avg
|
||||
void setLevel(int current);
|
||||
void setCompReverse(bool reverse);
|
||||
void clearMeterOnPTTtoggle();
|
||||
void clearMeter();
|
||||
void setMeterType(meter_t type);
|
||||
|
@ -35,17 +40,26 @@ public slots:
|
|||
void setColors(QColor current, QColor peakScale, QColor peakLevel,
|
||||
QColor average, QColor lowLine,
|
||||
QColor lowText);
|
||||
void blockMeterType(meter_t type);
|
||||
|
||||
private slots:
|
||||
void acceptComboItem(int item);
|
||||
|
||||
private:
|
||||
//QPainter painter;
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
void handleDoubleClick();
|
||||
bool freezeDrawing = false;
|
||||
QComboBox *combo = NULL;
|
||||
meter_t meterType;
|
||||
QString meterShortString;
|
||||
bool haveUpdatedData = false;
|
||||
int fontSize = 10;
|
||||
int length=30;
|
||||
int current=0;
|
||||
int peak = 0;
|
||||
int average = 0;
|
||||
bool reverseCompMeter = true;
|
||||
|
||||
int averageBalisticLength = 30;
|
||||
int peakBalisticLength = 30;
|
||||
|
@ -73,11 +87,16 @@ private:
|
|||
void drawScaleVd(QPainter *qp);
|
||||
void drawScaleId(QPainter *qp);
|
||||
void drawScaleComp(QPainter *qp);
|
||||
void drawScaleCompInverted(QPainter *qp);
|
||||
void drawScale_dBFs(QPainter *qp);
|
||||
void drawScaleRaw(QPainter *qp);
|
||||
|
||||
void drawLabel(QPainter *qp);
|
||||
|
||||
void muteSingleComboItem(QComboBox *comboBox, int index);
|
||||
void enableAllComboBoxItems(QComboBox *combobox);
|
||||
void setComboBoxItemEnabled(QComboBox * comboBox, int index, bool enabled);
|
||||
|
||||
QString label;
|
||||
|
||||
QColor currentColor;
|
||||
|
|
14
prefs.h
14
prefs.h
|
@ -25,11 +25,13 @@ enum prefIfItem {
|
|||
if_confirmExit = 1 << 12,
|
||||
if_confirmPowerOff = 1 << 13,
|
||||
if_meter2Type = 1 << 14,
|
||||
if_clickDragTuningEnable = 1 << 15,
|
||||
if_currentColorPresetNumber = 1 << 16,
|
||||
if_rigCreatorEnable = 1 << 17,
|
||||
if_frequencyUnits = 1 << 18,
|
||||
if_all = 1 << 19
|
||||
if_meter3Type = 1 << 15,
|
||||
if_compMeterReverse = 1 << 16,
|
||||
if_clickDragTuningEnable = 1 << 17,
|
||||
if_currentColorPresetNumber = 1 << 18,
|
||||
if_rigCreatorEnable = 1 << 19,
|
||||
if_frequencyUnits = 1 << 20,
|
||||
if_all = 1 << 21
|
||||
};
|
||||
|
||||
enum prefColItem {
|
||||
|
@ -178,6 +180,8 @@ struct preferences {
|
|||
bool confirmExit;
|
||||
bool confirmPowerOff;
|
||||
meter_t meter2Type;
|
||||
meter_t meter3Type;
|
||||
bool compMeterReverse = false;
|
||||
bool clickDragTuningEnable;
|
||||
int currentColorPresetNumber = 0;
|
||||
bool rigCreatorEnable = false;
|
||||
|
|
18
printhex.h
18
printhex.h
|
@ -5,6 +5,24 @@
|
|||
|
||||
#include "logcategories.h"
|
||||
|
||||
|
||||
QStringList inline getHexArray(const QByteArray &pdata)
|
||||
{
|
||||
QString head = "---- Begin hex dump -----:";
|
||||
QString sdata("DATA: ");
|
||||
QString index("INDEX: ");
|
||||
|
||||
for(int i=0; i < pdata.length(); i++)
|
||||
{
|
||||
sdata.append(QString("%1 ").arg((unsigned char)pdata[i], 2, 16, QChar('0')) );
|
||||
index.append(QString("%1 ").arg(i, 2, 10, QChar('0')));
|
||||
}
|
||||
|
||||
QString tail = "---- End hex dump -----";
|
||||
|
||||
return {head, sdata, index, tail};
|
||||
}
|
||||
|
||||
QString inline getHex(const QByteArray &pdata)
|
||||
{
|
||||
QString head = "---- Begin hex dump -----:\n";
|
||||
|
|
|
@ -317,6 +317,7 @@ void rigCommander::prepDataAndSend(QByteArray data)
|
|||
qDebug(logRigTraffic()) << "Final payload in rig commander to be sent to rig: ";
|
||||
printHexNow(data, logRigTraffic());
|
||||
}
|
||||
lastCommandToRig = data;
|
||||
emit dataForComm(data);
|
||||
}
|
||||
|
||||
|
@ -938,7 +939,7 @@ void rigCommander::parseCommand()
|
|||
case funcTransceiverId:
|
||||
if (!rigCaps.modelID)
|
||||
{
|
||||
if (payloadIn[0] == 0x0 && payloadIn.size() > 1)
|
||||
if (payloadIn[0] == (char)0x0 && payloadIn.size() > 1)
|
||||
{
|
||||
payloadIn.remove(0,1); // Remove spurious response.
|
||||
}
|
||||
|
@ -1092,7 +1093,7 @@ void rigCommander::parseCommand()
|
|||
// This tells us whether we are receiving main or sub data
|
||||
case funcScopeSingleDual:
|
||||
// This tells us whether we are receiving single or dual scopes
|
||||
qInfo(logRig()) << "funcScopeSingleDual" << static_cast<bool>(payloadIn[0]);
|
||||
//qInfo(logRig()) << "funcScopeSingleDual (" << vfo <<") " << static_cast<bool>(payloadIn[0]);
|
||||
value.setValue(static_cast<bool>(payloadIn[0]));
|
||||
break;
|
||||
#if defined __GNUC__
|
||||
|
@ -1185,9 +1186,15 @@ void rigCommander::parseCommand()
|
|||
case funcFB:
|
||||
break;
|
||||
case funcFA:
|
||||
qInfo(logRig()) << "Error (FA) received from rig.";
|
||||
printHex(payloadIn, false ,true);
|
||||
{
|
||||
qWarning(logRig()) << "Error (FA) received from rig, last command sent:";
|
||||
|
||||
QStringList messages = getHexArray(lastCommandToRig);
|
||||
foreach (auto msg, messages)
|
||||
qWarning(logRig()) << msg;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
qWarning(logRig()) << "Unhandled command received from rig" << payloadIn.toHex().mid(0,10) << "Contact support!";
|
||||
break;
|
||||
|
@ -1424,7 +1431,7 @@ void rigCommander::determineRigCaps()
|
|||
for (int c = 0; c < numAttenuators; c++)
|
||||
{
|
||||
settings->setArrayIndex(c);
|
||||
//qInfo(logRig()) << "** GOT ATTENUATOR" << settings->value("dB", 0).toString().toUInt();
|
||||
qDebug(logRig()) << "** GOT ATTENUATOR" << settings->value("dB", 0).toString().toUInt();
|
||||
rigCaps.attenuators.push_back((unsigned char)settings->value("dB", 0).toString().toUInt());
|
||||
}
|
||||
settings->endArray();
|
||||
|
@ -1460,7 +1467,7 @@ void rigCommander::determineRigCaps()
|
|||
|
||||
rigCaps.bands.push_back(bandType(band,bsr,start,end,range,memGroup));
|
||||
rigCaps.bsr[band] = bsr;
|
||||
qInfo(logRig()) << "Adding Band " << band << "Start" << start << "End" << end << "BSR" << QString::number(bsr,16);
|
||||
qDebug(logRig()) << "Adding Band " << band << "Start" << start << "End" << end << "BSR" << QString::number(bsr,16);
|
||||
}
|
||||
settings->endArray();
|
||||
}
|
||||
|
@ -2415,7 +2422,7 @@ void rigCommander::receiveCommand(funcs func, QVariant value, uchar vfo)
|
|||
if (func == funcSendCW)
|
||||
{
|
||||
val = value.value<QString>().length();
|
||||
qInfo(logRig()) << "Send CW received";
|
||||
qDebug(logRig()) << "Send CW received";
|
||||
}
|
||||
|
||||
if (func == funcAfGain && value.isValid() && udp != Q_NULLPTR) {
|
||||
|
@ -2481,13 +2488,13 @@ void rigCommander::receiveCommand(funcs func, QVariant value, uchar vfo)
|
|||
}
|
||||
}
|
||||
payload.append(textData);
|
||||
qInfo(logRig()) << "Sending CW: payload:" << payload.toHex(' ');
|
||||
qDebug(logRig()) << "Sending CW: payload:" << payload.toHex(' ');
|
||||
}
|
||||
}
|
||||
else if (!strcmp(value.typeName(),"uchar"))
|
||||
{
|
||||
payload.append(bcdEncodeChar(value.value<uchar>()));
|
||||
qInfo(logRig()) << "**** setting uchar value" << funcString[func] << "val" << value.value<uchar>();
|
||||
qDebug(logRig()) << "**** setting uchar value" << funcString[func] << "val" << value.value<uchar>();
|
||||
}
|
||||
else if (!strcmp(value.typeName(),"ushort"))
|
||||
{
|
||||
|
|
|
@ -221,6 +221,8 @@ private:
|
|||
QString rigSerialPort;
|
||||
quint32 rigBaudRate;
|
||||
|
||||
QByteArray lastCommandToRig;
|
||||
|
||||
QString ip;
|
||||
int cport;
|
||||
int sport;
|
||||
|
|
|
@ -6,6 +6,7 @@ Manufacturer=Icom
|
|||
Model=IC-785x
|
||||
CIVAddress=142
|
||||
RigCtlDModel=3075
|
||||
NumberOfVFOs=2
|
||||
SpectrumSeqMax=15
|
||||
SpectrumAmpMax=200
|
||||
SpectrumLenMax=689
|
||||
|
|
|
@ -81,6 +81,20 @@ void settingswidget::populateComboBoxes()
|
|||
ui->meter2selectionCombo->show();
|
||||
ui->meter2selectionCombo->blockSignals(false);
|
||||
|
||||
ui->meter3selectionCombo->blockSignals(true);
|
||||
ui->meter3selectionCombo->addItem("None", meterNone);
|
||||
ui->meter3selectionCombo->addItem("SWR", meterSWR);
|
||||
ui->meter3selectionCombo->addItem("ALC", meterALC);
|
||||
ui->meter3selectionCombo->addItem("Compression", meterComp);
|
||||
ui->meter3selectionCombo->addItem("Voltage", meterVoltage);
|
||||
ui->meter3selectionCombo->addItem("Current", meterCurrent);
|
||||
ui->meter3selectionCombo->addItem("Center", meterCenter);
|
||||
ui->meter3selectionCombo->addItem("TxRxAudio", meterAudio);
|
||||
ui->meter3selectionCombo->addItem("RxAudio", meterRxAudio);
|
||||
ui->meter3selectionCombo->addItem("TxAudio", meterTxMod);
|
||||
ui->meter3selectionCombo->show();
|
||||
ui->meter3selectionCombo->blockSignals(false);
|
||||
|
||||
ui->secondaryMeterSelectionLabel->show();
|
||||
|
||||
ui->audioRXCodecCombo->blockSignals(true);
|
||||
|
@ -412,6 +426,25 @@ void settingswidget::updateIfPref(prefIfItem pif)
|
|||
int m = ui->meter2selectionCombo->findData(prefs->meter2Type);
|
||||
ui->meter2selectionCombo->setCurrentIndex(m);
|
||||
ui->meter2selectionCombo->blockSignals(false);
|
||||
if(prefs->meter2Type != meterNone) {
|
||||
muteSingleComboItem(ui->meter3selectionCombo, m);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case if_meter3Type:
|
||||
{
|
||||
ui->meter3selectionCombo->blockSignals(true);
|
||||
int m = ui->meter3selectionCombo->findData(prefs->meter3Type);
|
||||
ui->meter3selectionCombo->setCurrentIndex(m);
|
||||
ui->meter3selectionCombo->blockSignals(false);
|
||||
if(prefs->meter3Type != meterNone) {
|
||||
muteSingleComboItem(ui->meter2selectionCombo, m);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case if_compMeterReverse:
|
||||
{
|
||||
quietlyUpdateCheckbox(ui->revCompMeterBtn, prefs->compMeterReverse);
|
||||
break;
|
||||
}
|
||||
case if_clickDragTuningEnable:
|
||||
|
@ -1490,6 +1523,51 @@ void settingswidget::on_meter2selectionCombo_currentIndexChanged(int index)
|
|||
{
|
||||
prefs->meter2Type = static_cast<meter_t>(ui->meter2selectionCombo->itemData(index).toInt());
|
||||
emit changedIfPref(if_meter2Type);
|
||||
enableAllComboBoxItems(ui->meter3selectionCombo);
|
||||
if(prefs->meter2Type != meterNone) {
|
||||
setComboBoxItemEnabled(ui->meter3selectionCombo, index, false);
|
||||
}
|
||||
}
|
||||
|
||||
void settingswidget::on_meter3selectionCombo_currentIndexChanged(int index)
|
||||
{
|
||||
prefs->meter3Type = static_cast<meter_t>(ui->meter3selectionCombo->itemData(index).toInt());
|
||||
emit changedIfPref(if_meter3Type);
|
||||
// Since the meter combo boxes have the same items in each list,
|
||||
// we can disable an item from the other list with confidence.
|
||||
enableAllComboBoxItems(ui->meter2selectionCombo);
|
||||
if(prefs->meter3Type != meterNone) {
|
||||
setComboBoxItemEnabled(ui->meter2selectionCombo, index, false);
|
||||
}
|
||||
}
|
||||
|
||||
void settingswidget::on_revCompMeterBtn_clicked(bool checked)
|
||||
{
|
||||
prefs->compMeterReverse = checked;
|
||||
emit changedIfPref(if_compMeterReverse);
|
||||
}
|
||||
|
||||
void settingswidget::muteSingleComboItem(QComboBox *comboBox, int index) {
|
||||
enableAllComboBoxItems(comboBox);
|
||||
setComboBoxItemEnabled(comboBox, index, false);
|
||||
}
|
||||
|
||||
void settingswidget::enableAllComboBoxItems(QComboBox *combobox) {
|
||||
for(int i=0; i < combobox->count(); i++) {
|
||||
setComboBoxItemEnabled(combobox, i, true);
|
||||
}
|
||||
}
|
||||
|
||||
void settingswidget::setComboBoxItemEnabled(QComboBox * comboBox, int index, bool enabled)
|
||||
{
|
||||
auto * model = qobject_cast<QStandardItemModel*>(comboBox->model());
|
||||
assert(model);
|
||||
if(!model) return;
|
||||
|
||||
auto * item = model->item(index);
|
||||
assert(item);
|
||||
if(!item) return;
|
||||
item->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void settingswidget::on_tuningFloorZerosChk_clicked(bool checked)
|
||||
|
@ -2645,4 +2723,18 @@ void settingswidget::connectionStatus(bool conn)
|
|||
ui->serverRXAudioInputCombo->setEnabled(!conn);
|
||||
ui->serverTXAudioOutputCombo->setEnabled(!conn);
|
||||
ui->audioSystemServerCombo->setEnabled(!conn);
|
||||
|
||||
if(conn) {
|
||||
ui->connectBtn->setText("Disconnect from radio");
|
||||
} else {
|
||||
ui->connectBtn->setText("Connect to radio");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void settingswidget::on_connectBtn_clicked()
|
||||
{
|
||||
emit connectButtonPressed();
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@ signals:
|
|||
void changedClusterPref(prefClusterItem i);
|
||||
void changedUdpPref(prefUDPItem i);
|
||||
void changedServerPref(prefServerItem i);
|
||||
void connectButtonPressed();
|
||||
|
||||
private slots:
|
||||
void on_settingsList_currentRowChanged(int currentRow);
|
||||
|
@ -236,6 +237,12 @@ private slots:
|
|||
|
||||
void serverAddUserLine(int row,const QString& user="", const QString& pass="", const int& type=0);
|
||||
|
||||
void on_meter3selectionCombo_currentIndexChanged(int index);
|
||||
|
||||
void on_revCompMeterBtn_clicked(bool checked);
|
||||
|
||||
void on_connectBtn_clicked();
|
||||
|
||||
private:
|
||||
Ui::settingswidget *ui;
|
||||
void createSettingsListItems();
|
||||
|
@ -255,6 +262,9 @@ private:
|
|||
void quietlyUpdateCheckbox(QGroupBox *gb, bool isChecked);
|
||||
void quietlyUpdateRadiobutton(QRadioButton *rb, bool isChecked);
|
||||
void quietlyUpdateLineEdit(QLineEdit *le, const QString text);
|
||||
void setComboBoxItemEnabled(QComboBox *comboBox, int index, bool enabled);
|
||||
void enableAllComboBoxItems(QComboBox *combobox);
|
||||
void muteSingleComboItem(QComboBox *comboBox, int index);
|
||||
|
||||
// Colors (helper functions)
|
||||
void setEditAndLedFromColor(QColor c, QLineEdit *e, QLedLabel *d);
|
||||
|
|
|
@ -734,6 +734,13 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="connectBtn">
|
||||
<property name="text">
|
||||
<string>Connect To Radio</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
|
@ -795,9 +802,9 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="clickDragTuningEnableChk">
|
||||
<widget class="QCheckBox" name="pttEnableChk">
|
||||
<property name="text">
|
||||
<string>Allow tuning via click and drag (experimental)</string>
|
||||
<string>Enable PTT Controls</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -848,6 +855,13 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="clickDragTuningEnableChk">
|
||||
<property name="text">
|
||||
<string>Allow tuning via click and drag (experimental)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="useSystemThemeChk">
|
||||
<property name="text">
|
||||
|
@ -1026,13 +1040,6 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_28">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="pttEnableChk">
|
||||
<property name="text">
|
||||
<string>Enable PTT Controls</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_30">
|
||||
<property name="orientation">
|
||||
|
@ -1052,13 +1059,26 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<item>
|
||||
<widget class="QLabel" name="secondaryMeterSelectionLabel">
|
||||
<property name="text">
|
||||
<string>Secondary Meter Selection:</string>
|
||||
<string>Additional Meter Selection:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="meter2selectionCombo"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="meter3selectionCombo"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="revCompMeterBtn">
|
||||
<property name="toolTip">
|
||||
<string>Broadcast-style reduction meter</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reverse Comp Meter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="autoPollBtn">
|
||||
<property name="toolTip">
|
||||
|
@ -1276,8 +1296,8 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>925</width>
|
||||
<height>330</height>
|
||||
<width>916</width>
|
||||
<height>309</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
|
|
|
@ -175,6 +175,11 @@ spectrumScope::spectrumScope(QWidget *parent)
|
|||
spectrum->addLayer( "Top Layer", spectrum->layer("main"));
|
||||
spectrum->graph(0)->setLayer("Top Layer");
|
||||
|
||||
spectrumPlasma.resize(spectrumPlasmaSizeMax);
|
||||
for(unsigned int p=0; p < spectrumPlasmaSizeMax; p++) {
|
||||
spectrumPlasma[p] = 0;
|
||||
}
|
||||
|
||||
QColor color(20+200/4.0*1,70*(1.6-1/4.0), 150, 150);
|
||||
spectrum->graph(1)->setLineStyle(QCPGraph::lsLine);
|
||||
spectrum->graph(1)->setPen(QPen(color.lighter(200)));
|
||||
|
@ -429,6 +434,10 @@ bool spectrumScope::prepareWf(uint wf)
|
|||
waterfall->yAxis->setRangeReversed(true);
|
||||
waterfall->xAxis->setVisible(false);
|
||||
|
||||
clearPeaks();
|
||||
clearPlasma();
|
||||
|
||||
|
||||
scopePrepared = true;
|
||||
return ret;
|
||||
}
|
||||
|
@ -437,6 +446,8 @@ void spectrumScope::setRange(int floor, int ceiling)
|
|||
{
|
||||
plotFloor = floor;
|
||||
plotCeiling = ceiling;
|
||||
wfFloor = floor;
|
||||
wfCeiling = ceiling;
|
||||
maxAmp = ceiling;
|
||||
if (spectrum != Q_NULLPTR)
|
||||
spectrum->yAxis->setRange(QCPRange(floor, ceiling));
|
||||
|
@ -527,9 +538,6 @@ bool spectrumScope::updateScope(scopeData data)
|
|||
// TODO: create non-button function to do this
|
||||
// This will break if the button is ever moved or renamed.
|
||||
clearPeaks();
|
||||
} else {
|
||||
plasmaPrepared = false;
|
||||
preparePlasma();
|
||||
}
|
||||
// Inform other threads (cluster) that the frequency range has changed.
|
||||
emit frequencyRange(vfo, data.startFreq, data.endFreq);
|
||||
|
@ -567,11 +575,15 @@ bool spectrumScope::updateScope(scopeData data)
|
|||
}
|
||||
}
|
||||
plasmaMutex.lock();
|
||||
spectrumPlasma.push_front(data.data);
|
||||
if(spectrumPlasma.size() > (int)spectrumPlasmaSize)
|
||||
{
|
||||
spectrumPlasma.pop_back();
|
||||
}
|
||||
spectrumPlasma[spectrumPlasmaPosition] = data.data;
|
||||
spectrumPlasmaPosition = (spectrumPlasmaPosition+1) % spectrumPlasmaSizeCurrent;
|
||||
//spectrumPlasma.push_front(data.data);
|
||||
// if(spectrumPlasma.size() > (int)spectrumPlasmaSizeCurrent)
|
||||
// {
|
||||
// // If we have pushed_front more than spectrumPlasmaSize,
|
||||
// // then we cut one off the back.
|
||||
// spectrumPlasma.pop_back();
|
||||
// }
|
||||
plasmaMutex.unlock();
|
||||
QMutexLocker locker(&mutex);
|
||||
if ((plotFloor != oldPlotFloor) || (plotCeiling != oldPlotCeiling)){
|
||||
|
@ -766,52 +778,25 @@ bool spectrumScope::updateScope(scopeData data)
|
|||
|
||||
|
||||
// Plasma functions
|
||||
void spectrumScope::preparePlasma()
|
||||
{
|
||||
QMutexLocker locker(&plasmaMutex);
|
||||
|
||||
if(plasmaPrepared)
|
||||
return;
|
||||
|
||||
if(spectrumPlasmaSize == 0)
|
||||
spectrumPlasmaSize = 128;
|
||||
|
||||
spectrumPlasma.clear();
|
||||
spectrumPlasma.squeeze();
|
||||
plasmaPrepared = true;
|
||||
}
|
||||
|
||||
void spectrumScope::resizePlasmaBuffer(int size) {
|
||||
QMutexLocker locker(&plasmaMutex);
|
||||
QByteArray empty((int)spectWidth, '\x01');
|
||||
|
||||
int oldSize = spectrumPlasma.size();
|
||||
|
||||
if(oldSize < size)
|
||||
{
|
||||
spectrumPlasma.resize(size);
|
||||
for(int p=oldSize; p < size; p++)
|
||||
{
|
||||
spectrumPlasma.append(empty);
|
||||
}
|
||||
} else if (oldSize > size){
|
||||
for(int p = oldSize; p > size; p--)
|
||||
{
|
||||
spectrumPlasma.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
spectrumPlasma.squeeze();
|
||||
// QMutexLocker locker(&plasmaMutex);
|
||||
qDebug() << "Resizing plasma buffer via parameter, from oldsize " << spectrumPlasmaSizeCurrent << " to new size: " << size;
|
||||
spectrumPlasmaSizeCurrent = size;
|
||||
return;
|
||||
}
|
||||
|
||||
void spectrumScope::clearPeaks()
|
||||
{
|
||||
// Clear the spectrum peaks as well as the plasma buffer
|
||||
spectrumPeaks = QByteArray( (int)spectWidth, '\x01' );
|
||||
clearPlasma();
|
||||
//clearPlasma();
|
||||
}
|
||||
|
||||
void spectrumScope::clearPlasma()
|
||||
{
|
||||
// Clear the buffer of spectrum used for peak and average computation.
|
||||
// This is only needed one time, when the VFO is created with spectrum size info.
|
||||
QMutexLocker locker(&plasmaMutex);
|
||||
QByteArray empty((int)spectWidth, '\x01');
|
||||
int pSize = spectrumPlasma.size();
|
||||
|
@ -824,27 +809,35 @@ void spectrumScope::clearPlasma()
|
|||
void spectrumScope::computePlasma()
|
||||
{
|
||||
QMutexLocker locker(&plasmaMutex);
|
||||
spectrumPlasmaLine.clear();
|
||||
spectrumPlasmaLine.resize(spectWidth);
|
||||
int specPlasmaSize = spectrumPlasma.size();
|
||||
// Spec PlasmaLine is a single line of spectrum, ~~600 pixels or however many the radio provides.
|
||||
// This changes width only when we connect to a new radio.
|
||||
if(spectrumPlasmaLine.size() != spectWidth) {
|
||||
spectrumPlasmaLine.clear();
|
||||
spectrumPlasmaLine.resize(spectWidth);
|
||||
}
|
||||
|
||||
// spectrumPlasma is the bufffer of spectrum lines to use when computing the average or peak.
|
||||
|
||||
int specPlasmaSize = spectrumPlasmaSizeCurrent; // go only this far in
|
||||
if(underlayMode == underlayAverageBuffer)
|
||||
{
|
||||
for(int col=0; col < spectWidth; col++)
|
||||
{
|
||||
for(int pos=0; pos < specPlasmaSize; pos++)
|
||||
{
|
||||
spectrumPlasmaLine[col] += (unsigned char)spectrumPlasma[pos][col];
|
||||
spectrumPlasmaLine[col] += (unsigned char)spectrumPlasma.at(pos).at(col);
|
||||
}
|
||||
spectrumPlasmaLine[col] = spectrumPlasmaLine[col] / specPlasmaSize;
|
||||
spectrumPlasmaLine[col] = spectrumPlasmaLine.at(col) / specPlasmaSize;
|
||||
}
|
||||
} else if (underlayMode == underlayPeakBuffer){
|
||||
// peak mode, running peak display
|
||||
for(int col=0; col < spectWidth; col++)
|
||||
{
|
||||
spectrumPlasmaLine[col] = spectrumPlasma.at(0).at(col); // initial value
|
||||
for(int pos=0; pos < specPlasmaSize; pos++)
|
||||
{
|
||||
if((double)((unsigned char)spectrumPlasma[pos][col]) > spectrumPlasmaLine[col])
|
||||
spectrumPlasmaLine[col] = (unsigned char)spectrumPlasma[pos][col];
|
||||
if((double)((unsigned char)spectrumPlasma.at(pos).at(col)) > spectrumPlasmaLine.at(col))
|
||||
spectrumPlasmaLine[col] = (unsigned char)spectrumPlasma.at(pos).at(col);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -866,7 +859,6 @@ void spectrumScope::showHideControls(spectrumMode_t mode)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void spectrumScope::enableScope(bool en)
|
||||
{
|
||||
this->splitter->setVisible(en);
|
||||
|
@ -1485,11 +1477,11 @@ void spectrumScope::receiveCwPitch(uchar pitch)
|
|||
{
|
||||
if (mode.mk == modeCW || mode.mk == modeCW_R) {
|
||||
quint16 p = round((((600.0 / 255.0) * pitch) + 300) / 5.0) * 5.0;
|
||||
if (p != cwPitch)
|
||||
if (p != this->cwPitch)
|
||||
{
|
||||
passbandCenterFrequency = p / 2000000.0;
|
||||
qInfo(logSystem()) << QString("%0 Received new CW Pitch %1 Hz was %2 (center freq %3 MHz)").arg((vfo?"Sub":"Main")).arg(p).arg(cwPitch).arg(passbandCenterFrequency);
|
||||
cwPitch = p;
|
||||
this->cwPitch = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ public:
|
|||
bool prepareWf(uint wfLength);
|
||||
void prepareScope(uint ampMap, uint spectWidth);
|
||||
bool updateScope(scopeData spectrum);
|
||||
void preparePlasma();
|
||||
void setRange(int floor, int ceiling);
|
||||
void wfInterpolate(bool en) { colorMap->setInterpolate(en); }
|
||||
void wfAntiAliased(bool en) { colorMap->setAntialiased(en); }
|
||||
|
@ -77,7 +76,7 @@ public:
|
|||
void setFrequency (freqt f);
|
||||
|
||||
void receiveMode (modeInfo m);
|
||||
modeInfo currentMode() {return mode;};
|
||||
modeInfo currentMode() {return mode;}
|
||||
void clearSpans() { spanCombo->clear();}
|
||||
void clearMode() { modeCombo->clear();}
|
||||
void clearData() { dataCombo->clear();}
|
||||
|
@ -228,9 +227,11 @@ private:
|
|||
QByteArray spectrumPeaks;
|
||||
QVector <double> spectrumPlasmaLine;
|
||||
QVector <QByteArray> spectrumPlasma;
|
||||
unsigned int spectrumPlasmaSize = 64;
|
||||
unsigned int spectrumPlasmaSizeCurrent = 64;
|
||||
unsigned int spectrumPlasmaSizeMax = 128;
|
||||
unsigned int spectrumPlasmaPosition = 0;
|
||||
|
||||
underlay_t underlayMode = underlayNone;
|
||||
bool plasmaPrepared = false;
|
||||
QMutex plasmaMutex;
|
||||
|
||||
double plotFloor = 0;
|
||||
|
|
|
@ -459,7 +459,7 @@ void udpHandler::dataReceived()
|
|||
if (in->busy && in->computer[0] != '\x0')
|
||||
admin = true;
|
||||
|
||||
qCritical(logUdp()) << "Is the user an admin? " << admin;
|
||||
qDebug(logUdp()) << "Is the user an admin? " << admin;
|
||||
emit setRadioUsage(f, admin, in->busy, QString(in->computer), ip.toString());
|
||||
qDebug(logUdp()) << "Set radio usage num:" << f << in->name << "Busy:" << in->busy << "Computer" << in->computer << "IP" << ip.toString();
|
||||
}
|
||||
|
|
|
@ -113,11 +113,11 @@ void usbController::init(QMutex* mut,usbDevMap* devs ,QVector<BUTTON>* buts,QVec
|
|||
#endif
|
||||
#endif
|
||||
|
||||
qInfo(logUsbControl()) << "Found available HID devices (not all will be suitable for use):";
|
||||
qDebug(logUsbControl()) << "Found available HID devices (not all will be suitable for use):";
|
||||
struct hid_device_info* devs;
|
||||
devs = hid_enumerate(0x0, 0x0);
|
||||
while (devs) {
|
||||
qInfo(logUsbControl()) << QString("Device found: (%0:%1) %2 manufacturer: (%3)%4 usage: 0x%5 usage_page 0x%6")
|
||||
qDebug(logUsbControl()) << QString("Device found: (%0:%1) %2 manufacturer: (%3)%4 usage: 0x%5 usage_page 0x%6")
|
||||
.arg(devs->vendor_id, 4, 16, QChar('0'))
|
||||
.arg(devs->product_id, 4, 16, QChar('0'))
|
||||
.arg(QString::fromWCharArray(devs->product_string),QString::fromWCharArray(devs->product_string),QString::fromWCharArray(devs->manufacturer_string))
|
||||
|
|
189
wfmain.cpp
189
wfmain.cpp
|
@ -247,6 +247,27 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
QToolTip::showText(QCursor::pos(), QString("%1").arg(value*100/255), nullptr);
|
||||
});
|
||||
|
||||
connect(ui->meter2Widget, &meter::configureMeterSignal,
|
||||
[=](const meter_t &meterTypeRequested) {
|
||||
// Change the preferences and update settings widget to reflect new meter selection:
|
||||
prefs.meter2Type = meterTypeRequested;
|
||||
setupui->updateIfPref(if_meter2Type);
|
||||
// Change the meter locally:
|
||||
changeMeterType(meterTypeRequested, 2);
|
||||
// Block duplicate meter selection in the other meter:
|
||||
ui->meter3Widget->blockMeterType(meterTypeRequested);
|
||||
});
|
||||
|
||||
connect(ui->meter3Widget, &meter::configureMeterSignal,
|
||||
[=](const meter_t &meterTypeRequested) {
|
||||
// Change the preferences and update settings widget to reflect new meter selection:
|
||||
prefs.meter3Type = meterTypeRequested;
|
||||
setupui->updateIfPref(if_meter3Type);
|
||||
// Change the meter locally:
|
||||
changeMeterType(meterTypeRequested, 3);
|
||||
// Block duplicate meter selection in the other meter:
|
||||
ui->meter2Widget->blockMeterType(meterTypeRequested);
|
||||
});
|
||||
|
||||
#if defined(USB_CONTROLLER)
|
||||
#if defined(USB_HOTPLUG) && defined(Q_OS_LINUX)
|
||||
|
@ -729,6 +750,7 @@ void wfmain::receiveNetworkAudioLevels(networkAudioLevels l)
|
|||
void wfmain::setupMainUI()
|
||||
{
|
||||
ui->meter2Widget->hide();
|
||||
ui->meter3Widget->hide();
|
||||
|
||||
// Future ideas:
|
||||
//ui->meter2selectionCombo->addItem("Transmit Audio", meterTxMod);
|
||||
|
@ -864,6 +886,7 @@ void wfmain::connectSettingsWidget()
|
|||
//connect(setupui, SIGNAL(changedServerTXAudioOutputCombo(int)), this, SLOT(changedServerTXAudioOutput(int)));
|
||||
|
||||
connect(this, SIGNAL(connectionStatus(bool)), setupui, SLOT(connectionStatus(bool)));
|
||||
connect(setupui, SIGNAL(connectButtonPressed()), this, SLOT(handleExtConnectBtn()));
|
||||
}
|
||||
|
||||
// NOT Migrated, EHL TODO, carefully remove this function
|
||||
|
@ -993,7 +1016,6 @@ void wfmain::configureVFOs()
|
|||
vfo->wfInterpolate(prefs.wfInterpolate);
|
||||
vfo->setScrollSpeedXY(prefs.scopeScrollX, prefs.scopeScrollY);
|
||||
vfo->prepareWf(i==0?prefs.mainWflength:prefs.subWflength);
|
||||
vfo->preparePlasma();
|
||||
vfo->setRange(i==0?prefs.mainPlotFloor:prefs.subPlotFloor,i==0?prefs.mainPlotCeiling:prefs.subPlotCeiling);
|
||||
vfo->wfTheme(i==0?prefs.mainWfTheme:prefs.subWfTheme);
|
||||
vfo->setClickDragTuning(prefs.clickDragTuningEnable);
|
||||
|
@ -1087,6 +1109,10 @@ void wfmain::setupKeyShortcuts()
|
|||
keyControlR->setKey(Qt::CTRL | Qt::Key_R);
|
||||
connect(keyControlR, SIGNAL(activated()), this, SLOT(shortcutControlR()));
|
||||
|
||||
keyControlR = new QShortcut(this);
|
||||
keyControlR->setKey(Qt::CTRL | Qt::Key_P);
|
||||
connect(keyControlR, SIGNAL(activated()), this, SLOT(shortcutControlP()));
|
||||
|
||||
keyControlI = new QShortcut(this);
|
||||
keyControlI->setKey(Qt::CTRL | Qt::Key_I);
|
||||
connect(keyControlI, SIGNAL(activated()), this, SLOT(shortcutControlI()));
|
||||
|
@ -1516,6 +1542,9 @@ void wfmain::setDefPrefs()
|
|||
defPrefs.confirmExit = true;
|
||||
defPrefs.confirmPowerOff = true;
|
||||
defPrefs.meter2Type = meterNone;
|
||||
defPrefs.meter3Type = meterNone;
|
||||
defPrefs.compMeterReverse = false;
|
||||
|
||||
defPrefs.tcpPort = 0;
|
||||
defPrefs.tciPort = 50001;
|
||||
defPrefs.waterfallFormat = 0;
|
||||
|
@ -1586,6 +1615,8 @@ void wfmain::loadSettings()
|
|||
prefs.confirmExit = settings->value("ConfirmExit", defPrefs.confirmExit).toBool();
|
||||
prefs.confirmPowerOff = settings->value("ConfirmPowerOff", defPrefs.confirmPowerOff).toBool();
|
||||
prefs.meter2Type = static_cast<meter_t>(settings->value("Meter2Type", defPrefs.meter2Type).toInt());
|
||||
prefs.meter3Type = static_cast<meter_t>(settings->value("Meter3Type", defPrefs.meter3Type).toInt());
|
||||
prefs.compMeterReverse = settings->value("compMeterReverse", defPrefs.compMeterReverse).toBool();
|
||||
prefs.clickDragTuningEnable = settings->value("ClickDragTuning", false).toBool();
|
||||
|
||||
prefs.rigCreatorEnable = settings->value("RigCreator",false).toBool();
|
||||
|
@ -2137,6 +2168,7 @@ void wfmain::extChangedRsPrefs(quint64 items)
|
|||
{
|
||||
qDebug(logSystem()) << "Updating Rs pref in wfmain" << (int)i;
|
||||
prs = (prefRsItem)i;
|
||||
extChangedRsPref(prs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2288,12 +2320,19 @@ void wfmain::extChangedIfPref(prefIfItem i)
|
|||
// Not in settings widget
|
||||
break;
|
||||
case if_meter2Type:
|
||||
changeMeter2Type(prefs.meter2Type);
|
||||
changeMeterType(prefs.meter2Type, 2);
|
||||
break;
|
||||
case if_meter3Type:
|
||||
changeMeterType(prefs.meter3Type, 3);
|
||||
break;
|
||||
case if_clickDragTuningEnable:
|
||||
// There's nothing to do here since the code
|
||||
// already uses the preference variable as state.
|
||||
break;
|
||||
case if_compMeterReverse:
|
||||
ui->meter2Widget->setCompReverse(prefs.compMeterReverse);
|
||||
ui->meter3Widget->setCompReverse(prefs.compMeterReverse);
|
||||
break;
|
||||
case if_rigCreatorEnable:
|
||||
ui->rigCreatorBtn->setEnabled(prefs.rigCreatorEnable);
|
||||
break;
|
||||
|
@ -2353,6 +2392,7 @@ void wfmain::extChangedColPref(prefColItem i)
|
|||
case col_meterText:
|
||||
ui->meterSPoWidget->setColors(cp->meterLevel, cp->meterPeakScale, cp->meterPeakLevel, cp->meterAverage, cp->meterLowerLine, cp->meterLowText);
|
||||
ui->meter2Widget->setColors(cp->meterLevel, cp->meterPeakScale, cp->meterPeakLevel, cp->meterAverage, cp->meterLowerLine, cp->meterLowText);
|
||||
ui->meter3Widget->setColors(cp->meterLevel, cp->meterPeakScale, cp->meterPeakLevel, cp->meterAverage, cp->meterLowerLine, cp->meterLowText);
|
||||
break;
|
||||
default:
|
||||
qWarning(logSystem()) << "Cannot update wfmain col pref" << (int)i;
|
||||
|
@ -2744,6 +2784,8 @@ void wfmain::saveSettings()
|
|||
settings->setValue("ConfirmExit", prefs.confirmExit);
|
||||
settings->setValue("ConfirmPowerOff", prefs.confirmPowerOff);
|
||||
settings->setValue("Meter2Type", (int)prefs.meter2Type);
|
||||
settings->setValue("Meter3Type", (int)prefs.meter3Type);
|
||||
settings->setValue("compMeterReverse", prefs.compMeterReverse);
|
||||
settings->setValue("ClickDragTuning", prefs.clickDragTuningEnable);
|
||||
settings->setValue("RigCreator",prefs.rigCreatorEnable);
|
||||
settings->setValue("FrequencyUnits",prefs.frequencyUnits);
|
||||
|
@ -3119,7 +3161,7 @@ void wfmain::shortcutF12()
|
|||
void wfmain::shortcutControlT()
|
||||
{
|
||||
// Transmit
|
||||
qInfo(logSystem()) << "Activated Control-T shortcut";
|
||||
qDebug(logSystem()) << "Activated Control-T shortcut";
|
||||
showStatusBarText(QString("Transmitting. Press Control-R to receive."));
|
||||
extChangedRsPrefs(rs_pttOn);
|
||||
}
|
||||
|
@ -3130,6 +3172,17 @@ void wfmain::shortcutControlR()
|
|||
extChangedRsPrefs(rs_pttOff);
|
||||
}
|
||||
|
||||
void wfmain::shortcutControlP()
|
||||
{
|
||||
// Toggle PTT
|
||||
if(amTransmitting) {
|
||||
extChangedRsPrefs(rs_pttOff);
|
||||
} else {
|
||||
extChangedRsPrefs(rs_pttOn);
|
||||
showStatusBarText(QString("Transmitting. Press Control-P again to receive."));
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::shortcutControlI()
|
||||
{
|
||||
// Enable ATU
|
||||
|
@ -3441,7 +3494,7 @@ void wfmain:: getInitialRigState()
|
|||
queue->add(priorityImmediate,funcMonitorGain,false);
|
||||
|
||||
*/
|
||||
if(rigCaps.hasSpectrum && vfos.size())
|
||||
if(rigCaps.hasSpectrum)
|
||||
{
|
||||
queue->add(priorityImmediate,queueItem(funcScopeOnOff,QVariant::fromValue(quint8(1)),false));
|
||||
queue->add(priorityImmediate,queueItem(funcScopeDataOutput,QVariant::fromValue(quint8(1)),false));
|
||||
|
@ -3457,7 +3510,8 @@ void wfmain:: getInitialRigState()
|
|||
auto sr = rigCaps.commands.find(funcScopeSubRef);
|
||||
if (sr != rigCaps.commands.end())
|
||||
{
|
||||
vfos[1]->setRefLimits(sr.value().minVal,sr.value().maxVal);
|
||||
if (vfos.size()>1)
|
||||
vfos[1]->setRefLimits(sr.value().minVal,sr.value().maxVal);
|
||||
queue->add(priorityImmediate,(funcScopeSubRef),false,true);
|
||||
}
|
||||
}
|
||||
|
@ -3881,7 +3935,10 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
|
|||
}
|
||||
|
||||
// Set the second meter here as I suspect we need to be connected for it to work?
|
||||
changeMeter2Type(prefs.meter2Type);
|
||||
changeMeterType(prefs.meter2Type, 2);
|
||||
changeMeterType(prefs.meter3Type, 3);
|
||||
ui->meter2Widget->setCompReverse(prefs.compMeterReverse);
|
||||
ui->meter3Widget->setCompReverse(prefs.compMeterReverse);
|
||||
// for (int i = 0; i < ui->meter2selectionCombo->count(); i++)
|
||||
// {
|
||||
// if (static_cast<meter_t>(ui->meter2selectionCombo->itemData(i).toInt()) == prefs.meter2Type)
|
||||
|
@ -3938,7 +3995,10 @@ void wfmain::initPeriodicCommands()
|
|||
queue->add(priorityMediumLow,funcMonitor,true,false);
|
||||
}
|
||||
|
||||
// Medium/MediumLow Priority commands on all rigs (if supported)
|
||||
queue->add(priorityMedium,funcRfGain,true,false);
|
||||
queue->add(priorityMedium,funcTunerStatus,true,false);
|
||||
|
||||
queue->add(priorityMediumLow,funcTuningStep,true,false);
|
||||
queue->add(priorityMediumLow,funcAttenuator,true,false);
|
||||
queue->add(priorityMediumLow,funcPreamp,true,false);
|
||||
|
@ -3947,6 +4007,19 @@ void wfmain::initPeriodicCommands()
|
|||
queue->add(priorityMediumLow,funcToneSquelchType,true,false);
|
||||
|
||||
queue->add(priorityHighest,queueItem(funcSMeter,true));
|
||||
meter* marray[2];
|
||||
marray[0] = ui->meter2Widget;
|
||||
marray[1] = ui->meter3Widget;
|
||||
for(int m=0; m < 2; m++) {
|
||||
funcs meterCmd = meter_tToMeterCommand(marray[m]->getMeterType());
|
||||
if(meterCmd != funcNone) {
|
||||
qDebug() << "Adding meter command per current UI meters.";
|
||||
queue->add(priorityHighest,queueItem(meterCmd,true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void wfmain::receivePTTstatus(bool pttOn)
|
||||
|
@ -3959,6 +4032,7 @@ void wfmain::receivePTTstatus(bool pttOn)
|
|||
|
||||
pttLed->setState(QLedLabel::State::StateError);
|
||||
pttLed->setToolTip("Transmitting");
|
||||
changePrimaryMeter(true);
|
||||
if(splitModeEnabled)
|
||||
{
|
||||
pttLed->setState(QLedLabel::State::StateSplitErrorOk);
|
||||
|
@ -3972,6 +4046,8 @@ void wfmain::receivePTTstatus(bool pttOn)
|
|||
{
|
||||
pttLed->setState(QLedLabel::State::StateOk);
|
||||
pttLed->setToolTip("Receiving");
|
||||
changePrimaryMeter(false);
|
||||
|
||||
}
|
||||
amTransmitting = pttOn;
|
||||
rpt->handleTransmitStatus(pttOn);
|
||||
|
@ -3983,11 +4059,36 @@ void wfmain::changeTxBtn()
|
|||
if(amTransmitting)
|
||||
{
|
||||
ui->transmitBtn->setText("Receive");
|
||||
|
||||
} else {
|
||||
ui->transmitBtn->setText("Transmit");
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::changePrimaryMeter(bool transmitOn) {
|
||||
// Change the Primary UI Meter and alter the queue
|
||||
|
||||
// This function is only called from one place:
|
||||
// When we receive a new PTT status.
|
||||
// It is not called by UI changes, since we receive
|
||||
// PTT status regularly and quite frequently.
|
||||
|
||||
funcs newCmd;
|
||||
funcs oldCmd;
|
||||
|
||||
if(transmitOn) {
|
||||
oldCmd = meter_tToMeterCommand(meterS);
|
||||
newCmd = meter_tToMeterCommand(meterPower);
|
||||
ui->meterSPoWidget->setMeterType(meterPower);
|
||||
} else {
|
||||
oldCmd = meter_tToMeterCommand(meterPower);
|
||||
newCmd = meter_tToMeterCommand(meterS);
|
||||
ui->meterSPoWidget->setMeterType(meterS);
|
||||
}
|
||||
queue->del(oldCmd);
|
||||
queue->add(priorityHighest,queueItem(newCmd,true));
|
||||
}
|
||||
|
||||
void wfmain::changeFullScreenMode(bool checked)
|
||||
{
|
||||
if(checked)
|
||||
|
@ -4303,6 +4404,11 @@ void wfmain::receiveATUStatus(unsigned char atustatus)
|
|||
}
|
||||
}
|
||||
|
||||
void wfmain::handleExtConnectBtn() {
|
||||
// from settings widget
|
||||
on_connectBtn_clicked();
|
||||
}
|
||||
|
||||
void wfmain::on_connectBtn_clicked()
|
||||
{
|
||||
this->rigStatus->setText(""); // Clear status
|
||||
|
@ -4534,9 +4640,10 @@ void wfmain::receiveTuningStep(unsigned char step)
|
|||
|
||||
void wfmain::receiveMeter(meter_t inMeter, unsigned char level)
|
||||
{
|
||||
|
||||
switch(inMeter)
|
||||
{
|
||||
// These first two meters, S and Power,
|
||||
// are automatically assigned to the primary meter.
|
||||
case meterS:
|
||||
ui->meterSPoWidget->setMeterType(meterS);
|
||||
ui->meterSPoWidget->setLevel(level);
|
||||
|
@ -4548,16 +4655,23 @@ void wfmain::receiveMeter(meter_t inMeter, unsigned char level)
|
|||
ui->meterSPoWidget->update();
|
||||
break;
|
||||
default:
|
||||
if(ui->meter2Widget->getMeterType() == inMeter)
|
||||
{
|
||||
ui->meter2Widget->setLevel(level);
|
||||
} else if ( (ui->meter2Widget->getMeterType() == meterAudio) &&
|
||||
(inMeter == meterTxMod) && amTransmitting) {
|
||||
ui->meter2Widget->setLevel(level);
|
||||
} else if ( (ui->meter2Widget->getMeterType() == meterAudio) &&
|
||||
(inMeter == meterRxAudio) && !amTransmitting) {
|
||||
ui->meter2Widget->setLevel(level);
|
||||
meter* marray[2];
|
||||
marray[0] = ui->meter2Widget;
|
||||
marray[1] = ui->meter3Widget;
|
||||
for(int m=0; m < 2; m++) {
|
||||
if(marray[m]->getMeterType() == inMeter)
|
||||
{
|
||||
// The incoming meter data matches the UI meter
|
||||
marray[m]->setLevel(level);
|
||||
} else if ( (marray[m]->getMeterType() == meterAudio) &&
|
||||
(inMeter == meterTxMod) && amTransmitting) {
|
||||
marray[m]->setLevel(level);
|
||||
} else if ( (marray[m]->getMeterType() == meterAudio) &&
|
||||
(inMeter == meterRxAudio) && !amTransmitting) {
|
||||
marray[m]->setLevel(level);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4901,15 +5015,26 @@ funcs wfmain::meter_tToMeterCommand(meter_t m)
|
|||
}
|
||||
|
||||
|
||||
void wfmain::changeMeter2Type(meter_t m)
|
||||
void wfmain::changeMeterType(meter_t m, int meterNum)
|
||||
{
|
||||
qDebug() << "Changing meter type.";
|
||||
meter_t newMeterType;
|
||||
meter_t oldMeterType;
|
||||
newMeterType = m;
|
||||
oldMeterType = ui->meter2Widget->getMeterType();
|
||||
|
||||
if(newMeterType == oldMeterType)
|
||||
meter* uiMeter = NULL;
|
||||
if(meterNum == 2) {
|
||||
uiMeter = ui->meter2Widget;
|
||||
} else if (meterNum == 3) {
|
||||
uiMeter = ui->meter3Widget;
|
||||
} else {
|
||||
qCritical() << "Error, invalid meter requested: meterNum ==" << meterNum;
|
||||
return;
|
||||
}
|
||||
newMeterType = m;
|
||||
oldMeterType = uiMeter->getMeterType();
|
||||
|
||||
if(newMeterType == oldMeterType) {
|
||||
qDebug() << "Debug note: the old meter was the same as the new meter.";
|
||||
}
|
||||
|
||||
funcs newCmd = meter_tToMeterCommand(newMeterType);
|
||||
funcs oldCmd = meter_tToMeterCommand(oldMeterType);
|
||||
|
@ -4921,11 +5046,11 @@ void wfmain::changeMeter2Type(meter_t m)
|
|||
|
||||
if(newMeterType==meterNone)
|
||||
{
|
||||
ui->meter2Widget->hide();
|
||||
ui->meter2Widget->setMeterType(newMeterType);
|
||||
uiMeter->hide();
|
||||
uiMeter->setMeterType(newMeterType);
|
||||
} else {
|
||||
ui->meter2Widget->show();
|
||||
ui->meter2Widget->setMeterType(newMeterType);
|
||||
uiMeter->show();
|
||||
uiMeter->setMeterType(newMeterType);
|
||||
if((newMeterType!=meterRxAudio) && (newMeterType!=meterTxMod) && (newMeterType!=meterAudio))
|
||||
queue->add(priorityHighest,queueItem(newCmd,true));
|
||||
}
|
||||
|
@ -5014,6 +5139,7 @@ void wfmain::useColorPreset(colorPrefsType *cp)
|
|||
//qInfo(logSystem()) << "Setting plots to color preset number " << cp->presetNum << ", with name " << *(cp->presetName);
|
||||
ui->meterSPoWidget->setColors(cp->meterLevel, cp->meterPeakScale, cp->meterPeakLevel, cp->meterAverage, cp->meterLowerLine, cp->meterLowText);
|
||||
ui->meter2Widget->setColors(cp->meterLevel, cp->meterPeakScale, cp->meterPeakLevel, cp->meterAverage, cp->meterLowerLine, cp->meterLowText);
|
||||
ui->meter3Widget->setColors(cp->meterLevel, cp->meterPeakScale, cp->meterPeakLevel, cp->meterAverage, cp->meterLowerLine, cp->meterLowText);
|
||||
foreach(auto vfo, vfos) {
|
||||
vfo->colorPreset(cp);
|
||||
}
|
||||
|
@ -5100,6 +5226,12 @@ void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, c
|
|||
return;
|
||||
}
|
||||
|
||||
if( (type == QtWarningMsg) && (msg.contains("QPainter::")) ) {
|
||||
// This is a message from QCP about a collapsed plot area.
|
||||
// Ignore.
|
||||
return;
|
||||
}
|
||||
|
||||
QMutexLocker locker(&logMutex);
|
||||
QTextStream out(m_logFile.data());
|
||||
QString text;
|
||||
|
@ -5142,7 +5274,6 @@ void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, c
|
|||
logTextMutex.lock();
|
||||
logStringBuffer.push_front(QPair<QtMsgType,QString>(type,text));
|
||||
logTextMutex.unlock();
|
||||
|
||||
}
|
||||
|
||||
void wfmain::receiveClusterOutput(QString text) {
|
||||
|
@ -5179,6 +5310,7 @@ void wfmain::connectionHandler(bool connect)
|
|||
|
||||
// Whatever happened, make sure we delete the memories window.
|
||||
if (memWindow != Q_NULLPTR) {
|
||||
memWindow->close();
|
||||
delete memWindow;
|
||||
memWindow = Q_NULLPTR;
|
||||
}
|
||||
|
@ -5204,7 +5336,7 @@ void wfmain::on_memoriesBtn_clicked()
|
|||
if (haveRigCaps) {
|
||||
if (memWindow == Q_NULLPTR) {
|
||||
// Add slowload option for background loading.
|
||||
memWindow = new memories(rigCaps,false,this);
|
||||
memWindow = new memories(rigCaps,false);
|
||||
this->memWindow->connect(this, SIGNAL(haveMemory(memoryType)), memWindow, SLOT(receiveMemory(memoryType)));
|
||||
|
||||
this->memWindow->connect(this->memWindow, &memories::getMemory, rig,[=](const quint32 &mem) {
|
||||
|
@ -5420,6 +5552,9 @@ void wfmain::receiveValue(cacheItem val){
|
|||
emit sendLevel(val.command,val.value.value<uchar>());
|
||||
break;
|
||||
case funcRFPower:
|
||||
changeSliderQuietly(ui->txPowerSlider, val.value.value<uchar>());
|
||||
emit sendLevel(val.command,val.value.value<uchar>());
|
||||
break;
|
||||
case funcCompressorLevel:
|
||||
case funcNBLevel:
|
||||
case funcNRLevel:
|
||||
|
|
6
wfmain.h
6
wfmain.h
|
@ -329,6 +329,8 @@ private slots:
|
|||
void extChangedUdpPref(prefUDPItem i);
|
||||
void extChangedServerPref(prefServerItem i);
|
||||
|
||||
void handleExtConnectBtn();
|
||||
|
||||
void receiveScopeSettings(uchar vfo, int theme, quint16 len, int floor, int ceiling);
|
||||
void receiveValue(cacheItem val);
|
||||
void setAudioDevicesUI();
|
||||
|
@ -348,6 +350,7 @@ private slots:
|
|||
|
||||
void shortcutControlT();
|
||||
void shortcutControlR();
|
||||
void shortcutControlP();
|
||||
void shortcutControlI();
|
||||
void shortcutControlU();
|
||||
|
||||
|
@ -468,7 +471,7 @@ private slots:
|
|||
void on_ritTuneDial_valueChanged(int value);
|
||||
void on_ritEnableChk_clicked(bool checked);
|
||||
|
||||
void changeMeter2Type(meter_t m);
|
||||
void changeMeterType(meter_t m, int meterNum);
|
||||
void enableRigCtl(bool enabled);
|
||||
|
||||
void on_memoriesBtn_clicked();
|
||||
|
@ -679,6 +682,7 @@ private:
|
|||
unsigned int tsHz);
|
||||
|
||||
void changeTxBtn();
|
||||
void changePrimaryMeter(bool transmitOn);
|
||||
void changeSliderQuietly(QSlider *slider, int value);
|
||||
void showAndRaiseWidget(QWidget *w);
|
||||
void statusFromSliderPercent(QString name, int percentValue);
|
||||
|
|
55
wfmain.ui
55
wfmain.ui
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>922</width>
|
||||
<height>569</height>
|
||||
<width>956</width>
|
||||
<height>384</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
|
@ -68,27 +68,11 @@
|
|||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="meter" name="meterSPoWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
|
@ -106,19 +90,47 @@
|
|||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>80</height>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="meter" name="meter2Widget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>280</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="meter" name="meter3Widget" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -1233,6 +1245,7 @@
|
|||
<widget class="QPushButton" name="exitBtn">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
|
@ -29,6 +29,7 @@ enum meter_t {
|
|||
meterLatency
|
||||
};
|
||||
|
||||
|
||||
enum spectrumMode_t {
|
||||
spectModeCenter=0x00,
|
||||
spectModeFixed=0x01,
|
||||
|
@ -412,6 +413,54 @@ enum usbCommandType{ commandButton, commandKnob, commandAny };
|
|||
enum usbFeatureType { featureReset,featureResetKeys, featureEventsA, featureEventsB, featureFirmware, featureSerial, featureButton, featureSensitivity, featureBrightness,
|
||||
featureOrientation, featureSpeed, featureColor, featureOverlay, featureTimeout, featureLCD, featureGraph, featureLEDControl };
|
||||
|
||||
inline QString getMeterDebug(meter_t m) {
|
||||
QString rtn = QString("Meter name: ");
|
||||
switch(m) {
|
||||
case meterNone:
|
||||
rtn.append("meterNone");
|
||||
break;
|
||||
case meterS:
|
||||
rtn.append("meterS");
|
||||
break;
|
||||
case meterCenter:
|
||||
rtn.append("meterCenter");
|
||||
break;
|
||||
case meterSWR:
|
||||
rtn.append("meterSWR");
|
||||
break;
|
||||
case meterPower:
|
||||
rtn.append("meterPower");
|
||||
break;
|
||||
case meterALC:
|
||||
rtn.append("meterALC");
|
||||
break;
|
||||
case meterComp:
|
||||
rtn.append("meterComp");
|
||||
break;
|
||||
case meterVoltage:
|
||||
rtn.append("meterVoltage");
|
||||
break;
|
||||
case meterCurrent:
|
||||
rtn.append("meterCurrent");
|
||||
break;
|
||||
case meterRxdB:
|
||||
rtn.append("meterRxdB");
|
||||
break;
|
||||
case meterTxMod:
|
||||
rtn.append("meterTxMod");
|
||||
break;
|
||||
case meterRxAudio:
|
||||
rtn.append("meterRxAudio");
|
||||
break;
|
||||
case meterLatency:
|
||||
rtn.append("meterLatency");
|
||||
break;
|
||||
default:
|
||||
rtn.append("UNKNOWN");
|
||||
break;
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(freqt)
|
||||
Q_DECLARE_METATYPE(spectrumMode_t)
|
||||
|
|
Ładowanie…
Reference in New Issue