Porównaj commity

...

4 Commity

Autor SHA1 Wiadomość Data
Phil Taylor c9c129ffe3 Fix cluster spots 2024-01-28 13:14:47 +00:00
Phil Taylor d25dc81d66 Remove more hex conversions 2024-01-28 09:49:08 +00:00
Phil Taylor 03b4059f76 Fix for mode selection 2024-01-28 09:42:50 +00:00
Phil Taylor b3eb151104 Add support for more than 2 VFOs 2024-01-27 22:13:47 +00:00
25 zmienionych plików z 530 dodań i 621 usunięć

Wyświetl plik

@ -81,12 +81,12 @@ void cachingQueue::run()
}
it--;
auto item = it.value();
emit haveCommand(item.command,item.param,item.sub);
emit haveCommand(item.command,item.param,item.vfo);
it=queue.erase(it);
if (item.recurring && prio != priorityImmediate) {
queue.insert(prio,item);
}
updateCache(false,item.command,item.param,item.sub);
updateCache(false,item.command,item.param,item.vfo);
}
QCoreApplication::processEvents();
@ -109,9 +109,9 @@ void cachingQueue::interval(quint64 val)
qInfo() << "Changing queue interval to" << val << "ms";
}
void cachingQueue::add(queuePriority prio ,funcs func, bool recurring, bool sub)
void cachingQueue::add(queuePriority prio ,funcs func, bool recurring, uchar vfo)
{
queueItem q(func,recurring,sub);
queueItem q(func,recurring,vfo);
add(prio,q);
}
@ -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 << "sub" << item.sub;
qInfo() << "adding" << funcString[item.command] << "recurring" << item.recurring << "priority" << prio << "vfo" << item.vfo;
}
queue.insert(prio, item);
}
@ -138,9 +138,9 @@ void cachingQueue::add(queuePriority prio ,queueItem item)
}
}
void cachingQueue::addUnique(queuePriority prio ,funcs func, bool recurring, bool sub)
void cachingQueue::addUnique(queuePriority prio ,funcs func, bool recurring, uchar vfo)
{
queueItem q(func,recurring, sub);
queueItem q(func,recurring, vfo);
addUnique(prio,q);
}
@ -157,9 +157,9 @@ void cachingQueue::addUnique(queuePriority prio ,queueItem item)
auto it(queue.begin());
// This is quite slow but a new unique command is only added in response to user interaction (mode change etc.)
while (it != queue.end()) {
if (it.value().command == item.command && it.value().recurring == item.recurring && it.value().sub == item.sub && it.value().param.isValid() == item.param.isValid())
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] << "sub" << it.value().sub << "recurring" << it.value().recurring ;
//qInfo() << "deleting" << it.value().id << funcString[it.value().command] << "vfo" << it.value().vfo << "recurring" << it.value().recurring ;
it = queue.erase(it);
}
else
@ -172,25 +172,25 @@ 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 << "sub" << item.sub;
qInfo() << "adding unique" << funcString[item.command] << "recurring" << item.recurring << "priority" << prio << "vfo" << item.vfo;
}
queue.insert(prio, item);
}
}
}
void cachingQueue::del(funcs func, bool sub)
void cachingQueue::del(funcs func, uchar vfo)
{
// This will immediately delete any matching commands.
if (func != funcNone)
{
QMutexLocker locker(&mutex);
auto it = std::find_if(queue.begin(), queue.end(), [func,sub](const queueItem& c) { return (c.command == func && c.sub == sub && c.recurring); });
auto it = std::find_if(queue.begin(), queue.end(), [func,vfo](const queueItem& c) { return (c.command == func && c.vfo == vfo && c.recurring); });
//auto it(queue.begin());
if (it == queue.end())
qInfo() << "recurring command" << funcString[func] << "sub" << sub << "not found in queue";
qInfo() << "recurring command" << funcString[func] << "vfo" << vfo << "not found in queue";
while (it != queue.end()) {
if (it.value().command == func && it.value().sub == sub) {
if (it.value().command == func && it.value().vfo == vfo) {
//qInfo() << "deleting" << funcString[it.value().command] << "sub" << it.value().sub << "recurring" << it.value().recurring;
it = queue.erase(it);
}
@ -202,10 +202,10 @@ void cachingQueue::del(funcs func, bool sub)
}
}
queuePriority cachingQueue::isRecurring(funcs func, bool sub)
queuePriority cachingQueue::isRecurring(funcs func, uchar vfo)
{
// Does NOT lock the mutex
auto rec = std::find_if(queue.begin(), queue.end(), [func,sub](const queueItem& c) { return (c.command == func && c.sub == sub && c.recurring); });
auto rec = std::find_if(queue.begin(), queue.end(), [func,vfo](const queueItem& c) { return (c.command == func && c.vfo == vfo && c.recurring); });
if (rec != queue.end())
{
return rec.key();
@ -224,12 +224,12 @@ void cachingQueue::message(QString msg)
waiting.wakeOne();
}
void cachingQueue::receiveValue(funcs func, QVariant value, bool sub)
void cachingQueue::receiveValue(funcs func, QVariant value, uchar vfo)
{
QMutexLocker locker(&mutex);
cacheItem c = cacheItem(func,value,sub);
cacheItem c = cacheItem(func,value,vfo);
items.enqueue(c);
updateCache(true,func,value,sub);
updateCache(true,func,value,vfo);
waiting.wakeOne();
}
@ -239,7 +239,7 @@ void cachingQueue::updateCache(bool reply, queueItem item)
// Mutex MUST be locked by the calling function.
auto cv = cache.find(item.command);
while (cv != cache.end() && cv->command == item.command) {
if (cv->sub == item.sub) {
if (cv->vfo == item.vfo) {
if (reply) {
cv->reply = QDateTime::currentDateTime();
} else {
@ -261,7 +261,7 @@ void cachingQueue::updateCache(bool reply, queueItem item)
cacheItem c;
c.command = item.command;
c.sub = item.sub;
c.vfo = item.vfo;
if (reply) {
c.reply = QDateTime::currentDateTime();
} else {
@ -275,14 +275,14 @@ void cachingQueue::updateCache(bool reply, queueItem item)
}
void cachingQueue::updateCache(bool reply, funcs func, QVariant value, bool sub)
void cachingQueue::updateCache(bool reply, funcs func, QVariant value, uchar vfo)
{
queueItem q(func,value,false,sub);
queueItem q(func,value,false,vfo);
updateCache(reply,q);
}
cacheItem cachingQueue::getCache(funcs func, bool sub)
cacheItem cachingQueue::getCache(funcs func, uchar vfo)
{
cacheItem ret;
if (func != funcNone) {
@ -290,7 +290,7 @@ cacheItem cachingQueue::getCache(funcs func, bool sub)
auto it = cache.find(func);
while (it != cache.end() && it->command == func)
{
if (it->sub == sub)
if (it->vfo == vfo)
ret = cacheItem(*it);
++it;
}
@ -299,7 +299,7 @@ cacheItem cachingQueue::getCache(funcs func, bool sub)
// Using priorityhighest WILL slow down the S-Meter when a command intensive client is connected to rigctl
if (func != funcNone && (!ret.value.isValid() || ret.reply.addSecs(QRandomGenerator::global()->bounded(5,20)) <= QDateTime::currentDateTime())) {
//qInfo() << "No (or expired) cache found for" << funcString[func] << "requesting";
add(priorityHighest,func,false,sub);
add(priorityHighest,func,false,vfo);
}
return ret;
}

Wyświetl plik

@ -29,28 +29,28 @@ enum queueItemType {
// Command with no param is a get by default
struct queueItem {
queueItem () {}
queueItem (funcs command, QVariant param, bool recurring, bool sub) : command(command), param(param), sub(sub), recurring(recurring){};
queueItem (funcs command, QVariant param, bool recurring) : command(command), param(param), sub(false), recurring(recurring){};
queueItem (funcs command, QVariant param) : command(command), param(param), sub(false), recurring(false){};
queueItem (funcs command, bool recurring, bool sub=false) : command(command), param(QVariant()), sub(sub), recurring(recurring) {};
queueItem (funcs command, bool recurring) : command(command), param(QVariant()), sub(false), recurring(recurring) {};
queueItem (funcs command) : command(command), param(QVariant()), sub(false), recurring(false){};
queueItem (funcs command, QVariant param, bool recurring, uchar vfo) : command(command), param(param), vfo(vfo), recurring(recurring){};
queueItem (funcs command, QVariant param, bool recurring) : command(command), param(param), vfo(false), recurring(recurring){};
queueItem (funcs command, QVariant param) : command(command), param(param),vfo(0), recurring(false){};
queueItem (funcs command, bool recurring, uchar vfo) : command(command), param(QVariant()), vfo(vfo), recurring(recurring) {};
queueItem (funcs command, bool recurring) : command(command), param(QVariant()), vfo(0), recurring(recurring) {};
queueItem (funcs command) : command(command), param(QVariant()), vfo(0), recurring(false){};
funcs command;
QVariant param;
bool sub;
uchar vfo;
bool recurring;
qint64 id = QDateTime::currentMSecsSinceEpoch();
};
struct cacheItem {
cacheItem () {};
cacheItem (funcs command, QVariant value, bool sub=false) : command(command), req(QDateTime()), reply(QDateTime()), value(value), sub(sub){};
cacheItem (funcs command, QVariant value, uchar vfo=0) : command(command), req(QDateTime()), reply(QDateTime()), value(value), vfo(vfo){};
funcs command;
QDateTime req;
QDateTime reply;
QVariant value;
bool sub;
uchar vfo;
};
class cachingQueue : public QThread
@ -58,14 +58,14 @@ class cachingQueue : public QThread
Q_OBJECT
signals:
void haveCommand(funcs func, QVariant param, bool sub);
void haveCommand(funcs func, QVariant param, uchar vfo);
void sendValue(cacheItem item);
void cacheUpdated(cacheItem item);
void rigCapsUpdated(rigCapabilities* caps);
public slots:
// Can be called directly or via emit.
void receiveValue(funcs func, QVariant value, bool sub);
void receiveValue(funcs func, QVariant value, uchar vfo);
private:
@ -79,8 +79,8 @@ private:
QQueue<cacheItem> items;
// Command to set cache value
void setCache(funcs func, QVariant val, bool sub=false);
queuePriority isRecurring(funcs func, bool sub=false);
void setCache(funcs func, QVariant val, uchar vfo=0);
queuePriority isRecurring(funcs func, uchar vfo=0);
bool compare(QVariant a, QVariant b);
@ -104,17 +104,17 @@ public:
static cachingQueue *getInstance(QObject* parent = Q_NULLPTR);
void message(QString msg);
void add(queuePriority prio ,funcs func, bool recurring=false, bool sub=false);
void add(queuePriority prio ,funcs func, bool recurring=false, uchar vfo=0);
void add(queuePriority prio,queueItem item);
void addUnique(queuePriority prio ,funcs func, bool recurring=false, bool sub=false);
void addUnique(queuePriority prio ,funcs func, bool recurring=false, uchar vfo=0);
void addUnique(queuePriority prio,queueItem item);
void del(funcs func, bool sub=false);
void del(funcs func, uchar vfo=0);
void clear();
void interval(quint64 val);
void updateCache(bool reply, queueItem item);
void updateCache(bool reply, funcs func, QVariant value=QVariant(), bool sub=false);
void updateCache(bool reply, funcs func, QVariant value=QVariant(), uchar vfo=0);
cacheItem getCache(funcs func, bool sub=false);
cacheItem getCache(funcs func, uchar vfo=0);
QMultiMap<funcs,cacheItem> getCacheItems();
QMultiMap <queuePriority,queueItem> getQueueItems();

Wyświetl plik

@ -263,9 +263,10 @@ void dxClusterClient::tcpDisconnected() {
// Need to start a timer and attempt reconnect.
}
void dxClusterClient::freqRange(bool sub, double low, double high)
void dxClusterClient::freqRange(uchar vfo, double low, double high)
{
if (sub) {
freqRanges[vfo] = {low,high};
if (vfo) {
lowSubFreq = low;
highSubFreq = high;
} else {
@ -293,47 +294,28 @@ void dxClusterClient::updateSpots()
spots.append(s);
}
#else
QMap<QString, spotData*>::iterator mainSpot = allSpots.begin();;
while (mainSpot != allSpots.end()) {
if (mainSpot.value()->frequency > lowMainFreq && mainSpot.value()->frequency < highMainFreq)
QMap<uchar, rangeValues>::iterator range = freqRanges.begin();
while (range != freqRanges.end())
{
spots.clear();
QMap<QString, spotData*>::iterator mainSpot = allSpots.begin();
while (mainSpot != allSpots.end())
{
spots.append(**mainSpot);
if (mainSpot.value()->frequency >= range->low && mainSpot.value()->frequency <= range->high)
{
spots.append(**mainSpot);
}
++mainSpot;
}
++mainSpot;
if (!spots.empty()) {
emit sendSpots(range.key(),spots);
//qInfo(logCluster()) << "Sending" << spots.size() << "DX spots to vfo" << range.key();
}
++range;
}
#endif
if (!spots.empty())
emit sendMainSpots(spots);
spots.clear();
#ifdef USESQL
// Set the required frequency range.
QString queryText = QString("SELECT * FROM spots WHERE frequency > %1 AND frequency < %2").arg(lowFreq).arg(highFreq);
//QString queryText = QString("SELECT * FROM spots");
database db;
auto query = db.query(queryText);
while (query.next()) {
// Step through all current spots within range
spotData s = spotData();
s.dxcall = query.value(query.record().indexOf("dxcall")).toString();
s.frequency = query.value(query.record().indexOf("frequency")).toDouble();
spots.append(s);
}
#else
QMap<QString, spotData*>::iterator subSpot = allSpots.begin();;
while (subSpot != allSpots.end()) {
if (subSpot.value()->frequency > lowSubFreq && subSpot.value()->frequency < highSubFreq)
{
spots.append(**subSpot);
}
++subSpot;
}
#endif
if (!spots.empty())
emit sendSubSpots(spots);
}
void dxClusterClient::enableSkimmerSpots(bool enable)

Wyświetl plik

@ -43,6 +43,13 @@ struct clusterSettings {
bool isdefault;
};
struct rangeValues {
rangeValues() {};
rangeValues(double low, double high): low(low), high(high) {};
double low;
double high;
};
class dxClusterClient : public QObject
{
Q_OBJECT
@ -56,7 +63,7 @@ signals:
void deleteSpot(QString dxcall);
void deleteOldSpots(int minutes);
void sendOutput(QString text);
void sendMainSpots(QList<spotData> spots);
void sendSpots(uchar vfo, QList<spotData> spots);
void sendSubSpots(QList<spotData> spots);
public slots:
@ -72,7 +79,7 @@ public slots:
void setTcpPassword(QString s) { tcpPassword = s; }
void setTcpTimeout(int p) { tcpTimeout = p; }
void tcpCleanup();
void freqRange(bool sub, double low, double high);
void freqRange(uchar vfo, double low, double high);
void enableSkimmerSpots(bool enable);
private:
@ -102,6 +109,7 @@ private:
double highMainFreq;
double lowSubFreq;
double highSubFreq;
QMap<uchar,rangeValues> freqRanges;
QMap<QString,spotData*> allSpots;
bool skimmerSpots = false;
};

Wyświetl plik

@ -58,7 +58,7 @@ void debugWindow::getCache()
ui->cacheView->item(c,0)->setText(QString::number(i.value().command).rightJustified(3,'0'));
ui->cacheView->item(c,1)->setText(funcString[i.value().command]);
ui->cacheView->item(c,2)->setText(getValue(i.value().value));
ui->cacheView->item(c,3)->setText((i.value().sub)?"true":"false");
ui->cacheView->item(c,3)->setText(QString::number(i.value().vfo));
ui->cacheView->item(c,4)->setText((i.value().req.isValid()?i.value().req.toString("hh:mm:ss.zzz"):"<none>"));
ui->cacheView->item(c,5)->setText((i.value().reply.isValid()?i.value().reply.toString("hh:mm:ss.zzz"):"<none>"));
c++;

Wyświetl plik

@ -71,6 +71,12 @@ void loggingWindow::acceptLogText(QPair<QtMsgType,QString> text)
} else if (text.first == QtCriticalMsg || text.first == QtFatalMsg)
{
colour = "red";
} else if (text.first == QtInfoMsg) {
colour = "white";
}
else
{
colour = "green";
}
ui->logTextDisplay->appendHtml(QString("<p><span style='color:%0'>%1</span></p>").arg(colour).arg(text.second));
if(vertLogScroll->value() == vertLogScroll->maximum())

Wyświetl plik

@ -225,7 +225,7 @@ void rigCommander::commonSetup()
this->setObjectName("Rig Commander");
queue = cachingQueue::getInstance(this);
connect(queue,SIGNAL(haveCommand(funcs,QVariant,bool)),this,SLOT(receiveCommand(funcs,QVariant,bool)));
connect(queue,SIGNAL(haveCommand(funcs,QVariant,uchar)),this,SLOT(receiveCommand(funcs,QVariant,uchar)));
oldScopeMode = spectModeUnknown;
pttAllowed = true; // This is for developing, set to false for "safe" debugging. Set to true for deployment.
@ -1235,22 +1235,6 @@ void rigCommander::parseCommand()
}
unsigned char rigCommander::convertNumberToHex(unsigned char num)
{
// Two digit only
if(num > 99)
{
qInfo(logRig()) << "Invalid numeric conversion from num " << num << " to hex.";
return 0xFA;
}
unsigned char result = 0;
result = (num/10) << 4;
result |= (num - 10*(num/10));
//qDebug(logRig()) << "Converting number: " << num << " to hex: " + QString("0x%1").arg(result, 2, 16, QChar('0');
return result;
}
void rigCommander::determineRigCaps()
{
// First clear all of the current settings
@ -1291,6 +1275,7 @@ void rigCommander::determineRigCaps()
rigCaps.modelName = settings->value("Model", "").toString();
qInfo(logRig()) << QString("Loading Rig: %0 from %1").arg(rigCaps.modelName,rigCaps.filename);
rigCaps.numVFO = settings->value("NumberOfVFOs",1).toUInt();
rigCaps.spectSeqMax = settings->value("SpectrumSeqMax",0).toUInt();
rigCaps.spectAmpMax = settings->value("SpectrumAmpMax",0).toUInt();
rigCaps.spectLenMax = settings->value("SpectrumLenMax",0).toUInt();
@ -1357,7 +1342,7 @@ void rigCommander::determineRigCaps()
{
settings->setArrayIndex(c);
rigCaps.modes.push_back(modeInfo(rigMode_t(settings->value("Num", 0).toUInt()),
settings->value("Reg", 0).toString().toUInt(nullptr,16), settings->value("Name", "").toString(), settings->value("Min", 0).toInt(), settings->value("Max", 0).toInt()));
settings->value("Reg", 0).toString().toUInt(), settings->value("Name", "").toString(), settings->value("Min", 0).toInt(), settings->value("Max", 0).toInt()));
}
settings->endArray();
}
@ -1385,7 +1370,7 @@ void rigCommander::determineRigCaps()
{
settings->setArrayIndex(c);
rigCaps.inputs.append(rigInput(inputTypes(settings->value("Num", 0).toUInt()),
settings->value("Reg", 0).toString().toUInt(nullptr,16),settings->value("Name", "").toString()));
settings->value("Reg", 0).toString().toUInt(),settings->value("Name", "").toString()));
}
settings->endArray();
}
@ -1412,7 +1397,7 @@ void rigCommander::determineRigCaps()
for (int c = 0; c < numPreamps; c++)
{
settings->setArrayIndex(c);
rigCaps.preamps.push_back(genericType(settings->value("Num", 0).toString().toUInt(nullptr,16), settings->value("Name", 0).toString()));
rigCaps.preamps.push_back(genericType(settings->value("Num", 0).toString().toUInt(), settings->value("Name", 0).toString()));
}
settings->endArray();
}
@ -1425,7 +1410,7 @@ void rigCommander::determineRigCaps()
for (int c = 0; c < numAntennas; c++)
{
settings->setArrayIndex(c);
rigCaps.antennas.push_back(genericType(settings->value("Num", 0).toString().toUInt(nullptr,16), settings->value("Name", 0).toString()));
rigCaps.antennas.push_back(genericType(settings->value("Num", 0).toString().toUInt(), settings->value("Name", 0).toString()));
}
settings->endArray();
}
@ -1438,7 +1423,7 @@ void rigCommander::determineRigCaps()
for (int c = 0; c < numAttenuators; c++)
{
settings->setArrayIndex(c);
qInfo(logRig()) << "** GOT ATTENUATOR" << settings->value("dB", 0).toString().toUInt();
//qInfo(logRig()) << "** GOT ATTENUATOR" << settings->value("dB", 0).toString().toUInt();
rigCaps.attenuators.push_back((unsigned char)settings->value("dB", 0).toString().toUInt());
}
settings->endArray();
@ -1452,7 +1437,7 @@ void rigCommander::determineRigCaps()
for (int c = 0; c < numFilters; c++)
{
settings->setArrayIndex(c);
rigCaps.filters.push_back(filterType(settings->value("Num", 0).toString().toUInt(nullptr,0), settings->value("Name", "").toString(), settings->value("Modes", 0).toUInt()));
rigCaps.filters.push_back(filterType(settings->value("Num", 0).toString().toUInt(), settings->value("Name", "").toString(), settings->value("Modes", 0).toUInt()));
}
settings->endArray();
}
@ -2294,19 +2279,6 @@ void rigCommander::changeLatency(const quint16 value)
emit haveChangeLatency(value);
}
// Other:
QByteArray rigCommander::stripData(const QByteArray &data, unsigned char cutPosition)
{
QByteArray rtndata;
if(data.length() < cutPosition)
{
return rtndata;
}
rtndata = data.right(cutPosition);
return rtndata;
}
void rigCommander::radioSelection(QList<radio_cap_packet> radios)
{
@ -2423,7 +2395,7 @@ uchar rigCommander::makeFilterWidth(ushort pass,bool sub)
return b1;
}
void rigCommander::receiveCommand(funcs func, QVariant value, bool sub)
void rigCommander::receiveCommand(funcs func, QVariant value, uchar vfo)
{
//qInfo() << "Got command:" << funcString[func];
int val=INT_MIN;
@ -2474,7 +2446,7 @@ void rigCommander::receiveCommand(funcs func, QVariant value, bool sub)
}
QByteArray payload;
if (getCommand(func,payload,val,sub))
if (getCommand(func,payload,val,vfo))
{
if (value.isValid())
{
@ -2519,8 +2491,8 @@ void rigCommander::receiveCommand(funcs func, QVariant value, bool sub)
else if (!strcmp(value.typeName(),"ushort"))
{
if (func == funcFilterWidth) {
payload.append(makeFilterWidth(value.value<ushort>(),sub));
//qInfo() << "Setting filter width" << value.value<ushort>() << "sub" << sub << "hex" << payload.toHex();
payload.append(makeFilterWidth(value.value<ushort>(),vfo));
//qInfo() << "Setting filter width" << value.value<ushort>() << "VFO" << vfo << "hex" << payload.toHex();
}
else if (func == funcKeySpeed){
@ -2769,11 +2741,11 @@ void rigCommander::receiveCommand(funcs func, QVariant value, bool sub)
{
if (func == funcDataModeWithFilter)
{
payload.append(value.value<modeInfo>().data);
payload.append(bcdEncodeChar(value.value<modeInfo>().data));
if (value.value<modeInfo>().data != 0)
payload.append(value.value<modeInfo>().filter);
} else {
payload.append(value.value<modeInfo>().reg);
payload.append(bcdEncodeChar(value.value<modeInfo>().reg));
if (func == funcSelectedMode || func == funcUnselectedMode)
payload.append(value.value<modeInfo>().data);
payload.append(value.value<modeInfo>().filter);
@ -2789,7 +2761,7 @@ void rigCommander::receiveCommand(funcs func, QVariant value, bool sub)
}
else if(!strcmp(value.typeName(),"antennaInfo"))
{
payload.append(value.value<antennaInfo>().antenna);
payload.append(bcdEncodeChar(value.value<antennaInfo>().antenna));
if (rigCaps.commands.contains(funcRXAntenna))
payload.append(value.value<antennaInfo>().rx);
}
@ -2847,7 +2819,7 @@ void rigCommander::receiveCommand(funcs func, QVariant value, bool sub)
// will fail on some commands so they would need to be added here:
if (func != funcScopeFixedEdgeFreq && func != funcSpeech && func != funcBandStackReg && func != funcMemoryContents && func != funcSendCW)
{
queue->addUnique(priorityImmediate,func,false,sub);
queue->addUnique(priorityImmediate,func,false,vfo);
}
}
prepDataAndSend(payload);

Wyświetl plik

@ -74,7 +74,7 @@ public slots:
void radioUsage(quint8 radio, bool admin, quint8 busy, QString name, QString ip);
void setCurrentRadio(quint8 radio);
void getDebug();
void receiveCommand(funcs func, QVariant value, bool sub);
void receiveCommand(funcs func, QVariant value, uchar vfo);
void setAfGain(unsigned char level);
signals:
@ -127,7 +127,7 @@ signals:
private:
void commonSetup();
QByteArray stripData(const QByteArray &data, unsigned char cutPosition);
void parseData(QByteArray data); // new data come here
void parseCommand(); // Entry point for complete commands
unsigned char bcdHexToUChar(unsigned char in);
@ -148,7 +148,7 @@ private:
QByteArray makeFreqPayload(freqt freq);
QByteArray encodeTone(quint16 tone, bool tinv, bool rinv);
QByteArray encodeTone(quint16 tone);
unsigned char convertNumberToHex(unsigned char num);
toneInfo decodeTone(QByteArray eTone);
//quint16 decodeTone(QByteArray eTone, bool &tinv, bool &rinv);
uchar makeFilterWidth(ushort width, bool sub);

Wyświetl plik

@ -121,6 +121,7 @@ void rigCreator::loadRigFile(QString file)
ui->model->setText(settings->value("Model","").toString());
ui->civAddress->setText(QString("%1").arg(settings->value("CIVAddress",0).toInt(),2,16));
ui->rigctldModel->setText(settings->value("RigCtlDModel","").toString());
ui->numVFO->setText(settings->value("NumberOfVFOs","1").toString());
ui->seqMax->setText(settings->value("SpectrumSeqMax","").toString());
ui->ampMax->setText(settings->value("SpectrumAmpMax","").toString());
ui->lenMax->setText(settings->value("SpectrumLenMax","").toString());
@ -421,6 +422,7 @@ void rigCreator::saveRigFile(QString file)
settings->setValue("Model",ui->model->text());
settings->setValue("CIVAddress",ui->civAddress->text().toInt(nullptr,16));
settings->setValue("RigCtlDModel",ui->rigctldModel->text().toInt());
settings->setValue("NumberOfVFOs",ui->numVFO->text().toInt());
settings->setValue("SpectrumSeqMax",ui->seqMax->text().toInt());
settings->setValue("SpectrumAmpMax",ui->ampMax->text().toInt());
settings->setValue("SpectrumLenMax",ui->lenMax->text().toInt());

Wyświetl plik

@ -40,28 +40,28 @@
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Seq Max</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Len Max</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Amp Max</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QLineEdit" name="ampMax">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -80,7 +80,7 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QLineEdit" name="lenMax">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -99,7 +99,7 @@
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="QLineEdit" name="seqMax">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -124,6 +124,26 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Num VFO</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="numVFO">
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>

Wyświetl plik

@ -833,7 +833,7 @@ int rigCtlClient::getCommand(QStringList& response, bool extended, const command
return -RIG_EINVAL;
}
if (rigCaps.commands.contains(func))
queue->add(priorityImmediate, queueItem(func, val,false));
queue->add(priorityImmediate, queueItem(func, val,false,0));
} else {
// Simple get command
@ -1011,7 +1011,7 @@ int rigCtlClient::getSubCommand(QStringList& response, bool extended, const comm
return -RIG_EINVAL;
}
if (rigCaps.commands.contains(sub[i].func))
queue->add(priorityImmediate, queueItem(sub[i].func, val,false));
queue->add(priorityImmediate, queueItem(sub[i].func, val,false,0));
} else if (params.size() == 1){
// Not expecting a second argument as it is a get so dump the cache
cacheItem item;

Wyświetl plik

@ -211,6 +211,7 @@ struct rigCapabilities {
quint8 spectSeqMax;
quint16 spectAmpMax;
quint16 spectLenMax;
quint8 numVFO;
bool hasNB = false;
QByteArray nbCommand;

Wyświetl plik

@ -399,8 +399,8 @@ Commands\75\Max=0
Commands\75\Command29=false
Commands\76\Type=Filter Width
Commands\76\String=\\x1a\\x03
Commands\76\Min=0
Commands\76\Max=3600
Commands\76\Min=50
Commands\76\Max=10000
Commands\76\Command29=false
Commands\77\Type=Quick Split
Commands\77\String=\\x1a\\x05\\x00\\x45

Wyświetl plik

@ -304,8 +304,8 @@ Commands\56\Max=0
Commands\56\Command29=false
Commands\57\Type=Filter Width
Commands\57\String=\\x1a\\x03
Commands\57\Min=0
Commands\57\Max=3600
Commands\57\Min=50
Commands\57\Max=10000
Commands\57\Command29=false
Commands\58\Type=Quick Split
Commands\58\String=\\x1a\\x05\\x00\\x30

Wyświetl plik

@ -6,6 +6,7 @@ Manufacturer=Icom
Model=IC-7610
CIVAddress=152
RigCtlDModel=3078
NumberOfVFOs=2
SpectrumSeqMax=15
SpectrumAmpMax=200
SpectrumLenMax=689
@ -424,8 +425,8 @@ Commands\80\Max=0
Commands\80\Command29=false
Commands\81\Type=Filter Width
Commands\81\String=\\x1a\\x03
Commands\81\Min=0
Commands\81\Max=3600
Commands\81\Min=50
Commands\81\Max=10000
Commands\81\Command29=true
Commands\82\Type=Quick Dual Watch
Commands\82\String=\\x1a\\x05\\x00\\x32
@ -897,12 +898,12 @@ Modes\8\Min=50
Modes\8\Max=2700
Modes\8\Name=RTTY-R
Modes\9\Num=8
Modes\9\Reg=0
Modes\9\Reg=12
Modes\9\Min=50
Modes\9\Max=3600
Modes\9\Name=PSK
Modes\10\Num=9
Modes\10\Reg=0
Modes\10\Reg=13
Modes\10\Min=50
Modes\10\Max=3600
Modes\10\Name=PSK-R

Wyświetl plik

@ -424,8 +424,8 @@ Commands\80\Max=0
Commands\80\Command29=false
Commands\81\Type=Filter Width
Commands\81\String=\\x1a\\x03
Commands\81\Min=0
Commands\81\Max=3600
Commands\81\Min=50
Commands\81\Max=10000
Commands\81\Command29=true
Commands\82\Type=Quick Split
Commands\82\String=\\x1a\\x05\\x00\\x33

Wyświetl plik

@ -379,8 +379,8 @@ Commands\71\Max=0
Commands\71\Command29=false
Commands\72\Type=Filter Width
Commands\72\String=\\x1a\\x03
Commands\72\Min=0
Commands\72\Max=3600
Commands\72\Min=50
Commands\72\Max=10000
Commands\72\Command29=false
Commands\73\Type=Quick Split
Commands\73\String=\\x1a\\x05\\x00\\x46

Wyświetl plik

@ -89,8 +89,8 @@ Commands\13\Max=1
Commands\13\Command29=false
Commands\14\Type=Memory Mode
Commands\14\String=\\x08
Commands\14\Min=0
Commands\14\Max=0
Commands\14\Min=1
Commands\14\Max=107
Commands\14\Command29=false
Commands\15\Type=Scanning
Commands\15\String=\\x0e
@ -105,7 +105,7 @@ Commands\16\Command29=false
Commands\17\Type=Tuning Step
Commands\17\String=\\x10
Commands\17\Min=0
Commands\17\Max=0
Commands\17\Max=11
Commands\17\Command29=false
Commands\18\Type=Attenuator Status
Commands\18\String=\\x11
@ -399,8 +399,8 @@ Commands\75\Max=0
Commands\75\Command29=false
Commands\76\Type=Filter Width
Commands\76\String=\\x1a\\x03
Commands\76\Min=0
Commands\76\Max=3600
Commands\76\Min=50
Commands\76\Max=10000
Commands\76\Command29=false
Commands\77\Type=Quick Split
Commands\77\String=\\x1a\\x05\\x00\\x43
@ -570,7 +570,7 @@ Commands\109\Command29=false
Commands\110\Type=Scope Main Mode
Commands\110\String=\\x27\\x14\\x00
Commands\110\Min=0
Commands\110\Max=0
Commands\110\Max=3
Commands\110\Command29=false
Commands\111\Type=Scope Main Span
Commands\111\String=\\x27\\x15\\x00
@ -612,7 +612,7 @@ Commands\118\String=\\x27\\x1d\\x00
Commands\118\Min=0
Commands\118\Max=1
Commands\118\Command29=false
Commands\119\Type=Scope Fixed Freq
Commands\119\Type=Scope Fixed Edge Freq
Commands\119\String=\\x27\\x1e
Commands\119\Min=1
Commands\119\Max=0
@ -740,12 +740,12 @@ Modes\8\Min=50
Modes\8\Max=2700
Modes\8\Name=RTTY-R
Modes\9\Num=12
Modes\9\Reg=0
Modes\9\Reg=17
Modes\9\Min=0
Modes\9\Max=0
Modes\9\Name=DV
Modes\10\Num=14
Modes\10\Reg=0
Modes\10\Reg=22
Modes\10\Min=0
Modes\10\Max=0
Modes\10\Name=DD

Wyświetl plik

@ -291,51 +291,51 @@ spectrumScope::spectrumScope(QWidget *parent)
connect(configLength, &QSlider::valueChanged, this, [=](const int &val) {
prepareWf(val);
emit updateSettings(sub,currentTheme,wfLength,plotFloor,plotCeiling);
emit updateSettings(vfo,currentTheme,wfLength,plotFloor,plotCeiling);
});
connect(configBottom, &QSlider::valueChanged, this, [=](const int &val) {
this->plotFloor = val;
this->wfFloor = val;
this->setRange(plotFloor,plotCeiling);
emit updateSettings(sub,currentTheme,wfLength,plotFloor,plotCeiling);
emit updateSettings(vfo,currentTheme,wfLength,plotFloor,plotCeiling);
});
connect(configTop, &QSlider::valueChanged, this, [=](const int &val) {
this->plotCeiling = val;
this->wfCeiling = val;
this->setRange(plotFloor,plotCeiling);
emit updateSettings(sub,currentTheme,wfLength,plotFloor,plotCeiling);
emit updateSettings(vfo,currentTheme,wfLength,plotFloor,plotCeiling);
});
connect(configRef, &QSlider::valueChanged, this, [=](const int &val) {
currentRef = (val/5) * 5; // rounded to "nearest 5"
queue->add(priorityImmediate,queueItem(sub?funcScopeSubRef:funcScopeMainRef,QVariant::fromValue(currentRef),false,this->sub));
queue->add(priorityImmediate,queueItem(vfo?funcScopeSubRef:funcScopeMainRef,QVariant::fromValue(currentRef),false,this->vfo));
});
connect(configSpeed, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](const int &val) {
queue->add(priorityImmediate,queueItem(sub?funcScopeSubSpeed:funcScopeMainSpeed,configSpeed->itemData(val),false,this->sub));
queue->add(priorityImmediate,queueItem(vfo?funcScopeSubSpeed:funcScopeMainSpeed,configSpeed->itemData(val),false,this->vfo));
});
connect(configTheme, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=](const int &val) {
Q_UNUSED(val)
currentTheme = configTheme->currentData().value<QCPColorGradient::GradientPreset>();
colorMap->setGradient(currentTheme);
emit updateSettings(sub,currentTheme,wfLength,plotFloor,plotCeiling);
emit updateSettings(vfo,currentTheme,wfLength,plotFloor,plotCeiling);
});
connect(configPbtInner, &QSlider::valueChanged, this, [=](const int &val) {
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(val),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(val),false,vfo));
});
connect(configPbtOuter, &QSlider::valueChanged, this, [=](const int &val) {
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(val),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(val),false,vfo));
});
connect(configIfShift, &QSlider::valueChanged, this, [=](const int &val) {
queue->add(priorityImmediate,queueItem(funcIFShift,QVariant::fromValue<ushort>(val),false,sub));
queue->add(priorityImmediate,queueItem(funcIFShift,QVariant::fromValue<ushort>(val),false,vfo));
});
connect(configFilterWidth, &QSlider::valueChanged, this, [=](const int &val) {
queue->add(priorityImmediate,queueItem(funcFilterWidth,QVariant::fromValue<ushort>(val),false,sub));
queue->add(priorityImmediate,queueItem(funcFilterWidth,QVariant::fromValue<ushort>(val),false,vfo));
});
configGroup->setVisible(false);
@ -507,7 +507,7 @@ void spectrumScope::colorPreset(colorPrefsType *cp)
}
bool spectrumScope::update(scopeData data)
bool spectrumScope::updateScope(scopeData data)
{
if (!scopePrepared )
{
@ -532,7 +532,7 @@ bool spectrumScope::update(scopeData data)
preparePlasma();
}
// Inform other threads (cluster) that the frequency range has changed.
emit frequencyRange(sub, data.startFreq, data.endFreq);
emit frequencyRange(vfo, data.startFreq, data.endFreq);
}
lowerFreq = data.startFreq;
@ -757,7 +757,7 @@ bool spectrumScope::update(scopeData data)
oorIndicator->setVisible(false);
}
emit elapsedTime(sub, elapsed.elapsed());
emit elapsedTime(vfo, elapsed.elapsed());
return true;
}
@ -901,14 +901,14 @@ void spectrumScope::updatedScopeMode(int index)
//spectrumMode_t s = static_cast<spectrumMode_t>(scopeModeCombo->itemData(index).toInt());
spectrumMode_t s = scopeModeCombo->itemData(index).value<spectrumMode_t>();
queue->add(priorityImmediate,queueItem((sub?funcScopeSubMode:funcScopeMainMode),QVariant::fromValue(s),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcScopeSubMode:funcScopeMainMode),QVariant::fromValue(s),false,vfo));
showHideControls(s);
}
void spectrumScope::updatedSpan(int index)
{
queue->add(priorityImmediate,queueItem((sub?funcScopeSubSpan:funcScopeMainSpan),spanCombo->itemData(index),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcScopeSubSpan:funcScopeMainSpan),spanCombo->itemData(index),false,vfo));
}
void spectrumScope::updatedMode(int index)
@ -916,15 +916,22 @@ void spectrumScope::updatedMode(int index)
Q_UNUSED(index) // We don't know where it came from!
modeInfo mi = modeCombo->currentData().value<modeInfo>();
mi.filter = filterCombo->currentData().toInt();
mi.data = dataCombo->currentIndex();
queue->add(priorityImmediate,queueItem((sub?funcUnselectedMode:funcSelectedMode),QVariant::fromValue(mi),false,sub));
if (mi.mk == modeCW || mi.mk == modeCW_R || mi.mk == modeRTTY || mi.mk == modeRTTY_R || mi.mk == modePSK || mi.mk == modePSK_R)
{
mi.data = 0;
dataCombo->setEnabled(false);
} else {
mi.data = dataCombo->currentIndex();
dataCombo->setEnabled(true);
}
queue->add(priorityImmediate,queueItem((vfo?funcUnselectedMode:funcSelectedMode),QVariant::fromValue(mi),false,vfo));
}
void spectrumScope::updatedEdge(int index)
{
queue->add(priorityImmediate,queueItem((sub?funcScopeSubEdge:funcScopeMainEdge),QVariant::fromValue<uchar>(index+1),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcScopeSubEdge:funcScopeMainEdge),QVariant::fromValue<uchar>(index+1),false,vfo));
}
void spectrumScope::toFixedPressed()
@ -946,8 +953,8 @@ void spectrumScope::toFixedPressed()
edgeCombo->blockSignals(true);
edgeCombo->setCurrentIndex(edge-1);
edgeCombo->blockSignals(false);
queue->add(priorityImmediate,queueItem(funcScopeFixedEdgeFreq,QVariant::fromValue(spectrumBounds(lowerFreq, upperFreq, edge)),false,sub));
queue->add(priorityImmediate,queueItem((sub?funcScopeSubMode:funcScopeMainMode),QVariant::fromValue<uchar>(spectrumMode_t::spectModeFixed),false,sub));
queue->add(priorityImmediate,queueItem(funcScopeFixedEdgeFreq,QVariant::fromValue(spectrumBounds(lowerFreq, upperFreq, edge)),false,vfo));
queue->add(priorityImmediate,queueItem((vfo?funcScopeSubMode:funcScopeMainMode),QVariant::fromValue<uchar>(spectrumMode_t::spectModeFixed),false,vfo));
}
}
}
@ -1015,7 +1022,7 @@ void spectrumScope::doubleClick(QMouseEvent *me)
freqGo.Hz = roundFrequency(freqGo.Hz, stepSize);
freqGo.MHzDouble = (float)freqGo.Hz / 1E6;
setFrequency(freqGo);
queue->add(priorityImmediate,queueItem((sub?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(freqGo),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(freqGo),false,vfo));
}
}
@ -1027,8 +1034,8 @@ void spectrumScope::doubleClick(QMouseEvent *me)
{
double pbFreq = (pbtDefault / passbandWidth) * 127.0;
qint16 newFreq = pbFreq + 128;
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(newFreq),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTOuter,QVariant::fromValue<ushort>(newFreq),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(newFreq),false,vfo));
queue->add(priorityImmediate,queueItem(funcPBTOuter,QVariant::fromValue<ushort>(newFreq),false,vfo));
}
}
}
@ -1064,7 +1071,7 @@ void spectrumScope::scopeClick(QMouseEvent* me)
freqGo.Hz = (spot.value()->frequency) * 1E6;
freqGo.MHzDouble = spot.value()->frequency;
setFrequency(freqGo);
queue->add(priorityImmediate,queueItem((sub?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(freqGo),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(freqGo),false,vfo));
}
}
else if (passbandAction == passbandStatic && rectItem != nullptr)
@ -1199,7 +1206,7 @@ void spectrumScope::scopeMouseMove(QMouseEvent* me)
else {
pb = passbandIndicator->bottomRight->coords().x() - spectrum->xAxis->pixelToCoord(cursor);
}
queue->add(priorityImmediate,queueItem(funcFilterWidth,QVariant::fromValue<ushort>(pb * 1000000),false,sub));
queue->add(priorityImmediate,queueItem(funcFilterWidth,QVariant::fromValue<ushort>(pb * 1000000),false,vfo));
//qInfo() << "New passband" << uint(pb * 1000000);
lastFreq = movedFrequency;
@ -1222,8 +1229,8 @@ void spectrumScope::scopeMouseMove(QMouseEvent* me)
if (newInFreq >= 0 && newInFreq <= 255 && newOutFreq >= 0 && newOutFreq <= 255) {
qDebug() << QString("Moving passband by %1 Hz (Inner %2) (Outer %3) Mode:%4").arg((qint16)(movedFrequency * 1000000))
.arg(newInFreq).arg(newOutFreq).arg(mode.mk);
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(newInFreq),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTOuter,QVariant::fromValue<ushort>(newOutFreq),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(newInFreq),false,vfo));
queue->add(priorityImmediate,queueItem(funcPBTOuter,QVariant::fromValue<ushort>(newOutFreq),false,vfo));
}
lastFreq = movedFrequency;
}
@ -1234,7 +1241,7 @@ void spectrumScope::scopeMouseMove(QMouseEvent* me)
double pbFreq = ((double)(PBTInner + movedFrequency) / passbandWidth) * 127.0;
qint16 newFreq = pbFreq + 128;
if (newFreq >= 0 && newFreq <= 255) {
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(newFreq),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTInner,QVariant::fromValue<ushort>(newFreq),false,vfo));
}
lastFreq = movedFrequency;
}
@ -1245,7 +1252,7 @@ void spectrumScope::scopeMouseMove(QMouseEvent* me)
double pbFreq = ((double)(PBTOuter + movedFrequency) / passbandWidth) * 127.0;
qint16 newFreq = pbFreq + 128;
if (newFreq >= 0 && newFreq <= 255) {
queue->add(priorityImmediate,queueItem(funcPBTOuter,QVariant::fromValue<ushort>(newFreq),false,sub));
queue->add(priorityImmediate,queueItem(funcPBTOuter,QVariant::fromValue<ushort>(newFreq),false,vfo));
}
lastFreq = movedFrequency;
}
@ -1261,7 +1268,7 @@ void spectrumScope::scopeMouseMove(QMouseEvent* me)
freqGo.Hz = roundFrequency(freqGo.Hz, stepSize);
freqGo.MHzDouble = (float)freqGo.Hz / 1E6;
setFrequency(freqGo);
queue->add(priorityImmediate,queueItem((sub?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(freqGo),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(freqGo),false,vfo));
}
}
else {
@ -1335,7 +1342,7 @@ void spectrumScope::scroll(QWheelEvent *we)
freq = f; // Do we need to do this?
setFrequency(f);
queue->add(priorityImmediate,queueItem((sub?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(f),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(f),false,vfo));
//qInfo() << "Moving to freq:" << f.Hz << "step" << stepsHz;
scrollWheelOffsetAccumulated = 0;
}
@ -1350,7 +1357,7 @@ void spectrumScope::receiveMode(modeInfo m)
{
qInfo(logSystem()) << __func__ << QString("Received new mode for %0: %1 (%2) filter:%3 data:%4")
.arg((sub?"Sub":"Main")).arg(QString::number(m.mk,16)).arg(m.name).arg(m.filter).arg(m.data) ;
.arg((vfo?"Sub":"Main")).arg(QString::number(m.mk,16)).arg(m.name).arg(m.filter).arg(m.data) ;
if (mode.mk != m.mk) {
for (int i=0;i<modeCombo->count();i++)
@ -1381,6 +1388,13 @@ void spectrumScope::receiveMode(modeInfo m)
dataCombo->blockSignals(false);
}
if (m.mk == modeCW || m.mk == modeCW_R || m.mk == modeRTTY || m.mk == modeRTTY_R || m.mk == modePSK || m.mk == modePSK_R)
{
dataCombo->setEnabled(false);
} else {
dataCombo->setEnabled(true);
}
if (m.mk != mode.mk) {
// We have changed mode so "may" need to change regular commands
@ -1394,13 +1408,13 @@ void spectrumScope::receiveMode(modeInfo m)
// If new mode doesn't allow bandwidth control, disable filterwidth and pbt.
if (m.bwMin > 0 && m.bwMax > 0) {
queue->addUnique(priorityHigh,funcPBTInner,true,sub);
queue->addUnique(priorityHigh,funcPBTOuter,true,sub);
queue->addUnique(priorityHigh,funcFilterWidth,true,sub);
queue->addUnique(priorityHigh,funcPBTInner,true,vfo);
queue->addUnique(priorityHigh,funcPBTOuter,true,vfo);
queue->addUnique(priorityHigh,funcFilterWidth,true,vfo);
} else{
queue->del(funcPBTInner,sub);
queue->del(funcPBTOuter,sub);
queue->del(funcFilterWidth,sub);
queue->del(funcPBTInner,vfo);
queue->del(funcPBTOuter,vfo);
queue->del(funcFilterWidth,vfo);
}
switch (m.mk) {
@ -1412,15 +1426,15 @@ void spectrumScope::receiveMode(modeInfo m)
case modePSK:
case modePSK_R:
case modeAM:
queue->del(funcCwPitch,sub);
queue->del(funcDashRatio,sub);
queue->del(funcKeySpeed,sub);
queue->del(funcCwPitch,vfo);
queue->del(funcDashRatio,vfo);
queue->del(funcKeySpeed,vfo);
break;
case modeCW:
case modeCW_R:
queue->addUnique(priorityLow,funcCwPitch,true,sub);
queue->addUnique(priorityLow,funcDashRatio,true,sub);
queue->addUnique(priorityLow,funcKeySpeed,true,sub);
queue->addUnique(priorityLow,funcCwPitch,true,vfo);
queue->addUnique(priorityLow,funcDashRatio,true,vfo);
queue->addUnique(priorityLow,funcKeySpeed,true,vfo);
break;
default:
// FM and digital modes are fixed width, not sure about any other modes?
@ -1431,9 +1445,9 @@ void spectrumScope::receiveMode(modeInfo m)
else
passbandWidth = 0.007;
break;
queue->del(funcCwPitch,sub);
queue->del(funcDashRatio,sub);
queue->del(funcKeySpeed,sub);
queue->del(funcCwPitch,vfo);
queue->del(funcDashRatio,vfo);
queue->del(funcKeySpeed,vfo);
break;
}
@ -1474,7 +1488,7 @@ void spectrumScope::receiveCwPitch(uchar pitch)
if (p != cwPitch)
{
passbandCenterFrequency = p / 2000000.0;
qInfo(logSystem()) << QString("%0 Received new CW Pitch %1 Hz was %2 (center freq %3 MHz)").arg((sub?"Sub":"Main")).arg(p).arg(cwPitch).arg(passbandCenterFrequency);
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;
}
}
@ -1486,8 +1500,8 @@ void spectrumScope::receivePassband(quint16 pass)
if (passbandWidth != pb) {
passbandWidth = pb;
//trxadj->updatePassband(pass);
qInfo(logSystem()) << QString("%0 Received new IF Filter/Passband %1 Hz").arg(sub?"Sub":"Main").arg(pass);
emit showStatusBarText(QString("%0 IF filter width %1 Hz (%2 MHz)").arg(sub?"Sub":"Main").arg(pass).arg(passbandWidth));
qInfo(logSystem()) << QString("%0 Received new IF Filter/Passband %1 Hz").arg(vfo?"Sub":"Main").arg(pass);
emit showStatusBarText(QString("%0 IF filter width %1 Hz (%2 MHz)").arg(vfo?"Sub":"Main").arg(pass).arg(passbandWidth));
}
}
@ -1502,7 +1516,7 @@ void spectrumScope::selected(bool en)
void spectrumScope::holdPressed(bool en)
{
queue->add(priorityImmediate,queueItem(sub?funcScopeSubHold:funcScopeMainHold,QVariant::fromValue(en),false,sub));
queue->add(priorityImmediate,queueItem(vfo?funcScopeSubHold:funcScopeMainHold,QVariant::fromValue(en),false,vfo));
}
void spectrumScope::setHold(bool h)
@ -1519,8 +1533,11 @@ void spectrumScope::setSpeed(uchar s)
}
void spectrumScope::receiveSpots(QList<spotData> spots)
void spectrumScope::receiveSpots(uchar vfo, QList<spotData> spots)
{
if (vfo != this->vfo) {
return;
}
//QElapsedTimer timer;
//timer.start();
bool current = false;
@ -1606,7 +1623,6 @@ void spectrumScope::receiveSpots(QList<spotData> spots)
}
//qDebug(logCluster()) << "Processing took" << timer.nsecsElapsed() / 1000 << "us";
}
void spectrumScope::configPressed()
@ -1672,7 +1688,7 @@ void spectrumScope::newFrequency(qint64 freq)
f.MHzDouble = f.Hz / (double)1E6;
if (f.Hz > 0)
{
queue->add(priorityImmediate,queueItem((sub?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(f),false,sub));
queue->add(priorityImmediate,queueItem((vfo?funcUnselectedFreq:funcSelectedFreq),QVariant::fromValue<freqt>(f),false,vfo));
}
}
@ -1690,20 +1706,20 @@ void spectrumScope::detachScope(bool state)
{
if (state)
{
windowLabel = new QLabel("Detached to window");
windowLabel = new QLabel();
detachButton->setText("Attach");
qInfo(logGui()) << "Detaching scope" << (sub?"Sub":"Main");
qInfo(logGui()) << "Detaching scope" << (vfo?"Sub":"Main");
this->parentWidget()->layout()->replaceWidget(this,windowLabel);
this->setParent(NULL);
this-> setWindowFlags(Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint);
this->move(screen()->geometry().center() - frameGeometry().center());
this->repaint();
} else {
detachButton->setText("Detach");
qInfo(logGui()) << "Attaching scope" << (sub?"Sub":"Main");
qInfo(logGui()) << "Attaching scope" << (vfo?"Sub":"Main");
windowLabel->parentWidget()->layout()->replaceWidget(windowLabel,this);
windowLabel->setParent(NULL);
delete windowLabel;
this->repaint();
}
// Force a redraw?
this->show();
}

