From d83503f9c5f9a5ef254c10255a355dfeb5ad9eb6 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Wed, 22 Feb 2017 12:41:26 +1030 Subject: Added new buttons/sliders/etc to the disable/enable sections leaving them only accesible when usable. New sliders now default to 0. --- qt/RGBController/RGBController | Bin 93104 -> 92920 bytes qt/RGBController/controllerwindow.cpp | 47 ++++++++++++++++++++++++++++++ qt/RGBController/controllerwindow.o | Bin 101504 -> 103576 bytes qt/RGBController/serial_communication.cpp | 4 ++- qt/RGBController/serial_communication.o | Bin 10928 -> 10376 bytes 5 files changed, 50 insertions(+), 1 deletion(-) (limited to 'qt') diff --git a/qt/RGBController/RGBController b/qt/RGBController/RGBController index 8607dc8..fec5497 100755 Binary files a/qt/RGBController/RGBController and b/qt/RGBController/RGBController differ diff --git a/qt/RGBController/controllerwindow.cpp b/qt/RGBController/controllerwindow.cpp index cf53f82..1255491 100755 --- a/qt/RGBController/controllerwindow.cpp +++ b/qt/RGBController/controllerwindow.cpp @@ -26,6 +26,30 @@ controllerWindow::controllerWindow(QWidget *parent) : ui->r_slider->setValue(0); ui->g_slider->setValue(0); ui->b_slider->setValue(0); + ui->red_fade_button->setEnabled(false); + ui->green_fade_button->setEnabled(false); + ui->blue_fade_button->setEnabled(false); + ui->speed_button->setEnabled(false); + ui->rfrom->setEnabled(false); + ui->rto->setEnabled(false); + ui->gfrom->setEnabled(false); + ui->gto->setEnabled(false); + ui->bfrom->setEnabled(false); + ui->bto->setEnabled(false); + ui->r_speed_slider->setEnabled(false); + ui->g_speed_slider->setEnabled(false); + ui->b_speed_slider->setEnabled(false); + ui->speed_slider->setEnabled(false); + ui->r_speed_slider->setValue(0); + ui->g_speed_slider->setValue(0); + ui->b_speed_slider->setValue(0); + ui->speed_slider->setValue(0); + ui->rfrom->setValue(0); + ui->rto->setValue(0); + ui->gfrom->setValue(0); + ui->gto->setValue(0); + ui->bfrom->setValue(0); + ui->bto->setValue(0); /* set some crucial ints */ preset_index = 0, r = 0, g = 0, b = 0; /* populate our serial port dropdown box */ @@ -241,6 +265,20 @@ void controllerWindow::on_connect_button_clicked() ui->b_slider->setEnabled(true); ui->refresh_port_button->setEnabled(false); ui->arduino_port_dropdown->setEnabled(false); + ui->red_fade_button->setEnabled(true); + ui->green_fade_button->setEnabled(true); + ui->green_fade_button->setEnabled(true); + ui->speed_button->setEnabled(true); + ui->rfrom->setEnabled(true); + ui->rto->setEnabled(true); + ui->gfrom->setEnabled(true); + ui->gto->setEnabled(true); + ui->bfrom->setEnabled(true); + ui->bto->setEnabled(true); + ui->r_speed_slider->setEnabled(true); + ui->g_speed_slider->setEnabled(true); + ui->b_speed_slider->setEnabled(true); + ui->speed_slider->setEnabled(true); } else { info_log("Unable to connect (port in use?)"); @@ -278,6 +316,15 @@ void controllerWindow::on_disconnect_button_clicked() ui->r_slider->setValue(0); ui->g_slider->setValue(0); ui->b_slider->setValue(0); + ui->r_speed_slider->setValue(0); + ui->g_speed_slider->setValue(0); + ui->b_speed_slider->setValue(0); + ui->rfrom->setValue(0); + ui->rto->setValue(0); + ui->gfrom->setValue(0); + ui->gto->setValue(0); + ui->bfrom->setValue(0); + ui->bto->setValue(0); } else { /* I have no clue how we'd get here */ diff --git a/qt/RGBController/controllerwindow.o b/qt/RGBController/controllerwindow.o index 6c6c914..487cd2b 100644 Binary files a/qt/RGBController/controllerwindow.o and b/qt/RGBController/controllerwindow.o differ diff --git a/qt/RGBController/serial_communication.cpp b/qt/RGBController/serial_communication.cpp index 8ad951c..f8bd66a 100644 --- a/qt/RGBController/serial_communication.cpp +++ b/qt/RGBController/serial_communication.cpp @@ -39,7 +39,7 @@ bool serial_communication::serial_disconnect() void serial_communication::send(QString com) { data = ""; - qDebug() << com; + //qDebug() << com; data.append(com + "\n"); if (serial.isOpen()) serial.write(data); @@ -47,6 +47,8 @@ void serial_communication::send(QString com) void serial_communication::rgb_change(int r, int g, int b) { + // NOT USED FUNCTION + /* 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 */ diff --git a/qt/RGBController/serial_communication.o b/qt/RGBController/serial_communication.o index 6c6bc29..03987dd 100644 Binary files a/qt/RGBController/serial_communication.o and b/qt/RGBController/serial_communication.o differ -- cgit v1.2.3