kopia lustrzana https://gitlab.com/eliggett/wfview
Porównaj commity
5 Commity
37839556bd
...
8b60a48a56
Autor | SHA1 | Data |
---|---|---|
Elliott Liggett | 8b60a48a56 | |
Elliott Liggett | 603f87a99f | |
Phil Taylor | 7e3f4a8ac2 | |
Elliott Liggett | 4e8819becb | |
Elliott Liggett | d182d59f59 |
|
@ -360,6 +360,9 @@ bool cachingQueue::compare(QVariant a, QVariant b)
|
|||
} else if (!strcmp(a.typeName(),"duplexMode_t")) {
|
||||
if (a.value<duplexMode_t>() != b.value<duplexMode_t>())
|
||||
changed=true;
|
||||
} else if (!strcmp(a.typeName(),"toneInfo")) {
|
||||
if (a.value<toneInfo>().tone != b.value<toneInfo>().tone)
|
||||
changed=true;
|
||||
} else if (!strcmp(a.typeName(),"spectrumMode_t")) {
|
||||
if (a.value<spectrumMode_t>() != b.value<spectrumMode_t>())
|
||||
changed=true;
|
||||
|
|
|
@ -64,7 +64,7 @@ void loggingWindow::acceptLogText(QPair<QtMsgType,QString> text)
|
|||
QString colour = "white";
|
||||
if (text.first == QtDebugMsg)
|
||||
{
|
||||
colour = "grey";
|
||||
colour = "#ffbc11"; // orange
|
||||
} else if (text.first == QtWarningMsg)
|
||||
{
|
||||
colour = "yellow";
|
||||
|
|
|
@ -31,16 +31,27 @@ void repeaterSetup::setRig(rigCapabilities inRig)
|
|||
{
|
||||
this->rig = inRig;
|
||||
haveRig = true;
|
||||
if(rig.commands.contains(funcRepeaterTone)) {
|
||||
ui->rptToneCombo->setDisabled(false);
|
||||
ui->toneTone->setDisabled(false);
|
||||
} else {
|
||||
ui->rptToneCombo->setDisabled(true);
|
||||
ui->toneTone->setDisabled(true);
|
||||
}
|
||||
|
||||
if(rig.commands.contains(funcRepeaterTSQL)) {
|
||||
ui->toneTSQL->setDisabled(false);
|
||||
} else {
|
||||
ui->toneTSQL->setDisabled(true);
|
||||
}
|
||||
|
||||
if(rig.commands.contains(funcToneSquelchType))
|
||||
{
|
||||
ui->rptToneCombo->setDisabled(false);
|
||||
ui->toneTone->setDisabled(false);
|
||||
ui->toneTSQL->setDisabled(false);
|
||||
} else {
|
||||
ui->rptToneCombo->setDisabled(true);
|
||||
ui->toneTone->setDisabled(true);
|
||||
ui->toneTSQL->setDisabled(true);
|
||||
}
|
||||
|
||||
if(rig.commands.contains(funcRepeaterDTCS))
|
||||
{
|
||||
ui->rptDTCSCombo->setDisabled(false);
|
||||
|
@ -357,6 +368,7 @@ void repeaterSetup::handleRptAccessMode(rptAccessTxRx_t tmode)
|
|||
|
||||
void repeaterSetup::handleTone(quint16 tone)
|
||||
{
|
||||
qDebug(logRptr()) << "Handling incoming tone request of tone = " << tone;
|
||||
int tindex = ui->rptToneCombo->findData(tone);
|
||||
ui->rptToneCombo->setCurrentIndex(tindex);
|
||||
}
|
||||
|
@ -364,12 +376,14 @@ void repeaterSetup::handleTone(quint16 tone)
|
|||
void repeaterSetup::handleTSQL(quint16 tsql)
|
||||
{
|
||||
// TODO: Consider a second combo box for the TSQL
|
||||
qDebug(logRptr()) << "Handling incoming TSQL request of tone = " << tsql;
|
||||
int tindex = ui->rptToneCombo->findData(tsql);
|
||||
ui->rptToneCombo->setCurrentIndex(tindex);
|
||||
}
|
||||
|
||||
void repeaterSetup::handleDTCS(quint16 dcode, bool tinv, bool rinv)
|
||||
{
|
||||
qDebug(logRptr()) << "Handling incoming DTCS request of dcode = " << dcode;
|
||||
int dindex = ui->rptDTCSCombo->findData(dcode);
|
||||
ui->rptDTCSCombo->setCurrentIndex(dindex);
|
||||
ui->rptDTCSInvertTx->setChecked(tinv);
|
||||
|
@ -521,7 +535,7 @@ void repeaterSetup::on_rptToneCombo_activated(int tindex)
|
|||
emit setTone(rt);
|
||||
if(updateSub)
|
||||
{
|
||||
//rt.useSecondaryVFO = true;
|
||||
rt.useSecondaryVFO = true;
|
||||
emit setTone(rt);
|
||||
}
|
||||
|
||||
|
@ -529,7 +543,7 @@ void repeaterSetup::on_rptToneCombo_activated(int tindex)
|
|||
emit setTSQL(rt);
|
||||
if(updateSub)
|
||||
{
|
||||
//rt.useSecondaryVFO = true;
|
||||
rt.useSecondaryVFO = true;
|
||||
emit setTone(rt);
|
||||
}
|
||||
}
|
||||
|
@ -575,8 +589,8 @@ void repeaterSetup::on_toneTone_clicked()
|
|||
|
||||
if(updateSub)
|
||||
{
|
||||
//rd.useSecondaryVFO = true;
|
||||
//rt.useSecondaryVFO = true;
|
||||
rd.useSecondaryVFO = true;
|
||||
rt.useSecondaryVFO = true;
|
||||
emit setRptAccessMode(rd);
|
||||
emit setTone(rt);
|
||||
}
|
||||
|
@ -596,10 +610,10 @@ void repeaterSetup::on_toneTSQL_clicked()
|
|||
|
||||
if(updateSub)
|
||||
{
|
||||
//rd.useSecondaryVFO = true;
|
||||
//rt.useSecondaryVFO = true;
|
||||
rd.useSecondaryVFO = true;
|
||||
rt.useSecondaryVFO = true;
|
||||
emit setRptAccessMode(rd);
|
||||
emit setTone(rt);
|
||||
emit setTSQL(rt);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -822,7 +836,7 @@ void repeaterSetup::on_setToneSubVFOBtn_clicked()
|
|||
// TODO: DTCS
|
||||
toneInfo rt;
|
||||
rt.tone = (quint16)ui->rptToneCombo->currentData().toUInt();
|
||||
//rt.useSecondaryVFO = true;
|
||||
rt.useSecondaryVFO = true;
|
||||
emit setTone(rt);
|
||||
}
|
||||
|
||||
|
|
|
@ -329,10 +329,12 @@ bool rigCommander::getCommand(funcs func, QByteArray &payload, int value, uchar
|
|||
{
|
||||
if (value == INT_MIN || (value>=it.value().minVal && value <= it.value().maxVal))
|
||||
{
|
||||
/*
|
||||
if (value == INT_MIN)
|
||||
qDebug(logRig()) << QString("%0 with no value (get)").arg(funcString[func]);
|
||||
else
|
||||
qDebug(logRig()) << QString("%0 with value %1 (Range: %2-%3)").arg(funcString[func]).arg(value).arg(it.value().minVal).arg(it.value().maxVal);
|
||||
*/
|
||||
if (rigCaps.hasCommand29 && it.value().cmd29)
|
||||
{
|
||||
// This can use cmd29 so add sub/main to the command
|
||||
|
@ -350,11 +352,11 @@ bool rigCommander::getCommand(funcs func, QByteArray &payload, int value, uchar
|
|||
}
|
||||
else if (value != INT_MIN)
|
||||
{
|
||||
qInfo(logRig()) << QString("Value %0 for %1 is outside of allowed range (%2-%3)").arg(value).arg(funcString[func]).arg(it.value().minVal).arg(it.value().maxVal);
|
||||
qDebug(logRig()) << QString("Value %0 for %1 is outside of allowed range (%2-%3)").arg(value).arg(funcString[func]).arg(it.value().minVal).arg(it.value().maxVal);
|
||||
}
|
||||
} else {
|
||||
// Don't try this command again as the rig doesn't support it!
|
||||
qInfo(logRig()) << "Removing unsupported command from queue" << funcString[func] << "VFO" << vfo;
|
||||
qDebug(logRig()) << "Removing unsupported command from queue" << funcString[func] << "VFO" << vfo;
|
||||
queue->del(func,vfo);
|
||||
}
|
||||
return false;
|
||||
|
@ -511,20 +513,19 @@ toneInfo rigCommander::decodeTone(QByteArray eTone)
|
|||
// D(T)CS: 1B 01 TR 01 23 = T/R Invert bits + DCS code 123
|
||||
|
||||
toneInfo t;
|
||||
|
||||
if (eTone.length() < 5) {
|
||||
if (eTone.length() < 3) {
|
||||
return t;
|
||||
}
|
||||
|
||||
if((eTone.at(2) & 0x01) == 0x01)
|
||||
if((eTone.at(0) & 0x01) == 0x01)
|
||||
t.tinv = true;
|
||||
if((eTone.at(2) & 0x10) == 0x10)
|
||||
if((eTone.at(0) & 0x10) == 0x10)
|
||||
t.rinv = true;
|
||||
|
||||
t.tone += (eTone.at(4) & 0x0f);
|
||||
t.tone += ((eTone.at(4) & 0xf0) >> 4) * 10;
|
||||
t.tone += (eTone.at(3) & 0x0f) * 100;
|
||||
t.tone += ((eTone.at(3) & 0xf0) >> 4) * 1000;
|
||||
t.tone += (eTone.at(2) & 0x0f);
|
||||
t.tone += ((eTone.at(2) & 0xf0) >> 4) * 10;
|
||||
t.tone += (eTone.at(1) & 0x0f) * 100;
|
||||
t.tone += ((eTone.at(1) & 0xf0) >> 4) * 1000;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
@ -715,7 +716,7 @@ void rigCommander::parseCommand()
|
|||
if (rigCaps.hasCommand29 && payloadIn[0] == '\x29')
|
||||
{
|
||||
vfo = static_cast<uchar>(payloadIn[1]);
|
||||
payloadIn.remove(0,2);
|
||||
payloadIn.remove(0,2);
|
||||
}
|
||||
|
||||
// As some commands bave both single and multi-byte options, start at 4 characters and work down to 1.
|
||||
|
|
2158
rigs/IC-7610.rig
2158
rigs/IC-7610.rig
Plik diff jest za duży
Load Diff
1774
rigs/IC-9700.rig
1774
rigs/IC-9700.rig
Plik diff jest za duży
Load Diff
46
wfmain.cpp
46
wfmain.cpp
|
@ -64,6 +64,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
qRegisterMetaType<duplexMode_t>();
|
||||
qRegisterMetaType<rptAccessTxRx_t>();
|
||||
qRegisterMetaType<rptrAccessData>();
|
||||
qRegisterMetaType<toneInfo>();
|
||||
qRegisterMetaType<rigInput>();
|
||||
qRegisterMetaType<inputTypes>();
|
||||
qRegisterMetaType<meter_t>();
|
||||
|
@ -472,19 +473,34 @@ void wfmain::makeRig()
|
|||
[=](const duplexMode_t &t) { queue->add(priorityImmediate,queueItem(funcSplitStatus,QVariant::fromValue<duplexMode_t>(t),false));});
|
||||
|
||||
connect(this->rpt, &repeaterSetup::getTone, this->rig,
|
||||
[=]() { queue->add(priorityImmediate,funcRepeaterTone,false,false);});
|
||||
[=]() {
|
||||
qDebug(logSystem()) << "Asking for TONE";
|
||||
queue->add(priorityImmediate,funcRepeaterTone,false,false);});
|
||||
|
||||
connect(this->rpt, &repeaterSetup::setTone, this->rig,
|
||||
[=](const toneInfo& t) {
|
||||
qDebug(logSystem()) << "Setting TONE for VFO, useInactiveVFO= [" << t.useSecondaryVFO << "], tone=" << t.tone;
|
||||
queue->add(priorityImmediate,queueItem(funcToneFreq,QVariant::fromValue<toneInfo>(t),false, t.useSecondaryVFO));});
|
||||
|
||||
connect(this->rpt, &repeaterSetup::setTSQL, this->rig,
|
||||
[=](const toneInfo& t) { queue->add(priorityImmediate,queueItem(funcTSQLFreq,QVariant::fromValue<toneInfo>(t),false));});
|
||||
[=](const toneInfo& t) {
|
||||
qDebug(logSystem()) << "Setting TSQL for VFO, useInactiveVFO= [" << t.useSecondaryVFO << "], tone=" << t.tone;
|
||||
queue->add(priorityImmediate,queueItem(funcTSQLFreq,QVariant::fromValue<toneInfo>(t),false, t.useSecondaryVFO));});
|
||||
|
||||
connect(this->rpt, &repeaterSetup::getTSQL, this->rig,
|
||||
[=]() { queue->add(priorityImmediate,funcRepeaterTSQL,false,false);});
|
||||
[=]() {
|
||||
qDebug(logSystem()) << "Asking for TSQL";
|
||||
queue->add(priorityImmediate,funcRepeaterTSQL,false,false);});
|
||||
|
||||
connect(this->rpt, &repeaterSetup::setDTCS, this->rig,
|
||||
[=](const toneInfo& t) { queue->add(priorityImmediate,queueItem(funcRepeaterDTCS,QVariant::fromValue<toneInfo>(t),false));});
|
||||
[=](const toneInfo& t) {
|
||||
qDebug(logSystem()) << "Setting DCS, code =" << t.tone;
|
||||
queue->add(priorityImmediate,queueItem(funcRepeaterDTCS,QVariant::fromValue<toneInfo>(t),false));});
|
||||
|
||||
connect(this->rpt, &repeaterSetup::getDTCS, this->rig,
|
||||
[=]() { queue->add(priorityImmediate,funcRepeaterDTCS,false,false);});
|
||||
[=]() {
|
||||
qDebug(logSystem()) << "Asking for DCS";
|
||||
queue->add(priorityImmediate,funcRepeaterDTCS,false,false);});
|
||||
|
||||
|
||||
connect(this->rpt, &repeaterSetup::getRptAccessMode, this->rig,
|
||||
|
@ -504,8 +520,20 @@ void wfmain::makeRig()
|
|||
|
||||
connect(this->rpt, &repeaterSetup::setRptAccessMode, this->rig,
|
||||
[=](const rptrAccessData &rd) {
|
||||
if (rigCaps.commands.contains(funcToneSquelchType)) {
|
||||
queue->add(priorityImmediate,queueItem(funcToneSquelchType,QVariant::fromValue<rptrAccessData>(rd),false));
|
||||
});
|
||||
} else {
|
||||
if(rd.accessMode == ratrTN) {
|
||||
// recuring=false, vfo if rd.useSEcondaryVFO
|
||||
queue->add(priorityImmediate,queueItem(funcRepeaterTone, QVariant::fromValue<bool>(true), false, rd.useSecondaryVFO));
|
||||
} else if (rd.accessMode == ratrTT) {
|
||||
queue->add(priorityImmediate,queueItem(funcRepeaterTSQL, QVariant::fromValue<bool>(true), false, rd.useSecondaryVFO));
|
||||
} else if (rd.accessMode == ratrNN) {
|
||||
queue->add(priorityImmediate,queueItem(funcRepeaterTone, QVariant::fromValue<bool>(false), false, rd.useSecondaryVFO));
|
||||
queue->add(priorityImmediate,queueItem(funcRepeaterTSQL, QVariant::fromValue<bool>(false), false, rd.useSecondaryVFO));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
connect(this->rig, &rigCommander::haveDuplexMode, this->rpt,
|
||||
[=](const duplexMode_t &dm) {
|
||||
|
@ -5231,7 +5259,7 @@ void wfmain::setDebugLogging(bool debugModeOn)
|
|||
void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
|
||||
{
|
||||
// Open stream file writes
|
||||
|
||||
bool insaneDebugLogging = false;
|
||||
if (type == QtDebugMsg && !debugModeLogging)
|
||||
{
|
||||
return;
|
||||
|
@ -5243,6 +5271,10 @@ void wfmain::messageHandler(QtMsgType type, const QMessageLogContext& context, c
|
|||
return;
|
||||
}
|
||||
|
||||
if( (type == QtDebugMsg) && (!insaneDebugLogging) && (qstrncmp(context.category, "rigTraffic", 10)==0) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
QMutexLocker locker(&logMutex);
|
||||
QTextStream out(m_logFile.data());
|
||||
QString text;
|
||||
|
|
|
@ -148,6 +148,7 @@ struct toneInfo {
|
|||
quint16 tone=0;
|
||||
bool tinv=false;
|
||||
bool rinv=false;
|
||||
bool useSecondaryVFO = false;
|
||||
};
|
||||
|
||||
enum breakIn_t {
|
||||
|
|
Ładowanie…
Reference in New Issue