kopia lustrzana https://gitlab.com/eliggett/wfview
Add warning for FA received and slim some info logging
rodzic
7c3dd56baa
commit
b6496b1eea
|
@ -21,7 +21,7 @@ cachingQueue *cachingQueue::getInstance(QObject* parent)
|
||||||
connect (instance, SIGNAL(finished()),instance, SLOT(deleteLater()));
|
connect (instance, SIGNAL(finished()),instance, SLOT(deleteLater()));
|
||||||
instance->start(QThread::HighPriority);
|
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;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ void cachingQueue::add(queuePriority prio ,queueItem item)
|
||||||
queueItem it=item;
|
queueItem it=item;
|
||||||
it.recurring=false;
|
it.recurring=false;
|
||||||
queue.insert(queue.cend(),priorityHighest, it);
|
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);
|
queue.insert(prio, item);
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ void cachingQueue::addUnique(queuePriority prio ,queueItem item)
|
||||||
while (it != queue.end()) {
|
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())
|
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);
|
it = queue.erase(it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -172,7 +172,7 @@ void cachingQueue::addUnique(queuePriority prio ,queueItem item)
|
||||||
queueItem it = item;
|
queueItem it = item;
|
||||||
it.recurring=false;
|
it.recurring=false;
|
||||||
queue.insert(queue.cend(),priorityHighest, it);
|
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);
|
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";
|
qInfo() << "recurring command" << funcString[func] << "vfo" << vfo << "not found in queue";
|
||||||
while (it != queue.end()) {
|
while (it != queue.end()) {
|
||||||
if (it.value().command == func && it.value().vfo == vfo) {
|
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);
|
it = queue.erase(it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
18
printhex.h
18
printhex.h
|
@ -5,6 +5,24 @@
|
||||||
|
|
||||||
#include "logcategories.h"
|
#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 inline getHex(const QByteArray &pdata)
|
||||||
{
|
{
|
||||||
QString head = "---- Begin hex dump -----:\n";
|
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: ";
|
qDebug(logRigTraffic()) << "Final payload in rig commander to be sent to rig: ";
|
||||||
printHexNow(data, logRigTraffic());
|
printHexNow(data, logRigTraffic());
|
||||||
}
|
}
|
||||||
|
lastCommandToRig = data;
|
||||||
emit dataForComm(data);
|
emit dataForComm(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1185,9 +1186,15 @@ void rigCommander::parseCommand()
|
||||||
case funcFB:
|
case funcFB:
|
||||||
break;
|
break;
|
||||||
case funcFA:
|
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;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
qWarning(logRig()) << "Unhandled command received from rig" << payloadIn.toHex().mid(0,10) << "Contact support!";
|
qWarning(logRig()) << "Unhandled command received from rig" << payloadIn.toHex().mid(0,10) << "Contact support!";
|
||||||
break;
|
break;
|
||||||
|
@ -1424,7 +1431,7 @@ void rigCommander::determineRigCaps()
|
||||||
for (int c = 0; c < numAttenuators; c++)
|
for (int c = 0; c < numAttenuators; c++)
|
||||||
{
|
{
|
||||||
settings->setArrayIndex(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());
|
rigCaps.attenuators.push_back((unsigned char)settings->value("dB", 0).toString().toUInt());
|
||||||
}
|
}
|
||||||
settings->endArray();
|
settings->endArray();
|
||||||
|
@ -1460,7 +1467,7 @@ void rigCommander::determineRigCaps()
|
||||||
|
|
||||||
rigCaps.bands.push_back(bandType(band,bsr,start,end,range,memGroup));
|
rigCaps.bands.push_back(bandType(band,bsr,start,end,range,memGroup));
|
||||||
rigCaps.bsr[band] = bsr;
|
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();
|
settings->endArray();
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,6 +221,8 @@ private:
|
||||||
QString rigSerialPort;
|
QString rigSerialPort;
|
||||||
quint32 rigBaudRate;
|
quint32 rigBaudRate;
|
||||||
|
|
||||||
|
QByteArray lastCommandToRig;
|
||||||
|
|
||||||
QString ip;
|
QString ip;
|
||||||
int cport;
|
int cport;
|
||||||
int sport;
|
int sport;
|
||||||
|
|
|
@ -1477,11 +1477,11 @@ void spectrumScope::receiveCwPitch(uchar pitch)
|
||||||
{
|
{
|
||||||
if (mode.mk == modeCW || mode.mk == modeCW_R) {
|
if (mode.mk == modeCW || mode.mk == modeCW_R) {
|
||||||
quint16 p = round((((600.0 / 255.0) * pitch) + 300) / 5.0) * 5.0;
|
quint16 p = round((((600.0 / 255.0) * pitch) + 300) / 5.0) * 5.0;
|
||||||
if (p != cwPitch)
|
if (p != this->cwPitch)
|
||||||
{
|
{
|
||||||
passbandCenterFrequency = p / 2000000.0;
|
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);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -459,7 +459,7 @@ void udpHandler::dataReceived()
|
||||||
if (in->busy && in->computer[0] != '\x0')
|
if (in->busy && in->computer[0] != '\x0')
|
||||||
admin = true;
|
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());
|
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();
|
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
|
||||||
#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;
|
struct hid_device_info* devs;
|
||||||
devs = hid_enumerate(0x0, 0x0);
|
devs = hid_enumerate(0x0, 0x0);
|
||||||
while (devs) {
|
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->vendor_id, 4, 16, QChar('0'))
|
||||||
.arg(devs->product_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))
|
.arg(QString::fromWCharArray(devs->product_string),QString::fromWCharArray(devs->product_string),QString::fromWCharArray(devs->manufacturer_string))
|
||||||
|
|
Ładowanie…
Reference in New Issue