Merge branch 'multi-usb'

qcpfix
Roeland Jansen 2023-04-19 07:36:20 +02:00
commit 375acead89
23 zmienionych plików z 3895 dodań i 1820 usunięć

Wyświetl plik

@ -15,8 +15,7 @@ aboutbox::aboutbox(QWidget *parent) :
ui->topText->setText("wfview version " + QString(WFVIEW_VERSION));
QString head = QString("<html><head></head><body>");
QString copyright = QString("Copyright 2017-2022 Elliott H. Liggett, W6EL. All rights reserved.<br/>wfview source code is <a href=\"https://gitlab.com/eliggett/wfview/-/blob/master/LICENSE\">licensed</a> under the GNU GPLv3.");
QString nacode = QString("<br/><br/>Networking, audio, rigctl server, and much more written by Phil Taylor, M0VSE");
QString copyright = QString("Copyright 2017-2023 Elliott H. Liggett, W6EL and Phil E. Taylor, M0VSE. All rights reserved.<br/>wfview source code is <a href=\"https://gitlab.com/eliggett/wfview/-/blob/master/LICENSE\">licensed</a> under the GNU GPLv3.");
QString scm = QString("<br/><br/>Source code and issues managed by Roeland Jansen, PA3MET");
QString doctest = QString("<br/><br/>Testing and development mentorship from Jim Nijkamp, PA8E.");
@ -86,7 +85,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.");
// String it all together:
QString aboutText = head + copyright + "\n" + nacode + "\n" + scm + "\n" + doctest + dedication + wfviewcommunityack;
QString aboutText = head + copyright + "\n" + "\n" + scm + "\n" + doctest + dedication + wfviewcommunityack;
aboutText.append(website + "\n" + donate + "\n"+ docs + support + contact +"\n");
aboutText.append("\n" + ssCredit + "\n" + rsCredit + "\n");

Plik diff jest za duży Load Diff

Wyświetl plik