Wyświetl plik

@ -34,7 +34,7 @@ public:
bool prepareWf(uint wfLength);
void prepareScope(uint ampMap, uint spectWidth);
bool update(scopeData spectrum);
bool updateScope(scopeData spectrum);
void preparePlasma();
void setRange(int floor, int ceiling);
void wfInterpolate(bool en) { colorMap->setInterpolate(en); }
@ -51,8 +51,8 @@ public:
void setPassbandWidth(double hz) { passbandWidth = hz;}
double getPassbandWidth() { configFilterWidth->setValue(passbandWidth*1E6); return passbandWidth;}
void setIdentity(QString name, bool s) {this->setTitle(name), sub = s;}
bool getSub() { return sub;}
void setIdentity(QString name, uchar v) {this->setTitle(name), vfo = v;}
bool getVfo() { return vfo;}
void setTuningFloorZeros(bool tf) {this->tuningFloorZeros = tf;}
void setClickDragTuning(bool cg) { this->clickDragTuning = cg;}
@ -77,7 +77,7 @@ public:
void setFrequency (freqt f);
void receiveMode (modeInfo m);
modeInfo currentMode() {return mode;};
void clearSpans() { spanCombo->clear();}
void clearMode() { modeCombo->clear();}
void clearData() { dataCombo->clear();}
@ -100,15 +100,15 @@ public:
public slots: // Can be called directly or updated via signal/slot
void selectScopeMode(spectrumMode_t m);
void selectSpan(centerSpanData s);
void receiveSpots(QList<spotData> spots);
void receiveSpots(uchar vfo, QList<spotData> spots);
signals:
void frequencyRange(bool sub, double start, double end);
void frequencyRange(uchar vfo, double start, double end);
void updateScopeMode(spectrumMode_t index);
void updateSpan(centerSpanData s);
void showStatusBarText(QString text);
void updateSettings(bool sub, int value, quint16 len, int floor, int ceiling);
void elapsedTime(bool sub, qint64 ns);
void updateSettings(uchar vfo, int value, quint16 len, int floor, int ceiling);
void elapsedTime(uchar vfo, qint64 ns);
void dataChanged(modeInfo m);
private slots:
@ -261,7 +261,7 @@ private:
QVector <QByteArray> wfimage;
cachingQueue* queue;
bool sub=false;
uchar vfo=0;
double startFrequency;
QMap<QString, spotData*> clusterSpots;

