changed serial reading from lowlevel to boost with hope for more stability, changed a lot of smart pointers to unique_ptr, added fmt for logging
This commit is contained in:
@@ -13,6 +13,12 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/asio/read.hpp>
|
||||
#include <boost/asio/serial_port.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using std::vector;
|
||||
|
||||
MainWindow::MainWindow(QWidget * parent)
|
||||
@@ -43,9 +49,7 @@ MainWindow::MainWindow(QWidget * parent)
|
||||
QObject::connect(startRennen.get(), SIGNAL(activated()), this,
|
||||
SLOT(WindowRennen()));
|
||||
|
||||
this->db = std::make_shared<DataBase>();
|
||||
|
||||
// vector<vector<QString>> daten = db->getData("select * from Fahrer", 2);
|
||||
this->db = std::make_unique<DataBase>();
|
||||
}
|
||||
void MainWindow::closeEvent(QCloseEvent * event) {
|
||||
Q_UNUSED(event);
|
||||
@@ -57,13 +61,15 @@ MainWindow::~MainWindow() {
|
||||
|
||||
void MainWindow::WindowTraining() {
|
||||
{
|
||||
this->interfaceTraining = std::make_shared<Training>(this, this->db);
|
||||
this->interfaceTraining =
|
||||
std::make_unique<Training>(this, this->db.get());
|
||||
this->interfaceTraining->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::NewWindowSettings() {
|
||||
this->interfaceSettings = std::make_shared<WindowsSettings>(this->db, this);
|
||||
this->interfaceSettings =
|
||||
std::make_unique<WindowsSettings>(this->db.get(), this);
|
||||
this->interfaceSettings->show();
|
||||
}
|
||||
|
||||
@@ -108,16 +114,16 @@ void MainWindow::WindowRennen() {
|
||||
Q_UNUSED(e);
|
||||
}
|
||||
|
||||
this->interfaceRace = std::make_shared<WindowRace>(this->db, this);
|
||||
this->interfaceRace = std::make_unique<WindowRace>(this->db.get(), this);
|
||||
this->interfaceRace->show();
|
||||
this->interfaceRennliste =
|
||||
std::make_shared<WindowRennliste>(this->db, this);
|
||||
std::make_unique<WindowRennliste>(this->db.get(), this);
|
||||
this->interfaceRennliste->show();
|
||||
this->interfaceRace->setWindowRennliste(this->interfaceRennliste);
|
||||
this->interfaceRennliste->setWindowRace(this->interfaceRace);
|
||||
this->interfaceRace->setWindowRennliste(this->interfaceRennliste.get());
|
||||
this->interfaceRennliste->setWindowRace(this->interfaceRace.get());
|
||||
}
|
||||
|
||||
void MainWindow::WindowEvaluation() {
|
||||
this->interfaceEvaluation = std::make_shared<Evaluation>(this->db);
|
||||
this->interfaceEvaluation = std::make_unique<Evaluation>(this->db.get());
|
||||
this->interfaceEvaluation->show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user