From b7edb2cf96df76dcdfb82701c3e6f2b610f26e00 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Wed, 6 Oct 2021 23:41:11 +0100 Subject: [PATCH] Send TX/Freq changes multiple times with rigctld --- rigctld.cpp | 47 ++++++++++++++++++++++++++++++----------------- rigctld.h | 2 +- wfview.vcxproj | 8 ++++---- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/rigctld.cpp b/rigctld.cpp index fee26c3..c7a8595 100644 --- a/rigctld.cpp +++ b/rigctld.cpp @@ -55,10 +55,11 @@ rigCtlD::~rigCtlD() qInfo(logRigCtlD()) << "closing rigctld"; } -void rigCtlD::receiveFrequency(freqt freq) -{ - emit setFrequency(0, freq); -} +//void rigCtlD::receiveFrequency(freqt freq) +//{ +// emit setFrequency(0, freq); +// emit setFrequency(0, freq); +//} void rigCtlD::receiveStateInfo(rigStateStruct* state) { @@ -287,7 +288,7 @@ void rigCtlClient::socketReadyRead() freqt freq; bool ok=false; double newFreq=0.0f; - QString vfo = "VFOA"; + unsigned char vfo=0; if (command.length() == 2) { newFreq = command[1].toDouble(&ok); @@ -295,13 +296,20 @@ void rigCtlClient::socketReadyRead() else if (command.length() == 3) // Includes VFO { newFreq = command[2].toDouble(&ok); - vfo = command[1]; + if (command[1] == "VFOB") + { + vfo = 1; + } } if (ok) { freq.Hz = static_cast(newFreq); qDebug(logRigCtlD()) << QString("Set frequency: %1 (%2)").arg(freq.Hz).arg(command[1]); - emit parent->setFrequency(0, freq); + emit parent->setFrequency(vfo, freq); + emit parent->setFrequency(vfo, freq); + emit parent->setFrequency(vfo, freq); + emit parent->setFrequency(vfo, freq); + emit parent->setFrequency(vfo, freq); } } else if (command[0] == "1" || command[0] == "dump_caps") @@ -343,12 +351,11 @@ void rigCtlClient::socketReadyRead() { setCommand = true; if (rigCaps.hasPTTCommand) { - if (command[1] == "0") { - emit parent->setPTT(false); - } - else { - emit parent->setPTT(true); - } + emit parent->setPTT(bool(command[1].toInt())); + emit parent->setPTT(bool(command[1].toInt())); + emit parent->setPTT(bool(command[1].toInt())); + emit parent->setPTT(bool(command[1].toInt())); + emit parent->setPTT(bool(command[1].toInt())); } else { @@ -476,6 +483,10 @@ void rigCtlClient::socketReadyRead() freq.Hz = static_cast(newFreq); qDebug(logRigCtlD()) << QString("set_split_freq: %1 (%2)").arg(freq.Hz).arg(command[1]); emit parent->setFrequency(1, freq); + emit parent->setFrequency(1, freq); + emit parent->setFrequency(1, freq); + emit parent->setFrequency(1, freq); + emit parent->setFrequency(1, freq); } } else if (command.length() > 2 && (command[0] == "X" || command[0] == "set_split_mode")) @@ -531,21 +542,23 @@ void rigCtlClient::socketReadyRead() emit parent->setMode(getMode(mode), width); if (mode.mid(0, 3) == "PKT") { emit parent->setDataMode(true, width); + emit parent->setDataMode(true, width); } else { emit parent->setDataMode(false, width); + emit parent->setDataMode(false, width); } } else if (command[0] == "s" || command[0] == "get_split_vfo") { if (longReply) { - response.append(QString("Split: 0")); - response.append(QString("TX VFO: VFOA")); + response.append(QString("Split: 1")); + response.append(QString("TX VFO: VFOB")); } else { - response.append("0"); - response.append("VFOA"); + response.append("1"); + response.append("VFOb"); } } diff --git a/rigctld.h b/rigctld.h index 0b71fa9..130ae5e 100644 --- a/rigctld.h +++ b/rigctld.h @@ -369,7 +369,7 @@ public slots: virtual void incomingConnection(qintptr socketDescriptor); void receiveRigCaps(rigCapabilities caps); void receiveStateInfo(rigStateStruct* state); - void receiveFrequency(freqt freq); +// void receiveFrequency(freqt freq); private: rigStateStruct* rigState = Q_NULLPTR; diff --git a/wfview.vcxproj b/wfview.vcxproj index bf3abb6..030b9d6 100644 --- a/wfview.vcxproj +++ b/wfview.vcxproj @@ -57,7 +57,7 @@ Sync release\ MaxSpeed - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="fc2d1e2";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions) + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="66912e1";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions) false MultiThreadedDLL @@ -85,7 +85,7 @@ 0 - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"fc2d1e2\";HOST=\"wfview.org\";UNAME=\"build\";NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions) + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"66912e1\";HOST=\"wfview.org\";UNAME=\"build\";NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions) msvc./$(Configuration)/moc_predefs.hMoc'ing %(Identity)...output$(Configuration)moc_%(Filename).cppdefaultRcc'ing %(Identity)...$(Configuration)qrc_%(Filename).cppUic'ing %(Identity)...$(ProjectDir)ui_%(Filename).h @@ -99,7 +99,7 @@ Sync debug\ Disabled - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="fc2d1e2";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions) + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX="/usr/local";__WINDOWS_WASAPI__;GITSHORT="66912e1";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions) false MultiThreadedDebugDLL true @@ -124,7 +124,7 @@ 0 - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"fc2d1e2\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions) + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;USE_SSE;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;PREFIX=\"/usr/local\";__WINDOWS_WASAPI__;GITSHORT=\"66912e1\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions) msvc./$(Configuration)/moc_predefs.hMoc'ing %(Identity)...output$(Configuration)moc_%(Filename).cppdefaultRcc'ing %(Identity)...$(Configuration)qrc_%(Filename).cppUic'ing %(Identity)...$(ProjectDir)ui_%(Filename).h