diff options
author | daniel-Jones <daniel@danieljon.es> | 2017-07-06 19:04:48 +0930 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2017-07-06 19:04:48 +0930 |
commit | d3624454f67e3afc026d7e16546f5549e67f6102 (patch) | |
tree | e370fc7bd48c58f9d4a523d9eb7c554ebf6b461e /qt/console | |
parent | 9834782c287b1dc6df59a03e5992911d8fb70a83 (diff) | |
download | RGB-Controller-d3624454f67e3afc026d7e16546f5549e67f6102.tar.gz RGB-Controller-d3624454f67e3afc026d7e16546f5549e67f6102.zip |
Added console based server that allows clients to connect and send commands to the microcontroller, does not require X to use, includes the IRC bot. Also included my beginning works on a c ncurses based client.
Diffstat (limited to 'qt/console')
-rw-r--r-- | qt/console/.qmake.stash | 29 | ||||
-rw-r--r-- | qt/console/Makefile | 36 | ||||
-rw-r--r-- | qt/console/main.cpp | 5 | ||||
-rwxr-xr-x | qt/console/qtconsoletest | bin | 0 -> 25064 bytes |
4 files changed, 61 insertions, 9 deletions
diff --git a/qt/console/.qmake.stash b/qt/console/.qmake.stash index 39abb16..b8ee3b2 100644 --- a/qt/console/.qmake.stash +++ b/qt/console/.qmake.stash @@ -10,3 +10,32 @@ QMAKE_DEFAULT_LIBDIRS = \ /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1 \ /usr/lib \ /lib +QMAKE_CXX.INCDIRS = \ + /usr/include/c++/6.3.1 \ + /usr/include/c++/6.3.1/x86_64-pc-linux-gnu \ + /usr/include/c++/6.3.1/backward \ + /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/include \ + /usr/local/include \ + /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1/include-fixed \ + /usr/include \ + /usr/include/c++/7.1.1 \ + /usr/include/c++/7.1.1/x86_64-pc-linux-gnu \ + /usr/include/c++/7.1.1/backward \ + /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include \ + /usr/local/include \ + /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1/include-fixed \ + /usr/include +QMAKE_CXX.LIBDIRS = \ + /usr/lib/gcc/x86_64-pc-linux-gnu/6.3.1 \ + /usr/lib \ + /lib \ + /usr/lib/gcc/x86_64-pc-linux-gnu/7.1.1 +QMAKE_CXX.QT_COMPILER_STDCXX = 201402L +QMAKE_CXX.QT_GCC_MAJOR_VERSION = 7 +QMAKE_CXX.QT_GCC_MINOR_VERSION = 1 +QMAKE_CXX.QT_GCC_PATCH_VERSION = 1 +QMAKE_CXX.COMPILER_MACROS = \ + QT_COMPILER_STDCXX \ + QT_GCC_MAJOR_VERSION \ + QT_GCC_MINOR_VERSION \ + QT_GCC_PATCH_VERSION diff --git a/qt/console/Makefile b/qt/console/Makefile index 446865f..19f7057 100644 --- a/qt/console/Makefile +++ b/qt/console/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: qtconsoletest -# Generated by qmake (3.1) (Qt 5.8.0) +# Generated by qmake (3.1) (Qt 5.9.0) # Project: console.pro # Template: app # Command: /usr/bin/qmake -o Makefile console.pro @@ -26,13 +26,16 @@ COPY_DIR = cp -f -R INSTALL_FILE = install -m 644 -p INSTALL_PROGRAM = install -m 755 -p INSTALL_DIR = cp -f -R +QINSTALL_FILE = /usr/bin/qmake -install qinstall file +QINSTALL_PROGRAM = /usr/bin/qmake -install qinstall program +QINSTALL_DIR = /usr/bin/qmake -install qinstall directory DEL_FILE = rm -f SYMLINK = ln -f -s DEL_DIR = rmdir MOVE = mv -f TAR = tar -cf COMPRESS = gzip -9f -DISTNAME = rgb1.0.0 +DISTNAME = qtconsoletest1.0.0 DISTDIR = /home/daniel_j/documents/school/2016\ research\ project/RGBController/qt/console/.tmp/qtconsoletest1.0.0 LINK = g++ LFLAGS = -Wl,-O1 -Wl,-O1,--sort-common,--as-needed,-z,relro @@ -99,6 +102,8 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \ /usr/lib/qt/mkspecs/modules/qt_KWidgetsAddons.pri \ /usr/lib/qt/mkspecs/modules/qt_KWindowSystem.pri \ /usr/lib/qt/mkspecs/modules/qt_KXmlGui.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3danimation.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3danimation_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dcore.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dcore_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dextras.pri \ @@ -109,12 +114,16 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \ /usr/lib/qt/mkspecs/modules/qt_lib_3dlogic_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquick.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquick_private.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickanimation.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickanimation_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickextras.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickextras_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickinput.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickinput_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickrender.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickrender_private.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickscene2d.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickscene2d_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3drender.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3drender_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_accessibility_support_private.pri \ @@ -123,7 +132,6 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \ /usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_charts.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_charts_private.pri \ - /usr/lib/qt/mkspecs/modules/qt_lib_clucene_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_concurrent_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_core.pri \ @@ -152,6 +160,7 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \ /usr/lib/qt/mkspecs/modules/qt_lib_help.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_help_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_input_support_private.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_kms_support_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_location.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_location_private.pri \ @@ -272,9 +281,9 @@ DIST = /usr/lib/qt/mkspecs/features/spec_pre.prf \ /usr/lib/qt/mkspecs/features/yacc.prf \ /usr/lib/qt/mkspecs/features/lex.prf \ console.pro main.cpp -QMAKE_TARGET = rgb +QMAKE_TARGET = qtconsoletest DESTDIR = -TARGET = rgb +TARGET = qtconsoletest first: all @@ -332,6 +341,8 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_KWidgetsAddons.pri \ /usr/lib/qt/mkspecs/modules/qt_KWindowSystem.pri \ /usr/lib/qt/mkspecs/modules/qt_KXmlGui.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3danimation.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3danimation_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dcore.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dcore_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dextras.pri \ @@ -342,12 +353,16 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_lib_3dlogic_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquick.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquick_private.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickanimation.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickanimation_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickextras.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickextras_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickinput.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickinput_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickrender.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3dquickrender_private.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickscene2d.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_3dquickscene2d_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3drender.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_3drender_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_accessibility_support_private.pri \ @@ -356,7 +371,6 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_charts.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_charts_private.pri \ - /usr/lib/qt/mkspecs/modules/qt_lib_clucene_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_concurrent_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_core.pri \ @@ -385,6 +399,7 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_lib_help.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_help_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_input_support_private.pri \ + /usr/lib/qt/mkspecs/modules/qt_lib_kms_support_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_location.pri \ /usr/lib/qt/mkspecs/modules/qt_lib_location_private.pri \ @@ -557,6 +572,8 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_KWidgetsAddons.pri: /usr/lib/qt/mkspecs/modules/qt_KWindowSystem.pri: /usr/lib/qt/mkspecs/modules/qt_KXmlGui.pri: +/usr/lib/qt/mkspecs/modules/qt_lib_3danimation.pri: +/usr/lib/qt/mkspecs/modules/qt_lib_3danimation_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dcore.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dcore_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dextras.pri: @@ -567,12 +584,16 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_lib_3dlogic_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquick.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquick_private.pri: +/usr/lib/qt/mkspecs/modules/qt_lib_3dquickanimation.pri: +/usr/lib/qt/mkspecs/modules/qt_lib_3dquickanimation_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquickextras.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquickextras_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquickinput.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquickinput_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquickrender.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3dquickrender_private.pri: +/usr/lib/qt/mkspecs/modules/qt_lib_3dquickscene2d.pri: +/usr/lib/qt/mkspecs/modules/qt_lib_3dquickscene2d_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3drender.pri: /usr/lib/qt/mkspecs/modules/qt_lib_3drender_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_accessibility_support_private.pri: @@ -581,7 +602,6 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_charts.pri: /usr/lib/qt/mkspecs/modules/qt_lib_charts_private.pri: -/usr/lib/qt/mkspecs/modules/qt_lib_clucene_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_concurrent.pri: /usr/lib/qt/mkspecs/modules/qt_lib_concurrent_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_core.pri: @@ -610,6 +630,7 @@ Makefile: console.pro /usr/lib/qt/mkspecs/linux-g++/qmake.conf /usr/lib/qt/mkspe /usr/lib/qt/mkspecs/modules/qt_lib_help.pri: /usr/lib/qt/mkspecs/modules/qt_lib_help_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_input_support_private.pri: +/usr/lib/qt/mkspecs/modules/qt_lib_kms_support_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri: /usr/lib/qt/mkspecs/modules/qt_lib_location.pri: /usr/lib/qt/mkspecs/modules/qt_lib_location_private.pri: @@ -804,4 +825,3 @@ uninstall: FORCE FORCE: - diff --git a/qt/console/main.cpp b/qt/console/main.cpp index 4771303..90919ca 100644 --- a/qt/console/main.cpp +++ b/qt/console/main.cpp @@ -3,6 +3,7 @@ #include <QSerialPortInfo> #include <QSerialPort> #include <QTimer> +#include <QThread> void show_ports(); bool serial_connect(QString port); @@ -71,6 +72,8 @@ bool serial_connect(QString port) serial.setFlowControl(QSerialPort::NoFlowControl); serial.open(QIODevice::ReadWrite); serial.waitForBytesWritten(9000); + + QThread::sleep(1); if (serial.isWritable()) { return true; } @@ -93,7 +96,7 @@ void send(QString com) { data = ""; data.append(com + "\n"); - //qDebug() << "sending:" << data; + qDebug() << "sending:" << data; if (serial.isOpen()) { serial.write(data); diff --git a/qt/console/qtconsoletest b/qt/console/qtconsoletest Binary files differnew file mode 100755 index 0000000..a2b3014 --- /dev/null +++ b/qt/console/qtconsoletest |