Update Linux UI for generic RGB interface branch
This commit is contained in:
parent
7ba607be8a
commit
f71f325a97
5 changed files with 142 additions and 621 deletions
|
|
@ -10,13 +10,20 @@ SOURCES += \
|
|||
OpenAuraSDK/AuraController.cpp \
|
||||
OpenAuraSDK/OpenAuraSDK.cpp \
|
||||
OpenAuraSDK/i2c_smbus_linux.cpp \
|
||||
OpenAuraSDK/OpenAuraSDKQtDialog.cpp
|
||||
OpenAuraSDK/OpenAuraSDKQtDialog.cpp \
|
||||
OpenAuraSDK/CorsairController.cpp \
|
||||
OpenAuraSDK/RGBController_Aura.cpp \
|
||||
OpenAuraSDK/RGBController_Corsair.cpp
|
||||
|
||||
HEADERS += \
|
||||
OpenAuraSDK/i2c_smbus.h \
|
||||
OpenAuraSDK/i2c_smbus_linux.h \
|
||||
OpenAuraSDK/AuraController.h \
|
||||
OpenAuraSDK/OpenAuraSDKQtDialog.h
|
||||
OpenAuraSDK/OpenAuraSDKQtDialog.h \
|
||||
OpenAuraSDK/CorsairController.h \
|
||||
OpenAuraSDK/RGBController.h \
|
||||
OpenAuraSDK/RGBController_Aura.h \
|
||||
OpenAuraSDK/RGBController_Corsair.h
|
||||
|
||||
FORMS += \
|
||||
OpenAuraSDK/openaurasdk.ui
|
||||
|
|
|
|||
|
|
@ -679,7 +679,7 @@ int main(int argc, char *argv[])
|
|||
#else
|
||||
QApplication a(argc, argv);
|
||||
|
||||
Ui::OpenAuraSDKQtDialog dlg(busses, controllers);
|
||||
Ui::OpenAuraSDKQtDialog dlg(busses, rgb_controllers);
|
||||
dlg.show();
|
||||
|
||||
return a.exec();
|
||||
|
|
|
|||
|
|
@ -3,18 +3,17 @@
|
|||
|
||||
using namespace Ui;
|
||||
|
||||
OpenAuraSDKQtDialog::OpenAuraSDKQtDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<AuraController *>& control, QWidget *parent) : QMainWindow(parent), busses(bus), controllers (control), ui(new OpenAuraSDKQtDialogUi)
|
||||
OpenAuraSDKQtDialog::OpenAuraSDKQtDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent) : QMainWindow(parent), busses(bus), controllers (control), ui(new OpenAuraSDKQtDialogUi)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->ComboAuraDevices->addItem("All Devices");
|
||||
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
ui->ComboAuraDevices->addItem(controllers[i]->GetDeviceName());
|
||||
ui->ComboDevices->addItem(controllers[i]->name.c_str());
|
||||
}
|
||||
|
||||
ui->ComboAuraDevices->setCurrentIndex(0);
|
||||
//Triggers on_ComboDevices_currentIndexChanged so we don't need to update the other fields here
|
||||
ui->ComboDevices->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
OpenAuraSDKQtDialog::~OpenAuraSDKQtDialog()
|
||||
|
|
@ -29,328 +28,68 @@ void OpenAuraSDKQtDialog::show()
|
|||
|
||||
void Ui::OpenAuraSDKQtDialog::on_ButtonSetAll_clicked()
|
||||
{
|
||||
unsigned int aura_device = ui->ComboAuraDevices->currentIndex();
|
||||
RGBColor color = ToRGBColor(
|
||||
ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt()
|
||||
);
|
||||
|
||||
if (aura_device == 0)
|
||||
controllers[ui->ComboDevices->currentIndex()]->SetAllLEDs(color);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_ButtonSetZone_clicked()
|
||||
{
|
||||
RGBColor color = ToRGBColor(
|
||||
ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt()
|
||||
);
|
||||
|
||||
controllers[ui->ComboDevices->currentIndex()]->SetAllZoneLEDs(ui->ComboZones->currentIndex(), color);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_ButtonSetLED_clicked()
|
||||
{
|
||||
RGBColor color = ToRGBColor(
|
||||
ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt()
|
||||
);
|
||||
|
||||
controllers[ui->ComboDevices->currentIndex()]->SetLED(ui->ComboLEDs->currentIndex(), color);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_ComboDevices_currentIndexChanged(int index)
|
||||
{
|
||||
ui->ComboModes->clear();
|
||||
|
||||
for (int i = 0; i < controllers[ui->ComboDevices->currentIndex()]->modes.size(); i++)
|
||||
{
|
||||
unsigned char direct = ui->RadioDirect->isChecked();
|
||||
|
||||
if (direct == 0)
|
||||
{
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
controllers[i]->SetAllColorsEffect(ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt());
|
||||
|
||||
controllers[i]->SetDirect(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
controllers[i]->SetAllColorsDirect(ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt());
|
||||
|
||||
controllers[i]->SetDirect(true);
|
||||
}
|
||||
}
|
||||
ui->ComboModes->addItem(controllers[ui->ComboDevices->currentIndex()]->modes[i].name.c_str());
|
||||
}
|
||||
else
|
||||
|
||||
ui->ComboModes->setCurrentIndex(controllers[ui->ComboDevices->currentIndex()]->GetMode());
|
||||
|
||||
ui->ComboZones->clear();
|
||||
|
||||
for (int i = 0; i < controllers[ui->ComboDevices->currentIndex()]->zones.size(); i++)
|
||||
{
|
||||
unsigned char direct = controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_DIRECT);
|
||||
|
||||
if (direct == 0)
|
||||
{
|
||||
controllers[aura_device - 1]->SetAllColorsEffect(ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt());
|
||||
}
|
||||
else
|
||||
{
|
||||
controllers[aura_device - 1]->SetAllColorsDirect(ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt());
|
||||
}
|
||||
ui->ComboZones->addItem(controllers[ui->ComboDevices->currentIndex()]->zones[i].name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_ButtonSetColors_clicked()
|
||||
{
|
||||
unsigned int aura_device = ui->ComboAuraDevices->currentIndex();
|
||||
ui->ComboZones->setCurrentIndex(0);
|
||||
|
||||
if (aura_device == 0)
|
||||
ui->ComboLEDs->clear();
|
||||
|
||||
for (int i = 0; i < controllers[ui->ComboDevices->currentIndex()]->leds.size(); i++)
|
||||
{
|
||||
unsigned char direct = ui->RadioDirect->isChecked();
|
||||
|
||||
if (direct == 0)
|
||||
{
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
controllers[i]->SetLEDColorEffect( 0,
|
||||
ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt() );
|
||||
controllers[i]->SetLEDColorEffect( 1,
|
||||
ui->EditLED1R->text().toInt(),
|
||||
ui->EditLED1G->text().toInt(),
|
||||
ui->EditLED1B->text().toInt() );
|
||||
controllers[i]->SetLEDColorEffect( 2,
|
||||
ui->EditLED2R->text().toInt(),
|
||||
ui->EditLED2G->text().toInt(),
|
||||
ui->EditLED2B->text().toInt() );
|
||||
controllers[i]->SetLEDColorEffect( 3,
|
||||
ui->EditLED3R->text().toInt(),
|
||||
ui->EditLED3G->text().toInt(),
|
||||
ui->EditLED3B->text().toInt() );
|
||||
controllers[i]->SetLEDColorEffect( 4,
|
||||
ui->EditLED4R->text().toInt(),
|
||||
ui->EditLED4G->text().toInt(),
|
||||
ui->EditLED4B->text().toInt() );
|
||||
|
||||
controllers[i]->SetDirect(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
controllers[i]->SetLEDColorDirect( 0,
|
||||
ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt() );
|
||||
controllers[i]->SetLEDColorDirect( 1,
|
||||
ui->EditLED1R->text().toInt(),
|
||||
ui->EditLED1G->text().toInt(),
|
||||
ui->EditLED1B->text().toInt() );
|
||||
controllers[i]->SetLEDColorDirect( 2,
|
||||
ui->EditLED2R->text().toInt(),
|
||||
ui->EditLED2G->text().toInt(),
|
||||
ui->EditLED2B->text().toInt() );
|
||||
controllers[i]->SetLEDColorDirect( 3,
|
||||
ui->EditLED3R->text().toInt(),
|
||||
ui->EditLED3G->text().toInt(),
|
||||
ui->EditLED3B->text().toInt() );
|
||||
controllers[i]->SetLEDColorDirect( 4,
|
||||
ui->EditLED4R->text().toInt(),
|
||||
ui->EditLED4G->text().toInt(),
|
||||
ui->EditLED4B->text().toInt() );
|
||||
|
||||
controllers[i]->SetDirect(true);
|
||||
}
|
||||
}
|
||||
ui->ComboLEDs->addItem(controllers[ui->ComboDevices->currentIndex()]->leds[i].name.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char direct = controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_DIRECT);
|
||||
|
||||
if (direct == 0)
|
||||
{
|
||||
controllers[aura_device - 1]->SetLEDColorEffect( 0,
|
||||
ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorEffect( 1,
|
||||
ui->EditLED1R->text().toInt(),
|
||||
ui->EditLED1G->text().toInt(),
|
||||
ui->EditLED1B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorEffect( 2,
|
||||
ui->EditLED2R->text().toInt(),
|
||||
ui->EditLED2G->text().toInt(),
|
||||
ui->EditLED2B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorEffect( 3,
|
||||
ui->EditLED3R->text().toInt(),
|
||||
ui->EditLED3G->text().toInt(),
|
||||
ui->EditLED3B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorEffect( 4,
|
||||
ui->EditLED4R->text().toInt(),
|
||||
ui->EditLED4G->text().toInt(),
|
||||
ui->EditLED4B->text().toInt() );
|
||||
}
|
||||
else
|
||||
{
|
||||
controllers[aura_device - 1]->SetLEDColorDirect( 0,
|
||||
ui->EditLED0R->text().toInt(),
|
||||
ui->EditLED0G->text().toInt(),
|
||||
ui->EditLED0B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorDirect( 1,
|
||||
ui->EditLED1R->text().toInt(),
|
||||
ui->EditLED1G->text().toInt(),
|
||||
ui->EditLED1B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorDirect( 2,
|
||||
ui->EditLED2R->text().toInt(),
|
||||
ui->EditLED2G->text().toInt(),
|
||||
ui->EditLED2B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorDirect( 3,
|
||||
ui->EditLED3R->text().toInt(),
|
||||
ui->EditLED3G->text().toInt(),
|
||||
ui->EditLED3B->text().toInt() );
|
||||
controllers[aura_device - 1]->SetLEDColorDirect( 4,
|
||||
ui->EditLED4R->text().toInt(),
|
||||
ui->EditLED4G->text().toInt(),
|
||||
ui->EditLED4B->text().toInt() );
|
||||
}
|
||||
}
|
||||
ui->ComboLEDs->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioDirect_clicked()
|
||||
void Ui::OpenAuraSDKQtDialog::on_ComboModes_currentIndexChanged(int index)
|
||||
{
|
||||
unsigned int aura_device = ui->ComboAuraDevices->currentIndex();
|
||||
if ( aura_device == 0)
|
||||
{
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
controllers[i]->SetDirect(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
controllers[aura_device - 1]->SetDirect(true);
|
||||
}
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioEffect_clicked()
|
||||
{
|
||||
unsigned int aura_device = ui->ComboAuraDevices->currentIndex();
|
||||
if (aura_device == 0)
|
||||
{
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
controllers[i]->SetDirect(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
controllers[aura_device - 1]->SetDirect(false);
|
||||
}
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_ComboAuraDevices_currentIndexChanged(int aura_device)
|
||||
{
|
||||
if (aura_device != 0)
|
||||
{
|
||||
unsigned char direct = controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_DIRECT);
|
||||
|
||||
ui->RadioDirect->setChecked(direct != 0);
|
||||
ui->RadioEffect->setChecked(direct == 0);
|
||||
|
||||
unsigned char mode = controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_MODE);
|
||||
|
||||
ui->RadioOff->setChecked(mode == AURA_MODE_OFF);
|
||||
ui->RadioStatic->setChecked(mode == AURA_MODE_STATIC);
|
||||
ui->RadioBreathing->setChecked(mode == AURA_MODE_BREATHING);
|
||||
ui->RadioFlashing->setChecked(mode == AURA_MODE_FLASHING);
|
||||
ui->RadioSpectrumCycle->setChecked(mode == AURA_MODE_SPECTRUM_CYCLE);
|
||||
ui->RadioRainbow->setChecked(mode == AURA_MODE_RAINBOW);
|
||||
ui->RadioBreathingSpectrum->setChecked(mode == AURA_MODE_SPECTRUM_CYCLE_BREATHING);
|
||||
ui->RadioChaseFade->setChecked(mode == AURA_MODE_CHASE_FADE);
|
||||
|
||||
if (direct == 0)
|
||||
{
|
||||
ui->EditLED0R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 0)));
|
||||
ui->EditLED0B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 1)));
|
||||
ui->EditLED0G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 2)));
|
||||
ui->EditLED1R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 3)));
|
||||
ui->EditLED1B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 4)));
|
||||
ui->EditLED1G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 5)));
|
||||
ui->EditLED2R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 6)));
|
||||
ui->EditLED2B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 7)));
|
||||
ui->EditLED2G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 8)));
|
||||
ui->EditLED3R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 9)));
|
||||
ui->EditLED3B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 10)));
|
||||
ui->EditLED3G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 11)));
|
||||
ui->EditLED4R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 12)));
|
||||
ui->EditLED4B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 13)));
|
||||
ui->EditLED4G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_EFFECT + 14)));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->EditLED0R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 0)));
|
||||
ui->EditLED0B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 1)));
|
||||
ui->EditLED0G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 2)));
|
||||
ui->EditLED1R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 3)));
|
||||
ui->EditLED1B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 4)));
|
||||
ui->EditLED1G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 5)));
|
||||
ui->EditLED2R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 6)));
|
||||
ui->EditLED2B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 7)));
|
||||
ui->EditLED2G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 8)));
|
||||
ui->EditLED3R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 9)));
|
||||
ui->EditLED3B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 10)));
|
||||
ui->EditLED3G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 11)));
|
||||
ui->EditLED4R->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 12)));
|
||||
ui->EditLED4B->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 13)));
|
||||
ui->EditLED4G->setText(QString::number(controllers[aura_device - 1]->AuraRegisterRead(AURA_REG_COLORS_DIRECT + 14)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OpenAuraSDKQtDialog::setMode(unsigned char mode_val)
|
||||
{
|
||||
unsigned int aura_device = ui->ComboAuraDevices->currentIndex();
|
||||
|
||||
if (aura_device == 0)
|
||||
{
|
||||
for (int i = 0; i < controllers.size(); i++)
|
||||
{
|
||||
controllers[i]->SetMode(mode_val);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
controllers[aura_device - 1]->SetMode(mode_val);
|
||||
}
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioOff_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_OFF);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioStatic_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_STATIC);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioBreathing_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_BREATHING);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioFlashing_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_FLASHING);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioSpectrumCycle_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_SPECTRUM_CYCLE);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioRainbow_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_RAINBOW);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioBreathingSpectrum_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_SPECTRUM_CYCLE_BREATHING);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_RadioChaseFade_clicked()
|
||||
{
|
||||
setMode(AURA_MODE_CHASE_FADE);
|
||||
}
|
||||
|
||||
void Ui::OpenAuraSDKQtDialog::on_ButtonDumpAura_clicked()
|
||||
{
|
||||
unsigned int aura_device = ui->ComboAuraDevices->currentIndex();
|
||||
|
||||
if (aura_device > 0)
|
||||
{
|
||||
ui->ButtonDumpAura->setEnabled(false);
|
||||
DumpAuraRegisters(controllers[aura_device - 1]);
|
||||
ui->ButtonDumpAura->setEnabled(true);
|
||||
}
|
||||
controllers[ui->ComboDevices->currentIndex()]->SetMode(ui->ComboModes->currentIndex());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include <vector>
|
||||
#include "i2c_smbus.h"
|
||||
#include "AuraController.h"
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QTimer>
|
||||
|
|
@ -22,7 +22,7 @@ class Ui::OpenAuraSDKQtDialog : public QMainWindow
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenAuraSDKQtDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<AuraController *>& control, QWidget *parent = 0);
|
||||
explicit OpenAuraSDKQtDialog(std::vector<i2c_smbus_interface *>& bus, std::vector<RGBController *>& control, QWidget *parent = 0);
|
||||
~OpenAuraSDKQtDialog();
|
||||
|
||||
void show();
|
||||
|
|
@ -30,36 +30,18 @@ public:
|
|||
|
||||
protected:
|
||||
std::vector<i2c_smbus_interface *>& busses;
|
||||
std::vector<AuraController *>& controllers;
|
||||
std::vector<RGBController *>& controllers;
|
||||
|
||||
private slots:
|
||||
void on_ButtonSetAll_clicked();
|
||||
|
||||
void on_ButtonSetColors_clicked();
|
||||
void on_ButtonSetZone_clicked();
|
||||
|
||||
void on_RadioDirect_clicked();
|
||||
void on_ButtonSetLED_clicked();
|
||||
|
||||
void on_RadioEffect_clicked();
|
||||
void on_ComboDevices_currentIndexChanged(int index);
|
||||
|
||||
void on_ComboAuraDevices_currentIndexChanged(int index);
|
||||
|
||||
void on_RadioOff_clicked();
|
||||
|
||||
void on_RadioStatic_clicked();
|
||||
|
||||
void on_RadioBreathing_clicked();
|
||||
|
||||
void on_RadioFlashing_clicked();
|
||||
|
||||
void on_RadioSpectrumCycle_clicked();
|
||||
|
||||
void on_RadioRainbow_clicked();
|
||||
|
||||
void on_RadioBreathingSpectrum_clicked();
|
||||
|
||||
void on_RadioChaseFade_clicked();
|
||||
|
||||
void on_ButtonDumpAura_clicked();
|
||||
void on_ComboModes_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
Ui::OpenAuraSDKQtDialogUi *ui;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>500</width>
|
||||
<height>300</height>
|
||||
<height>160</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<y>60</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
|
|
@ -27,24 +27,24 @@
|
|||
<string>Set All</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="ButtonSetColors">
|
||||
<widget class="QPushButton" name="ButtonSetZone">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>10</y>
|
||||
<y>60</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set Colors</string>
|
||||
<string>Set Zone</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED0R">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<y>30</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>60</y>
|
||||
<y>30</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
|
|
@ -64,127 +64,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>60</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED1R">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>90</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED1G">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>90</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED1B">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>90</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED2R">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>120</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED2G">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>120</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED2B">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>120</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED3R">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>150</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED3G">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>150</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED3B">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>150</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED4R">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>180</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED4G">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>180</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="EditLED4B">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>180</y>
|
||||
<y>30</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
|
|
@ -194,7 +74,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<y>10</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
|
|
@ -207,7 +87,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>40</y>
|
||||
<y>10</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
|
|
@ -220,7 +100,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>40</y>
|
||||
<y>10</y>
|
||||
<width>50</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
|
|
@ -229,7 +109,7 @@
|
|||
<string>Blue</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="ComboAuraDevices">
|
||||
<widget class="QComboBox" name="ComboDevices">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
|
|
@ -249,176 +129,89 @@
|
|||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Aura Device</string>
|
||||
<string>Device</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="GroupBoxDirect">
|
||||
<widget class="QComboBox" name="ComboModes">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>40</y>
|
||||
<width>200</width>
|
||||
<height>60</height>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
</widget>
|
||||
<widget class="QLabel" name="LabelMode">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>40</y>
|
||||
<width>90</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mode</string>
|
||||
</property>
|
||||
<widget class="QRadioButton" name="RadioDirect">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>70</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Direct</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioEffect">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>30</y>
|
||||
<width>70</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Effect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="GroupBoxEffect">
|
||||
<widget class="QComboBox" name="ComboZones">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>70</y>
|
||||
<width>200</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="LabelZone">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>200</x>
|
||||
<y>70</y>
|
||||
<width>90</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Zone</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="ComboLEDs">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>100</y>
|
||||
<width>200</width>
|
||||
<height>180</height>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Effect</string>
|
||||
</property>
|
||||
<widget class="QRadioButton" name="RadioOff">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>150</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Off</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioStatic">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>150</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Static</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioBreathing">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>60</y>
|
||||
<width>150</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Breathing</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioFlashing">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>80</y>
|
||||
<width>150</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Flashing</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioSpectrumCycle">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>100</y>
|
||||
<width>150</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Spectrum Cycle</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioRainbow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>120</y>
|
||||
<width>150</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rainbow Wave</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioBreathingSpectrum">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>140</y>
|
||||
<width>180</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Breathing Spectrum</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="RadioChaseFade">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>180</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Chase Fade</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="ButtonDumpAura">
|
||||
<widget class="QLabel" name="LabelLED">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<y>260</y>
|
||||
<width>89</width>
|
||||
<height>25</height>
|
||||
<x>200</x>
|
||||
<y>100</y>
|
||||
<width>90</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dump Aura</string>
|
||||
<string>LED</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="ButtonSetLED">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>90</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set LED</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue