summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2017-02-22 12:41:26 +1030
committerdaniel-Jones <daniel@danieljon.es>2017-02-22 12:41:26 +1030
commitd83503f9c5f9a5ef254c10255a355dfeb5ad9eb6 (patch)
tree4b9dfc154c9f4011250ba9a3e570eac3cbc60eaf
parent84cf187da89ceb5c8a3cf3fa551d2329b29b0e59 (diff)
downloadRGB-Controller-d83503f9c5f9a5ef254c10255a355dfeb5ad9eb6.tar.gz
RGB-Controller-d83503f9c5f9a5ef254c10255a355dfeb5ad9eb6.zip
Added new buttons/sliders/etc to the disable/enable sections leaving them only accesible when usable. New sliders now default to 0.
-rw-r--r--arduino/rgb/.rgb.ino.swobin16384 -> 16384 bytes
-rw-r--r--arduino/rgb/rgb.ino1
-rwxr-xr-xqt/RGBController/RGBControllerbin93104 -> 92920 bytes
-rwxr-xr-xqt/RGBController/controllerwindow.cpp47
-rw-r--r--qt/RGBController/controllerwindow.obin101504 -> 103576 bytes
-rw-r--r--qt/RGBController/serial_communication.cpp4
-rw-r--r--qt/RGBController/serial_communication.obin10928 -> 10376 bytes
7 files changed, 50 insertions, 2 deletions
diff --git a/arduino/rgb/.rgb.ino.swo b/arduino/rgb/.rgb.ino.swo
index 259a52b..c9a379b 100644
--- a/arduino/rgb/.rgb.ino.swo
+++ b/arduino/rgb/.rgb.ino.swo
Binary files differ
diff --git a/arduino/rgb/rgb.ino b/arduino/rgb/rgb.ino
index 3c29aee..7a0294b 100644
--- a/arduino/rgb/rgb.ino
+++ b/arduino/rgb/rgb.ino
@@ -164,7 +164,6 @@ void parse(String com)
bf = p2.toInt();
if (p1.equalsIgnoreCase("bt"))
bt = p2.toInt();
-
}
String line;
diff --git a/qt/RGBController/RGBController b/qt/RGBController/RGBController
index 8607dc8..fec5497 100755
--- a/qt/RGBController/RGBController
+++ b/qt/RGBController/RGBController
Binary files 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
--- a/qt/RGBController/controllerwindow.o
+++ b/qt/RGBController/controllerwindow.o
Binary files 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
--- a/qt/RGBController/serial_communication.o
+++ b/qt/RGBController/serial_communication.o
Binary files differ