diff --git a/commhandler.cpp b/commhandler.cpp index bb5bfdd..a1145ba 100644 --- a/commhandler.cpp +++ b/commhandler.cpp @@ -191,7 +191,7 @@ void commHandler::receiveDataIn() if (inPortData.startsWith("\xFC\xFC\xFC\xFC\xFC")) { // Collision detected by remote end, re-send previous command. - qInfo(logSerial()) << "Collision detected by remote, resending previous command"; + qInfo(logSerial()) << "COLLISION, resending:"<commitTransaction(); emit sendDataOutToPort(previousSent); return; @@ -216,7 +216,7 @@ void commHandler::receiveDataIn() { if(inPortData.contains("\xFC")) { - //qInfo(logSerial()) << "Transaction contains collision data. Dumping."; + qInfo(logSerial()) << "Transaction contains collision data. Dumping."; //printHex(inPortData, false, true); port->commitTransaction(); return; diff --git a/memories.cpp b/memories.cpp index 15238f6..79318c7 100644 --- a/memories.cpp +++ b/memories.cpp @@ -82,7 +82,11 @@ memories::memories(bool slowLoad, QWidget *parent) : ui->group->blockSignals(true); ui->group->addItem("Memory Group",-1); for (int i=rigCaps->memStart;i<=rigCaps->memGroups;i++) { - + if (i == rigCaps->memStart) { + // Disable title if any groups to stop it being selected. + auto* model = qobject_cast(ui->group->model()); + model->item(0)->setEnabled(false); + } ui->group->addItem(QString("Group %0").arg(i,2,10,QChar('0')),i); } @@ -463,14 +467,16 @@ void memories::on_group_currentIndexChanged(int index) QVector parser; - queue->add(priorityImmediate,queueItem(funcSatelliteMode,QVariant::fromValue(ui->group->currentData().toInt() == MEMORY_SATGROUP))); if (ui->group->currentData().toInt() == MEMORY_SATGROUP) { + queue->add(priorityImmediate,queueItem(funcSatelliteMode,QVariant::fromValue(ui->group->currentData().toInt() == MEMORY_SATGROUP))); queue->del(funcMainFreq,false); queue->del(funcMainMode,false); queue->del(funcSubFreq,true); queue->del(funcSubMode,true); parser = rigCaps->satParser; } else { + // If the rig has memory groups, select it now. + queue->add(priorityImmediate,queueItem(funcMemoryGroup,QVariant::fromValue(ui->group->currentData().toInt()))); queue->addUnique(priorityMedium,funcMainFreq,true,false); queue->addUnique(priorityMedium,funcMainMode,true,false); queue->addUnique(priorityMedium,funcSubFreq,true,true); @@ -992,6 +998,9 @@ void memories::receiveMemory(memoryType mem) connect(recall, &QPushButton::clicked, this, [=]() { qInfo() << "Recalling" << mem.channel; queue->add(priorityImmediate,queueItem(funcMemoryMode,QVariant::fromValue(quint32((ui->group->currentData().toUInt() << 16) | mem.channel)))); + // We also should request the current frequency/mode etc so that the UI is updated. + queue->add(priorityImmediate,funcSelectedFreq,false,0); + queue->add(priorityImmediate,funcSelectedMode,false,0); }); } diff --git a/rigcommander.cpp b/rigcommander.cpp index 6543217..39b8ae1 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -666,7 +666,7 @@ void rigCommander::parseData(QByteArray dataInput) // This is an echo of our own broadcast request. // The data are "to 00" and "from E1" // Don't use it! - qDebug(logRig()) << "Caught it! Found the echo'd broadcast request from us! Rig has not responded to broadcast query yet."; + qDebug(logRig()) << "Echo caught:" << data.toHex(' '); } else { payloadIn = data.right(data.length() - 4); // Removes FE FE E0 94 part if(payloadIn.contains("\xFE")) @@ -777,7 +777,7 @@ void rigCommander::parseCommand() case funcModeTR: { modeInfo m; - m = parseMode(payloadIn[0], m.filter,receiver); + m = parseMode(bcdHexToUChar(payloadIn[0]), m.filter,receiver); if(payloadIn.size() > 1) { @@ -794,12 +794,14 @@ void rigCommander::parseCommand() case funcUnselectedMode: case funcMainMode: { - // New format payload with mode+datamode+filter - modeInfo m = parseMode(bcdHexToUChar(payloadIn[0]), bcdHexToUChar(payloadIn[2]),receiver); - m.data = bcdHexToUChar(payloadIn[1]); - m.VFO = selVFO_t(receiver); - value.setValue(m); - //qDebug(logRig()) << "Got Mode" << m.name << "data" << m.data; + // If in an invalid mode, the radio may respond with 0xff + if (uchar(payloadIn[0]) != 0xff) { + // New format payload with mode+datamode+filter + modeInfo m = parseMode(bcdHexToUChar(payloadIn[0]), bcdHexToUChar(payloadIn[2]),receiver); + m.data = bcdHexToUChar(payloadIn[1]); + m.VFO = selVFO_t(receiver); + value.setValue(m); + } break; } @@ -2004,7 +2006,7 @@ modeInfo rigCommander::parseMode(quint8 mode, quint8 filter, uchar receiver) } if (!found) { - qInfo(logRig()) << QString("parseMode() Couldn't find a matching mode %0 with filter %1").arg(mode).arg(filter); + qInfo(logRig()) << QString("parseMode() No such mode %0 with filter %1").arg(mode).arg(filter) << payloadIn.toHex(' ') ; } // We cannot query sub VFO width without command29. @@ -2493,6 +2495,10 @@ void rigCommander::receiveCommand(funcs func, QVariant value, uchar receiver) qDebug(logRig()) << "Removing unsupported set command from queue" << funcString[func] << "VFO" << receiver; queue->del(func,receiver); return; + } if (func == funcFreqSet) { + queue->addUnique(priorityImmediate,funcFreqGet,false,receiver); + } else if (func == funcModeSet) { + queue->addUnique(priorityImmediate,funcModeGet,false,receiver); } else if (cmd.getCmd && func != funcScopeFixedEdgeFreq && func != funcSpeech && func != funcBandStackReg && func != funcMemoryContents && func != funcSendCW) { // This was a set command, so queue a get to retrieve the updated value queue->addUnique(priorityImmediate,func,false,receiver); diff --git a/rigctld.cpp b/rigctld.cpp index 3c85dae..4646056 100644 --- a/rigctld.cpp +++ b/rigctld.cpp @@ -414,7 +414,7 @@ void rigCtlClient::socketReadyRead() if (((commands_list[i].flags & ARG_IN) == ARG_IN)) { - // For debugging only REMOVE next line + // For debugging only comment next line M0VSE qInfo(logRigCtlD()) << "Received set command" << commands; setCommand=true; } @@ -789,7 +789,12 @@ int rigCtlClient::getCommand(QStringList& response, bool extended, const command func = funcMainFreq; } else if ((cmd.func == funcModeGet || cmd.func == funcModeSet) && rigCaps->commands.contains(funcMainMode)) { func = funcMainMode; - } else { + } else if ((cmd.func == funcFreqGet || cmd.func == funcFreqSet) && rigCaps->commands.contains(funcSelectedFreq)) { + func = funcSelectedFreq; + } else if ((cmd.func == funcModeGet || cmd.func == funcModeSet) && rigCaps->commands.contains(funcSelectedMode)) { + func = funcSelectedMode; + } + else { func = cmd.func; } if (((cmd.flags & ARG_IN) == ARG_IN) && params.size()) diff --git a/rigs/IC-7100.rig b/rigs/IC-7100.rig index 0b3eaa4..4f4338d 100644 --- a/rigs/IC-7100.rig +++ b/rigs/IC-7100.rig @@ -7,7 +7,7 @@ Model=IC-7100 CIVAddress=136 RigCtlDModel=3070 NumberOfReceivers=1 -NumberOfVFOs=1 +NumberOfVFOs=2 SpectrumSeqMax=0 SpectrumAmpMax=0 SpectrumLenMax=0 @@ -97,7 +97,7 @@ Commands\10\SetCommand=true Commands\11\Type=Memory Mode Commands\11\String=\\x08 Commands\11\Min=1 -Commands\11\Max=0 +Commands\11\Max=109 Commands\11\Command29=false Commands\11\GetCommand=true Commands\11\SetCommand=true @@ -111,7 +111,7 @@ Commands\12\SetCommand=true Commands\13\Type=Memory Clear Commands\13\String=\\x0b Commands\13\Min=1 -Commands\13\Max=0 +Commands\13\Max=109 Commands\13\Command29=false Commands\13\GetCommand=true Commands\13\SetCommand=true @@ -430,70 +430,98 @@ Commands\58\Max=1 Commands\58\Command29=false Commands\58\GetCommand=true Commands\58\SetCommand=true -Commands\59\Type=CIV Transceive -Commands\59\String=\\x1a\\x05\\x00\\x95 +Commands\59\Type=Data Off Mod Input +Commands\59\String=\\x1a\\x05\\x00\\x90 Commands\59\Min=0 -Commands\59\Max=1 +Commands\59\Max=3 Commands\59\Command29=false Commands\59\GetCommand=true Commands\59\SetCommand=true -Commands\60\Type=RIT Status -Commands\60\String=\\x21\\x00 +Commands\60\Type=DATA1 Mod Input +Commands\60\String=\\x1a\\x05\\x00\\x91 Commands\60\Min=0 -Commands\60\Max=0 +Commands\60\Max=3 Commands\60\Command29=false Commands\60\GetCommand=true Commands\60\SetCommand=true -Commands\61\Type=RIT Frequency -Commands\61\String=\\x21\\x01 -Commands\61\Min=-999 -Commands\61\Max=999 +Commands\61\Type=CIV Transceive +Commands\61\String=\\x1a\\x05\\x00\\x95 +Commands\61\Min=0 +Commands\61\Max=1 Commands\61\Command29=false Commands\61\GetCommand=true Commands\61\SetCommand=true -Commands\62\Type=Selected Freq -Commands\62\String=\\x25\\x00 +Commands\62\Type=Transceiver Status +Commands\62\String=\\x1c\\x00 Commands\62\Min=0 -Commands\62\Max=0 +Commands\62\Max=1 Commands\62\Command29=false Commands\62\GetCommand=true Commands\62\SetCommand=true -Commands\63\Type=Unselected Freq -Commands\63\String=\\x25\\x01 +Commands\63\Type=Tuner/ATU Status +Commands\63\String=\\x1c\\x01 Commands\63\Min=0 -Commands\63\Max=0 +Commands\63\Max=2 Commands\63\Command29=false -Commands\63\GetCommand=true -Commands\63\SetCommand=true -Commands\64\Type=Selected Mode -Commands\64\String=\\x26\\x00 +Commands\63\GetCommand=false +Commands\63\SetCommand=false +Commands\64\Type=RIT Status +Commands\64\String=\\x21\\x00 Commands\64\Min=0 Commands\64\Max=0 Commands\64\Command29=false Commands\64\GetCommand=true Commands\64\SetCommand=true -Commands\65\Type=Unselected Mode -Commands\65\String=\\x26\\x01 -Commands\65\Min=0 -Commands\65\Max=0 +Commands\65\Type=RIT Frequency +Commands\65\String=\\x21\\x01 +Commands\65\Min=-999 +Commands\65\Max=999 Commands\65\Command29=false Commands\65\GetCommand=true Commands\65\SetCommand=true -Commands\66\Type=Command Error FA -Commands\66\String=\\xfa +Commands\66\Type=Selected Freq +Commands\66\String=\\x25\\x00 Commands\66\Min=0 Commands\66\Max=0 Commands\66\Command29=false Commands\66\GetCommand=true Commands\66\SetCommand=true -Commands\67\Type=Command OK FB -Commands\67\String=\\xfb +Commands\67\Type=Unselected Freq +Commands\67\String=\\x25\\x01 Commands\67\Min=0 Commands\67\Max=0 Commands\67\Command29=false Commands\67\GetCommand=true Commands\67\SetCommand=true -Commands\size=67 +Commands\68\Type=Selected Mode +Commands\68\String=\\x26\\x00 +Commands\68\Min=0 +Commands\68\Max=0 +Commands\68\Command29=false +Commands\68\GetCommand=true +Commands\68\SetCommand=true +Commands\69\Type=Unselected Mode +Commands\69\String=\\x26\\x01 +Commands\69\Min=0 +Commands\69\Max=0 +Commands\69\Command29=false +Commands\69\GetCommand=true +Commands\69\SetCommand=true +Commands\70\Type=Command Error FA +Commands\70\String=\\xfa +Commands\70\Min=0 +Commands\70\Max=0 +Commands\70\Command29=false +Commands\70\GetCommand=true +Commands\70\SetCommand=true +Commands\71\Type=Command OK FB +Commands\71\String=\\xfb +Commands\71\Min=0 +Commands\71\Max=0 +Commands\71\Command29=false +Commands\71\GetCommand=true +Commands\71\SetCommand=true +Commands\size=71 Periodic\1\Priority=Medium Low Periodic\1\Command=Attenuator Status Periodic\1\VFO=-1 @@ -732,7 +760,7 @@ Modes\8\Min=50 Modes\8\Max=2700 Modes\8\Name=RTTY-R Modes\9\Num=12 -Modes\9\Reg=11 +Modes\9\Reg=17 Modes\9\Min=0 Modes\9\Max=0 Modes\9\Name=DV