From 4159e535fc097c4d74d3840f37689900da3396d7 Mon Sep 17 00:00:00 2001 From: M0VSE Date: Sat, 5 Jun 2021 01:10:31 +0100 Subject: [PATCH] Fix compile errors on Linux --- shuttle.cpp | 10 +++++----- shuttle.h | 6 +++--- wfview.pro | 8 +++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/shuttle.cpp b/shuttle.cpp index f7937d3..caa4290 100644 --- a/shuttle.cpp +++ b/shuttle.cpp @@ -3,7 +3,7 @@ shuttle::shuttle() { - + qInfo() << "Starting USB device detection"; } shuttle::~shuttle() @@ -75,7 +75,7 @@ void shuttle::run() wchar_t product[MAX_STR]; res = hid_get_manufacturer_string(handle, manufacturer, MAX_STR); res = hid_get_product_string(handle, product, MAX_STR); - qDebug() << QString("Found Device: %0 from %1").arg(QString::fromWCharArray(product)).arg(QString::fromWCharArray(manufacturer)); + qInfo() << QString("Found Device: %0 from %1").arg(QString::fromWCharArray(product)).arg(QString::fromWCharArray(manufacturer)); hid_set_nonblocking(handle, 1); QTimer::singleShot(0, this, SLOT(runTimer())); } @@ -90,7 +90,7 @@ void shuttle::runTimer() ;//printf("waiting...\n"); else if (res < 0) { - qDebug() << "USB Device disconnected?"; + qInfo() << "USB Device disconnected?"; hid_close(handle); QTimer::singleShot(1000, this, SLOT(run())); return; @@ -104,7 +104,7 @@ void shuttle::runTimer() << hex << (unsigned char)data[3] << ":" << hex << (unsigned char)data[4]; - unsigned int tempButtons = unsigned int((unsigned char)data[3] | (unsigned char)data[4] << 8); + unsigned int tempButtons = (unsigned int)((unsigned char)data[3] | (unsigned char)data[4] << 8); unsigned char tempJogpos = (unsigned char)data[1]; unsigned char tempShutpos = (unsigned char)data[0]; @@ -161,7 +161,7 @@ void shuttle::runTimer() emit button7(true); } - buttons = unsigned int((unsigned char)data[3] | (unsigned char)data[4] << 8); + buttons = (unsigned int)((unsigned char)data[3] | (unsigned char)data[4] << 8); jogpos = (unsigned char)data[1]; shutpos = (unsigned char)data[0]; diff --git a/shuttle.h b/shuttle.h index 77b1142..129d1ff 100644 --- a/shuttle.h +++ b/shuttle.h @@ -2,10 +2,10 @@ #define SHUTTLE_H #include -#include +#include #include #include -#include "hidapi.h" +#include "hidapi/hidapi.h" #ifndef Q_OS_WIN //Headers needed for sleeping. @@ -65,4 +65,4 @@ protected: }; -#endif \ No newline at end of file +#endif diff --git a/wfview.pro b/wfview.pro index 74549f7..9b9637a 100644 --- a/wfview.pro +++ b/wfview.pro @@ -6,8 +6,6 @@ QT += core gui serialport network multimedia -QT += usb - greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport TARGET = wfview @@ -92,7 +90,7 @@ CONFIG(debug, release|debug) { } #linux:LIBS += -L./ -l$$QCPLIB -lpulse -lpulse-simple -lpthread -linux:LIBS += -L./ -l$$QCPLIB -lhidapi +linux:LIBS += -L./ -l$$QCPLIB -lhidapi-libusb macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread win32:LIBS += -L../hidapi/windows/release -lhidapi @@ -129,7 +127,7 @@ SOURCES += main.cpp\ repeatersetup.cpp \ rigctld.cpp \ ring/ring.cpp \ - shuttle.cpp + shuttle.cpp HEADERS += wfmain.h \ commhandler.h \ @@ -155,7 +153,7 @@ HEADERS += wfmain.h \ rigctld.h \ ulaw.h \ ring/ring.h \ - shuttle.h + shuttle.h FORMS += wfmain.ui \