kopia lustrzana https://gitlab.com/eliggett/wfview
Add more features to rigstate
rodzic
7eba494970
commit
e30cf248af
|
@ -1263,39 +1263,48 @@ void rigCommander::parseLevels()
|
|||
// AF level - ignore if LAN connection.
|
||||
if (udp == Q_NULLPTR) {
|
||||
emit haveAfGain(level);
|
||||
rigState.afGain = level;
|
||||
}
|
||||
break;
|
||||
case '\x02':
|
||||
// RX RF Gain
|
||||
emit haveRfGain(level);
|
||||
rigState.rfGain = level;
|
||||
break;
|
||||
case '\x03':
|
||||
// Squelch level
|
||||
emit haveSql(level);
|
||||
rigState.squelch = level;
|
||||
break;
|
||||
case '\x0A':
|
||||
// TX RF level
|
||||
emit haveTxPower(level);
|
||||
rigState.txPower = level;
|
||||
break;
|
||||
case '\x0B':
|
||||
// Mic Gain
|
||||
emit haveMicGain(level);
|
||||
rigState.micGain = level;
|
||||
break;
|
||||
case '\x0E':
|
||||
// compressor level
|
||||
emit haveCompLevel(level);
|
||||
rigState.compLevel = level;
|
||||
break;
|
||||
case '\x15':
|
||||
// monitor level
|
||||
emit haveMonitorLevel(level);
|
||||
rigState.monitorLevel = level;
|
||||
break;
|
||||
case '\x16':
|
||||
// VOX gain
|
||||
emit haveVoxGain(level);
|
||||
rigState.voxGain = level;
|
||||
break;
|
||||
case '\x17':
|
||||
// anti-VOX gain
|
||||
emit haveAntiVoxGain(level);
|
||||
rigState.antiVoxGain = level;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1313,30 +1322,37 @@ void rigCommander::parseLevels()
|
|||
case '\x02':
|
||||
// S-Meter
|
||||
emit haveMeter(meterS, level);
|
||||
rigState.sMeter = level;
|
||||
break;
|
||||
case '\x11':
|
||||
// RF-Power meter
|
||||
emit haveMeter(meterPower, level);
|
||||
rigState.powerMeter = level;
|
||||
break;
|
||||
case '\x12':
|
||||
// SWR
|
||||
emit haveMeter(meterSWR, level);
|
||||
rigState.swrMeter = level;
|
||||
break;
|
||||
case '\x13':
|
||||
// ALC
|
||||
emit haveMeter(meterALC, level);
|
||||
rigState.alcMeter = level;
|
||||
break;
|
||||
case '\x14':
|
||||
// COMP dB reduction
|
||||
emit haveMeter(meterComp, level);
|
||||
rigState.compMeter = level;
|
||||
break;
|
||||
case '\x15':
|
||||
// VD (12V)
|
||||
emit haveMeter(meterVoltage, level);
|
||||
rigState.voltageMeter = level;
|
||||
break;
|
||||
case '\x16':
|
||||
// ID
|
||||
emit haveMeter(meterCurrent, level);
|
||||
rigState.currentMeter = level;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -2111,19 +2127,24 @@ void rigCommander::parseRegister1B()
|
|||
// "Repeater tone"
|
||||
tone = decodeTone(payloadIn);
|
||||
emit haveTone(tone);
|
||||
rigState.ctcss = tone;
|
||||
break;
|
||||
case '\x01':
|
||||
// "TSQL tone"
|
||||
tone = decodeTone(payloadIn);
|
||||
emit haveTSQL(tone);
|
||||
rigState.tsql = tone;
|
||||
break;
|
||||
case '\x02':
|
||||
// DTCS (DCS)
|
||||
tone = decodeTone(payloadIn, tinv, rinv);
|
||||
emit haveDTCS(tone, tinv, rinv);
|
||||
rigState.dtcs = tone;
|
||||
break;
|
||||
case '\x07':
|
||||
// "CSQL code (DV mode)"
|
||||
tone = decodeTone(payloadIn);
|
||||
rigState.csql = tone;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -2143,6 +2164,7 @@ void rigCommander::parseRegister16()
|
|||
case '\x02':
|
||||
// Preamp
|
||||
emit havePreamp((unsigned char)payloadIn.at(2));
|
||||
rigState.preamp = (unsigned char)payloadIn.at(2);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -47,6 +47,31 @@ struct rigStateStruct {
|
|||
unsigned char mode;
|
||||
unsigned char filter;
|
||||
bool datamode;
|
||||
// Tones
|
||||
quint16 ctcss;
|
||||
quint16 tsql;
|
||||
quint16 dtcs;
|
||||
quint16 csql;
|
||||
// Levels
|
||||
unsigned char preamp;
|
||||
unsigned char modInput;
|
||||
unsigned char afGain;
|
||||
unsigned char rfGain;
|
||||
unsigned char squelch;
|
||||
unsigned char txPower;
|
||||
unsigned char micGain;
|
||||
unsigned char compLevel;
|
||||
unsigned char monitorLevel;
|
||||
unsigned char voxGain;
|
||||
unsigned char antiVoxGain;
|
||||
// Meters
|
||||
unsigned char sMeter;
|
||||
unsigned char powerMeter;
|
||||
unsigned char swrMeter;
|
||||
unsigned char alcMeter;
|
||||
unsigned char compMeter;
|
||||
unsigned char voltageMeter;
|
||||
unsigned char currentMeter;
|
||||
};
|
||||
|
||||
class rigCommander : public QObject
|
||||
|
|
|
@ -84,7 +84,7 @@ void rigCtlClient::socketReadyRead()
|
|||
bool longReply = false;
|
||||
if (commandBuffer.endsWith('\n'))
|
||||
{
|
||||
qInfo(logRigCtlD()) << sessionId << "command received" << commandBuffer;
|
||||
qDebug(logRigCtlD()) << sessionId << "command received" << commandBuffer;
|
||||
commandBuffer.chop(1); // Remove \n character
|
||||
if (commandBuffer.endsWith('\r'))
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ void rigCtlClient::closeSocket()
|
|||
|
||||
void rigCtlClient::sendData(QString data)
|
||||
{
|
||||
qInfo(logRigCtlD()) << "Sending:" << data;
|
||||
qDebug(logRigCtlD()) << "Sending:" << data;
|
||||
if (socket != Q_NULLPTR && socket->isValid() && socket->isOpen())
|
||||
{
|
||||
socket->write(data.toLatin1());
|
||||
|
|
29
rigctld.h
29
rigctld.h
|
@ -14,35 +14,6 @@
|
|||
|
||||
#include "rigcommander.h"
|
||||
|
||||
typedef void (*voidFunction)(void);
|
||||
//struct Interface {
|
||||
|
||||
// std::map<std::string, std::pair<voidFunction, std::type_index>> m1;
|
||||
|
||||
// template<typename T>
|
||||
// void insert(std::string s1, std::string s2, T f1) {
|
||||
// auto tt = std::type_index(typeid(f1));
|
||||
// m1.insert(std::make_pair(s1,
|
||||
// std::make_pair((voidFunction)f1, tt)));
|
||||
// m1.insert(std::make_pair(s2,
|
||||
// std::make_pair((voidFunction)f1, tt)));
|
||||
// }
|
||||
|
||||
// template<typename T, typename... Args>
|
||||
// T searchAndCall(std::string s1, Args&&... args) {
|
||||
// auto mapIter = m1.find(s1);
|
||||
// /*chk if not end*/
|
||||
// auto mapVal = mapIter->second;
|
||||
|
||||
// // auto typeCastedFun = reinterpret_cast< nowT(*)(Args ...)>(mapVal.first);
|
||||
// auto typeCastedFun = (T(*)(Args ...))(mapVal.first);
|
||||
|
||||
// //compare the types is equal or not
|
||||
// assert(mapVal.second == std::type_index(typeid(typeCastedFun)));
|
||||
// return typeCastedFun(std::forward<Args>(args)...);
|
||||
// }
|
||||
//};
|
||||
|
||||
class rigCtlD : public QTcpServer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -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;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT="70fe173";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;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT="7eba494";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;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT=\"70fe173\";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;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT=\"7eba494\";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;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT="70fe173";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT="7eba494";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;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT=\"70fe173\";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;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;GITSHORT=\"7eba494\";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>
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3bC:\QT\5.15.2\MSVC2019\bin%3b$(QTDIR)\bin%3bC:\QT\5.15.2\MSVC2019\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3bC:\QT\5.15.2\MSVC2019\bin%3b$(QTDIR)\bin%3bC:\QT\5.15.2\MSVC2019\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Ładowanie…
Reference in New Issue