From 12bddeda97b5d428f4ef9006180051c14b01aecc Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Wed, 15 Feb 2017 12:17:06 +1030 Subject: Fade with individual speed control now works, can fade each color at its own speed. Serial communication revamped to allow extra commands in both the front and backend. --- qt/RGBController/RGBController | Bin 82912 -> 93104 bytes qt/RGBController/RGBController.pro.user | 2 +- qt/RGBController/controllerwindow.cpp | 78 ++++- qt/RGBController/controllerwindow.h | 28 +- qt/RGBController/controllerwindow.o | Bin 83864 -> 98264 bytes qt/RGBController/controllerwindow.ui | 292 ++++++++++-------- qt/RGBController/controllerwindow.ui.autosave | 352 ---------------------- qt/RGBController/moc_controllerwindow.cpp | 112 +++++-- qt/RGBController/moc_controllerwindow.o | Bin 14024 -> 16920 bytes qt/RGBController/serial_communication.cpp | 11 +- qt/RGBController/serial_communication.h | 2 + qt/RGBController/serial_communication.o | Bin 8856 -> 10928 bytes qt/RGBController/ui_controllerwindow.h | 414 ++++++++++++++------------ 13 files changed, 610 insertions(+), 681 deletions(-) delete mode 100644 qt/RGBController/controllerwindow.ui.autosave (limited to 'qt/RGBController') diff --git a/qt/RGBController/RGBController b/qt/RGBController/RGBController index 2fc670d..ddb96b0 100755 Binary files a/qt/RGBController/RGBController and b/qt/RGBController/RGBController differ diff --git a/qt/RGBController/RGBController.pro.user b/qt/RGBController/RGBController.pro.user index 1e96029..be156cc 100755 --- a/qt/RGBController/RGBController.pro.user +++ b/qt/RGBController/RGBController.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/qt/RGBController/controllerwindow.cpp b/qt/RGBController/controllerwindow.cpp index e9eabd5..9cf41f2 100755 --- a/qt/RGBController/controllerwindow.cpp +++ b/qt/RGBController/controllerwindow.cpp @@ -301,19 +301,22 @@ void controllerWindow::on_reload_preset_button_clicked() void controllerWindow::on_r_slider_valueChanged(int value) { r = value; - serial_rgb_change(r, g, b); + //serial_rgb_change(r, g, b); + portf.send("red=" + QString::number(r)); } void controllerWindow::on_g_slider_valueChanged(int value) { g = value; - serial_rgb_change(r, g, b); + //serial_rgb_change(r, g, b); + portf.send("green=" + QString::number(g)); } void controllerWindow::on_b_slider_valueChanged(int value) { b = value; - serial_rgb_change(r, g, b); + //serial_rgb_change(r, g, b); + portf.send("blue=" + QString::number(b)); } void controllerWindow::on_red_button_clicked() @@ -339,6 +342,9 @@ void controllerWindow::on_blue_button_clicked() void controllerWindow::on_off_button_clicked() { + ui->r_slider->setValue(1); + ui->g_slider->setValue(1); + ui->b_slider->setValue(1); ui->r_slider->setValue(0); ui->g_slider->setValue(0); ui->b_slider->setValue(0); @@ -383,3 +389,69 @@ void controllerWindow::on_preset_delete_button_clicked() { delete_preset(ui->presets_dropdown->currentText()); } + +void controllerWindow::on_red_fade_button_clicked() +{ + portf.send("redfade"); +} + +void controllerWindow::on_green_fade_button_clicked() +{ + portf.send("greenfade"); +} + +void controllerWindow::on_blue_fade_button_clicked() +{ + portf.send("bluefade"); +} + +void controllerWindow::on_speed_button_clicked() +{ + portf.send("speed=" + QString::number(ui->speed_slider->value())); +} + +void controllerWindow::on_r_speed_slider_valueChanged(int value) +{ + portf.send("rspeed=" + QString::number(value)); +} + +void controllerWindow::on_g_speed_slider_valueChanged(int value) +{ + portf.send("gspeed=" + QString::number(value)); +} + +void controllerWindow::on_b_speed_slider_valueChanged(int value) +{ + portf.send("bspeed=" + QString::number(value)); +} + +void controllerWindow::on_rfrom_valueChanged(int arg1) +{ + portf.send("rf=" + QString::number(arg1)); + ui->r_slider->setValue(arg1); +} + +void controllerWindow::on_rto_valueChanged(int arg1) +{ + +} + +void controllerWindow::on_gfrom_valueChanged(int arg1) +{ + +} + +void controllerWindow::on_gto_valueChanged(int arg1) +{ + +} + +void controllerWindow::on_bfrom_valueChanged(int arg1) +{ + +} + +void controllerWindow::on_bto_valueChanged(int arg1) +{ + +} diff --git a/qt/RGBController/controllerwindow.h b/qt/RGBController/controllerwindow.h index b8ca051..8b4456b 100755 --- a/qt/RGBController/controllerwindow.h +++ b/qt/RGBController/controllerwindow.h @@ -75,7 +75,33 @@ class controllerWindow : public QMainWindow void on_preset_delete_button_clicked(); - private: + void on_red_fade_button_clicked(); + + void on_green_fade_button_clicked(); + + void on_blue_fade_button_clicked(); + + void on_speed_button_clicked(); + + void on_r_speed_slider_valueChanged(int value); + + void on_g_speed_slider_valueChanged(int value); + + void on_b_speed_slider_valueChanged(int value); + + void on_rfrom_valueChanged(int arg1); + + void on_rto_valueChanged(int arg1); + + void on_gfrom_valueChanged(int arg1); + + void on_gto_valueChanged(int arg1); + + void on_bfrom_valueChanged(int arg1); + + void on_bto_valueChanged(int arg1); + +private: Ui::controllerWindow *ui; /* serial communication object */ serial_communication portf; diff --git a/qt/RGBController/controllerwindow.o b/qt/RGBController/controllerwindow.o index 887caec..3ccf97f 100644 Binary files a/qt/RGBController/controllerwindow.o and b/qt/RGBController/controllerwindow.o differ diff --git a/qt/RGBController/controllerwindow.ui b/qt/RGBController/controllerwindow.ui index c4a9973..ca1d807 100755 --- a/qt/RGBController/controllerwindow.ui +++ b/qt/RGBController/controllerwindow.ui @@ -9,8 +9,8 @@ 0 0 - 227 - 499 + 232 + 629 @@ -18,38 +18,53 @@ - - + + - <font color = red>Disconnected</font> + Reload - - - - - 120 - 0 - + + + + Off + + + + - Arduino port + Delete - - + + + + Presets + + - - + + - Refresh + Disconnect - - + + + + <font color = red>Disconnected</font> + + + + + + + + 120 @@ -70,27 +85,25 @@ - - - - Connect + + + + 1 - - - - - - Disconnect + + 500 - - - - - - RGB colors + + Qt::Horizontal + + + + + + @@ -101,44 +114,63 @@ - - + + - Red + Information log - - - - - 120 - 0 - + + + + Green - - - 120 - 16777215 - + + + + + + Refresh + + + + + + + 1 - 255 + 500 Qt::Horizontal - - + + - Green + RGB colors - - + + + + Status + + + + + + + Save + + + + + 120 @@ -159,153 +191,171 @@ - - - - Blue + + + + 1 + + + 500 + + + Qt::Horizontal - - + + - Off + Green speed - - + + - Set + Red - - + + - Reload + Blue - - - - - + + - Save + Connect - - + + - Presets + Red speed - - - - Status + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + 255 + + + Qt::Horizontal - - + + - Delete + Set - + - Set + Blue toggle - + 255 - + 255 - + 255 - + to - + 255 - + to - + 255 - + 255 - + - Set + Green toggle - + - Set + Red toggle - + to - + Fade @@ -313,18 +363,35 @@ - - + + + + + 120 + 0 + + - Information log + Arduino port - - + + + + Blue speed + + - - + + + + Speed + + + + + 10 @@ -336,13 +403,6 @@ - - - - Speed - - - diff --git a/qt/RGBController/controllerwindow.ui.autosave b/qt/RGBController/controllerwindow.ui.autosave deleted file mode 100644 index 32a1319..0000000 --- a/qt/RGBController/controllerwindow.ui.autosave +++ /dev/null @@ -1,352 +0,0 @@ - - - controllerWindow - - - Qt::WindowModal - - - - 0 - 0 - 227 - 499 - - - - RGB Controller - - - - - - - <font color = red>Disconnected</font> - - - - - - - - 120 - 0 - - - - Arduino port - - - - - - - - - - Refresh - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 255 - - - Qt::Horizontal - - - - - - - Connect - - - - - - - Disconnect - - - - - - - RGB colors - - - - - - - - 120 - 0 - - - - - - - - Red - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 255 - - - Qt::Horizontal - - - - - - - Green - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - 255 - - - Qt::Horizontal - - - - - - - Blue - - - - - - - Off - - - - - - - Set - - - - - - - Reload - - - - - - - - - - Save - - - - - - - Presets - - - - - - - Status - - - - - - - Delete - - - - - - - - - Set - - - - - - - 255 - - - - - - - 255 - - - - - - - 255 - - - - - - - to - - - - - - - 255 - - - - - - - to - - - - - - - 255 - - - - - - - 255 - - - - - - - Set - - - - - - - Set - - - - - - - to - - - - - - - Fade - - - - - - - - - Information log - - - - - - - - - - 10 - - - 500 - - - Qt::Horizontal - - - - - - - Speed - - - - - - - - - - diff --git a/qt/RGBController/moc_controllerwindow.cpp b/qt/RGBController/moc_controllerwindow.cpp index a2e9cb0..3b9dff9 100644 --- a/qt/RGBController/moc_controllerwindow.cpp +++ b/qt/RGBController/moc_controllerwindow.cpp @@ -21,8 +21,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_controllerWindow_t { - QByteArrayData data[19]; - char stringdata0[445]; + QByteArrayData data[33]; + char stringdata0[777]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -49,7 +49,21 @@ QT_MOC_LITERAL(14, 308, 28), // "on_set_preset_button_clicked" QT_MOC_LITERAL(15, 337, 39), // "on_presets_dropdown_currentIn..." QT_MOC_LITERAL(16, 377, 5), // "index" QT_MOC_LITERAL(17, 383, 29), // "on_preset_save_button_clicked" -QT_MOC_LITERAL(18, 413, 31) // "on_preset_delete_button_clicked" +QT_MOC_LITERAL(18, 413, 31), // "on_preset_delete_button_clicked" +QT_MOC_LITERAL(19, 445, 26), // "on_red_fade_button_clicked" +QT_MOC_LITERAL(20, 472, 28), // "on_green_fade_button_clicked" +QT_MOC_LITERAL(21, 501, 27), // "on_blue_fade_button_clicked" +QT_MOC_LITERAL(22, 529, 23), // "on_speed_button_clicked" +QT_MOC_LITERAL(23, 553, 30), // "on_r_speed_slider_valueChanged" +QT_MOC_LITERAL(24, 584, 30), // "on_g_speed_slider_valueChanged" +QT_MOC_LITERAL(25, 615, 30), // "on_b_speed_slider_valueChanged" +QT_MOC_LITERAL(26, 646, 21), // "on_rfrom_valueChanged" +QT_MOC_LITERAL(27, 668, 4), // "arg1" +QT_MOC_LITERAL(28, 673, 19), // "on_rto_valueChanged" +QT_MOC_LITERAL(29, 693, 21), // "on_gfrom_valueChanged" +QT_MOC_LITERAL(30, 715, 19), // "on_gto_valueChanged" +QT_MOC_LITERAL(31, 735, 21), // "on_bfrom_valueChanged" +QT_MOC_LITERAL(32, 757, 19) // "on_bto_valueChanged" }, "controllerWindow\0on_connect_button_clicked\0" @@ -64,7 +78,18 @@ QT_MOC_LITERAL(18, 413, 31) // "on_preset_delete_button_clicked" "on_set_preset_button_clicked\0" "on_presets_dropdown_currentIndexChanged\0" "index\0on_preset_save_button_clicked\0" - "on_preset_delete_button_clicked" + "on_preset_delete_button_clicked\0" + "on_red_fade_button_clicked\0" + "on_green_fade_button_clicked\0" + "on_blue_fade_button_clicked\0" + "on_speed_button_clicked\0" + "on_r_speed_slider_valueChanged\0" + "on_g_speed_slider_valueChanged\0" + "on_b_speed_slider_valueChanged\0" + "on_rfrom_valueChanged\0arg1\0" + "on_rto_valueChanged\0on_gfrom_valueChanged\0" + "on_gto_valueChanged\0on_bfrom_valueChanged\0" + "on_bto_valueChanged" }; #undef QT_MOC_LITERAL @@ -74,7 +99,7 @@ static const uint qt_meta_data_controllerWindow[] = { 7, // revision 0, // classname 0, 0, // classinfo - 15, 14, // methods + 28, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors @@ -82,21 +107,34 @@ static const uint qt_meta_data_controllerWindow[] = { 0, // signalCount // slots: name, argc, parameters, tag, flags - 1, 0, 89, 2, 0x08 /* Private */, - 3, 0, 90, 2, 0x08 /* Private */, - 4, 0, 91, 2, 0x08 /* Private */, - 5, 0, 92, 2, 0x08 /* Private */, - 6, 1, 93, 2, 0x08 /* Private */, - 8, 1, 96, 2, 0x08 /* Private */, - 9, 1, 99, 2, 0x08 /* Private */, - 10, 0, 102, 2, 0x08 /* Private */, - 11, 0, 103, 2, 0x08 /* Private */, - 12, 0, 104, 2, 0x08 /* Private */, - 13, 0, 105, 2, 0x08 /* Private */, - 14, 0, 106, 2, 0x08 /* Private */, - 15, 1, 107, 2, 0x08 /* Private */, - 17, 0, 110, 2, 0x08 /* Private */, - 18, 0, 111, 2, 0x08 /* Private */, + 1, 0, 154, 2, 0x08 /* Private */, + 3, 0, 155, 2, 0x08 /* Private */, + 4, 0, 156, 2, 0x08 /* Private */, + 5, 0, 157, 2, 0x08 /* Private */, + 6, 1, 158, 2, 0x08 /* Private */, + 8, 1, 161, 2, 0x08 /* Private */, + 9, 1, 164, 2, 0x08 /* Private */, + 10, 0, 167, 2, 0x08 /* Private */, + 11, 0, 168, 2, 0x08 /* Private */, + 12, 0, 169, 2, 0x08 /* Private */, + 13, 0, 170, 2, 0x08 /* Private */, + 14, 0, 171, 2, 0x08 /* Private */, + 15, 1, 172, 2, 0x08 /* Private */, + 17, 0, 175, 2, 0x08 /* Private */, + 18, 0, 176, 2, 0x08 /* Private */, + 19, 0, 177, 2, 0x08 /* Private */, + 20, 0, 178, 2, 0x08 /* Private */, + 21, 0, 179, 2, 0x08 /* Private */, + 22, 0, 180, 2, 0x08 /* Private */, + 23, 1, 181, 2, 0x08 /* Private */, + 24, 1, 184, 2, 0x08 /* Private */, + 25, 1, 187, 2, 0x08 /* Private */, + 26, 1, 190, 2, 0x08 /* Private */, + 28, 1, 193, 2, 0x08 /* Private */, + 29, 1, 196, 2, 0x08 /* Private */, + 30, 1, 199, 2, 0x08 /* Private */, + 31, 1, 202, 2, 0x08 /* Private */, + 32, 1, 205, 2, 0x08 /* Private */, // slots: parameters QMetaType::Void, @@ -114,6 +152,19 @@ static const uint qt_meta_data_controllerWindow[] = { QMetaType::Void, QMetaType::Int, 16, QMetaType::Void, QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, QMetaType::Int, 7, + QMetaType::Void, QMetaType::Int, 7, + QMetaType::Void, QMetaType::Int, 7, + QMetaType::Void, QMetaType::Int, 27, + QMetaType::Void, QMetaType::Int, 27, + QMetaType::Void, QMetaType::Int, 27, + QMetaType::Void, QMetaType::Int, 27, + QMetaType::Void, QMetaType::Int, 27, + QMetaType::Void, QMetaType::Int, 27, 0 // eod }; @@ -139,6 +190,19 @@ void controllerWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int case 12: _t->on_presets_dropdown_currentIndexChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 13: _t->on_preset_save_button_clicked(); break; case 14: _t->on_preset_delete_button_clicked(); break; + case 15: _t->on_red_fade_button_clicked(); break; + case 16: _t->on_green_fade_button_clicked(); break; + case 17: _t->on_blue_fade_button_clicked(); break; + case 18: _t->on_speed_button_clicked(); break; + case 19: _t->on_r_speed_slider_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 20: _t->on_g_speed_slider_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 21: _t->on_b_speed_slider_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 22: _t->on_rfrom_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 23: _t->on_rto_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 24: _t->on_gfrom_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 25: _t->on_gto_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 26: _t->on_bfrom_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 27: _t->on_bto_valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } } @@ -169,13 +233,13 @@ int controllerWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 15) + if (_id < 28) qt_static_metacall(this, _c, _id, _a); - _id -= 15; + _id -= 28; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 15) + if (_id < 28) *reinterpret_cast(_a[0]) = -1; - _id -= 15; + _id -= 28; } return _id; } diff --git a/qt/RGBController/moc_controllerwindow.o b/qt/RGBController/moc_controllerwindow.o index cfe8fa3..4cb2317 100644 Binary files a/qt/RGBController/moc_controllerwindow.o and b/qt/RGBController/moc_controllerwindow.o differ diff --git a/qt/RGBController/serial_communication.cpp b/qt/RGBController/serial_communication.cpp index ac0fd81..8ad951c 100644 --- a/qt/RGBController/serial_communication.cpp +++ b/qt/RGBController/serial_communication.cpp @@ -36,12 +36,21 @@ bool serial_communication::serial_disconnect() return false; } +void serial_communication::send(QString com) +{ + data = ""; + qDebug() << com; + data.append(com + "\n"); + if (serial.isOpen()) + serial.write(data); +} + void serial_communication::rgb_change(int r, int g, int b) { /* here we send our rgb values to the serial port */ data = ""; /* the 0 is a hack, i need to look into it at some point */ - data.append("0" + QString::number(r) + "," + QString::number(g) + "," + QString::number(b) + "\n"); + data.append("red=" + QString::number(r) + "," + QString::number(g) + "," + QString::number(b) + "\n"); if (serial.isOpen()) serial.write(data); } diff --git a/qt/RGBController/serial_communication.h b/qt/RGBController/serial_communication.h index ffc9b82..3499028 100644 --- a/qt/RGBController/serial_communication.h +++ b/qt/RGBController/serial_communication.h @@ -4,6 +4,7 @@ /* includes */ #include #include +#include class serial_communication @@ -14,6 +15,7 @@ class serial_communication bool serial_connect(QString port); bool serial_disconnect(); void rgb_change(int r, int g, int b); + void send(QString com); /* variables */ QString port_name; QSerialPort serial; diff --git a/qt/RGBController/serial_communication.o b/qt/RGBController/serial_communication.o index 65ce715..6c6bc29 100644 Binary files a/qt/RGBController/serial_communication.o and b/qt/RGBController/serial_communication.o differ diff --git a/qt/RGBController/ui_controllerwindow.h b/qt/RGBController/ui_controllerwindow.h index faa820c..5c2c857 100644 --- a/qt/RGBController/ui_controllerwindow.h +++ b/qt/RGBController/ui_controllerwindow.h @@ -32,114 +32,170 @@ class Ui_controllerWindow public: QWidget *centralWidget; QGridLayout *gridLayout_2; + QPushButton *reload_preset_button; + QPushButton *off_button; + QPushButton *preset_delete_button; + QLabel *presets_label; + QPushButton *disconnect_button; QLabel *arduino_status_label; - QLabel *arduino_port_label; QComboBox *arduino_port_dropdown; + QSlider *b_slider; + QSlider *b_speed_slider; + QTextEdit *info_log_textarea; + QLineEdit *preset_name_textbox; + QComboBox *presets_dropdown; + QLabel *info_log_label; + QPushButton *green_button; QPushButton *refresh_port_button; - QSlider *r_slider; - QPushButton *connect_button; - QPushButton *disconnect_button; + QSlider *g_speed_slider; QLabel *rgb_label; - QComboBox *presets_dropdown; - QPushButton *red_button; + QLabel *status_label; + QPushButton *preset_save_button; QSlider *g_slider; - QPushButton *green_button; - QSlider *b_slider; + QSlider *r_speed_slider; + QLabel *g_speed_label; + QPushButton *red_button; QPushButton *blue_button; - QPushButton *off_button; + QPushButton *connect_button; + QLabel *r_speed_label; + QSlider *r_slider; QPushButton *set_preset_button; - QPushButton *reload_preset_button; - QLineEdit *preset_name_textbox; - QPushButton *preset_save_button; - QLabel *presets_label; - QLabel *status_label; - QPushButton *preset_delete_button; QGridLayout *gridLayout; - QPushButton *pushButton_3; - QSpinBox *spinBox; - QSpinBox *spinBox_4; - QSpinBox *spinBox_3; - QLabel *label; - QSpinBox *spinBox_2; - QLabel *label_2; - QSpinBox *spinBox_6; - QSpinBox *spinBox_5; - QPushButton *pushButton_2; - QPushButton *pushButton; - QLabel *label_3; - QLabel *label_4; - QLabel *info_log_label; - QTextEdit *info_log_textarea; - QSlider *horizontalSlider; - QPushButton *pushButton_4; + QPushButton *blue_fade_button; + QSpinBox *bfrom; + QSpinBox *rto; + QSpinBox *gfrom; + QLabel *r_to_label; + QSpinBox *rfrom; + QLabel *g_to_label; + QSpinBox *bto; + QSpinBox *gto; + QPushButton *green_fade_button; + QPushButton *red_fade_button; + QLabel *_to_label; + QLabel *fade_label; + QLabel *arduino_port_label; + QLabel *b_speed_label; + QPushButton *speed_button; + QSlider *speed_slider; void setupUi(QMainWindow *controllerWindow) { if (controllerWindow->objectName().isEmpty()) controllerWindow->setObjectName(QStringLiteral("controllerWindow")); controllerWindow->setWindowModality(Qt::WindowModal); - controllerWindow->resize(227, 499); + controllerWindow->resize(232, 629); centralWidget = new QWidget(controllerWindow); centralWidget->setObjectName(QStringLiteral("centralWidget")); gridLayout_2 = new QGridLayout(centralWidget); gridLayout_2->setSpacing(6); gridLayout_2->setContentsMargins(11, 11, 11, 11); gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + reload_preset_button = new QPushButton(centralWidget); + reload_preset_button->setObjectName(QStringLiteral("reload_preset_button")); + + gridLayout_2->addWidget(reload_preset_button, 11, 0, 1, 1); + + off_button = new QPushButton(centralWidget); + off_button->setObjectName(QStringLiteral("off_button")); + + gridLayout_2->addWidget(off_button, 8, 1, 1, 1); + + preset_delete_button = new QPushButton(centralWidget); + preset_delete_button->setObjectName(QStringLiteral("preset_delete_button")); + + gridLayout_2->addWidget(preset_delete_button, 13, 1, 1, 1); + + presets_label = new QLabel(centralWidget); + presets_label->setObjectName(QStringLiteral("presets_label")); + + gridLayout_2->addWidget(presets_label, 9, 0, 1, 1); + + disconnect_button = new QPushButton(centralWidget); + disconnect_button->setObjectName(QStringLiteral("disconnect_button")); + + gridLayout_2->addWidget(disconnect_button, 3, 1, 1, 1); + arduino_status_label = new QLabel(centralWidget); arduino_status_label->setObjectName(QStringLiteral("arduino_status_label")); gridLayout_2->addWidget(arduino_status_label, 0, 1, 1, 1); - arduino_port_label = new QLabel(centralWidget); - arduino_port_label->setObjectName(QStringLiteral("arduino_port_label")); - arduino_port_label->setMinimumSize(QSize(120, 0)); - - gridLayout_2->addWidget(arduino_port_label, 1, 0, 1, 1); - arduino_port_dropdown = new QComboBox(centralWidget); arduino_port_dropdown->setObjectName(QStringLiteral("arduino_port_dropdown")); gridLayout_2->addWidget(arduino_port_dropdown, 1, 1, 1, 1); - refresh_port_button = new QPushButton(centralWidget); - refresh_port_button->setObjectName(QStringLiteral("refresh_port_button")); + b_slider = new QSlider(centralWidget); + b_slider->setObjectName(QStringLiteral("b_slider")); + b_slider->setMinimumSize(QSize(120, 0)); + b_slider->setMaximumSize(QSize(120, 16777215)); + b_slider->setMaximum(255); + b_slider->setOrientation(Qt::Horizontal); - gridLayout_2->addWidget(refresh_port_button, 2, 1, 1, 1); + gridLayout_2->addWidget(b_slider, 7, 0, 1, 1); - r_slider = new QSlider(centralWidget); - r_slider->setObjectName(QStringLiteral("r_slider")); - r_slider->setMinimumSize(QSize(120, 0)); - r_slider->setMaximumSize(QSize(120, 16777215)); - r_slider->setMaximum(255); - r_slider->setOrientation(Qt::Horizontal); + b_speed_slider = new QSlider(centralWidget); + b_speed_slider->setObjectName(QStringLiteral("b_speed_slider")); + b_speed_slider->setMinimum(1); + b_speed_slider->setMaximum(500); + b_speed_slider->setOrientation(Qt::Horizontal); - gridLayout_2->addWidget(r_slider, 5, 0, 1, 1); + gridLayout_2->addWidget(b_speed_slider, 17, 0, 1, 1); - connect_button = new QPushButton(centralWidget); - connect_button->setObjectName(QStringLiteral("connect_button")); + info_log_textarea = new QTextEdit(centralWidget); + info_log_textarea->setObjectName(QStringLiteral("info_log_textarea")); - gridLayout_2->addWidget(connect_button, 3, 0, 1, 1); + gridLayout_2->addWidget(info_log_textarea, 20, 0, 1, 2); - disconnect_button = new QPushButton(centralWidget); - disconnect_button->setObjectName(QStringLiteral("disconnect_button")); + preset_name_textbox = new QLineEdit(centralWidget); + preset_name_textbox->setObjectName(QStringLiteral("preset_name_textbox")); - gridLayout_2->addWidget(disconnect_button, 3, 1, 1, 1); + gridLayout_2->addWidget(preset_name_textbox, 12, 0, 1, 1); + + presets_dropdown = new QComboBox(centralWidget); + presets_dropdown->setObjectName(QStringLiteral("presets_dropdown")); + presets_dropdown->setMinimumSize(QSize(120, 0)); + + gridLayout_2->addWidget(presets_dropdown, 10, 0, 1, 1); + + info_log_label = new QLabel(centralWidget); + info_log_label->setObjectName(QStringLiteral("info_log_label")); + + gridLayout_2->addWidget(info_log_label, 19, 0, 1, 1); + + green_button = new QPushButton(centralWidget); + green_button->setObjectName(QStringLiteral("green_button")); + + gridLayout_2->addWidget(green_button, 6, 1, 1, 1); + + refresh_port_button = new QPushButton(centralWidget); + refresh_port_button->setObjectName(QStringLiteral("refresh_port_button")); + + gridLayout_2->addWidget(refresh_port_button, 2, 1, 1, 1); + + g_speed_slider = new QSlider(centralWidget); + g_speed_slider->setObjectName(QStringLiteral("g_speed_slider")); + g_speed_slider->setMinimum(1); + g_speed_slider->setMaximum(500); + g_speed_slider->setOrientation(Qt::Horizontal); + + gridLayout_2->addWidget(g_speed_slider, 16, 0, 1, 1); rgb_label = new QLabel(centralWidget); rgb_label->setObjectName(QStringLiteral("rgb_label")); gridLayout_2->addWidget(rgb_label, 4, 0, 1, 1); - presets_dropdown = new QComboBox(centralWidget); - presets_dropdown->setObjectName(QStringLiteral("presets_dropdown")); - presets_dropdown->setMinimumSize(QSize(120, 0)); + status_label = new QLabel(centralWidget); + status_label->setObjectName(QStringLiteral("status_label")); - gridLayout_2->addWidget(presets_dropdown, 10, 0, 1, 1); + gridLayout_2->addWidget(status_label, 0, 0, 1, 1); - red_button = new QPushButton(centralWidget); - red_button->setObjectName(QStringLiteral("red_button")); + preset_save_button = new QPushButton(centralWidget); + preset_save_button->setObjectName(QStringLiteral("preset_save_button")); - gridLayout_2->addWidget(red_button, 5, 1, 1, 1); + gridLayout_2->addWidget(preset_save_button, 12, 1, 1, 1); g_slider = new QSlider(centralWidget); g_slider->setObjectName(QStringLiteral("g_slider")); @@ -150,164 +206,153 @@ public: gridLayout_2->addWidget(g_slider, 6, 0, 1, 1); - green_button = new QPushButton(centralWidget); - green_button->setObjectName(QStringLiteral("green_button")); + r_speed_slider = new QSlider(centralWidget); + r_speed_slider->setObjectName(QStringLiteral("r_speed_slider")); + r_speed_slider->setMinimum(1); + r_speed_slider->setMaximum(500); + r_speed_slider->setOrientation(Qt::Horizontal); - gridLayout_2->addWidget(green_button, 6, 1, 1, 1); + gridLayout_2->addWidget(r_speed_slider, 15, 0, 1, 1); - b_slider = new QSlider(centralWidget); - b_slider->setObjectName(QStringLiteral("b_slider")); - b_slider->setMinimumSize(QSize(120, 0)); - b_slider->setMaximumSize(QSize(120, 16777215)); - b_slider->setMaximum(255); - b_slider->setOrientation(Qt::Horizontal); + g_speed_label = new QLabel(centralWidget); + g_speed_label->setObjectName(QStringLiteral("g_speed_label")); - gridLayout_2->addWidget(b_slider, 7, 0, 1, 1); + gridLayout_2->addWidget(g_speed_label, 16, 1, 1, 1); + + red_button = new QPushButton(centralWidget); + red_button->setObjectName(QStringLiteral("red_button")); + + gridLayout_2->addWidget(red_button, 5, 1, 1, 1); blue_button = new QPushButton(centralWidget); blue_button->setObjectName(QStringLiteral("blue_button")); gridLayout_2->addWidget(blue_button, 7, 1, 1, 1); - off_button = new QPushButton(centralWidget); - off_button->setObjectName(QStringLiteral("off_button")); - - gridLayout_2->addWidget(off_button, 8, 1, 1, 1); - - set_preset_button = new QPushButton(centralWidget); - set_preset_button->setObjectName(QStringLiteral("set_preset_button")); - - gridLayout_2->addWidget(set_preset_button, 10, 1, 1, 1); - - reload_preset_button = new QPushButton(centralWidget); - reload_preset_button->setObjectName(QStringLiteral("reload_preset_button")); - - gridLayout_2->addWidget(reload_preset_button, 11, 0, 1, 1); - - preset_name_textbox = new QLineEdit(centralWidget); - preset_name_textbox->setObjectName(QStringLiteral("preset_name_textbox")); - - gridLayout_2->addWidget(preset_name_textbox, 12, 0, 1, 1); - - preset_save_button = new QPushButton(centralWidget); - preset_save_button->setObjectName(QStringLiteral("preset_save_button")); + connect_button = new QPushButton(centralWidget); + connect_button->setObjectName(QStringLiteral("connect_button")); - gridLayout_2->addWidget(preset_save_button, 12, 1, 1, 1); + gridLayout_2->addWidget(connect_button, 3, 0, 1, 1); - presets_label = new QLabel(centralWidget); - presets_label->setObjectName(QStringLiteral("presets_label")); + r_speed_label = new QLabel(centralWidget); + r_speed_label->setObjectName(QStringLiteral("r_speed_label")); - gridLayout_2->addWidget(presets_label, 9, 0, 1, 1); + gridLayout_2->addWidget(r_speed_label, 15, 1, 1, 1); - status_label = new QLabel(centralWidget); - status_label->setObjectName(QStringLiteral("status_label")); + r_slider = new QSlider(centralWidget); + r_slider->setObjectName(QStringLiteral("r_slider")); + r_slider->setMinimumSize(QSize(120, 0)); + r_slider->setMaximumSize(QSize(120, 16777215)); + r_slider->setMaximum(255); + r_slider->setOrientation(Qt::Horizontal); - gridLayout_2->addWidget(status_label, 0, 0, 1, 1); + gridLayout_2->addWidget(r_slider, 5, 0, 1, 1); - preset_delete_button = new QPushButton(centralWidget); - preset_delete_button->setObjectName(QStringLiteral("preset_delete_button")); + set_preset_button = new QPushButton(centralWidget); + set_preset_button->setObjectName(QStringLiteral("set_preset_button")); - gridLayout_2->addWidget(preset_delete_button, 13, 1, 1, 1); + gridLayout_2->addWidget(set_preset_button, 10, 1, 1, 1); gridLayout = new QGridLayout(); gridLayout->setSpacing(6); gridLayout->setObjectName(QStringLiteral("gridLayout")); - pushButton_3 = new QPushButton(centralWidget); - pushButton_3->setObjectName(QStringLiteral("pushButton_3")); + blue_fade_button = new QPushButton(centralWidget); + blue_fade_button->setObjectName(QStringLiteral("blue_fade_button")); - gridLayout->addWidget(pushButton_3, 4, 3, 1, 1); + gridLayout->addWidget(blue_fade_button, 4, 3, 1, 1); - spinBox = new QSpinBox(centralWidget); - spinBox->setObjectName(QStringLiteral("spinBox")); - spinBox->setMaximum(255); + bfrom = new QSpinBox(centralWidget); + bfrom->setObjectName(QStringLiteral("bfrom")); + bfrom->setMaximum(255); - gridLayout->addWidget(spinBox, 4, 0, 1, 1); + gridLayout->addWidget(bfrom, 4, 0, 1, 1); - spinBox_4 = new QSpinBox(centralWidget); - spinBox_4->setObjectName(QStringLiteral("spinBox_4")); - spinBox_4->setMaximum(255); + rto = new QSpinBox(centralWidget); + rto->setObjectName(QStringLiteral("rto")); + rto->setMaximum(255); - gridLayout->addWidget(spinBox_4, 1, 2, 1, 1); + gridLayout->addWidget(rto, 1, 2, 1, 1); - spinBox_3 = new QSpinBox(centralWidget); - spinBox_3->setObjectName(QStringLiteral("spinBox_3")); - spinBox_3->setMaximum(255); + gfrom = new QSpinBox(centralWidget); + gfrom->setObjectName(QStringLiteral("gfrom")); + gfrom->setMaximum(255); - gridLayout->addWidget(spinBox_3, 3, 0, 1, 1); + gridLayout->addWidget(gfrom, 3, 0, 1, 1); - label = new QLabel(centralWidget); - label->setObjectName(QStringLiteral("label")); + r_to_label = new QLabel(centralWidget); + r_to_label->setObjectName(QStringLiteral("r_to_label")); - gridLayout->addWidget(label, 1, 1, 1, 1); + gridLayout->addWidget(r_to_label, 1, 1, 1, 1); - spinBox_2 = new QSpinBox(centralWidget); - spinBox_2->setObjectName(QStringLiteral("spinBox_2")); - spinBox_2->setMaximum(255); + rfrom = new QSpinBox(centralWidget); + rfrom->setObjectName(QStringLiteral("rfrom")); + rfrom->setMaximum(255); - gridLayout->addWidget(spinBox_2, 1, 0, 1, 1); + gridLayout->addWidget(rfrom, 1, 0, 1, 1); - label_2 = new QLabel(centralWidget); - label_2->setObjectName(QStringLiteral("label_2")); + g_to_label = new QLabel(centralWidget); + g_to_label->setObjectName(QStringLiteral("g_to_label")); - gridLayout->addWidget(label_2, 3, 1, 1, 1); + gridLayout->addWidget(g_to_label, 3, 1, 1, 1); - spinBox_6 = new QSpinBox(centralWidget); - spinBox_6->setObjectName(QStringLiteral("spinBox_6")); - spinBox_6->setMaximum(255); + bto = new QSpinBox(centralWidget); + bto->setObjectName(QStringLiteral("bto")); + bto->setMaximum(255); - gridLayout->addWidget(spinBox_6, 4, 2, 1, 1); + gridLayout->addWidget(bto, 4, 2, 1, 1); - spinBox_5 = new QSpinBox(centralWidget); - spinBox_5->setObjectName(QStringLiteral("spinBox_5")); - spinBox_5->setMaximum(255); + gto = new QSpinBox(centralWidget); + gto->setObjectName(QStringLiteral("gto")); + gto->setMaximum(255); - gridLayout->addWidget(spinBox_5, 3, 2, 1, 1); + gridLayout->addWidget(gto, 3, 2, 1, 1); - pushButton_2 = new QPushButton(centralWidget); - pushButton_2->setObjectName(QStringLiteral("pushButton_2")); + green_fade_button = new QPushButton(centralWidget); + green_fade_button->setObjectName(QStringLiteral("green_fade_button")); - gridLayout->addWidget(pushButton_2, 3, 3, 1, 1); + gridLayout->addWidget(green_fade_button, 3, 3, 1, 1); - pushButton = new QPushButton(centralWidget); - pushButton->setObjectName(QStringLiteral("pushButton")); + red_fade_button = new QPushButton(centralWidget); + red_fade_button->setObjectName(QStringLiteral("red_fade_button")); - gridLayout->addWidget(pushButton, 1, 3, 1, 1); + gridLayout->addWidget(red_fade_button, 1, 3, 1, 1); - label_3 = new QLabel(centralWidget); - label_3->setObjectName(QStringLiteral("label_3")); + _to_label = new QLabel(centralWidget); + _to_label->setObjectName(QStringLiteral("_to_label")); - gridLayout->addWidget(label_3, 4, 1, 1, 1); + gridLayout->addWidget(_to_label, 4, 1, 1, 1); - label_4 = new QLabel(centralWidget); - label_4->setObjectName(QStringLiteral("label_4")); + fade_label = new QLabel(centralWidget); + fade_label->setObjectName(QStringLiteral("fade_label")); - gridLayout->addWidget(label_4, 0, 0, 1, 1); + gridLayout->addWidget(fade_label, 0, 0, 1, 1); gridLayout_2->addLayout(gridLayout, 14, 0, 1, 2); - info_log_label = new QLabel(centralWidget); - info_log_label->setObjectName(QStringLiteral("info_log_label")); + arduino_port_label = new QLabel(centralWidget); + arduino_port_label->setObjectName(QStringLiteral("arduino_port_label")); + arduino_port_label->setMinimumSize(QSize(120, 0)); - gridLayout_2->addWidget(info_log_label, 16, 0, 1, 1); + gridLayout_2->addWidget(arduino_port_label, 1, 0, 1, 1); - info_log_textarea = new QTextEdit(centralWidget); - info_log_textarea->setObjectName(QStringLiteral("info_log_textarea")); + b_speed_label = new QLabel(centralWidget); + b_speed_label->setObjectName(QStringLiteral("b_speed_label")); - gridLayout_2->addWidget(info_log_textarea, 17, 0, 1, 2); + gridLayout_2->addWidget(b_speed_label, 17, 1, 1, 1); - horizontalSlider = new QSlider(centralWidget); - horizontalSlider->setObjectName(QStringLiteral("horizontalSlider")); - horizontalSlider->setMinimum(10); - horizontalSlider->setMaximum(500); - horizontalSlider->setOrientation(Qt::Horizontal); + speed_button = new QPushButton(centralWidget); + speed_button->setObjectName(QStringLiteral("speed_button")); - gridLayout_2->addWidget(horizontalSlider, 15, 0, 1, 1); + gridLayout_2->addWidget(speed_button, 18, 1, 1, 1); - pushButton_4 = new QPushButton(centralWidget); - pushButton_4->setObjectName(QStringLiteral("pushButton_4")); + speed_slider = new QSlider(centralWidget); + speed_slider->setObjectName(QStringLiteral("speed_slider")); + speed_slider->setMinimum(10); + speed_slider->setMaximum(500); + speed_slider->setOrientation(Qt::Horizontal); - gridLayout_2->addWidget(pushButton_4, 15, 1, 1, 1); + gridLayout_2->addWidget(speed_slider, 18, 0, 1, 1); controllerWindow->setCentralWidget(centralWidget); @@ -319,31 +364,34 @@ public: void retranslateUi(QMainWindow *controllerWindow) { controllerWindow->setWindowTitle(QApplication::translate("controllerWindow", "RGB Controller", Q_NULLPTR)); + reload_preset_button->setText(QApplication::translate("controllerWindow", "Reload", Q_NULLPTR)); + off_button->setText(QApplication::translate("controllerWindow", "Off", Q_NULLPTR)); + preset_delete_button->setText(QApplication::translate("controllerWindow", "Delete", Q_NULLPTR)); + presets_label->setText(QApplication::translate("controllerWindow", "Presets", Q_NULLPTR)); + disconnect_button->setText(QApplication::translate("controllerWindow", "Disconnect", Q_NULLPTR)); arduino_status_label->setText(QApplication::translate("controllerWindow", "Disconnected", Q_NULLPTR)); - arduino_port_label->setText(QApplication::translate("controllerWindow", "Arduino port", Q_NULLPTR)); + info_log_label->setText(QApplication::translate("controllerWindow", "Information log", Q_NULLPTR)); + green_button->setText(QApplication::translate("controllerWindow", "Green", Q_NULLPTR)); refresh_port_button->setText(QApplication::translate("controllerWindow", "Refresh", Q_NULLPTR)); - connect_button->setText(QApplication::translate("controllerWindow", "Connect", Q_NULLPTR)); - disconnect_button->setText(QApplication::translate("controllerWindow", "Disconnect", Q_NULLPTR)); rgb_label->setText(QApplication::translate("controllerWindow", "RGB colors", Q_NULLPTR)); + status_label->setText(QApplication::translate("controllerWindow", "Status", Q_NULLPTR)); + preset_save_button->setText(QApplication::translate("controllerWindow", "Save", Q_NULLPTR)); + g_speed_label->setText(QApplication::translate("controllerWindow", "Green speed", Q_NULLPTR)); red_button->setText(QApplication::translate("controllerWindow", "Red", Q_NULLPTR)); - green_button->setText(QApplication::translate("controllerWindow", "Green", Q_NULLPTR)); blue_button->setText(QApplication::translate("controllerWindow", "Blue", Q_NULLPTR)); - off_button->setText(QApplication::translate("controllerWindow", "Off", Q_NULLPTR)); + connect_button->setText(QApplication::translate("controllerWindow", "Connect", Q_NULLPTR)); + r_speed_label->setText(QApplication::translate("controllerWindow", "Red speed", Q_NULLPTR)); set_preset_button->setText(QApplication::translate("controllerWindow", "Set", Q_NULLPTR)); - reload_preset_button->setText(QApplication::translate("controllerWindow", "Reload", Q_NULLPTR)); - preset_save_button->setText(QApplication::translate("controllerWindow", "Save", Q_NULLPTR)); - presets_label->setText(QApplication::translate("controllerWindow", "Presets", Q_NULLPTR)); - status_label->setText(QApplication::translate("controllerWindow", "Status", Q_NULLPTR)); - preset_delete_button->setText(QApplication::translate("controllerWindow", "Delete", Q_NULLPTR)); - pushButton_3->setText(QApplication::translate("controllerWindow", "Set", Q_NULLPTR)); - label->setText(QApplication::translate("controllerWindow", "to", Q_NULLPTR)); - label_2->setText(QApplication::translate("controllerWindow", "to", Q_NULLPTR)); - pushButton_2->setText(QApplication::translate("controllerWindow", "Set", Q_NULLPTR)); - pushButton->setText(QApplication::translate("controllerWindow", "Set", Q_NULLPTR)); - label_3->setText(QApplication::translate("controllerWindow", "to", Q_NULLPTR)); - label_4->setText(QApplication::translate("controllerWindow", "Fade", Q_NULLPTR)); - info_log_label->setText(QApplication::translate("controllerWindow", "Information log", Q_NULLPTR)); - pushButton_4->setText(QApplication::translate("controllerWindow", "Speed", Q_NULLPTR)); + blue_fade_button->setText(QApplication::translate("controllerWindow", "Blue toggle", Q_NULLPTR)); + r_to_label->setText(QApplication::translate("controllerWindow", "to", Q_NULLPTR)); + g_to_label->setText(QApplication::translate("controllerWindow", "to", Q_NULLPTR)); + green_fade_button->setText(QApplication::translate("controllerWindow", "Green toggle", Q_NULLPTR)); + red_fade_button->setText(QApplication::translate("controllerWindow", "Red toggle", Q_NULLPTR)); + _to_label->setText(QApplication::translate("controllerWindow", "to", Q_NULLPTR)); + fade_label->setText(QApplication::translate("controllerWindow", "Fade", Q_NULLPTR)); + arduino_port_label->setText(QApplication::translate("controllerWindow", "Arduino port", Q_NULLPTR)); + b_speed_label->setText(QApplication::translate("controllerWindow", "Blue speed", Q_NULLPTR)); + speed_button->setText(QApplication::translate("controllerWindow", "Speed", Q_NULLPTR)); } // retranslateUi }; -- cgit v1.2.3