...
 
Commits (6)
...@@ -14,6 +14,7 @@ CONFIG(release, debug|release): { ...@@ -14,6 +14,7 @@ CONFIG(release, debug|release): {
} else { } else {
Qt_SECRET_LIB_OUTPUT_DIR="$$PWD/build/debug" Qt_SECRET_LIB_OUTPUT_DIR="$$PWD/build/debug"
} }
unix:LIBS += -L$$Qt_SECRET_LIB_OUTPUT_DIR -lQt-Secret unix:LIBS += -L$$Qt_SECRET_LIB_OUTPUT_DIR -lQt-Secret
win32:LIBS += -L$$Qt_SECRET_LIB_OUTPUT_DIR -lQt-Secret1 win32:LIBS += -L$$Qt_SECRET_LIB_OUTPUT_DIR -lQt-Secret1
......
...@@ -21,7 +21,7 @@ CONFIG(release, debug|release): { ...@@ -21,7 +21,7 @@ CONFIG(release, debug|release): {
DESTDIR="$$PWD/build/debug" DESTDIR="$$PWD/build/debug"
} }
#include($$PWD/GMP/GMP.pri) include($$PWD/GMP/GMP.pri)
VERSION = 1.2.0 VERSION = 1.2.0
...@@ -32,4 +32,5 @@ HEADERS += \ ...@@ -32,4 +32,5 @@ HEADERS += \
SOURCES += \ SOURCES += \
Qt-RSA/qrsaencryption.cpp Qt-RSA/qrsaencryption.cpp
include($$PWD/GMP/GMP.pri) target.path = $$GLOBAL_TARGET_PATH/lib
!isEmpty(target.path): INSTALLS += target
...@@ -4,3 +4,10 @@ CONFIG += ordered ...@@ -4,3 +4,10 @@ CONFIG += ordered
SUBDIRS += \ SUBDIRS += \
Qt-Secret \ Qt-Secret \
ScStwBasestationSrc ScStwBasestationSrc
ScStwBasestationSrc.depends = Qt-Secret
contains(QMAKE_CXX, .*raspbian.*arm.*):{
GLOBAL_TARGET_PATH = "/home/pi/ScStwBasestation/bin"
cache(GLOBAL_TARGET_PATH, set)
}
...@@ -4,15 +4,22 @@ QT += network multimedia sql ...@@ -4,15 +4,22 @@ QT += network multimedia sql
CONFIG += c++11 console CONFIG += c++11 console
CONFIG -= app_bundle CONFIG -= app_bundle
VERSION = 0.8.1 TARGET = ScStwBasestation
VERSION = 0.8.6
# add version to defined
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
# for raspi include wiringpi lib # for raspi include wiringpi lib and change target path
contains(QMAKE_CXX, .*raspbian.*arm.*):{ contains(QMAKE_CXX, .*raspbian.*arm.*):{
message("this is raspi") message("this is raspi")
DEFINES += RASPI DEFINES += RASPI
LIBS += -lwiringPi LIBS += -lwiringPi
} }
# Default rules for deployment.
target.path = $$GLOBAL_TARGET_PATH
!isEmpty(target.path): INSTALLS += target
QT_DEBUG_PLUGINS=10 QT_DEBUG_PLUGINS=10
QT_MESSAGE_PATTERN=[%{type}] %{appname} (%{file}:%{line}) - %{message} QT_MESSAGE_PATTERN=[%{type}] %{appname} (%{file}:%{line}) - %{message}
...@@ -22,14 +29,6 @@ QT_MESSAGE_PATTERN=[%{type}] %{appname} (%{file}:%{line}) - %{message} ...@@ -22,14 +29,6 @@ QT_MESSAGE_PATTERN=[%{type}] %{appname} (%{file}:%{line}) - %{message}
# deprecated API in order to know how to port your code away from it. # deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
# add version
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
SOURCES += \ SOURCES += \
sources/athleteprofiles.cpp \ sources/athleteprofiles.cpp \
sources/main.cpp \ sources/main.cpp \
...@@ -40,12 +39,6 @@ SOURCES += \ ...@@ -40,12 +39,6 @@ SOURCES += \
sources/appsettings.cpp \ sources/appsettings.cpp \
sources/audioplayer.cpp sources/audioplayer.cpp
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
#else: unix:!android: target.path = /opt/$${TARGET}/bin
else: unix:!android: target.path = /home/pi/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \ HEADERS += \
headers/athleteprofiles.h \ headers/athleteprofiles.h \
headers/mainactivity.h \ headers/mainactivity.h \
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
ExtensionConn::ExtensionConn(QObject *parent, QString ip, int port, QString name, extensionType type, int debugLvl = 0) : QObject(parent) ExtensionConn::ExtensionConn(QObject *parent, QString ip, int port, QString name, extensionType type, int debugLvl = 0) : QObject(parent)
{ {
this->log("Was created with parameters debugLvl:" + QString::number(this->debugLvl), 2);
// set object parameters // set object parameters
this->ip = ip; this->ip = ip;
...@@ -11,6 +10,8 @@ ExtensionConn::ExtensionConn(QObject *parent, QString ip, int port, QString name ...@@ -11,6 +10,8 @@ ExtensionConn::ExtensionConn(QObject *parent, QString ip, int port, QString name
this->type = type; this->type = type;
this->debugLvl = debugLvl; this->debugLvl = debugLvl;
this->log("Was created with parameters debugLvl:" + QString::number(this->debugLvl), 2);
this->errors = 0; this->errors = 0;
this->latest_button_pressed = 0; this->latest_button_pressed = 0;
this->connection_progress = 0; this->connection_progress = 0;
......
...@@ -11,15 +11,15 @@ int main(int argc, char *argv[]) ...@@ -11,15 +11,15 @@ int main(int argc, char *argv[])
QCoreApplication a(argc, argv); QCoreApplication a(argc, argv);
qDebug() << "---------------------------------------------"; qDebug() << "--------------------------------------------------" ;
qDebug() << "Speed Climbing Stopwatch Basestation - V" << APP_VERSION << ""; qDebug() << "- Speed Climbing Stopwatch Basestation - V" << APP_VERSION << "-";
qDebug() << "---------------------------------------------"; qDebug() << "--------------------------------------------------";
//construct MainActivity class //construct MainActivity class
MainActivity * pMainActivity = new MainActivity; MainActivity * pMainActivity = new MainActivity;
currentExitCode = a.exec(); currentExitCode = a.exec();
delete pMainActivity; pMainActivity->deleteLater();
qDebug() << "end: " << currentExitCode << "\n---------------------------------------------\n"; qDebug() << "end: " << currentExitCode << "\n---------------------------------------------\n";
} }
...@@ -27,10 +27,7 @@ int main(int argc, char *argv[]) ...@@ -27,10 +27,7 @@ int main(int argc, char *argv[])
// a reboot of the host was requested // a reboot of the host was requested
QProcess rebootProcess; QProcess rebootProcess;
rebootProcess.start("sudo reboot now"); rebootProcess.start("sudo reboot now");
rebootProcess.waitForFinished();
QEventLoop rebootWaitLoop;
QObject::connect(&rebootProcess, SIGNAL(finished), &rebootWaitLoop, SLOT(quit));
rebootWaitLoop.exec();
} }
return currentExitCode; return currentExitCode;
......
...@@ -29,7 +29,7 @@ MainActivity::MainActivity(QObject *parent) : QObject(parent) ...@@ -29,7 +29,7 @@ MainActivity::MainActivity(QObject *parent) : QObject(parent)
this->extensionConnections.append( new ExtensionConn(nullptr, "192.168.4.11", 80, "startpadA", ExtensionConn::STARTPAD, 1) ); this->extensionConnections.append( new ExtensionConn(nullptr, "192.168.4.11", 80, "startpadA", ExtensionConn::STARTPAD, 1) );
// toppad lane B // toppad lane B
this->extensionConnections.append( new ExtensionConn(nullptr, "192.168.4.12", 80, "buzzerB", ExtensionConn::TOPPAD, 1) ); this->extensionConnections.append( new ExtensionConn(nullptr, "192.168.4.12", 80, "toppadB", ExtensionConn::TOPPAD, 1) );
// startpad lane B // startpad lane B
this->extensionConnections.append( new ExtensionConn(nullptr, "192.168.4.13", 80, "startpadB", ExtensionConn::STARTPAD, 1) ); this->extensionConnections.append( new ExtensionConn(nullptr, "192.168.4.13", 80, "startpadB", ExtensionConn::STARTPAD, 1) );
...@@ -92,19 +92,25 @@ MainActivity::MainActivity(QObject *parent) : QObject(parent) ...@@ -92,19 +92,25 @@ MainActivity::MainActivity(QObject *parent) : QObject(parent)
MainActivity::~MainActivity(){ MainActivity::~MainActivity(){
// destructor // destructor
delete this->appSettings; this->appSettings->deleteLater();
delete this->date;
this->athleteProfiles->deleteLater();
this->commandPlayer->deleteLater();
this->falseSoundPlayer->deleteLater();
this->startSoundPlayer->deleteLater();
for(int i = 0; i < this->speedTimers.length(); i++){ for(int i = 0; i < this->speedTimers.length(); i++){
delete this->speedTimers[i]; this->speedTimers[i]->deleteLater();
} }
for(int i=0; i < this->extensionConnections.length(); i++){ for(int i=0; i < this->extensionConnections.length(); i++){
delete this->extensionConnections[i]; this->extensionConnections[i]->deleteLater();
} }
delete this->socketServer; this->socketServer->deleteLater();
delete this->nextActionTimer; this->nextActionTimer->deleteLater();
#ifdef RASPI #ifdef RASPI
digitalWrite(this->leds["RED"],0); digitalWrite(this->leds["RED"],0);
...@@ -438,7 +444,6 @@ void MainActivity::handleSocketCommand(SocketServer::socketClient *socketClient, ...@@ -438,7 +444,6 @@ void MainActivity::handleSocketCommand(SocketServer::socketClient *socketClient,
socketClient->updateSubscriptions = requestData["updateSubs"].toVariant().toStringList(); socketClient->updateSubscriptions = requestData["updateSubs"].toVariant().toStringList();
socketClient->usingTerminationKeys = requestData["usingTerminationKeys"].toBool(); socketClient->usingTerminationKeys = requestData["usingTerminationKeys"].toBool();
qDebug() << "set update subs to: " << socketClient->updateSubscriptions;
replyHeader = 200; replyHeader = 200;
replyData = QJsonObject::fromVariantMap({ { "version", APP_VERSION }, { "time", this->date->currentMSecsSinceEpoch() } }); replyData = QJsonObject::fromVariantMap({ { "version", APP_VERSION }, { "time", this->date->currentMSecsSinceEpoch() } });
...@@ -774,6 +779,9 @@ void MainActivity::handleSocketCommand(SocketServer::socketClient *socketClient, ...@@ -774,6 +779,9 @@ void MainActivity::handleSocketCommand(SocketServer::socketClient *socketClient,
// send the reply back to the client // send the reply back to the client
this->socketServer->sendToClient(socket, jsonReply.toJson()); this->socketServer->sendToClient(socket, jsonReply.toJson());
// wait for the client to recieve the reply
socket->waitForBytesWritten();
// perform the actual update // perform the actual update
QString newFirmwareString = signedMessage.split("<BIN>")[1].split("</BIN>")[0]; QString newFirmwareString = signedMessage.split("<BIN>")[1].split("</BIN>")[0];
//qDebug() << newFirmwareString; //qDebug() << newFirmwareString;
......
...@@ -19,10 +19,11 @@ SocketServer::SocketServer() : QObject() ...@@ -19,10 +19,11 @@ SocketServer::SocketServer() : QObject()
SocketServer::~SocketServer(){ SocketServer::~SocketServer(){
for(int i=0; i<this->clients.length(); i++){ for(int i=0; i<this->clients.length(); i++){
delete this->clients[i].socket; this->clients[i].socket->close();
this->clients[i].socket->deleteLater();
} }
delete this->tcpServer; this->tcpServer->deleteLater();
} }
// ----------------------- // -----------------------
......
...@@ -31,6 +31,7 @@ SpeedTimer::SpeedTimer(ExtensionConn *topPad, ExtensionConn *startPad, bool auto ...@@ -31,6 +31,7 @@ SpeedTimer::SpeedTimer(ExtensionConn *topPad, ExtensionConn *startPad, bool auto
SpeedTimer::~SpeedTimer(){ SpeedTimer::~SpeedTimer(){
delete this->date; delete this->date;
this->clickSoundPlayer->deleteLater();
} }
// -------------------------- // --------------------------
......
This diff is collapsed.
libQt-Secret.so.1.2.0
\ No newline at end of file
libQt-Secret.so.1.2.0
\ No newline at end of file
libQt-Secret.so.1.2.0
\ No newline at end of file
This diff is collapsed.