Lots more features and other fixes

qcpfix
Phil Taylor 2023-04-09 23:53:51 +01:00
rodzic 1da3696ba2
commit d5f0e0f63c
8 zmienionych plików z 602 dodań i 517 usunięć

Wyświetl plik

@ -21,6 +21,7 @@ controllerSetup::~controllerSetup()
delete noControllersText;
delete updateDialog;
delete ui;
}
void controllerSetup::hideEvent(QHideEvent *event)
@ -106,7 +107,7 @@ void controllerSetup::init(usbDevMap* dev, QVector<BUTTON>* but, QVector<KNOB>*
offEvent->addItem(c.text, c.index);
}
}
else if (c.cmdType == commandKnob || c.cmdType == commandAny) {
if (c.cmdType == commandKnob || c.cmdType == commandAny) {
if (c.command == cmdSeparator) {
knobEvent->insertSeparator(knobEvent->count());
} else {
@ -124,7 +125,7 @@ void controllerSetup::init(usbDevMap* dev, QVector<BUTTON>* but, QVector<KNOB>*
connect(buttonLatch, SIGNAL(stateChanged(int)), this, SLOT(latchStateChanged(int)));
}
void controllerSetup::mousePressed(controllerScene* scene, QPoint p)
void controllerSetup::showMenu(controllerScene* scene, QPoint p)
{
Q_UNUSED (scene) // We might want it in the future?
@ -245,11 +246,13 @@ void controllerSetup::onEventIndexChanged(int index) {
if (currentButton != Q_NULLPTR && onEvent->currentData().toInt() < commands->size()) {
QMutexLocker locker(mutex);
currentButton->onCommand = &commands->at(onEvent->currentData().toInt());
currentButton->onText->setPlainText(currentButton->onCommand->text);
currentButton->onText->setPos(currentButton->pos.center().x() - currentButton->onText->boundingRect().width() / 2,
(currentButton->pos.center().y() - currentButton->onText->boundingRect().height() / 2)-6);
currentButton->text->setPlainText(currentButton->onCommand->text);
currentButton->text->setPos(currentButton->pos.center().x() - currentButton->text->boundingRect().width() / 2,
(currentButton->pos.center().y() - currentButton->text->boundingRect().height() / 2));
// Signal that any button programming on the device should be completed.
emit sendRequest(currentButton->parent,usbFeatureType::featureButton,currentButton->num,currentButton->onCommand->text,Q_NULLPTR,&currentButton->backgroundOn);
if (currentButton->icon == Q_NULLPTR) {
emit sendRequest(currentButton->parent,usbFeatureType::featureButton,currentButton->num,currentButton->onCommand->text,Q_NULLPTR,&currentButton->backgroundOn);
}
}
}
@ -260,9 +263,6 @@ void controllerSetup::offEventIndexChanged(int index) {
if (currentButton != Q_NULLPTR && offEvent->currentData().toInt() < commands->size()) {
QMutexLocker locker(mutex);
currentButton->offCommand = &commands->at(offEvent->currentData().toInt());
currentButton->offText->setPlainText(currentButton->offCommand->text);
currentButton->offText->setPos(currentButton->pos.center().x() - currentButton->offText->boundingRect().width() / 2,
(currentButton->pos.center().y() - currentButton->offText->boundingRect().height() / 2)+6);
}
}
@ -273,8 +273,6 @@ void controllerSetup::knobEventIndexChanged(int index) {
// If command is changed, delete current command and deep copy the new command
if (currentKnob != Q_NULLPTR && knobEvent->currentData().toInt() < commands->size()) {
QMutexLocker locker(mutex);
if (currentKnob->command)
delete currentKnob->command;
currentKnob->command = &commands->at(knobEvent->currentData().toInt());
currentKnob->text->setPlainText(currentKnob->command->text);
currentKnob->text->setPos(currentKnob->pos.center().x() - currentKnob->text->boundingRect().width() / 2,
@ -295,6 +293,10 @@ void controllerSetup::buttonOnColorClicked()
{
QMutexLocker locker(mutex);
currentButton->backgroundOn = selColor;
if (currentButton->graphics && currentButton->bgRect != Q_NULLPTR)
{
currentButton->bgRect->setBrush(currentButton->backgroundOn);
}
buttonOnColor->setStyleSheet(QString("background-color: %1").arg(currentButton->backgroundOn.name(QColor::HexArgb)));
emit sendRequest(currentButton->parent,usbFeatureType::featureButton,currentButton->num,currentButton->onCommand->text,currentButton->icon,&currentButton->backgroundOn);
}
@ -327,8 +329,16 @@ void controllerSetup::buttonIconClicked()
if (currentButton->icon != Q_NULLPTR)
delete currentButton->icon;
currentButton->icon = new QImage(image.scaled(currentButton->parent->type.iconSize,currentButton->parent->type.iconSize));
emit sendRequest(currentButton->parent,usbFeatureType::featureButton,currentButton->num,currentButton->onCommand->text,currentButton->icon, &currentButton->backgroundOn);
} else {
if (currentButton->icon != Q_NULLPTR)
{
currentButton->iconName = "";
delete currentButton->icon;
currentButton->icon = Q_NULLPTR;
}
}
iconLabel->setText(currentButton->iconName);
emit sendRequest(currentButton->parent,usbFeatureType::featureButton,currentButton->num,currentButton->onCommand->text,currentButton->icon, &currentButton->backgroundOn);
}
void controllerSetup::latchStateChanged(int state)
@ -339,38 +349,6 @@ void controllerSetup::latchStateChanged(int state)
}
}
void controllerSetup::deleteMyWidget(QWidget* widget) {
QLayout *layout = widget->layout();
if (widget->layout())
{
QLayoutItem* child;
while (nullptr != (child = layout->takeAt(0)))
{
if (child->layout())
{
QLayoutItem* child2;
while (nullptr != (child2 = child->layout()->takeAt(0)))
{
if (child2->widget())
{
deleteMyWidget(child2->widget());
}
delete child2;
child2 = Q_NULLPTR;
}
}
else if (child->widget())
{
deleteMyWidget(child->widget());
}
delete child;
child = Q_NULLPTR;
}
}
delete widget;
}
void controllerSetup::removeDevice(USBDEVICE* dev)
{
QMutexLocker locker(mutex);
@ -387,22 +365,23 @@ void controllerSetup::removeDevice(USBDEVICE* dev)
{
if (b->parent == dev && b->page == dev->currentPage)
{
if (b->onText != Q_NULLPTR) {
tab.value()->scene->removeItem(b->onText);
delete b->onText;
b->onText = Q_NULLPTR;
b->onCommand = Q_NULLPTR;
}
if (b->offText != Q_NULLPTR) {
tab.value()->scene->removeItem(b->offText);
delete b->offText;
b->offText = Q_NULLPTR;
b->offCommand = Q_NULLPTR;
if (b->text != Q_NULLPTR) {
tab.value()->scene->removeItem(b->text);
delete b->text;
b->text = Q_NULLPTR;
}
b->offCommand = Q_NULLPTR;
b->onCommand = Q_NULLPTR;
if (b->icon != Q_NULLPTR) {
delete b->icon;
b->icon=Q_NULLPTR;
}
if (b->bgRect != Q_NULLPTR) {
tab.value()->scene->removeItem(b->bgRect);
delete b->bgRect;
b->bgRect = Q_NULLPTR;
}
}
}
@ -481,7 +460,6 @@ void controllerSetup::newDevice(USBDEVICE* dev)
c->mainLayout.addWidget(&c->widget);
c->widget.setLayout(&c->layout);
c->layout.addLayout(&c->sensLayout);
c->topLayout.addWidget(&c->disabled);
@ -503,14 +481,9 @@ void controllerSetup::newDevice(USBDEVICE* dev)
c->layout.addWidget(&c->view);
c->page.setObjectName("Page SpinBox");
c->page.setValue(1);
c->page.setMinimum(1);
c->page.setMaximum(dev->pages);
c->page.setToolTip("Select current page to edit");
c->layout.addWidget(&c->page,0,Qt::AlignBottom | Qt::AlignRight);
dev->pageSpin = &c->page;
c->layout.addLayout(&c->sensLayout);
c->sensLabel.setText("Sensitivity:");
c->sensLayout.addWidget(&c->sensLabel);
c->sens.setMinimum(1);
c->sens.setMaximum(21);
@ -521,6 +494,17 @@ void controllerSetup::newDevice(USBDEVICE* dev)
connect(&c->sens, &QSlider::valueChanged,
[dev,this](int val) { this->sensitivityMoved(dev,val); });
c->pageLabel.setText("Page:");
c->sensLayout.addWidget(&c->pageLabel);
c->page.setObjectName("Page SpinBox");
c->page.setValue(1);
c->page.setMinimum(1);
c->page.setMaximum(dev->pages);
c->page.setToolTip("Select current page to edit");
c->sensLayout.addWidget(&c->page);
dev->pageSpin = &c->page;
switch (dev->type.model) {
case shuttleXpress:
c->image.load(":/resources/shuttlexpress.png");
@ -577,11 +561,12 @@ void controllerSetup::newDevice(USBDEVICE* dev)
c->scene = new controllerScene();
c->view.setScene(c->scene);
connect(c->scene, SIGNAL(mousePressed(controllerScene*,QPoint)), this, SLOT(mousePressed(controllerScene*,QPoint)));
connect(c->scene, SIGNAL(showMenu(controllerScene*,QPoint)), this, SLOT(showMenu(controllerScene*,QPoint)));
c->scene->addItem(c->bgImage);
c->layout.addLayout(&c->grid);
c->brightLabel.setText("Brightness");
c->grid.addWidget(&c->brightLabel,0,0);
c->brightness.addItem("Off");
c->brightness.addItem("Low");
@ -592,6 +577,7 @@ void controllerSetup::newDevice(USBDEVICE* dev)
connect(&c->brightness, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->brightnessChanged(dev,index); });
c->speedLabel.setText("Speed");
c->grid.addWidget(&c->speedLabel,0,1);
c->speed.setObjectName("Speed");
c->speed.addItem("Fastest");
@ -604,6 +590,7 @@ void controllerSetup::newDevice(USBDEVICE* dev)
connect(&c->speed, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->speedChanged(dev,index); });
c->orientLabel.setText("Orientation");
c->grid.addWidget(&c->orientLabel,0,2);
c->orientation.addItem("Rotate 0");
c->orientation.addItem("Rotate 90");
@ -628,7 +615,7 @@ void controllerSetup::newDevice(USBDEVICE* dev)
connect(&c->timeout, qOverload<int>(&QSpinBox::valueChanged),
[dev,this](int index) { this->timeoutChanged(dev,index); });
c->pagesLabel.setText("Pages");
c->pagesLabel.setText("Num Pages");
c->grid.addWidget(&c->pagesLabel,0,5);
c->pages.setValue(dev->pages);
c->pages.setMinimum(1);
@ -664,12 +651,11 @@ void controllerSetup::newDevice(USBDEVICE* dev)
emit sendRequest(dev,usbFeatureType::featureOrientation,dev->orientation);
emit sendRequest(dev,usbFeatureType::featureSpeed,dev->speed);
emit sendRequest(dev,usbFeatureType::featureTimeout,dev->timeout);
emit sendRequest(dev,usbFeatureType::featureColor,0,dev->color.name(QColor::HexArgb));
emit sendRequest(dev,usbFeatureType::featureColor,0,"", Q_NULLPTR, &dev->color);
locker.unlock();
// pageChanged will update the buttons/knobs for the tab
pageChanged(dev,1);
// pageChanged will update the buttons/knobs for the tab (using qTimer ensures mutex is unlocked first)
QTimer::singleShot(0, this, [=]() { pageChanged(dev,1); });
}
@ -704,7 +690,7 @@ void controllerSetup::colorPicker(USBDEVICE* dev, QPushButton* btn, QColor curre
if(selColor.isValid())
{
btn->setStyleSheet(QString("background-color: %1").arg(selColor.name(QColor::HexArgb)));
emit sendRequest(dev,usbFeatureType::featureColor,0,selColor.name(QColor::HexArgb));
emit sendRequest(dev,usbFeatureType::featureColor,0, "", Q_NULLPTR, &selColor);
}
}
@ -723,6 +709,8 @@ void controllerSetup::pagesChanged(USBDEVICE* dev, int val)
void controllerSetup::pageChanged(USBDEVICE* dev, int val)
{
//QMutexLocker locker(mutex); // Not sure why I can't take the mutex here?
auto tab = tabs.find(dev->path);
if (tab == tabs.end())
{
@ -738,8 +726,6 @@ void controllerSetup::pageChanged(USBDEVICE* dev, int val)
updateDialog->hide(); // Hide the dialog if the page changes.
QMutexLocker locker(mutex);
int lastPage = dev->currentPage;
dev->currentPage=val;
dev->pageSpin->setValue(val);
@ -751,31 +737,31 @@ void controllerSetup::pageChanged(USBDEVICE* dev, int val)
{
if (b->page == lastPage)
{
if (b->onText != Q_NULLPTR) {
tab.value()->scene->removeItem(b->onText);
delete b->onText;
b->onText = Q_NULLPTR;
if (b->text != Q_NULLPTR) {
tab.value()->scene->removeItem(b->text);
delete b->text;
b->text = Q_NULLPTR;
}
if (b->offText != Q_NULLPTR) {
tab.value()->scene->removeItem(b->offText);
delete b->offText;
b->offText = Q_NULLPTR;
if (b->bgRect != Q_NULLPTR) {
tab.value()->scene->removeItem(b->bgRect);
delete b->bgRect;
b->bgRect = Q_NULLPTR;
}
}
else if (b->page == dev->currentPage)
if (b->page == dev->currentPage)
{
b->onText = new QGraphicsTextItem(b->onCommand->text);
b->onText->setDefaultTextColor(b->textColour);
tab.value()->scene->addItem(b->onText);
b->onText->setPos(b->pos.center().x() - b->onText->boundingRect().width() / 2,
(b->pos.center().y() - b->onText->boundingRect().height() / 2) - 6);
if (b->graphics)
{
b->bgRect = new QGraphicsRectItem(b->pos);
b->bgRect->setBrush(b->backgroundOn);
tab.value()->scene->addItem(b->bgRect);
}
b->text = new QGraphicsTextItem(b->onCommand->text);
b->text->setDefaultTextColor(b->textColour);
tab.value()->scene->addItem(b->text);
b->text->setPos(b->pos.center().x() - b->text->boundingRect().width() / 2,
(b->pos.center().y() - b->text->boundingRect().height() / 2));
emit sendRequest(dev,usbFeatureType::featureButton,b->num,b->onCommand->text,b->icon,&b->backgroundOn);
b->offText = new QGraphicsTextItem(b->offCommand->text);
b->offText->setDefaultTextColor(b->textColour);
tab.value()->scene->addItem(b->offText);
b->offText->setPos(b->pos.center().x() - b->offText->boundingRect().width() / 2,
(b->pos.center().y() - b->onText->boundingRect().height() / 2) + 6);
}
}
}
@ -792,7 +778,7 @@ void controllerSetup::pageChanged(USBDEVICE* dev, int val)
k->text = Q_NULLPTR;
}
}
else if (k->page == dev->currentPage)
if (k->page == dev->currentPage)
{
k->text = new QGraphicsTextItem(k->command->text);
k->text->setDefaultTextColor(k->textColour);
@ -836,8 +822,15 @@ void controllerSetup::on_backupButton_clicked()
{
QString file = QFileDialog::getSaveFileName(this,"Select Backup Filename",".","Backup Files (*.ini)");
if (!file.isEmpty()) {
QString path = ui->tabWidget->currentWidget()->objectName();
emit backup(file, path);
auto devIt = devices->find(ui->tabWidget->currentWidget()->objectName());
if (devIt==devices->end())
{
qWarning(logUsbControl) << "on_restoreButton_clicked() Cannot find existing controller, aborting!";
}
else
{
emit backup(&devIt.value(), file);
}
}
}
@ -888,8 +881,7 @@ void controllerSetup::on_restoreButton_clicked()
return;
}
}
emit restore(file, path);
emit restore(dev, file);
}
}

Wyświetl plik

@ -6,6 +6,7 @@
#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QGraphicsPixmapItem>
#include <QGraphicsRectItem>
#include <QPoint>
#include <QGraphicsSceneMouseEvent>
#include <QVector>
@ -39,19 +40,37 @@ class controllerScene : public QGraphicsScene
QGraphicsLineItem* item = Q_NULLPTR;
signals:
void mousePressed(controllerScene* scene, QPoint p);
void showMenu(controllerScene* scene, QPoint p);
void buttonAction(bool pressed, QPoint p);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent* event) {
if (event->button() == Qt::RightButton)
{
emit mousePressed(this, event->scenePos().toPoint());
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);
}
}
};
@ -64,6 +83,7 @@ struct tabContent {
QCheckBox disabled;
QLabel message;
QGraphicsView view;
QLabel pageLabel;
QSpinBox page;
QHBoxLayout sensLayout;
QLabel sensLabel;
@ -103,17 +123,17 @@ public:
signals:
void started();
void sendRequest(USBDEVICE* dev, usbFeatureType request, quint8 val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
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(QString file, QString path);
void restore(QString file, QString path);
void backup(USBDEVICE* dev, QString path);
void restore(USBDEVICE *dev, QString path);
public slots:
void init(usbDevMap* dev, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
void newDevice(USBDEVICE* dev);
void removeDevice(USBDEVICE* dev);
void mousePressed(controllerScene *scene,QPoint p);
void showMenu(controllerScene *scene,QPoint p);
void onEventIndexChanged(int index);
void offEventIndexChanged(int index);
void knobEventIndexChanged(int index);
@ -139,7 +159,6 @@ public slots:
private:
void deleteMyWidget(QWidget *);
usbDeviceType type = usbNone;
Ui::controllerSetup* ui;
QGraphicsTextItem* textItem;

Wyświetl plik

@ -2460,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()

Plik diff jest za duży Load Diff

Wyświetl plik

@ -163,9 +163,9 @@ 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), on(onCommand->text), off(offCommand->text) {}
BUTTON(usbDeviceType dev, QString name, 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) :
dev(dev), num(num), name(""), pos(pos), textColour(textColour), onCommand(on), offCommand(off), on(onCommand->text), off(offCommand->text), graphics(graphics) {}
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), on(onCommand->text), off(offCommand->text) {}
usbDeviceType dev;
@ -177,8 +177,8 @@ struct BUTTON {
QColor textColour;
const COMMAND* onCommand = Q_NULLPTR;
const COMMAND* offCommand = Q_NULLPTR;
QGraphicsTextItem* onText = Q_NULLPTR;
QGraphicsTextItem* offText = Q_NULLPTR;
QGraphicsRectItem* bgRect = Q_NULLPTR;
QGraphicsTextItem* text = Q_NULLPTR;
QString on;
QString off;
QString path;
@ -188,6 +188,7 @@ struct BUTTON {
QImage* icon = Q_NULLPTR;
bool toggle = false;
bool isOn = false;
bool graphics = false;
};
@ -234,10 +235,10 @@ public slots:
void programPages(USBDEVICE* dev, int pages);
void programDisable(USBDEVICE* dev, bool disabled);
void sendRequest(USBDEVICE *dev, usbFeatureType feature, quint8 val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
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(QString file, QString path);
void restoreController(QString file, QString path);
void backupController(USBDEVICE* dev, QString file);
void restoreController(USBDEVICE* dev, QString file);
signals:
void jogPlus();
@ -268,7 +269,7 @@ private:
QVector<KNOB> defaultKnobs;
QVector<USBTYPE> knownDevices;
QVector<COMMAND> commands;
usbDevMap* devices;
usbDevMap* devices;
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
QGamepad* gamepad=Q_NULLPTR;
@ -280,6 +281,7 @@ private:
QMutex* mutex=Q_NULLPTR;
COMMAND sendCommand;
QTimer* dataTimer = Q_NULLPTR;
protected:
};

Wyświetl plik

@ -1715,16 +1715,16 @@ void wfmain::setupUsbControllerDevice()
connect(usbControllerDev, SIGNAL(newDevice(USBDEVICE*)), usbWindow, SLOT(newDevice(USBDEVICE *)));
usbControllerThread->start(QThread::LowestPriority);
connect(usbWindow, SIGNAL(sendRequest(USBDEVICE*, usbFeatureType, quint8, QString, QImage*, QColor *)), usbControllerDev, SLOT(sendRequest(USBDEVICE*, usbFeatureType, quint8, QString, QImage*, QColor *)));
connect(this, SIGNAL(sendControllerRequest(USBDEVICE*, usbFeatureType, quint8, QString, QImage*, QColor *)), usbControllerDev, SLOT(sendRequest(USBDEVICE*, usbFeatureType, quint8, QString, QImage*, QColor *)));
connect(usbWindow, SIGNAL(sendRequest(USBDEVICE*, usbFeatureType, int, QString, QImage*, QColor *)), usbControllerDev, SLOT(sendRequest(USBDEVICE*, usbFeatureType, int, QString, QImage*, QColor *)));
connect(this, SIGNAL(sendControllerRequest(USBDEVICE*, usbFeatureType, int, QString, QImage*, QColor *)), usbControllerDev, SLOT(sendRequest(USBDEVICE*, usbFeatureType, int, QString, QImage*, QColor *)));
connect(usbWindow, SIGNAL(programPages(USBDEVICE*, int)), usbControllerDev, SLOT(programPages(USBDEVICE*, int)));
connect(usbWindow, SIGNAL(programDisable(USBDEVICE*, bool)), usbControllerDev, SLOT(programDisable(USBDEVICE*, bool)));
connect(this, SIGNAL(setPTT(bool)), usbControllerDev, SLOT(receivePTTStatus(bool)));
connect(this, SIGNAL(sendLevel(cmds, unsigned char)), usbControllerDev, SLOT(receiveLevel(cmds, unsigned char)));
connect(this, SIGNAL(initUsbController(QMutex*,usbDevMap*,QVector<BUTTON>*,QVector<KNOB>*)), usbControllerDev, SLOT(init(QMutex*,usbDevMap*,QVector<BUTTON>*,QVector<KNOB>*)));
connect(this, SIGNAL(usbHotplug()), usbControllerDev, SLOT(run()));
connect(usbWindow, SIGNAL(backup(QString, QString)), usbControllerDev, SLOT(backupController(QString, QString)));
connect(usbWindow, SIGNAL(restore(QString, QString)), usbControllerDev, SLOT(restoreController(QString, QString)));
connect(usbWindow, SIGNAL(backup(USBDEVICE*, QString)), usbControllerDev, SLOT(backupController(USBDEVICE*, QString)));
connect(usbWindow, SIGNAL(restore(USBDEVICE*, QString)), usbControllerDev, SLOT(restoreController(USBDEVICE*, QString)));
#endif
}
@ -2579,6 +2579,7 @@ void wfmain::loadSettings()
}
butt.on = settings->value("OnCommand", "None").toString();
butt.off = settings->value("OffCommand", "None").toString();
butt.graphics = settings->value("Graphics", false).toBool();
if (!butt.path.isEmpty())
usbButtons.append(butt);
}
@ -3091,6 +3092,7 @@ void wfmain::saveSettings()
settings->setValue("OnCommand", usbButtons[nb].onCommand->text);
if (usbButtons[nb].offCommand != Q_NULLPTR)
settings->setValue("OffCommand", usbButtons[nb].offCommand->text);
settings->setValue("Graphics",usbButtons[nb].graphics);
}
settings->endArray();

Wyświetl plik

@ -277,7 +277,7 @@ signals:
void setClusterTimeout(int timeout);
void setClusterSkimmerSpots(bool enable);
void setFrequencyRange(double low, double high);
void sendControllerRequest(USBDEVICE* dev, usbFeatureType request, quint8 val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
void sendControllerRequest(USBDEVICE* dev, usbFeatureType request, int val=0, QString text="", QImage* img=Q_NULLPTR, QColor* color=Q_NULLPTR);
private slots:
void setAudioDevicesUI();

Wyświetl plik

@ -174,7 +174,7 @@ enum cmds {
// Below Only used for USB Controller at the moment.
cmdSetBandUp, cmdSetBandDown, cmdSetModeUp, cmdSetModeDown, cmdSetStepUp, cmdSetStepDown,
cmdSetSpanUp, cmdSetSpanDown, cmdIFFilterUp, cmdIFFilterDown, cmdPageDown, cmdPageUp,
cmdLCDWaterfall, cmdLCDSpectrum, cmdSeparator
cmdLCDWaterfall, cmdLCDSpectrum, cmdLCDNothing, cmdSeparator
};
struct commandtype {