Minor changes.

This commit is contained in:
Nffj84
2024-07-04 13:31:28 +03:00
parent d377a626e2
commit f419d69dab
8 changed files with 18 additions and 13 deletions
+4 -4
View File
@@ -6,8 +6,8 @@ CONFIG += c++17 console
TARGET = a8 TARGET = a8
QMAKE_CXXFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum #QMAKE_CXXFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum
QMAKE_LFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum #QMAKE_LFLAGS = -O0 -g -ggdb -fsanitize=undefined,address,bounds,float-divide-by-zero,integer-divide-by-zero,null,return,signed-integer-overflow,unreachable,shift,alignment,nonnull-attribute,returns-nonnull-attribute,enum
QMAKE_CXX = g++ QMAKE_CXX = g++
QMAKE_CC = gcc QMAKE_CC = gcc
@@ -32,8 +32,8 @@ SOURCES += \
HEADERS += \ HEADERS += \
config.hpp \ config.hpp \
defines.hpp \ defines.hpp \
localControl.h \ localControl.hpp \
remoteControl.h \ remoteControl.hpp \
serialCommand.hpp \ serialCommand.hpp \
serialPort.hpp \ serialPort.hpp \
serialResponse.hpp \ serialResponse.hpp \
+1 -1
View File
@@ -1,4 +1,4 @@
#include "localControl.h" #include "localControl.hpp"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>
#include <QObject> #include <QObject>
+7 -3
View File
@@ -2,8 +2,8 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QThread> #include <QThread>
#include "config.hpp" #include "config.hpp"
#include "localControl.h" #include "localControl.hpp"
#include "remoteControl.h" #include "remoteControl.hpp"
#include "serialCommand.hpp" #include "serialCommand.hpp"
#include "serialPort.hpp" #include "serialPort.hpp"
@@ -11,6 +11,8 @@ int main(int argc, char *argv[])
{ {
QCoreApplication app(argc, argv); QCoreApplication app(argc, argv);
QCommandLineParser parser; QCommandLineParser parser;
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption lOption(QStringList() << "l", "Use local mode"); QCommandLineOption lOption(QStringList() << "l", "Use local mode");
parser.addOption(lOption); parser.addOption(lOption);
QCommandLineOption pOption(QStringList() << "p", "Use serial port", "value"); QCommandLineOption pOption(QStringList() << "p", "Use serial port", "value");
@@ -24,9 +26,11 @@ int main(int argc, char *argv[])
if (parser.isSet(pOption)) { if (parser.isSet(pOption)) {
useSerialPort = parser.value(pOption); useSerialPort = parser.value(pOption);
} }
qDebug() << useRemoteMode;
qDebug() << useSerialPort;
SerialCommand serialCommand;
SerialPort serialPort(useSerialPort); SerialPort serialPort(useSerialPort);
SerialCommand serialCommand;
Config::setInitalValues(&serialPort, &serialCommand); Config::setInitalValues(&serialPort, &serialCommand);
// Remote mode will read commands from pipe // Remote mode will read commands from pipe
+1 -1
View File
@@ -1,4 +1,4 @@
#include "remoteControl.h" #include "remoteControl.hpp"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>
#include <QJsonDocument> #include <QJsonDocument>
+4 -3
View File
@@ -21,11 +21,12 @@ SerialPort::SerialPort(QString usePort)
// Open the serial port // Open the serial port
if (openPort() == false) { if (openPort() == false) {
qCritical().noquote().nospace() << "SerialPort(): Unable to open port " << port; qCritical().noquote().nospace() << "SerialPort(): Unable to open port " << usePort;
return; delete mSerialPort;
exit(EXIT_FAILURE);
} }
qDebug().noquote().nospace() << "SerialPort(): Opened port " << port; qDebug().noquote().nospace() << "SerialPort(): Opened port " << usePort;
} }
SerialPort::~SerialPort() SerialPort::~SerialPort()
+1 -1
View File
@@ -6,10 +6,10 @@
#include <QThread> #include <QThread>
#include <QTimer> #include <QTimer>
#include <fcntl.h> #include <fcntl.h>
#include <iostream>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#ifdef FIFO_TEST #ifdef FIFO_TEST
#include <iostream>
#include <random> #include <random>
#endif #endif