kopia lustrzana https://gitlab.com/eliggett/wfview
Merge latest master and make USB controllers a compile time directive
rodzic
93f18fae9e
commit
0d9a01cd1f
|
@ -1,4 +1,5 @@
|
|||
|
||||
#if defined(USB_CONTROLLER)
|
||||
#include "usbcontroller.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
@ -538,3 +539,4 @@ void usbController::buttonState(QString name, double val)
|
|||
}
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <QGraphicsTextItem>
|
||||
#include <QColor>
|
||||
#include <QVector>
|
||||
|
||||
#if defined(USB_CONTROLLER)
|
||||
#include <QGamepad>
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
|
@ -22,6 +24,7 @@
|
|||
//Headers needed for sleeping.
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Include these so we have the various enums
|
||||
#include "rigidentities.h"
|
||||
|
@ -75,6 +78,7 @@ struct BUTTON {
|
|||
|
||||
};
|
||||
|
||||
#if defined(USB_CONTROLLER)
|
||||
class usbController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -125,5 +129,6 @@ private:
|
|||
protected:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
16
wfmain.cpp
16
wfmain.cpp
|
@ -163,10 +163,14 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
|
||||
amTransmitting = false;
|
||||
|
||||
#if defined(USB_CONTROLLER)
|
||||
// Setup USB Controller
|
||||
setupUsbControllerDevice();
|
||||
emit sendUsbControllerCommands(&usbCommands);
|
||||
emit sendUsbControllerButtons(&usbButtons);
|
||||
#else
|
||||
ui->usbControllerBtn->setVisible(false);
|
||||
#endif
|
||||
|
||||
connect(ui->txPowerSlider, &QSlider::sliderMoved,
|
||||
[&](int value) {
|
||||
|
@ -201,10 +205,12 @@ wfmain::~wfmain()
|
|||
delete rpt;
|
||||
delete ui;
|
||||
delete settings;
|
||||
#if defined(USB_CONTROLLER)
|
||||
if (usbControllerThread != Q_NULLPTR) {
|
||||
usbControllerThread->quit();
|
||||
usbControllerThread->wait();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void wfmain::closeEvent(QCloseEvent *event)
|
||||
|
@ -1440,6 +1446,7 @@ void wfmain::setupKeyShortcuts()
|
|||
|
||||
void wfmain::setupUsbControllerDevice()
|
||||
{
|
||||
#if defined (USB_CONTROLLER)
|
||||
usbControllerDev = new usbController();
|
||||
usbControllerThread = new QThread(this);
|
||||
usbControllerDev->moveToThread(usbControllerThread);
|
||||
|
@ -1455,7 +1462,7 @@ void wfmain::setupUsbControllerDevice()
|
|||
|
||||
connect(this, SIGNAL(sendUsbControllerCommands(QVector<COMMAND>*)), usbControllerDev, SLOT(receiveCommands(QVector<COMMAND>*)));
|
||||
connect(this, SIGNAL(sendUsbControllerButtons(QVector<BUTTON>*)), usbControllerDev, SLOT(receiveButtons(QVector<BUTTON>*)));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void wfmain::pttToggle(bool status)
|
||||
|
@ -2075,6 +2082,7 @@ void wfmain::loadSettings()
|
|||
settings->endArray();
|
||||
|
||||
settings->endGroup();
|
||||
#if defined (USB_CONTROLLER)
|
||||
/* Load USB buttons*/
|
||||
settings->beginGroup("USB");
|
||||
int numCommands = settings->beginReadArray("Commands");
|
||||
|
@ -2253,7 +2261,7 @@ void wfmain::loadSettings()
|
|||
}
|
||||
|
||||
settings->endGroup();
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void wfmain::serverAddUserLine(const QString& user, const QString& pass, const int& type)
|
||||
|
@ -2615,6 +2623,7 @@ void wfmain::saveSettings()
|
|||
|
||||
settings->endGroup();
|
||||
|
||||
#if defined(USB_CONTROLLER)
|
||||
settings->beginGroup("USB");
|
||||
// Store USB Controller
|
||||
|
||||
|
@ -2639,6 +2648,7 @@ void wfmain::saveSettings()
|
|||
settings->endArray();
|
||||
|
||||
settings->endGroup();
|
||||
#endif
|
||||
|
||||
settings->sync(); // Automatic, not needed (supposedly)
|
||||
}
|
||||
|
@ -3499,7 +3509,7 @@ void wfmain::doCmd(commandtype cmddata)
|
|||
case cmdGetBandStackReg:
|
||||
{
|
||||
char band = (*std::static_pointer_cast<char>(data));
|
||||
//bandStkBand = rigCaps.bsr[(bandType)band]; // 23cm Needs fixing
|
||||
bandStkBand = rigCaps.bsr[band]; // 23cm Needs fixing
|
||||
bandStkRegCode = ui->bandStkPopdown->currentIndex() + 1;
|
||||
emit getBandStackReg(bandStkBand, bandStkRegCode);
|
||||
break;
|
||||
|
|
3
wfmain.h
3
wfmain.h
|
@ -1072,12 +1072,13 @@ private:
|
|||
SERVERCONFIG serverConfig;
|
||||
void serverAddUserLine(const QString& user, const QString& pass, const int& type);
|
||||
|
||||
#if defined (USB_CONTROLLER)
|
||||
usbController *usbControllerDev = Q_NULLPTR;
|
||||
QThread *usbControllerThread = Q_NULLPTR;
|
||||
|
||||
QString usbDeviceName;
|
||||
QVector<COMMAND> usbCommands;
|
||||
QVector<BUTTON> usbButtons;
|
||||
#endif
|
||||
|
||||
dxClusterClient* cluster = Q_NULLPTR;
|
||||
QThread* clusterThread = Q_NULLPTR;
|
||||
|
|
|
@ -1798,7 +1798,6 @@
|
|||
<font>
|
||||
<family>DejaVu Sans Mono</family>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
@ -3383,8 +3382,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>858</width>
|
||||
<height>287</height>
|
||||
<width>579</width>
|
||||
<height>224</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
|
@ -5333,7 +5332,6 @@
|
|||
<widget class="QPushButton" name="exitBtn">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
@ -5353,7 +5351,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1082</width>
|
||||
<height>21</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui serialport network multimedia xml gamepad
|
||||
QT += core gui serialport network multimedia xml
|
||||
|
||||
#QT += sql
|
||||
#DEFINES += USESQL
|
||||
|
@ -18,13 +18,13 @@ DEFINES += WFVIEW_VERSION=\\\"1.56\\\"
|
|||
|
||||
DEFINES += BUILD_WFVIEW
|
||||
|
||||
#Uncomment The following 5 lines enable USB controllers (Shuttle/RC-28 etc.)
|
||||
#Uncomment The following 6 lines to enable USB controllers (Shuttle/RC-28 etc.)
|
||||
#DEFINES += USB_CONTROLLERS
|
||||
#linux:LIBS += -L./ -l$$QCPLIB -lhidapi-libusb
|
||||
#macx:LIBS += -framework CoreAudio -framework CoreFoundation -lhidapi
|
||||
#win32:INCLUDEPATH += ../hidapi/hidapi
|
||||
#win32:SOURCES += ../hidapi/windows/hid.c
|
||||
|
||||
#QT += gamepad
|
||||
|
||||
CONFIG(debug, release|debug) {
|
||||
# For Debug builds only:
|
||||
|
|
|
@ -111,11 +111,11 @@
|
|||
<OutDir>$(SolutionDir)wfview-release\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtInstall>msvc2019</QtInstall>
|
||||
<QtInstall>msvc2019_64_v62</QtInstall>
|
||||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
|
||||
<QtInstall>msvc2019</QtInstall>
|
||||
<QtInstall>msvc2019_64_v62</QtInstall>
|
||||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
@ -123,7 +123,7 @@
|
|||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
|
||||
<QtInstall>msvc2019</QtInstall>
|
||||
<QtInstall>msvc2019_64_v62</QtInstall>
|
||||
<QtModules>core;gui;network;widgets;multimedia;printsupport;serialport;xml</QtModules>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">
|
||||
|
@ -414,6 +414,7 @@ cmd /c copy /y ..\portaudio\msvc\Win32\Debug\portaudio_x86.dll wfview-debug</Com
|
|||
<ClCompile Include="calibrationwindow.cpp" />
|
||||
<ClCompile Include="cluster.cpp" />
|
||||
<ClCompile Include="commhandler.cpp" />
|
||||
<ClCompile Include="controllersetup.cpp" />
|
||||
<ClCompile Include="freqmemory.cpp" />
|
||||
<ClCompile Include="logcategories.cpp" />
|
||||
<ClCompile Include="loggingwindow.cpp" />
|
||||
|
@ -437,15 +438,18 @@ cmd /c copy /y ..\portaudio\msvc\Win32\Debug\portaudio_x86.dll wfview-debug</Com
|
|||
<ClCompile Include="udpcivdata.cpp" />
|
||||
<ClCompile Include="udphandler.cpp" />
|
||||
<ClCompile Include="udpserver.cpp" />
|
||||
<ClCompile Include="usbcontroller.cpp" />
|
||||
<ClCompile Include="wfmain.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\rtaudio\RTAUdio.h" />
|
||||
<QtMoc Include="usbcontroller.h" />
|
||||
<QtMoc Include="aboutbox.h">
|
||||
</QtMoc>
|
||||
<QtMoc Include="audiodevices.h" />
|
||||
<QtMoc Include="loggingwindow.h" />
|
||||
<QtMoc Include="cluster.h" />
|
||||
<QtMoc Include="controllersetup.h" />
|
||||
<ClInclude Include="resampler\arch.h" />
|
||||
<QtMoc Include="audioconverter.h">
|
||||
</QtMoc>
|
||||
|
@ -533,6 +537,7 @@ cmd /c copy /y ..\portaudio\msvc\Win32\Debug\portaudio_x86.dll wfview-debug</Com
|
|||
</QtUic>
|
||||
<QtUic Include="calibrationwindow.ui">
|
||||
</QtUic>
|
||||
<QtUic Include="controllersetup.ui" />
|
||||
<QtUic Include="loggingwindow.ui" />
|
||||
<QtUic Include="repeatersetup.ui">
|
||||
</QtUic>
|
||||
|
|
|
@ -143,6 +143,12 @@
|
|||
<ClCompile Include="wfmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="usbcontroller.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="controllersetup.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\rtaudio\RTAUdio.h">
|
||||
|
@ -272,6 +278,9 @@
|
|||
<QtUic Include="calibrationwindow.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="controllersetup.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="loggingwindow.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
|
@ -425,4 +434,12 @@
|
|||
<ItemGroup>
|
||||
<ResourceCompile Include=".\wfview_resource.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="usbcontroller.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="controllersetup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -45,10 +45,10 @@
|
|||
<QtLastBackgroundBuild>2022-08-21T18:58:23.4329764Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-01-01T21:18:41.6777849Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-01-12T19:02:11.7122024Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-01-01T21:18:41.0898794Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-01-12T19:02:11.0783744Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<QtLastBackgroundBuild>2022-08-22T10:47:49.1255783Z</QtLastBackgroundBuild>
|
||||
|
@ -60,9 +60,9 @@
|
|||
<QtLastBackgroundBuild>2022-08-20T19:06:43.4553894Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-01-02T15:55:24.4600387Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-01-12T19:02:13.6556090Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
|
||||
<QtLastBackgroundBuild>2023-01-01T21:18:42.4124187Z</QtLastBackgroundBuild>
|
||||
<QtLastBackgroundBuild>2023-01-12T19:02:12.4064183Z</QtLastBackgroundBuild>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,6 +1,6 @@
|
|||
#include <windows.h>
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "C:\\Users\\Phil\\source\\repos\\wfview\\resources\\wfview.ico"
|
||||
IDI_ICON1 ICON "C:\\Users\\Phil\\source\\repos\\wfview\\resources\\wfview.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,0,0,0
|
||||
|
@ -11,9 +11,9 @@ VS_VERSION_INFO VERSIONINFO
|
|||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS__WINDOWS32
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE 0x0L
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
|
@ -26,6 +26,9 @@ VS_VERSION_INFO VERSIONINFO
|
|||
VALUE "OriginalFilename", "wfview.exe\0"
|
||||
VALUE "ProductName", "wfview\0"
|
||||
VALUE "ProductVersion", "0.0.0.0\0"
|
||||
VALUE "InternalName", "\0"
|
||||
VALUE "Comments", "\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
Ładowanie…
Reference in New Issue