kopia lustrzana https://gitlab.com/eliggett/wfview
Fixes for setting freq/mode
rodzic
e091ed5254
commit
543b289c99
64
rigctld.cpp
64
rigctld.cpp
|
@ -180,16 +180,24 @@ void rigCtlClient::socketReadyRead()
|
||||||
else if (command[0] == "F" || command[0] == "set_freq")
|
else if (command[0] == "F" || command[0] == "set_freq")
|
||||||
{
|
{
|
||||||
setCommand = true;
|
setCommand = true;
|
||||||
if (command.length() > 1)
|
freqt freq;
|
||||||
|
bool ok=false;
|
||||||
|
double newFreq;
|
||||||
|
QString vfo = "VFOA";
|
||||||
|
if (command.length() == 2)
|
||||||
{
|
{
|
||||||
freqt freq;
|
newFreq = command[1].toDouble(&ok);
|
||||||
bool ok;
|
}
|
||||||
double newFreq = command[1].toDouble(&ok);
|
else if (command.length() == 3) // Includes VFO
|
||||||
if (ok) {
|
{
|
||||||
freq.Hz = static_cast<int>(newFreq);
|
newFreq = command[2].toDouble(&ok);
|
||||||
qDebug(logRigCtlD()) << QString("Set frequency: %1 (%2)").arg(freq.Hz).arg(command[1]);
|
vfo = command[1];
|
||||||
emit parent->setFrequency(freq);
|
}
|
||||||
}
|
|
||||||
|
if (ok) {
|
||||||
|
freq.Hz = static_cast<int>(newFreq);
|
||||||
|
qDebug(logRigCtlD()) << QString("Set frequency: %1 (%2)").arg(freq.Hz).arg(command[1]);
|
||||||
|
emit parent->setFrequency(freq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (command[0] == "1" || command[0] == "dump_caps")
|
else if (command[0] == "1" || command[0] == "dump_caps")
|
||||||
|
@ -340,23 +348,31 @@ void rigCtlClient::socketReadyRead()
|
||||||
{
|
{
|
||||||
// Set mode
|
// Set mode
|
||||||
setCommand = true;
|
setCommand = true;
|
||||||
if (command.length() > 2) {
|
int width = -1;
|
||||||
|
QString vfo = "VFOA";
|
||||||
|
QString mode = "USB";
|
||||||
|
if (command.length() == 3) {
|
||||||
|
width = command[2].toInt();
|
||||||
|
mode = command[1];
|
||||||
|
}
|
||||||
|
else if (command.length() == 4) {
|
||||||
|
width = command[3].toInt();
|
||||||
|
mode = command[2];
|
||||||
|
vfo = command[1];
|
||||||
|
}
|
||||||
|
qDebug(logRigCtlD()) << "setting mode: VFO:" << vfo << getMode(mode) << mode << "width" << width;
|
||||||
|
|
||||||
qDebug(logRigCtlD()) << "setting mode: " << getMode(command[1]) << command[1] << "width" << command[2];
|
if (width != -1 && width <= 1800)
|
||||||
int width = command[2].toInt();
|
width = 2;
|
||||||
|
else
|
||||||
|
width = 1;
|
||||||
|
|
||||||
if (width != -1 && width <= 1800)
|
emit parent->setMode(getMode(mode), width);
|
||||||
width = 2;
|
if (mode.mid(0, 3) == "PKT") {
|
||||||
else
|
emit parent->setDataMode(true, width);
|
||||||
width = 1;
|
}
|
||||||
|
else {
|
||||||
emit parent->setMode(getMode(command[1]), width);
|
emit parent->setDataMode(false, width);
|
||||||
if (command[1].mid(0, 3) == "PKT") {
|
|
||||||
emit parent->setDataMode(true, width);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
emit parent->setDataMode(false, width);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (command[0] == "s" || command[0] == "get_split_vfo")
|
else if (command[0] == "s" || command[0] == "get_split_vfo")
|
||||||
|
|
Ładowanie…
Reference in New Issue