Wyświetl plik

@ -137,7 +137,7 @@ tciServer::~tciServer()
server->close();
auto it = clients.begin();
if (it != clients.end())
while (it != clients.end())
{
it.key()->deleteLater();
it = clients.erase(it);
@ -228,7 +228,8 @@ void tciServer::processIncomingTextMessage(QString message)
else if (cmd == "trx" ) {
if (arg.size() == 1) {
it.value().rxaudio=false;
reply = QString("trx:%0,%1;").arg(QString::number(sub)).arg(queue->getCache(funcTransceiverStatus).value.value<bool>()?"true":"false");
reply = QString("trx:%0,%1;").arg(
QString::number(sub),queue->getCache(funcTransceiverStatus).value.value<bool>()?"true":"false");
}
else if (arg.size() > 1) {
bool on = arg[1]=="true"?true:false;
@ -238,7 +239,7 @@ void tciServer::processIncomingTextMessage(QString message)
else if (cmd == "vfo")
{
if (arg.size() == 2) {
reply = QString("%0:%1,%2,%3;").arg(cmd).arg(arg[0]).arg(arg[1])
reply = QString("%0:%1,%2,%3;").arg(cmd,arg[0],arg[1])
.arg(queue->getCache(sub?funcUnselectedFreq:funcSelectedFreq,sub).value.value<freqt>().Hz);
}
else if (arg.size() == 3) {
@ -252,13 +253,13 @@ void tciServer::processIncomingTextMessage(QString message)
else if (cmd == "modulation")
{
if (arg.size() == 1) {
reply = QString("modulation:%0,%1;").arg(QString::number(sub))
.arg(queue->getCache(sub?funcUnselectedMode:funcSelectedMode,sub).value.value<modeInfo>().name.toLower());
reply = QString("modulation:%0,%1;").arg(
QString::number(sub),queue->getCache(sub?funcUnselectedMode:funcSelectedMode,sub).value.value<modeInfo>().name.toLower());
}
else if (arg.size() == 2) {
qInfo() << "Mode (TODO)" << arg[1];
reply = QString("modulation:%0,%1;").arg(QString::number(sub))
.arg(queue->getCache(sub?funcUnselectedMode:funcSelectedMode,sub).value.value<modeInfo>().name.toLower());
reply = QString("modulation:%0,%1;").arg(
QString::number(sub),queue->getCache(sub?funcUnselectedMode:funcSelectedMode,sub).value.value<modeInfo>().name.toLower());
/*
freqt f;
f.Hz = arg[2].toUInt();
@ -357,15 +358,15 @@ void tciServer::receiveCache(cacheItem item)
case funcFreqTR:
case funcSelectedFreq:
case funcUnselectedFreq:
reply = QString("vfo:0,%0,%1;").arg(QString::number(item.sub)).arg(item.value.value<freqt>().Hz);
reply = QString("vfo:0,%0,%1;").arg(QString::number(item.vfo),item.value.value<freqt>().Hz);
break;
case funcModeTR:
case funcSelectedMode:
case funcUnselectedMode:
reply = QString("modulation:%0,%1;").arg(QString::number(item.sub)).arg(item.value.value<modeInfo>().name.toLower());
reply = QString("modulation:%0,%1;").arg(QString::number(item.vfo),item.value.value<modeInfo>().name.toLower());
break;
case funcTransceiverStatus:
reply = QString("trx:%0,%1;").arg(QString::number(item.sub)).arg(item.value.value<bool>()?"true":"false");
reply = QString("trx:%0,%1;").arg(QString::number(item.vfo),item.value.value<bool>()?"true":"false");
break;
default:
break;

Plik diff jest za duży Load Diff

Wyświetl plik

@ -329,7 +329,7 @@ private slots:
void extChangedUdpPref(prefUDPItem i);
void extChangedServerPref(prefServerItem i);
void receiveScopeSettings(bool sub, int theme, quint16 len, int floor, int ceiling);
void receiveScopeSettings(uchar vfo, int theme, quint16 len, int floor, int ceiling);
void receiveValue(cacheItem val);
void setAudioDevicesUI();
void shortcutF1();
@ -381,8 +381,6 @@ private slots:
//void receiveDuplexMode(duplexMode_t dm);
void receivePassband(quint16 pass);
void receiveCwPitch(unsigned char pitch);
void receivePBTInner(unsigned char level);
void receivePBTOuter(unsigned char level);
void receiveVox(bool en);
void receiveMonitor(bool en);
void receiveComp(bool en);
@ -498,7 +496,8 @@ private slots:
void receiveElapsed(bool sub, qint64 us);
private:
Ui::wfmain *ui;
Ui::wfmain *ui; // Main UI
QList<spectrumScope*>vfos; // Spectrum Scope/VFO item.
void closeEvent(QCloseEvent *event);
QString logFilename;
bool debugMode;
@ -521,7 +520,6 @@ private:
QCPItemText* ovfIndicator;
void setAppTheme(bool isCustom);
void showHideSpectrum(bool show);
void getInitialRigState();
void showButton(QPushButton *btn);
void hideButton(QPushButton *btn);
@ -600,7 +598,7 @@ private:
void setupKeyShortcuts();
void setupMainUI();
void setUIToPrefs();
void configureVFOs();
void setSerialDevicesUI();
void setServerToPrefs();
void setupUsbControllerDevice();
@ -809,6 +807,7 @@ private:
audioDevices* audioDev = Q_NULLPTR;
QImage lcdImage;
connectionStatus_t connStatus = connDisconnected;
};
Q_DECLARE_METATYPE(udpPreferences)

Wyświetl plik

@ -49,36 +49,10 @@
<number>3</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="vfoLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<widget class="spectrumScope" name="mainScope" native="true"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<widget class="spectrumScope" name="subScope" native="true"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
@ -1282,12 +1256,6 @@
<header>meter.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>spectrumScope</class>
<extends>QWidget</extends>
<header>spectrumscope.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

Wyświetl plik

@ -15,7 +15,7 @@ DEFINES += USB_CONTROLLER
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport websockets
contains(DEFINES,USB_CONTROLLER){
lessThan(QT_MAJOR_VERSION, 6): QT += gamepad
lessThan(QT_MAJOR_VERSION, 6): QT += gamepad
}
TARGET = wfview