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)); ui->topText->setText("wfview version " + QString(WFVIEW_VERSION));
QString head = QString("<html><head></head><body>"); 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 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 nacode = QString("<br/><br/>Networking, audio, rigctl server, and much more written by Phil Taylor, M0VSE");
QString scm = QString("<br/><br/>Source code and issues managed by Roeland Jansen, PA3MET"); 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."); 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: // 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(website + "\n" + donate + "\n"+ docs + support + contact +"\n");
aboutText.append("\n" + ssCredit + "\n" + rsCredit + "\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 <QGraphicsScene>
#include <QGraphicsTextItem> #include <QGraphicsTextItem>
#include <QGraphicsPixmapItem> #include <QGraphicsPixmapItem>
#include <QGraphicsRectItem>
#include <QPoint> #include <QPoint>
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#include <QVector> #include <QVector>
@ -14,14 +15,99 @@
#include <QLabel> #include <QLabel>
#include <QGraphicsProxyWidget> #include <QGraphicsProxyWidget>
#include <QAbstractItemView> #include <QAbstractItemView>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QPushButton>
#include <QScopedPointer>
#include <QCheckBox>
#include <QFileDialog>
#include <QMessageBox>
#include <QLayoutItem>
#include <QDebug> #include <QDebug>
#include <QObject> #include <QObject>
#include <QColorDialog> #include <QColorDialog>
#include <QWidget>
#include <QSpinBox>
#include <QCheckBox>
#include "usbcontroller.h" #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 { namespace Ui {
class controllerSetup; class controllerSetup;
@ -36,81 +122,102 @@ public:
~controllerSetup(); ~controllerSetup();
signals: signals:
void sendSensitivity(int val); void started();
void programButton(quint8 but, QString text); void sendRequest(USBDEVICE* dev, usbFeatureType request, int val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
void programBrightness(quint8 level); void programDisable(USBDEVICE* dev, bool disable);
void programWheelColour(quint8 r, quint8 g, quint8 b); void programPages(USBDEVICE* dev, int pages);
void programOverlay(quint8 duration, QString text); void backup(USBDEVICE* dev, QString path);
void programOrientation(quint8 value); void restore(USBDEVICE *dev, QString path);
void programSpeed(quint8 value);
void programTimeout(quint8 value);
void updateSettings(quint8 bright, quint8 orient, quint8 speed, quint8 timeout, QColor color);
public slots: public slots:
void newDevice(unsigned char devType, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut); void init(usbDevMap* dev, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
void mousePressed(QPoint p); void newDevice(USBDEVICE* dev);
void removeDevice(USBDEVICE* dev);
void showMenu(controllerScene *scene,QPoint p);
void onEventIndexChanged(int index); void onEventIndexChanged(int index);
void offEventIndexChanged(int index); void offEventIndexChanged(int index);
void knobEventIndexChanged(int index); void knobEventIndexChanged(int index);
void receiveSensitivity(int val); void ledNumberChanged(int index);
void on_sensitivitySlider_valueChanged(int val); void sensitivityMoved(USBDEVICE* dev, int val);
void on_qkBrightCombo_currentIndexChanged(int index); void brightnessChanged(USBDEVICE* dev, int index);
void on_qkOrientCombo_currentIndexChanged(int index); void orientationChanged(USBDEVICE* dev, int index);
void on_qkSpeedCombo_currentIndexChanged(int index); void speedChanged(USBDEVICE* dev, int index);
void on_qkColorButton_clicked(); void colorPicker(USBDEVICE* dev, QPushButton* btn, QColor color);
void on_qkTimeoutSpin_valueChanged(int arg1); void buttonOnColorClicked();
void setDefaults(quint8 bright, quint8 orient, quint8 speed, quint8 timeout, QColor color); 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: private:
usbDeviceType usbDevice = usbNone; usbDeviceType type = usbNone;
Ui::controllerSetup* ui; Ui::controllerSetup* ui;
QGraphicsScene* scene;
QGraphicsTextItem* textItem; QGraphicsTextItem* textItem;
QGraphicsItem* bgImage = Q_NULLPTR;
QLabel* imgLabel; QLabel* imgLabel;
unsigned char currentDevice = 0; unsigned char currentDevice = 0;
QVector<BUTTON>* buttons; QVector<BUTTON>* buttons;
QVector<KNOB>* knobs; QVector<KNOB>* knobs;
QVector<COMMAND>* commands; QVector<COMMAND>* commands;
usbDevMap* devices;
BUTTON* currentButton = Q_NULLPTR; BUTTON* currentButton = Q_NULLPTR;
KNOB* currentKnob = Q_NULLPTR; KNOB* currentKnob = Q_NULLPTR;
QComboBox* onEvent = Q_NULLPTR;
QComboBox* offEvent = Q_NULLPTR; // Update Dialog
QComboBox* knobEvent = Q_NULLPTR; QDialog * updateDialog = Q_NULLPTR;
QComboBox* qkBright = Q_NULLPTR; QComboBox* onEvent;
QGraphicsProxyWidget* onEventProxy = Q_NULLPTR; QComboBox* offEvent;
QGraphicsProxyWidget* offEventProxy = Q_NULLPTR; QComboBox* knobEvent;
QGraphicsProxyWidget* knobEventProxy = Q_NULLPTR; QLabel* onLabel;
QGraphicsProxyWidget* qkBrightProxy = Q_NULLPTR; QLabel* offLabel;
QLabel* knobLabel;
QPushButton* buttonOnColor;
QPushButton* buttonOffColor;
QCheckBox *buttonLatch;
QPushButton* buttonIcon;
QLabel* iconLabel;
QSpinBox* ledNumber;
QString deviceName; QString deviceName;
QMutex* mutex; QMutex* mutex;
QColor initialColor = Qt::white; 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> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>442</width> <width>788</width>
<height>343</height> <height>646</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Controller setup</string> <string>Controller setup</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <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"> <layout class="QHBoxLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
@ -31,6 +51,20 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </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> <item>
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
@ -60,197 +94,6 @@
</item> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
<resources/> <resources/>

Wyświetl plik

@ -399,6 +399,49 @@ typedef union capabilities_packet {
} *capabilities_packet_t; } *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) #pragma pack(pop)

11
prefs.h
Wyświetl plik

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

Wyświetl plik

@ -7,5 +7,10 @@
<file>ecoder.png</file> <file>ecoder.png</file>
<file>quickkeys.png</file> <file>quickkeys.png</file>
<file>xbox.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> </qresource>
</RCC> </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); 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() void rigCommander::getFrequency()
{ {
// figure out frequency and then respond with haveFrequency(); // figure out frequency and then respond with haveFrequency();
@ -1675,11 +1687,9 @@ void rigCommander::parseCommand()
parseFrequency(); parseFrequency();
break; break;
case '\x25': case '\x25':
if((int)payloadIn[1] == 0) // Parse both VFOs
{ emit haveFrequency(parseFrequency(payloadIn, 5));
emit haveFrequency(parseFrequency(payloadIn, 5)); break;
}
break;
case '\x01': case '\x01':
//qInfo(logRig()) << "Have mode data"; //qInfo(logRig()) << "Have mode data";
this->parseMode(); this->parseMode();
@ -1844,6 +1854,11 @@ void rigCommander::parseLevels()
emit haveTPBFOuter(level); emit haveTPBFOuter(level);
state.set(PBTOUT, level, false); state.set(PBTOUT, level, false);
break; break;
case '\x06':
// NR Level
emit haveNRLevel(level);
state.set(NR, level, false);
break;
case '\x09': case '\x09':
// CW Pitch // CW Pitch
emit haveCwPitch(level); emit haveCwPitch(level);
@ -1874,12 +1889,12 @@ void rigCommander::parseLevels()
state.set(COMPLEVEL, level, false); state.set(COMPLEVEL, level, false);
break; break;
case '\x12': case '\x12':
// NB level - ignore for now emit haveNB((bool)level);
state.set(NB, level, false); state.set(NB, level, false);
break; break;
case '\x15': case '\x15':
// monitor level // monitor level
emit haveMonitorLevel(level); emit haveMonitorGain(level);
state.set(MONITORLEVEL, level, false); state.set(MONITORLEVEL, level, false);
break; break;
case '\x16': case '\x16':
@ -2399,9 +2414,9 @@ void rigCommander::setCompLevel(unsigned char compLevel)
prepDataAndSend(payload); 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)); payload.append(bcdEncodeInt(monitorLevel));
prepDataAndSend(payload); prepDataAndSend(payload);
} }
@ -2420,6 +2435,22 @@ void rigCommander::setAntiVoxGain(unsigned char gain)
prepDataAndSend(payload); 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() void rigCommander::getRfGain()
{ {
@ -2429,8 +2460,13 @@ void rigCommander::getRfGain()
void rigCommander::getAfGain() void rigCommander::getAfGain()
{ {
QByteArray payload("\x14\x01"); if (udp == Q_NULLPTR) {
prepDataAndSend(payload); QByteArray payload("\x14\x01");
prepDataAndSend(payload);
}
else {
emit haveAfGain(localVolume);
}
} }
void rigCommander::getIFShift() void rigCommander::getIFShift()
@ -2475,7 +2511,7 @@ void rigCommander::getCompLevel()
prepDataAndSend(payload); prepDataAndSend(payload);
} }
void rigCommander::getMonitorLevel() void rigCommander::getMonitorGain()
{ {
QByteArray payload("\x14\x15"); QByteArray payload("\x14\x15");
prepDataAndSend(payload); prepDataAndSend(payload);
@ -2493,6 +2529,19 @@ void rigCommander::getAntiVoxGain()
prepDataAndSend(payload); prepDataAndSend(payload);
} }
void rigCommander::getNBLevel()
{
if (rigCaps.hasNB) {
prepDataAndSend(rigCaps.nbCommand);
}
}
void rigCommander::getNRLevel()
{
QByteArray payload("\x14\x06");
prepDataAndSend(payload);
}
void rigCommander::getLevels() void rigCommander::getLevels()
{ {
// Function to grab all levels // Function to grab all levels
@ -2502,7 +2551,7 @@ void rigCommander::getLevels()
getTxLevel(); // 0x0A getTxLevel(); // 0x0A
getMicGain(); // 0x0B getMicGain(); // 0x0B
getCompLevel(); // 0x0E getCompLevel(); // 0x0E
// getMonitorLevel(); // 0x15 // getMonitorGain(); // 0x15
// getVoxGain(); // 0x16 // getVoxGain(); // 0x16
// getAntiVoxGain(); // 0x17 // getAntiVoxGain(); // 0x17
} }
@ -3026,9 +3075,11 @@ void rigCommander::parseRegister16()
state.set(PREAMP, (quint8)payloadIn.at(2), false); state.set(PREAMP, (quint8)payloadIn.at(2), false);
break; break;
case '\x22': case '\x22':
emit haveNB(payloadIn.at(2) != 0);
state.set(NBFUNC, payloadIn.at(2) != 0, false); state.set(NBFUNC, payloadIn.at(2) != 0, false);
break; break;
case '\x40': case '\x40':
emit haveNR(payloadIn.at(2) != 0);
state.set(NRFUNC, payloadIn.at(2) != 0, false); state.set(NRFUNC, payloadIn.at(2) != 0, false);
break; break;
case '\x41': // Auto notch case '\x41': // Auto notch
@ -3055,12 +3106,15 @@ void rigCommander::parseRegister16()
emit haveRptAccessMode(ra); emit haveRptAccessMode(ra);
break; break;
case '\x44': case '\x44':
emit haveComp(payloadIn.at(2) != 0);
state.set(COMPFUNC, payloadIn.at(2) != 0, false); state.set(COMPFUNC, payloadIn.at(2) != 0, false);
break; break;
case '\x45': case '\x45':
emit haveMonitor(payloadIn.at(2) != 0);
state.set(MONFUNC, payloadIn.at(2) != 0, false); state.set(MONFUNC, payloadIn.at(2) != 0, false);
break; break;
case '\x46': case '\x46':
emit haveVox(payloadIn.at(2) != 0);
state.set(VOXFUNC, payloadIn.at(2) != 0, false); state.set(VOXFUNC, payloadIn.at(2) != 0, false);
break; break;
case '\x47': case '\x47':
@ -3104,6 +3158,10 @@ void rigCommander::parseBandStackReg()
freqt freqs = parseFrequency(payloadIn, 7); freqt freqs = parseFrequency(payloadIn, 7);
//float freq = (float)freqs.MHzDouble; //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... bool dataOn = (payloadIn[11] & 0x10) >> 4; // not sure...
char mode = payloadIn[9]; char mode = payloadIn[9];
char filter = payloadIn[10]; char filter = payloadIn[10];
@ -4644,6 +4702,7 @@ void rigCommander::parseFrequency()
// payloadIn[01] = ; // . XX KHz // payloadIn[01] = ; // . XX KHz
// printHex(payloadIn, false, true); // printHex(payloadIn, false, true);
frequencyMhz = 0.0; frequencyMhz = 0.0;
if (payloadIn.length() == 7) 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. // 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. // 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; freqt freqs;
freqs.MHzDouble = 0; freqs.MHzDouble = 0;
freqs.Hz = 0; freqs.Hz = 0;
// MHz: // Does Frequency contain 100 MHz/1 GHz data?
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
if(data.length() >= lastPosition+1) if(data.length() >= lastPosition+1)
{ {
freqs.Hz += (data[lastPosition+1] & 0x0f) * 1E6 * 100; // 100 MHz freqs.Hz += (data[lastPosition+1] & 0x0f) * 1E6 * 100; // 100 MHz
freqs.Hz += ((data[lastPosition+1] & 0xf0) >> 4) * 1E6 * 1000; // 1000 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: freqs.Hz += (data[lastPosition] & 0x0f) * 1E6;
freq += ((data[lastPosition-1] & 0xf0) >>4)/10.0 ; freqs.Hz += ((data[lastPosition] & 0xf0) >> 4) * 1E6 * 10; // 10 MHz
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-1] & 0x0f) * 10E3; // 10 KHz freqs.Hz += (data[lastPosition-1] & 0x0f) * 10E3; // 10 KHz
freqs.Hz += ((data[lastPosition-1] & 0xf0) >> 4) * 100E3; // 100 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); prepDataAndSend(payload);
} }
void rigCommander::setNb(bool enabled) { void rigCommander::setNB(bool enabled) {
QByteArray payload("\x16\x22"); QByteArray payload("\x16\x22");
payload.append((unsigned char)enabled); payload.append((unsigned char)enabled);
prepDataAndSend(payload); prepDataAndSend(payload);
} }
void rigCommander::getNb() void rigCommander::getNB()
{ {
QByteArray payload; QByteArray payload;
payload.setRawData("\x16\x22", 2); payload.setRawData("\x16\x22", 2);
prepDataAndSend(payload); prepDataAndSend(payload);
} }
void rigCommander::setNr(bool enabled) { void rigCommander::setNR(bool enabled) {
QByteArray payload("\x16\x40"); QByteArray payload("\x16\x40");
payload.append((unsigned char)enabled); payload.append((unsigned char)enabled);
prepDataAndSend(payload); prepDataAndSend(payload);
} }
void rigCommander::getNr() void rigCommander::getNR()
{ {
QByteArray payload; QByteArray payload;
payload.setRawData("\x16\x40", 2); payload.setRawData("\x16\x40", 2);
@ -5342,9 +5386,9 @@ void rigCommander::stateUpdated()
break; break;
case MONITORLEVEL: case MONITORLEVEL:
if (i.value()._valid) { if (i.value()._valid) {
setMonitorLevel(state.getChar(MONITORLEVEL)); setMonitorGain(state.getChar(MONITORLEVEL));
} }
getMonitorLevel(); getMonitorGain();
break; break;
case VOXGAIN: case VOXGAIN:
if (i.value()._valid) { if (i.value()._valid) {
@ -5360,15 +5404,15 @@ void rigCommander::stateUpdated()
break; break;
case NBFUNC: case NBFUNC:
if (i.value()._valid) { if (i.value()._valid) {
setNb(state.getBool(NBFUNC)); setNB(state.getBool(NBFUNC));
} }
getNb(); getNB();
break; break;
case NRFUNC: case NRFUNC:
if (i.value()._valid) { if (i.value()._valid) {
setNr(state.getBool(NRFUNC)); setNR(state.getBool(NRFUNC));
} }
getNr(); getNR();
break; break;
case ANFFUNC: case ANFFUNC:
if (i.value()._valid) { if (i.value()._valid) {

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Plik diff jest za duży Load Diff

Wyświetl plik

@ -8,12 +8,24 @@
#include <QDateTime> #include <QDateTime>
#include <QRect> #include <QRect>
#include <QGraphicsTextItem> #include <QGraphicsTextItem>
#include <QSpinBox>
#include <QColor> #include <QColor>
#include <QVector> #include <QVector>
#include <QList> #include <QList>
#include <QMap>
#include <QMutex> #include <QMutex>
#include <QIODevice> #include <QIODevice>
#include <QtEndian> #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) #if defined(USB_CONTROLLER) && QT_VERSION < QT_VERSION_CHECK(6,0,0)
#include <QGamepad> #include <QGamepad>
@ -23,7 +35,7 @@
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
#include "hidapi/hidapi.h" #include "hidapi/hidapi.h"
#else #else
#include "hidapi.h" #include "hidapi.h"
#endif #endif
#ifdef HID_API_VERSION_MAJOR #ifdef HID_API_VERSION_MAJOR
@ -53,15 +65,87 @@
using namespace std; using namespace std;
#define HIDDATALENGTH 64 #define HIDDATALENGTH 64
#define MAX_STR 255 #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 { struct COMMAND {
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) : COMMAND(int index, QString text, usbCommandType cmdType, int command, unsigned char suffix) :
index(index), text(text), cmdType(cmdType), command(command), suffix(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) : COMMAND(int index, QString text, usbCommandType cmdType, int command, availableBands band) :
index(index), text(text), cmdType(cmdType), command(command), band(band) {} index(index), text(text), cmdType(cmdType), command(command), band(band) {}
COMMAND(int index, QString text, usbCommandType cmdType, int command, mode_kind mode) : COMMAND(int index, QString text, usbCommandType cmdType, int command, mode_kind mode) :
@ -71,7 +155,9 @@ struct COMMAND {
QString text; QString text;
usbCommandType cmdType = commandButton; usbCommandType cmdType = commandButton;
int command=0; int command=0;
int getCommand=0;
unsigned char suffix=0x0; unsigned char suffix=0x0;
int value=0;
availableBands band=bandGen; availableBands band=bandGen;
mode_kind mode=modeLSB; mode_kind mode=modeLSB;
}; };
@ -79,21 +165,33 @@ struct COMMAND {
struct BUTTON { struct BUTTON {
BUTTON() {} BUTTON() {}
BUTTON(usbDeviceType dev, int num, QRect pos, const QColor textColour, COMMAND* on, COMMAND* 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) {} 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) : 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; usbDeviceType dev;
USBDEVICE* parent = Q_NULLPTR;
int page=1;
int num; int num;
QString name; QString name;
QRect pos; QRect pos;
QColor textColour; QColor textColour;
const COMMAND* onCommand = Q_NULLPTR; const COMMAND* onCommand = Q_NULLPTR;
const COMMAND* offCommand = Q_NULLPTR; const COMMAND* offCommand = Q_NULLPTR;
QGraphicsTextItem* onText; QGraphicsRectItem* bgRect = Q_NULLPTR;
QGraphicsTextItem* offText; 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() {}
KNOB(usbDeviceType dev, int num, QRect pos, const QColor textColour, COMMAND* command) : 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; usbDeviceType dev;
USBDEVICE* parent = Q_NULLPTR;
int page=1;
int num; int num;
QString name; QString name;
QRect pos; QRect pos;
QColor textColour; QColor textColour;
const COMMAND* command = Q_NULLPTR; const COMMAND* command = Q_NULLPTR;
QGraphicsTextItem* text; QGraphicsTextItem* text = Q_NULLPTR;
QString cmd;
QString path;
}; };
typedef QMap<QString,USBDEVICE> usbDevMap;
#if defined(USB_CONTROLLER) #if defined(USB_CONTROLLER)
class usbController : public QObject class usbController : public QObject
{ {
@ -121,25 +226,21 @@ class usbController : public QObject
public: public:
usbController(); usbController();
~usbController(); ~usbController();
bool hotPlugEvent(const QByteArray & eventType, void * message, long * result);
public slots: public slots:
void init(int sens, QMutex *mut); void init(QMutex* mut,usbDevMap* prefs ,QVector<BUTTON>* buts,QVector<KNOB>* knobs);
void run(); void run();
void runTimer(); 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 receivePTTStatus(bool on);
void getVersion(); void receiveLevel(cmds cmd, unsigned char level);
void receiveSensitivity(int val); void programPages(USBDEVICE* dev, int pages);
void programButton(quint8 val, QString text); void programDisable(USBDEVICE* dev, bool disabled);
void programBrightness(quint8 val);
void programOrientation(quint8 val); void sendRequest(USBDEVICE *dev, usbFeatureType feature, int val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
void programSpeed(quint8 val); void sendToLCD(QImage *img);
void programWheelColour(quint8 r, quint8 g, quint8 b); void backupController(USBDEVICE* dev, QString file);
void programOverlay(quint8 duration, QString text); void restoreController(USBDEVICE* dev, QString file);
void programTimeout(quint8 val);
signals: signals:
void jogPlus(); void jogPlus();
@ -148,56 +249,53 @@ signals:
void doShuttle(bool plus, quint8 level); void doShuttle(bool plus, quint8 level);
void setBand(int band); void setBand(int band);
void button(const COMMAND* cmd); void button(const COMMAND* cmd);
void newDevice(unsigned char devType, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut); void initUI(usbDevMap* devs, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
void sendSensitivity(int val); void newDevice(USBDEVICE* dev);
void removeDevice(USBDEVICE* dev);
void setConnected(USBDEVICE* dev);
void changePage(USBDEVICE* dev, int page);
private: private:
hid_device* handle=NULL; void loadButtons();
void loadKnobs();
void loadCommands();
int hidStatus = 1; int hidStatus = 1;
bool isOpen=false; bool isOpen=false;
quint32 buttons = 0; int devicesConnected=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;
QVector<BUTTON>* buttonList; QVector<BUTTON>* buttonList;
QVector<KNOB>* knobList; QVector<KNOB>* knobList;
QVector<COMMAND>* commands = Q_NULLPTR;
QString product=""; QVector<BUTTON> defaultButtons;
QString manufacturer=""; QVector<KNOB> defaultKnobs;
QString serial="<none>"; QVector<USBTYPE> knownDevices;
QString deviceId = ""; QVector<COMMAND> commands;
QString path = ""; usbDevMap* devices;
quint16 vendorId = 0;
quint16 productId = 0;
int sensitivity = 1;
QList<int> knobValues;
QList<quint8> knobSend;
QMutex* mutex=Q_NULLPTR;
QColor currentColour;
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) #if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
QGamepad* gamepad=Q_NULLPTR; QGamepad* gamepad=Q_NULLPTR;
#endif #endif
void buttonState(QString but, bool val); void buttonState(QString but, bool val);
void buttonState(QString but, double val); void buttonState(QString but, double val);
usbDeviceType usbDevice = usbNone; QColor currentColour;
unsigned short knownUsbDevices[6][5] = { QMutex* mutex=Q_NULLPTR;
{shuttleXpress,0x0b33,0x0020,0x0000,0x0000}, COMMAND sendCommand;
{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}
};
QTimer* dataTimer = Q_NULLPTR;
protected: protected:
}; };
class usbControllerDev : public QObject
{
Q_OBJECT
};
#endif #endif
#endif #endif

Plik diff jest za duży Load Diff

Wyświetl plik

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

Wyświetl plik

@ -18,7 +18,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="mainTab"> <widget class="QWidget" name="mainTab">
<attribute name="title"> <attribute name="title">
@ -159,12 +159,18 @@
</item> </item>
<item> <item>
<widget class="QCheckBox" name="scopeEnableWFBtn"> <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"> <property name="text">
<string>Enable WF</string> <string>Enable WF</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="tristate">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -3443,8 +3449,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>820</width> <width>579</width>
<height>302</height> <height>254</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
@ -5015,7 +5021,7 @@
<string/> <string/>
</property> </property>
<property name="text"> <property name="text">
<string>Setup USB Controller</string> <string>Setup USB Controllers</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -5033,23 +5039,16 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="usbButtonsResetBtn"> <widget class="QPushButton" name="usbControllersResetBtn">
<property name="text"> <property name="text">
<string>Reset Buttons</string> <string>Reset Controllers</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="usbCommandsResetBtn">
<property name="text">
<string>Reset Commands</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="usbResetLbl"> <widget class="QLabel" name="usbResetLbl">
<property name="text"> <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> </property>
</widget> </widget>
</item> </item>
@ -5537,8 +5536,8 @@
<resources/> <resources/>
<connections/> <connections/>
<buttongroups> <buttongroups>
<buttongroup name="underlayButtonGroup"/>
<buttongroup name="buttonGroup"/> <buttongroup name="buttonGroup"/>
<buttongroup name="pollingButtonGroup"/> <buttongroup name="pollingButtonGroup"/>
<buttongroup name="underlayButtonGroup"/>
</buttongroups> </buttongroups>
</ui> </ui>

Wyświetl plik

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

Wyświetl plik

@ -148,16 +148,19 @@ struct timekind {
}; };
enum cmds { enum cmds {
cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdSetFreq, cmdGetMode, cmdSetMode, cmdNone, cmdGetRigID, cmdGetRigCIV, cmdGetFreq, cmdGetFreqB, cmdSetFreq, cmdGetMode, cmdSetMode,
cmdGetDataMode, cmdSetModeFilter, cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue, cmdGetDataMode, cmdSetModeFilter, cmdSetDataModeOn, cmdSetDataModeOff, cmdGetRitEnabled, cmdGetRitValue,
cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdSetRxRfGain, cmdGetAfGain, cmdSetAfGain, cmdSpecOn, cmdSpecOff, cmdDispEnable, cmdDispDisable, cmdGetRxGain, cmdSetRxRfGain, cmdGetAfGain, cmdSetAfGain,
cmdGetSql, cmdSetSql, cmdGetIFShift, cmdSetIFShift, cmdGetTPBFInner, cmdSetTPBFInner, cmdGetSql, cmdSetSql, cmdGetIFShift, cmdSetIFShift, cmdGetNRLevel, cmdSetNRLevel, cmdGetTPBFInner, cmdSetTPBFInner,
cmdGetTPBFOuter, cmdSetTPBFOuter, cmdGetPassband, cmdSetPassband, cmdGetTPBFOuter, cmdSetTPBFOuter, cmdGetPassband, cmdSetPassband, cmdGetNBLevel, cmdSetNBLevel,
cmdGetCompLevel, cmdSetCompLevel,
cmdGetMonitorGain, cmdSetMonitorGain, cmdGetVoxGain, cmdSetVoxGain, cmdGetAntiVoxGain, cmdSetAntiVoxGain,
cmdGetCwPitch, cmdGetPskTone, cmdGetRttyMark, cmdSetCwPitch, cmdSetPskTone, cmdSetRttyMark, cmdGetCwPitch, cmdGetPskTone, cmdGetRttyMark, cmdSetCwPitch, cmdSetPskTone, cmdSetRttyMark,
cmdGetVox,cmdSetVox, cmdGetMonitor,cmdSetMonitor, cmdGetComp, cmdSetComp, cmdGetNB, cmdSetNB, cmdGetNR, cmdSetNR,
cmdSetATU, cmdStartATU, cmdGetATUStatus, cmdSetATU, cmdStartATU, cmdGetATUStatus,
cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode, cmdGetSpectrumMode, cmdGetSpectrumSpan, cmdScopeCenterMode, cmdScopeFixedMode,
cmdGetPTT, cmdSetPTT,cmdPTTToggle, cmdGetPTT, cmdSetPTT,cmdPTTToggle,
cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdSetModLevel, cmdGetTxPower, cmdSetTxPower, cmdGetMicGain, cmdSetMicGain, cmdGetModLevel, cmdSetModLevel,
cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput, cmdGetSpectrumRefLevel, cmdGetDuplexMode, cmdGetModInput, cmdGetModDataInput,
cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed, cmdGetCurrentModLevel, cmdStartRegularPolling, cmdStopRegularPolling, cmdQueNormalSpeed,
cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetCenterMeter, cmdGetPowerMeter, cmdGetVdMeter, cmdGetIdMeter, cmdGetSMeter, cmdGetCenterMeter, cmdGetPowerMeter,
@ -170,7 +173,9 @@ enum cmds {
cmdGetBandStackReg, cmdGetKeySpeed, cmdSetKeySpeed, cmdGetBreakMode, cmdSetBreakMode, cmdSendCW, cmdStopCW, cmdGetDashRatio, cmdSetDashRatio, cmdGetBandStackReg, cmdGetKeySpeed, cmdSetKeySpeed, cmdGetBreakMode, cmdSetBreakMode, cmdSendCW, cmdStopCW, cmdGetDashRatio, cmdSetDashRatio,
cmdSetTime, cmdSetDate, cmdSetUTCOffset, cmdSetTime, cmdSetDate, cmdSetUTCOffset,
// Below Only used for USB Controller at the moment. // 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 { struct commandtype {
@ -195,7 +200,14 @@ enum codecType { LPCM, PCMU, OPUS };
enum passbandActions {passbandStatic, pbtInnerMove, pbtOuterMove, pbtMoving, passbandResizing}; enum passbandActions {passbandStatic, pbtInnerMove, pbtOuterMove, pbtMoving, passbandResizing};
enum usbDeviceType { usbNone = 0, shuttleXpress, shuttlePro2, RC28, xBoxGamepad, unknownGamepad, eCoderPlus, QuickKeys}; enum usbDeviceType { usbNone = 0, shuttleXpress, shuttlePro2,
enum usbCommandType{ commandButton, commandKnob }; 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 #endif // WFVIEWTYPES_H