Send TX/Freq changes multiple times with rigctld

merge-requests/7/head
Phil Taylor 2021-10-06 23:41:11 +01:00
rodzic 66912e13b2
commit b7edb2cf96
3 zmienionych plików z 35 dodań i 22 usunięć

Wyświetl plik

@ -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<int>(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<int>(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");
}
}

Wyświetl plik

@ -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;

Wyświetl plik

@ -57,7 +57,7 @@
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>release\</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<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="fc2d1e2";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName></ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@ -85,7 +85,7 @@
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<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=\"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)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -99,7 +99,7 @@
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>debug\</ObjectFileName>
<Optimization>Disabled</Optimization>
<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="fc2d1e2";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
@ -124,7 +124,7 @@
<WarningLevel>0</WarningLevel>
</Midl>
<ResourceCompile>
<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=\"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)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
</ResourceCompile>
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
<ItemGroup>