@ -6,6 +6,7 @@
#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QGraphicsPixmapItem>
#include <QGraphicsRectItem>
#include <QPoint>
#include <QGraphicsSceneMouseEvent>
#include <QVector>
@ -14,14 +15,99 @@
#include <QLabel>
#include <QGraphicsProxyWidget>
#include <QAbstractItemView>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QPushButton>
#include <QScopedPointer>
#include <QCheckBox>
#include <QFileDialog>
#include <QMessageBox>
#include <QLayoutItem>
#include <QDebug>
#include <QObject>
#include <QColorDialog>
#include <QWidget>
#include <QSpinBox>
#include <QCheckBox>
#include "usbcontroller.h"
class controllerScene : public QGraphicsScene
{
Q_OBJECT
QGraphicsLineItem* item = Q_NULLPTR;
signals:
void showMenu(controllerScene* scene, QPoint p);
void buttonAction(bool pressed, QPoint p);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* event) {
if (event->button() == Qt::RightButton)
{
emit showMenu(this, event->scenePos().toPoint());
}
else if (event->button() == Qt::LeftButton)
{
// Simulate a button press
emit buttonAction(true,event->scenePos().toPoint());
}
else
{
QGraphicsScene::mousePressEvent(event);
}
}
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) {
if (event->button() == Qt::LeftButton)
{
// Simulate a button release
emit buttonAction(false,event->scenePos().toPoint());
}
else
{
QGraphicsScene::mouseReleaseEvent(event);
}
}
};
struct tabContent {
QWidget* tab;
QVBoxLayout* mainLayout;
QHBoxLayout* topLayout;
QWidget* widget;
QVBoxLayout* layout;
QCheckBox* disabled;
QLabel* message;
QGraphicsView* view;
QLabel* pageLabel;
QSpinBox* page;
QHBoxLayout* sensLayout;
QLabel* sensLabel;
QSlider* sens;
QImage* image;
QGraphicsItem* bgImage = Q_NULLPTR;
controllerScene* scene = Q_NULLPTR;
QGridLayout* grid;
QLabel* brightLabel;
QComboBox* brightness;
QLabel* speedLabel;
QComboBox* speed;
QLabel* orientLabel;
QComboBox* orientation;
QLabel* colorLabel;
QPushButton* color;
QLabel* timeoutLabel;
QSpinBox* timeout;
QLabel* pagesLabel;
QSpinBox* pages;
QLabel* helpText;
};
namespace Ui {
class controllerSetup;
@ -36,81 +122,102 @@ public:
~controllerSetup();
signals:
void sendSensitivity(int val);
void programButton(quint8 but, QString text);
void programBrightness(quint8 level);
void programWheelColour(quint8 r, quint8 g, quint8 b);
void programOverlay(quint8 duration, QString text);
void programOrientation(quint8 value);
void programSpeed(quint8 value);
void programTimeout(quint8 value);
void updateSettings(quint8 bright, quint8 orient, quint8 speed, quint8 timeout, QColor color);
void started();
void sendRequest(USBDEVICE* dev, usbFeatureType request, int val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
void programDisable(USBDEVICE* dev, bool disable);
void programPages(USBDEVICE* dev, int pages);
void backup(USBDEVICE* dev, QString path);
void restore(USBDEVICE *dev, QString path);
public slots:
void newDevice(unsigned char devType, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
void mousePressed(QPoint p);
void init(usbDevMap* dev, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
void newDevice(USBDEVICE* dev);
void removeDevice(USBDEVICE* dev);
void showMenu(controllerScene *scene,QPoint p);
void onEventIndexChanged(int index);
void offEventIndexChanged(int index);
void knobEventIndexChanged(int index);
void receiveSensitivity(int val);
void on_sensitivitySlider_valueChanged(int val);
void on_qkBrightCombo_currentIndexChanged(int index);
void on_qkOrientCombo_currentIndexChanged(int index);
void on_qkSpeedCombo_currentIndexChanged(int index);
void on_qkColorButton_clicked();
void on_qkTimeoutSpin_valueChanged(int arg1);
void setDefaults(quint8 bright, quint8 orient, quint8 speed, quint8 timeout, QColor color);
void ledNumberChanged(int index);
void sensitivityMoved(USBDEVICE* dev, int val);
void brightnessChanged(USBDEVICE* dev, int index);
void orientationChanged(USBDEVICE* dev, int index);
void speedChanged(USBDEVICE* dev, int index);
void colorPicker(USBDEVICE* dev, QPushButton* btn, QColor color);
void buttonOnColorClicked();
void buttonOffColorClicked();
void buttonIconClicked();
void latchStateChanged(int state);
void timeoutChanged(USBDEVICE* dev, int val);
void pageChanged(USBDEVICE* dev, int val);
void pagesChanged(USBDEVICE* dev, int val);
void disableClicked(USBDEVICE* dev, bool clicked, QWidget* widget);
void setConnected(USBDEVICE* dev);
void hideEvent(QHideEvent *event);
void on_tabWidget_currentChanged(int index);
void on_backupButton_clicked();
void on_restoreButton_clicked();
private:
usbDeviceType usbDevice = usbNone;
usbDeviceType type = usbNone;
Ui::controllerSetup* ui;
QGraphicsScene* scene;
QGraphicsTextItem* textItem;
QGraphicsItem* bgImage = Q_NULLPTR;
QLabel* imgLabel;
unsigned char currentDevice = 0;
QVector<BUTTON>* buttons;
QVector<KNOB>* knobs;
QVector<COMMAND>* commands;
usbDevMap* devices;
BUTTON* currentButton = Q_NULLPTR;
KNOB* currentKnob = Q_NULLPTR;
QComboBox* onEvent = Q_NULLPTR;
QComboBox* offEvent = Q_NULLPTR;
QComboBox* knobEvent = Q_NULLPTR;
QComboBox* qkBright = Q_NULLPTR;
QGraphicsProxyWidget* onEventProxy = Q_NULLPTR;
QGraphicsProxyWidget* offEventProxy = Q_NULLPTR;
QGraphicsProxyWidget* knobEventProxy = Q_NULLPTR;
QGraphicsProxyWidget* qkBrightProxy = Q_NULLPTR;
// Update Dialog
QDialog * updateDialog = Q_NULLPTR;
QComboBox* onEvent;
QComboBox* offEvent;
QComboBox* knobEvent;
QLabel* onLabel;
QLabel* offLabel;
QLabel* knobLabel;
QPushButton* buttonOnColor;
QPushButton* buttonOffColor;
QCheckBox *buttonLatch;
QPushButton* buttonIcon;
QLabel* iconLabel;
QSpinBox* ledNumber;
QString deviceName;
QMutex* mutex;
QColor initialColor = Qt::white;
QLabel* noControllersText;
int numTabs=0;
QMap<QString,tabContent*> tabs;
// Below are used for each tab:
/*
QList<QWidget *> tabs;
QList<QVBoxLayout *> layouts;
QList<QWidget *> widgets;
QList<QGraphicsView *> graphicsViews;
QList<QGraphicsScene*> scenes;
QList<QGraphicsItem*> bgImages;
QList<QSlider *>sensitivitys;
// Just used for QuickKeys device
QList<QComboBox *>brightCombos;
QList<QComboBox *>speedCombos;
QList<QComboBox *>orientCombos;
QList<QPushButton *>colorButtons;
QList<QSpinBox *>timeoutSpins;
*/
};
class controllerScene : public QGraphicsScene
{
Q_OBJECT
QGraphicsLineItem* item = Q_NULLPTR;
signals:
void mousePressed(QPoint p);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* event) {
if (event->button() == Qt::RightButton)
{
emit mousePressed(event->scenePos().toPoint());
}
else
{
QGraphicsScene::mousePressEvent(event);
}
}
};
#endif
#endif

Wyświetl plik

@ -6,15 +6,35 @@
<rect>
<x>0</x>
<y>0</y>
<width>442</width>
<height>343</height>
<width>788</width>
<height>646</height>
</rect>
</property>
<property name="windowTitle">
<string>Controller setup</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="7" column="0">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Tab 1</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Tab 2</string>
</attribute>
</widget>
</widget>
</item>
<item row="2" column="0">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
@ -31,6 +51,20 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="backupButton">
<property name="text">
<string>Backup</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="restoreButton">
<property name="text">
<string>Restore</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
@ -60,197 +94,6 @@
</item>
</layout>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QComboBox" name="qkBrightCombo">
<property name="enabled">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Brightness</string>
</property>
</item>
<item>
<property name="text">
<string>Off</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
<item>
<property name="text">
<string>Medium</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="qkSpeedCombo">
<item>
<property name="text">
<string>Speed</string>
</property>
</item>
<item>
<property name="text">
<string>Fastest</string>
</property>
</item>
<item>
<property name="text">
<string>Faster</string>
</property>
</item>
<item>
<property name="text">
<string>Normal</string>
</property>
</item>
<item>
<property name="text">
<string>Slower</string>
</property>
</item>
<item>
<property name="text">
<string>Slowest</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="qkOrientCombo">
<item>
<property name="text">
<string>Orientation</string>
</property>
</item>
<item>
<property name="text">
<string>Rotate 0</string>
</property>
</item>
<item>
<property name="text">
<string>Rotate 90</string>
</property>
</item>
<item>
<property name="text">
<string>Rotate 180</string>
</property>
</item>
<item>
<property name="text">
<string>Rotate 270</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QPushButton" name="qkColorButton">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="qkTimeoutLabel">
<property name="text">
<string>Timeout</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="qkTimeoutSpin">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Sensitivity</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="sensitivitySlider">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>21</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;Button configuration: &lt;/span&gt;Right-click on each button to configure it.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Top selection is command to send when button is pressed and bottom is (optional) command to send when button is released.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGraphicsView" name="graphicsView"/>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>

Wyświetl plik

@ -399,6 +399,49 @@ typedef union capabilities_packet {
} *capabilities_packet_t;
typedef union streamdeck_image_header {
struct
{
quint8 cmd;
quint8 suffix;
quint8 button;
quint8 isLast;
quint16 length;
quint16 index;
};
char packet[8];
} *streamdeck_image_header_t;
typedef union streamdeck_v1_image_header {
struct
{
quint8 cmd;
quint8 suffix;
quint16 index;
quint8 isLast;
quint8 button;
quint8 unused[10];
};
char packet[16];
} *streamdeck_v1_image_header_t;
typedef union streamdeck_lcd_header {
struct
{
quint8 cmd;
quint8 suffix;
quint16 x;
quint16 y;
quint16 width;
quint16 height;
quint8 isLast;
quint16 index;
quint16 length;
quint8 unused;
};
char packet[16];
} *streamdeck_lcd_header_t;
#pragma pack(pop)

11
prefs.h
Wyświetl plik

@ -2,9 +2,11 @@
#define PREFS_H
#include <QString>
#include <QColor>
#include <QMap>
#include "wfviewtypes.h"
struct preferences {
// Program:
QString version;
@ -15,6 +17,7 @@ struct preferences {
// Interface:
bool useFullScreen;
bool useSystemTheme;
int wfEnable;
bool drawPeaks;
underlay_t underlayMode = underlayNone;
int underlayBufferSize = 64;
@ -46,12 +49,6 @@ struct preferences {
bool niceTS;
bool automaticSidebandSwitching = true;
bool enableUSBControllers;
int usbSensitivity;
quint8 usbSpeed;
quint8 usbTimeout;
quint8 usbBrightness;
quint8 usbOrientation;
QColor usbColor;
// LAN:
bool enableLAN;

Wyświetl plik

@ -7,5 +7,10 @@
<file>ecoder.png</file>
<file>quickkeys.png</file>
<file>xbox.png</file>
<file>streamdeck.png</file>
<file>streamdeckmini.png</file>
<file>streamdeckxl.png</file>
<file>streamdeckpedal.png</file>
<file>streamdeckplus.png</file>
</qresource>
</RCC>

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 179 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 331 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 396 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 217 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 412 KiB

Wyświetl plik

@ -872,6 +872,18 @@ void rigCommander::setDataMode(bool dataOn, unsigned char filter)
prepDataAndSend(payload);
}
void rigCommander::getFrequency(unsigned char vfo)
{
if (rigCaps.hasVFOAB || rigCaps.hasVFOMS)
{
QByteArray payload("\x25");
payload.append(vfo);
prepDataAndSend(payload);
} else {
getFrequency();
}
}
void rigCommander::getFrequency()
{
// figure out frequency and then respond with haveFrequency();
@ -1675,11 +1687,9 @@ void rigCommander::parseCommand()
parseFrequency();
break;
case '\x25':
if((int)payloadIn[1] == 0)
{
emit haveFrequency(parseFrequency(payloadIn, 5));
}
break;
// Parse both VFOs
emit haveFrequency(parseFrequency(payloadIn, 5));
break;
case '\x01':
//qInfo(logRig()) << "Have mode data";
this->parseMode();
@ -1844,6 +1854,11 @@ void rigCommander::parseLevels()
emit haveTPBFOuter(level);
state.set(PBTOUT, level, false);
break;
case '\x06':
// NR Level
emit haveNRLevel(level);
state.set(NR, level, false);
break;
case '\x09':
// CW Pitch
emit haveCwPitch(level);
@ -1874,12 +1889,12 @@ void rigCommander::parseLevels()
state.set(COMPLEVEL, level, false);
break;
case '\x12':
// NB level - ignore for now
emit haveNB((bool)level);
state.set(NB, level, false);
break;
case '\x15':
// monitor level
emit haveMonitorLevel(level);
emit haveMonitorGain(level);
state.set(MONITORLEVEL, level, false);
break;
case '\x16':
@ -2399,9 +2414,9 @@ void rigCommander::setCompLevel(unsigned char compLevel)
prepDataAndSend(payload);
}
void rigCommander::setMonitorLevel(unsigned char monitorLevel)
void rigCommander::setMonitorGain(unsigned char monitorLevel)
{
QByteArray payload("\x14\x0E");
QByteArray payload("\x14\x15");
payload.append(bcdEncodeInt(monitorLevel));
prepDataAndSend(payload);
}
@ -2420,6 +2435,22 @@ void rigCommander::setAntiVoxGain(unsigned char gain)
prepDataAndSend(payload);
}
void rigCommander::setNBLevel(unsigned char level)
{
if (rigCaps.hasNB) {
QByteArray payload(rigCaps.nbCommand);
payload.append(bcdEncodeInt(level));
prepDataAndSend(payload);
}
}
void rigCommander::setNRLevel(unsigned char level)
{
QByteArray payload("\x14\x06");
payload.append(bcdEncodeInt(level));
prepDataAndSend(payload);
}
void rigCommander::getRfGain()
{
@ -2429,8 +2460,13 @@ void rigCommander::getRfGain()
void rigCommander::getAfGain()
{
QByteArray payload("\x14\x01");
prepDataAndSend(payload);
if (udp == Q_NULLPTR) {
QByteArray payload("\x14\x01");
prepDataAndSend(payload);
}
else {
emit haveAfGain(localVolume);
}
}
void rigCommander::getIFShift()
@ -2475,7 +2511,7 @@ void rigCommander::getCompLevel()
prepDataAndSend(payload);
}
void rigCommander::getMonitorLevel()
void rigCommander::getMonitorGain()
{
QByteArray payload("\x14\x15");
prepDataAndSend(payload);
@ -2493,6 +2529,19 @@ void rigCommander::getAntiVoxGain()
prepDataAndSend(payload);
}
void rigCommander::getNBLevel()
{
if (rigCaps.hasNB) {
prepDataAndSend(rigCaps.nbCommand);
}
}
void rigCommander::getNRLevel()
{
QByteArray payload("\x14\x06");
prepDataAndSend(payload);
}
void rigCommander::getLevels()
{
// Function to grab all levels
@ -2502,7 +2551,7 @@ void rigCommander::getLevels()
getTxLevel(); // 0x0A
getMicGain(); // 0x0B
getCompLevel(); // 0x0E
// getMonitorLevel(); // 0x15
// getMonitorGain(); // 0x15
// getVoxGain(); // 0x16
// getAntiVoxGain(); // 0x17
}
@ -3026,9 +3075,11 @@ void rigCommander::parseRegister16()
state.set(PREAMP, (quint8)payloadIn.at(2), false);
break;
case '\x22':
emit haveNB(payloadIn.at(2) != 0);
state.set(NBFUNC, payloadIn.at(2) != 0, false);
break;
case '\x40':
emit haveNR(payloadIn.at(2) != 0);
state.set(NRFUNC, payloadIn.at(2) != 0, false);
break;
case '\x41': // Auto notch
@ -3055,12 +3106,15 @@ void rigCommander::parseRegister16()
emit haveRptAccessMode(ra);
break;
case '\x44':
emit haveComp(payloadIn.at(2) != 0);
state.set(COMPFUNC, payloadIn.at(2) != 0, false);
break;
case '\x45':
emit haveMonitor(payloadIn.at(2) != 0);
state.set(MONFUNC, payloadIn.at(2) != 0, false);
break;
case '\x46':
emit haveVox(payloadIn.at(2) != 0);
state.set(VOXFUNC, payloadIn.at(2) != 0, false);
break;
case '\x47':
@ -3104,6 +3158,10 @@ void rigCommander::parseBandStackReg()
freqt freqs = parseFrequency(payloadIn, 7);
//float freq = (float)freqs.MHzDouble;
// The Band Stacking command returns the regCode in the position that VFO is expected.
// As BSR is always on the active VFO, just set that.
freqs.VFO = selVFO_t::activeVFO;
bool dataOn = (payloadIn[11] & 0x10) >> 4; // not sure...
char mode = payloadIn[9];
char filter = payloadIn[10];
@ -4644,6 +4702,7 @@ void rigCommander::parseFrequency()
// payloadIn[01] = ; // . XX KHz
// printHex(payloadIn, false, true);
frequencyMhz = 0.0;
if (payloadIn.length() == 7)
{
@ -4733,40 +4792,25 @@ freqt rigCommander::parseFrequency(QByteArray data, unsigned char lastPosition)
// NOTE: This function was written on the IC-7300, which has no need for 100 MHz and 1 GHz.
// Therefore, this function has to go to position +1 to retrieve those numbers for the IC-9700.
// TODO: 64-bit value is incorrect, multiplying by wrong numbers.
float freq = 0.0;
freqt freqs;
freqs.MHzDouble = 0;
freqs.Hz = 0;
// MHz:
freq += 100*(data[lastPosition+1] & 0x0f);
freq += (1000*((data[lastPosition+1] & 0xf0) >> 4));
freq += data[lastPosition] & 0x0f;
freq += 10*((data[lastPosition] & 0xf0) >> 4);
freqs.Hz += (data[lastPosition] & 0x0f) * 1E6;
freqs.Hz += ((data[lastPosition] & 0xf0) >> 4) * 1E6 * 10; // 10 MHz
// Does Frequency contain 100 MHz/1 GHz data?
if(data.length() >= lastPosition+1)
{
freqs.Hz += (data[lastPosition+1] & 0x0f) * 1E6 * 100; // 100 MHz
freqs.Hz += ((data[lastPosition+1] & 0xf0) >> 4) * 1E6 * 1000; // 1000 MHz
}
// Does Frequency contain VFO data? (\x25 command)
if (lastPosition-4 >= 0 && (quint8)data[lastPosition-4] < 0x02)
{
freqs.VFO=(selVFO_t)(quint8)data[lastPosition-4];
}
// Hz:
freq += ((data[lastPosition-1] & 0xf0) >>4)/10.0 ;
freq += (data[lastPosition-1] & 0x0f) / 100.0;
freq += ((data[lastPosition-2] & 0xf0) >> 4) / 1000.0;
freq += (data[lastPosition-2] & 0x0f) / 10000.0;
freq += ((data[lastPosition-3] & 0xf0) >> 4) / 100000.0;
freq += (data[lastPosition-3] & 0x0f) / 1000000.0;
freqs.Hz += (data[lastPosition] & 0x0f) * 1E6;
freqs.Hz += ((data[lastPosition] & 0xf0) >> 4) * 1E6 * 10; // 10 MHz
freqs.Hz += (data[lastPosition-1] & 0x0f) * 10E3; // 10 KHz
freqs.Hz += ((data[lastPosition-1] & 0xf0) >> 4) * 100E3; // 100 KHz
@ -4947,26 +4991,26 @@ void rigCommander::setAntenna(unsigned char ant, bool rx)
prepDataAndSend(payload);
}
void rigCommander::setNb(bool enabled) {
void rigCommander::setNB(bool enabled) {
QByteArray payload("\x16\x22");
payload.append((unsigned char)enabled);
prepDataAndSend(payload);
}
void rigCommander::getNb()
void rigCommander::getNB()
{
QByteArray payload;
payload.setRawData("\x16\x22", 2);
prepDataAndSend(payload);
}
void rigCommander::setNr(bool enabled) {
void rigCommander::setNR(bool enabled) {
QByteArray payload("\x16\x40");
payload.append((unsigned char)enabled);
prepDataAndSend(payload);
}
void rigCommander::getNr()
void rigCommander::getNR()
{
QByteArray payload;
payload.setRawData("\x16\x40", 2);
@ -5342,9 +5386,9 @@ void rigCommander::stateUpdated()
break;
case MONITORLEVEL:
if (i.value()._valid) {
setMonitorLevel(state.getChar(MONITORLEVEL));
setMonitorGain(state.getChar(MONITORLEVEL));
}
getMonitorLevel();
getMonitorGain();
break;
case VOXGAIN:
if (i.value()._valid) {
@ -5360,15 +5404,15 @@ void rigCommander::stateUpdated()
break;
case NBFUNC:
if (i.value()._valid) {
setNb(state.getBool(NBFUNC));
setNB(state.getBool(NBFUNC));
}
getNb();
getNB();
break;
case NRFUNC:
if (i.value()._valid) {
setNr(state.getBool(NRFUNC));
setNR(state.getBool(NRFUNC));
}
getNr();
getNR();
break;
case ANFFUNC:
if (i.value()._valid) {

Wyświetl plik

@ -70,6 +70,7 @@ public slots:
// Frequency, Mode, BSR:
void setFrequency(unsigned char vfo, freqt freq);
void getFrequency(unsigned char vfo);
void getFrequency();
void selectVFO(vfo_t vfo);
void equalizeVFOsAB();
@ -103,10 +104,10 @@ public slots:
void setAttenuator(unsigned char att);
void setPreamp(unsigned char pre);
void setAntenna(unsigned char ant, bool rx);
void setNb(bool enabled);
void getNb();
void setNr(bool enabled);
void getNr();
void setNB(bool enabled);
void getNB();
void setNR(bool enabled);
void getNR();
void setAutoNotch(bool enabled);
void getAutoNotch();
void setToneEnabled(bool enabled);
@ -127,7 +128,8 @@ public slots:
void getManualNotch();
void getPassband();
void getCwPitch();
void getNBLevel();
void getNRLevel(); void getCwPitch();
void setCwPitch(unsigned char pitch);
void getDashRatio();
void setDashRatio(unsigned char ratio);
@ -166,7 +168,7 @@ public slots:
void getTxLevel();
void getMicGain();
void getCompLevel();
void getMonitorLevel();
void getMonitorGain();
void getVoxGain();
void getAntiVoxGain();
void getUSBGain();
@ -192,13 +194,15 @@ public slots:
void setACCGain(unsigned char gain);
void setACCGain(unsigned char gain, unsigned char ab);
void setCompLevel(unsigned char compLevel);
void setMonitorLevel(unsigned char monitorLevel);
void setMonitorGain(unsigned char monitorLevel);
void setVoxGain(unsigned char gain);
void setAntiVoxGain(unsigned char gain);
void setModInput(rigInput input, bool dataOn);
void setModInputLevel(rigInput input, unsigned char level);
void setAfMute(bool muteOn);
void setDialLock(bool lockOn);
void setNBLevel(unsigned char level);
void setNRLevel(unsigned char level);
// NB, NR, IP+:
void setIPP(bool enabled);
@ -330,9 +334,16 @@ signals:
void haveTxPower(unsigned char level);
void haveMicGain(unsigned char level);
void haveCompLevel(unsigned char level);
void haveMonitorLevel(unsigned char level);
void haveMonitorGain(unsigned char level);
void haveVoxGain(unsigned char gain);
void haveAntiVoxGain(unsigned char gain);
void haveNBLevel(unsigned char level);
void haveNRLevel(unsigned char level);
void haveVox(bool en);
void haveMonitor(bool en);
void haveComp(bool en);
void haveNB(bool en);
void haveNR(bool en);
// Modulation source and gain:
void haveModInput(rigInput input, bool isData);

Wyświetl plik

@ -360,7 +360,7 @@ signals:
void setMicGain(quint8);
void setCompLevel(quint8);
void setTxPower(quint8);
void setMonitorLevel(quint8);
void setMonitorGain(quint8);
void setVoxGain(quint8);
void setAntiVoxGain(quint8);
void setSpectrumRefLevel(int);

Wyświetl plik

@ -137,6 +137,9 @@ struct rigCapabilities {
quint16 spectAmpMax;
quint16 spectLenMax;
bool hasNB = false;
QByteArray nbCommand;
bool hasDD;
bool hasDV;
bool hasATU;

Plik diff jest za duży Load Diff

Wyświetl plik

@ -8,12 +8,24 @@
#include <QDateTime>
#include <QRect>
#include <QGraphicsTextItem>
#include <QSpinBox>
#include <QColor>
#include <QVector>
#include <QList>
#include <QMap>
#include <QMutex>
#include <QIODevice>
#include <QtEndian>
#include <QUuid>
#include <QLabel>
#include <QImage>
#include <QPainter>
#include <QImageWriter>
#include <QBuffer>
#include <QSettings>
#include <QMessageBox>
#include <memory>
#if defined(USB_CONTROLLER) && QT_VERSION < QT_VERSION_CHECK(6,0,0)
#include <QGamepad>
@ -23,7 +35,7 @@
#ifndef Q_OS_WIN
#include "hidapi/hidapi.h"
#else
#include "hidapi.h"
#include "hidapi.h"
#endif
#ifdef HID_API_VERSION_MAJOR
@ -53,15 +65,87 @@
using namespace std;
#define HIDDATALENGTH 64
#define MAX_STR 255
struct USBTYPE {
USBTYPE() {}
USBTYPE(usbDeviceType model,quint32 manufacturerId, quint32 productId , quint32 usage, quint32 usagePage, int buttons, int knobs, int leds, int maxPayload, int iconSize) :
model(model), manufacturerId(manufacturerId), productId(productId), usage(usage), usagePage(usagePage), buttons(buttons), knobs(knobs), leds(leds), maxPayload(maxPayload), iconSize(iconSize) {}
usbDeviceType model = usbNone;
quint32 manufacturerId=0;
quint32 productId=0;
quint32 usage=0;
quint32 usagePage=0;
int buttons=0;
int knobs=0;
int leds=0;
int maxPayload=0;
int iconSize=0;
};
struct KNOBVALUE {
int value=0;
int previous=0;
quint8 send=0;
qint64 lastChanged=0;
QString name="";
};
struct USBDEVICE {
USBDEVICE() {}
USBDEVICE(USBTYPE type) : type(type) {}
USBTYPE type;
bool detected = false;
bool remove = false;
bool connected = false;
bool uiCreated = false;
bool disabled = false;
quint8 speed=2;
quint8 timeout=30;
quint8 brightness=2;
quint8 orientation=0;
QColor color=Qt::darkGray;
cmds lcd=cmdNone;
hid_device* handle = NULL;
QString product = "";
QString manufacturer = "";
QString serial = "<none>";
QString deviceId = "";
QString path = "";
int sensitivity = 1;
unsigned char jogpos=0;
unsigned char shutpos=0;
unsigned char shutMult = 0;
int jogCounter = 0;
quint32 buttons = 0;
quint32 knobs = 0;
QList<KNOBVALUE> knobValues;
QTime lastusbController = QTime::currentTime();
QByteArray lastData = QByteArray(8,0x0);
unsigned char lastDialPos=0;
QUuid uuid;
QLabel *message;
int pages=1;
int currentPage=0;
QGraphicsScene* scene = Q_NULLPTR;
QSpinBox* pageSpin = Q_NULLPTR;
QImage image;
quint8 ledStatus=0x07;
};
struct COMMAND {
COMMAND() {}
COMMAND(int index, QString text, usbCommandType cmdType, int command, int value) :
index(index), text(text), cmdType(cmdType), command(command), value(value) {}
COMMAND(int index, QString text, usbCommandType cmdType, int command, unsigned char suffix) :
index(index), text(text), cmdType(cmdType), command(command), suffix(suffix) {}
COMMAND(int index, QString text, usbCommandType cmdType, int command, int getCommand, unsigned char suffix) :
index(index), text(text), cmdType(cmdType), command(command), getCommand(getCommand), suffix(suffix) {}
COMMAND(int index, QString text, usbCommandType cmdType, int command, availableBands band) :
index(index), text(text), cmdType(cmdType), command(command), band(band) {}
COMMAND(int index, QString text, usbCommandType cmdType, int command, mode_kind mode) :
@ -71,7 +155,9 @@ struct COMMAND {
QString text;
usbCommandType cmdType = commandButton;
int command=0;
int getCommand=0;
unsigned char suffix=0x0;
int value=0;
availableBands band=bandGen;
mode_kind mode=modeLSB;
};
@ -79,21 +165,33 @@ struct COMMAND {
struct BUTTON {
BUTTON() {}
BUTTON(usbDeviceType dev, int num, QRect pos, const QColor textColour, COMMAND* on, COMMAND* off) :
dev(dev), num(num), name(""), pos(pos), textColour(textColour), onCommand(on), offCommand(off) {}
BUTTON(usbDeviceType dev, int num, QRect pos, const QColor textColour, COMMAND* on, COMMAND* off, bool graphics=false, int led=0) :
dev(dev), num(num), name(""), pos(pos), textColour(textColour), onCommand(on), offCommand(off), on(onCommand->text), off(offCommand->text), graphics(graphics), led(led){}
BUTTON(usbDeviceType dev, QString name, QRect pos, const QColor textColour, COMMAND* on, COMMAND* off) :
dev(dev), num(-1), name(name), pos(pos), textColour(textColour), onCommand(on), offCommand(off) {}
dev(dev), num(-1), name(name), pos(pos), textColour(textColour), onCommand(on), offCommand(off), on(onCommand->text), off(offCommand->text) {}
usbDeviceType dev;
USBDEVICE* parent = Q_NULLPTR;
int page=1;
int num;
QString name;
QRect pos;
QColor textColour;
const COMMAND* onCommand = Q_NULLPTR;
const COMMAND* offCommand = Q_NULLPTR;
QGraphicsTextItem* onText;
QGraphicsTextItem* offText;
QGraphicsRectItem* bgRect = Q_NULLPTR;
QGraphicsTextItem* text = Q_NULLPTR;
QString on;
QString off;
QString path;
QColor backgroundOn = Qt::lightGray;
QColor backgroundOff = Qt::blue;
QString iconName = "";
QImage* icon = Q_NULLPTR;
bool toggle = false;
bool isOn = false;
bool graphics = false;
int led = 0;
};
@ -101,18 +199,25 @@ struct KNOB {
KNOB() {}
KNOB(usbDeviceType dev, int num, QRect pos, const QColor textColour, COMMAND* command) :
dev(dev), num(num), name(""), pos(pos), textColour(textColour), command(command) {}
dev(dev), num(num), name(""), pos(pos), textColour(textColour), command(command), cmd(command->text) {}
usbDeviceType dev;
USBDEVICE* parent = Q_NULLPTR;
int page=1;
int num;
QString name;
QRect pos;
QColor textColour;
const COMMAND* command = Q_NULLPTR;
QGraphicsTextItem* text;
QGraphicsTextItem* text = Q_NULLPTR;
QString cmd;
QString path;
};
typedef QMap<QString,USBDEVICE> usbDevMap;
#if defined(USB_CONTROLLER)
class usbController : public QObject
{
@ -121,25 +226,21 @@ class usbController : public QObject
public:
usbController();
~usbController();
bool hotPlugEvent(const QByteArray & eventType, void * message, long * result);
public slots:
void init(int sens, QMutex *mut);
void init(QMutex* mut,usbDevMap* prefs ,QVector<BUTTON>* buts,QVector<KNOB>* knobs);
void run();
void runTimer();
void ledControl(bool on, unsigned char num);
void receiveCommands(QVector<COMMAND>*);
void receiveButtons(QVector<BUTTON>*);
void receiveKnobs(QVector<KNOB>*);
void receivePTTStatus(bool on);
void getVersion();
void receiveSensitivity(int val);
void programButton(quint8 val, QString text);
void programBrightness(quint8 val);
void programOrientation(quint8 val);
void programSpeed(quint8 val);
void programWheelColour(quint8 r, quint8 g, quint8 b);
void programOverlay(quint8 duration, QString text);
void programTimeout(quint8 val);
void receiveLevel(cmds cmd, unsigned char level);
void programPages(USBDEVICE* dev, int pages);
void programDisable(USBDEVICE* dev, bool disabled);
void sendRequest(USBDEVICE *dev, usbFeatureType feature, int val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
void sendToLCD(QImage *img);
void backupController(USBDEVICE* dev, QString file);
void restoreController(USBDEVICE* dev, QString file);
signals:
void jogPlus();
@ -148,56 +249,53 @@ signals:
void doShuttle(bool plus, quint8 level);
void setBand(int band);
void button(const COMMAND* cmd);
void newDevice(unsigned char devType, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
void sendSensitivity(int val);
void initUI(usbDevMap* devs, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
void newDevice(USBDEVICE* dev);
void removeDevice(USBDEVICE* dev);
void setConnected(USBDEVICE* dev);
void changePage(USBDEVICE* dev, int page);
private:
hid_device* handle=NULL;
void loadButtons();
void loadKnobs();
void loadCommands();
int hidStatus = 1;
bool isOpen=false;
quint32 buttons = 0;
quint32 knobs = 0;
unsigned char jogpos=0;
unsigned char shutpos=0;
unsigned char shutMult = 0;
int jogCounter = 0;
QTime lastusbController = QTime::currentTime();
QByteArray lastData = QByteArray(8,0x0);
unsigned char lastDialPos=0;
int devicesConnected=0;
QVector<BUTTON>* buttonList;
QVector<KNOB>* knobList;
QVector<COMMAND>* commands = Q_NULLPTR;
QString product="";
QString manufacturer="";
QString serial="<none>";
QString deviceId = "";
QString path = "";
quint16 vendorId = 0;
quint16 productId = 0;
int sensitivity = 1;
QList<int> knobValues;
QList<quint8> knobSend;
QMutex* mutex=Q_NULLPTR;
QColor currentColour;
QVector<BUTTON> defaultButtons;
QVector<KNOB> defaultKnobs;
QVector<USBTYPE> knownDevices;
QVector<COMMAND> commands;
usbDevMap* devices;
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
QGamepad* gamepad=Q_NULLPTR;
#endif
void buttonState(QString but, bool val);
void buttonState(QString but, double val);
usbDeviceType usbDevice = usbNone;
QColor currentColour;
unsigned short knownUsbDevices[6][5] = {
{shuttleXpress,0x0b33,0x0020,0x0000,0x0000},
{shuttlePro2,0x0b33,0x0030,0x0000,0x0000},
{RC28,0x0c26,0x001e,0x0004,0x0004},
{eCoderPlus, 0x1fc9, 0x0003,0x0000,0x0000},
{QuickKeys, 0x28bd, 0x5202,0x0001,0xff0a},
{QuickKeys, 0x28bd, 0x5203,0x0001,0xff0a}
};
QMutex* mutex=Q_NULLPTR;
COMMAND sendCommand;
QTimer* dataTimer = Q_NULLPTR;
protected:
};
class usbControllerDev : public QObject
{
Q_OBJECT
};
#endif
#endif

Plik diff jest za duży Load Diff

Wyświetl plik

@ -19,6 +19,7 @@
#include <QMutexLocker>
#include <QColorDialog>
#include <QColor>
#include <QMap>
#include "logcategories.h"
#include "wfviewtypes.h"
@ -62,6 +63,18 @@
#include "rtaudio/RtAudio.h"
#endif
#ifdef USB_CONTROLLER
#ifdef Q_OS_WIN
#include <windows.h>
#include <dbt.h>
#define USB_HOTPLUG
#elif defined(Q_OS_LINUX)
#include <QSocketNotifier>
#include <libudev.h>
#define USB_HOTPLUG
#endif
#endif
#define numColorPresetsTotal (5)
namespace Ui {
@ -78,7 +91,20 @@ public:
static void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg);
void handleLogText(QString text);
#ifdef USB_HOTPLUG
#if defined(Q_OS_WIN)
protected:
virtual bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result);
#elif defined(Q_OS_LINUX)
private slots:
void uDevEvent();
#endif
#endif
signals:
// Signal levels received to other parts of wfview
void sendLevel(cmds cmd, unsigned char level);
void usbHotplug();
// Basic to rig:
void setCIVAddr(unsigned char newRigCIVAddr);
void setRigID(unsigned char rigID);
@ -90,6 +116,7 @@ signals:
// Frequency, mode, band:
void getFrequency();
void getFrequency(unsigned char);
void setFrequency(unsigned char vfo, freqt freq);
void getMode();
void setMode(unsigned char modeIndex, unsigned char modeFilter);
@ -140,7 +167,20 @@ signals:
void getModInputLevel(rigInput input);
void getMeters(meterKind meter);
void getPassband();
void getVoxGain();
void getAntiVoxGain();
void getMonitorGain();
void getNBLevel();
void getNRLevel();
void getCompLevel();
void getCwPitch();
void getVox();
void getMonitor();
void getCompressor();
void getNB();
void getNR();
void getDashRatio();
void getPskTone();
void getRttyMark();
@ -159,9 +199,18 @@ signals:
void setMicGain(unsigned char);
void setCompLevel(unsigned char);
void setTxPower(unsigned char);
void setMonitorLevel(unsigned char);
void setMonitorGain(unsigned char);
void setVoxGain(unsigned char);
void setAntiVoxGain(unsigned char);
void setNBLevel(unsigned char level);
void setNRLevel(unsigned char level);
void setVox(bool en);
void setMonitor(bool en);
void setCompressor(bool en);
void setNB(bool en);
void setNR(bool en);
void setSpectrumRefLevel(int);
void setModLevel(rigInput input, unsigned char level);
@ -170,6 +219,7 @@ signals:
void setACCBGain(unsigned char level);
void setUSBGain(unsigned char level);
void setLANGain(unsigned char level);
void setPassband(quint16 pass);
// PTT, ATU, ATT, Antenna, Preamp:
@ -225,11 +275,7 @@ signals:
void openShuttle();
void requestRigState();
void stateUpdated();
void initUsbController(int sens, QMutex* mutex);
void sendUsbControllerCommands(QVector<COMMAND>* cmds);
void sendUsbControllerButtons(QVector<BUTTON>* buts);
void sendUsbControllerKnobs(QVector<KNOB>* kbs);
void initUsbDefaults(quint8 bright, quint8 orient, quint8 speed, quint8 timeout, QColor color);
void initUsbController(QMutex* mutex,usbDevMap* devs ,QVector<BUTTON>* buts,QVector<KNOB>* knobs);
void setClusterUdpPort(int port);
void setClusterEnableUdp(bool udp);
void setClusterEnableTcp(bool tcp);
@ -240,6 +286,7 @@ signals:
void setClusterTimeout(int timeout);
void setClusterSkimmerSpots(bool enable);
void setFrequencyRange(double low, double high);
void sendControllerRequest(USBDEVICE* dev, usbFeatureType request, int val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
private slots:
void setAudioDevicesUI();
@ -299,9 +346,17 @@ private slots:
void receiveModInput(rigInput input, bool dataOn);
//void receiveDuplexMode(duplexMode dm);
void receivePassband(quint16 pass);
void receiveMonitorGain(unsigned char pass);
void receiveNBLevel(unsigned char pass);
void receiveNRLevel(unsigned char pass);
void receiveCwPitch(unsigned char pitch);
void receiveTPBFInner(unsigned char level);
void receiveTPBFOuter(unsigned char level);
void receiveVox(bool en);
void receiveMonitor(bool en);
void receiveComp(bool en);
void receiveNB(bool en);
void receiveNR(bool en);
// Levels:
void receiveRfGain(unsigned char level);
@ -317,7 +372,6 @@ private slots:
void receiveTxPower(unsigned char power);
void receiveMicGain(unsigned char gain);
void receiveCompLevel(unsigned char compLevel);
void receiveMonitorGain(unsigned char monitorGain);
void receiveVoxGain(unsigned char voxGain);
void receiveAntiVoxGain(unsigned char antiVoxGain);
void receiveSpectrumRefLevel(int level);
@ -354,8 +408,6 @@ private slots:
void showStatusBarText(QString text);
void receiveBaudRate(quint32 baudrate);
void radioSelection(QList<radio_cap_packet> radios);
void receiveUsbSensitivity(int val);
void receiveUsbSettings(quint8 bright, quint8 orient, quint8 speed, quint8 timeout, QColor color);
// Added for RC28/Shuttle support
@ -405,8 +457,7 @@ private slots:
void on_fEnterBtn_clicked();
void on_usbControllerBtn_clicked();
void on_usbButtonsResetBtn_clicked();
void on_usbCommandsResetBtn_clicked();
void on_usbControllersResetBtn_clicked();
void on_enableUsbChk_clicked(bool checked);
@ -500,7 +551,7 @@ private slots:
void on_vspCombo_currentIndexChanged(int value);
void on_scopeEnableWFBtn_clicked(bool checked);
void on_scopeEnableWFBtn_stateChanged(int state);
void on_sqlSlider_valueChanged(int value);
@ -926,6 +977,7 @@ private:
double oldLowerFreq;
double oldUpperFreq;
freqt freq;
freqt freqb;
float tsKnobMHz;
unsigned char setModeVal=0;
@ -1073,9 +1125,6 @@ private:
void updateUsbButtons();
void resetUsbButtons();
void resetUsbKnobs();
void resetUsbCommands();
int oldFreqDialVal;
rigCapabilities rigCaps;
@ -1102,7 +1151,7 @@ private:
satelliteSetup *sat;
transceiverAdjustments *trxadj;
cwSender *cw;
controllerSetup* shut;
controllerSetup* usbWindow = Q_NULLPTR;
aboutbox *abtBox;
selectRadio *selRad;
loggingWindow *logWindow;
@ -1150,11 +1199,18 @@ private:
#if defined (USB_CONTROLLER)
usbController *usbControllerDev = Q_NULLPTR;
QThread *usbControllerThread = Q_NULLPTR;
QString usbDeviceName;
QVector<COMMAND> usbCommands;
QString typeName;
QVector<BUTTON> usbButtons;
QVector<KNOB> usbKnobs;
usbDevMap usbDevices;
QMutex usbMutex;
qint64 lastUsbNotify=0;
#if defined (Q_OS_LINUX)
struct udev* uDev = nullptr;
struct udev_monitor* uDevMonitor = nullptr;
QSocketNotifier* uDevNotifier = nullptr;
#endif
#endif
dxClusterClient* cluster = Q_NULLPTR;
@ -1166,6 +1222,7 @@ private:
QMutex clusterMutex;
QColor clusterColor;
audioDevices* audioDev = Q_NULLPTR;
QImage lcdImage;
};
Q_DECLARE_METATYPE(struct rigCapabilities)
@ -1192,12 +1249,15 @@ Q_DECLARE_METATYPE(QVector <BUTTON>*)
Q_DECLARE_METATYPE(QVector <KNOB>*)
Q_DECLARE_METATYPE(QVector <COMMAND>*)
Q_DECLARE_METATYPE(const COMMAND*)
Q_DECLARE_METATYPE(const USBDEVICE*)
Q_DECLARE_METATYPE(codecType)
Q_DECLARE_METATYPE(errorType)
Q_DECLARE_METATYPE(enum duplexMode)
Q_DECLARE_METATYPE(enum rptAccessTxRx)
Q_DECLARE_METATYPE(struct rptrTone_t)
Q_DECLARE_METATYPE(struct rptrAccessData_t)
Q_DECLARE_METATYPE(enum usbFeatureType)
Q_DECLARE_METATYPE(enum cmds)
//void (*wfmain::logthistext)(QString text) = NULL;

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -159,12 +159,18 @@
</item>
<item>
<widget class="QCheckBox" name="scopeEnableWFBtn">
<property name="toolTip">
<string>Checked=WF enable, Unchecked=WF disable, Partial=Enable WF but no local display</string>
</property>
<property name="text">
<string>Enable WF</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -3443,8 +3449,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>820</width>
<height>302</height>
<width>579</width>
<height>254</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@ -5015,7 +5021,7 @@
<string/>
</property>
<property name="text">
<string>Setup USB Controller</string>
<string>Setup USB Controllers</string>
</property>
</widget>
</item>
@ -5033,23 +5039,16 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="usbButtonsResetBtn">
<widget class="QPushButton" name="usbControllersResetBtn">
<property name="text">
<string>Reset Buttons</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="usbCommandsResetBtn">
<property name="text">
<string>Reset Commands</string>
<string>Reset Controllers</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="usbResetLbl">
<property name="text">
<string>Only reset buttons/commands if you have issues. </string>
<string>Reset all USB controllers to defaults (delete all knobs/buttons)</string>
</property>
</widget>
</item>
@ -5537,8 +5536,8 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="underlayButtonGroup"/>
<buttongroup name="buttonGroup"/>
<buttongroup name="pollingButtonGroup"/>
<buttongroup name="underlayButtonGroup"/>
</buttongroups>
</ui>

Wyświetl plik

@ -51,7 +51,7 @@ macx:DEFINES += __MACOSX_CORE__
!linux:HEADERS += ../rtaudio/RTAUdio.h
!linux:INCLUDEPATH += ../rtaudio
linux:LIBS += -lpulse -lpulse-simple -lrtaudio -lpthread
linux:LIBS += -lpulse -lpulse-simple -lrtaudio -lpthread -ludev
win32:INCLUDEPATH += ../portaudio/include
!win32:LIBS += -lportaudio
@ -202,7 +202,7 @@ contains(DEFINES,USB_CONTROLLER){
}
!win32:LIBS += -L./ -l$$QCPLIB -lopus
win32:LIBS += -l$$QCPLIB -lopus -lole32
win32:LIBS += -l$$QCPLIB -lopus -lole32 -luser32
#macx:SOURCES += ../qcustomplot/qcustomplot.cpp

Wyświetl plik

@ -148,16 +148,19 @@ struct timekind {
};
enum cmds {
cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdSetFreq, cmdGetMode, cmdSetMode,
cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdGetFreqB, cmdSetFreq, cmdGetMode, cmdSetMode,
cmdGetDataMode, cmdSetModeFilter, cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue,
cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdSetRxRfGain, cmdGetAfGain, cmdSetAfGain,
cmdGetSql, cmdSetSql, cmdGetIFShift, cmdSetIFShift, cmdGetTPBFInner, cmdSetTPBFInner,
cmdGetTPBFOuter, cmdSetTPBFOuter, cmdGetPassband, cmdSetPassband,
cmdGetSql, cmdSetSql, cmdGetIFShift, cmdSetIFShift, cmdGetNRLevel, cmdSetNRLevel, cmdGetTPBFInner, cmdSetTPBFInner,
cmdGetTPBFOuter, cmdSetTPBFOuter, cmdGetPassband, cmdSetPassband, cmdGetNBLevel, cmdSetNBLevel,
cmdGetCompLevel, cmdSetCompLevel,
cmdGetMonitorGain, cmdSetMonitorGain, cmdGetVoxGain, cmdSetVoxGain, cmdGetAntiVoxGain, cmdSetAntiVoxGain,
cmdGetCwPitch, cmdGetPskTone, cmdGetRttyMark, cmdSetCwPitch, cmdSetPskTone, cmdSetRttyMark,
cmdGetVox,cmdSetVox, cmdGetMonitor,cmdSetMonitor, cmdGetComp, cmdSetComp, cmdGetNB, cmdSetNB, cmdGetNR, cmdSetNR,
cmdSetATU, cmdStartATU, cmdGetATUStatus,
cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode,
cmdGetPTT, cmdSetPTT,cmdPTTToggle,
cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdSetModLevel,
cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdGetModLevel, cmdSetModLevel,
cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput,
cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed,
cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetCenterMeter, cmdGetPowerMeter,
@ -170,7 +173,9 @@ enum cmds {
cmdGetBandStackReg, cmdGetKeySpeed, cmdSetKeySpeed, cmdGetBreakMode, cmdSetBreakMode, cmdSendCW, cmdStopCW, cmdGetDashRatio, cmdSetDashRatio,
cmdSetTime, cmdSetDate, cmdSetUTCOffset,
// Below Only used for USB Controller at the moment.
cmdSetBandUp, cmdSetBandDown, cmdSetModeUp, cmdSetModeDown, cmdSetStepUp, cmdSetStepDown, cmdSetSpanUp, cmdSetSpanDown, cmdIFFilterUp, cmdIFFilterDown
cmdSetBandUp, cmdSetBandDown, cmdSetModeUp, cmdSetModeDown, cmdSetStepUp, cmdSetStepDown,
cmdSetSpanUp, cmdSetSpanDown, cmdIFFilterUp, cmdIFFilterDown, cmdPageDown, cmdPageUp,
cmdLCDWaterfall, cmdLCDSpectrum, cmdLCDNothing, cmdSeparator
};
struct commandtype {
@ -195,7 +200,14 @@ enum codecType { LPCM, PCMU, OPUS };
enum passbandActions {passbandStatic, pbtInnerMove, pbtOuterMove, pbtMoving, passbandResizing};
enum usbDeviceType { usbNone = 0, shuttleXpress, shuttlePro2, RC28, xBoxGamepad, unknownGamepad, eCoderPlus, QuickKeys};
enum usbCommandType{ commandButton, commandKnob };
enum usbDeviceType { usbNone = 0, shuttleXpress, shuttlePro2,
RC28, xBoxGamepad, unknownGamepad, eCoderPlus, QuickKeys,
StreamDeckMini,StreamDeckMiniV2,StreamDeckOriginal,StreamDeckOriginalV2,
StreamDeckOriginalMK2,StreamDeckXL,StreamDeckXLV2,StreamDeckPedal, StreamDeckPlus
};
enum usbCommandType{ commandButton, commandKnob, commandAny };
enum usbFeatureType { featureReset,featureResetKeys, featureEventsA, featureEventsB, featureFirmware, featureSerial, featureButton, featureSensitivity, featureBrightness,
featureOrientation, featureSpeed, featureColor, featureOverlay, featureTimeout, featureLCD, featureGraph, featureLEDControl };
#endif // WFVIEWTYPES_H