feature: added possibility to change hardware interface from GUI

This commit is contained in:
2019-12-29 17:07:42 +01:00
parent 8443b12937
commit e102dab939
8 changed files with 163 additions and 9 deletions

View File

@@ -50,6 +50,21 @@ MainWindow::MainWindow(QWidget * parent)
SLOT(WindowRennen()));
this->db = std::make_unique<DataBase>();
vector<vector<QString>> interface =
this->db->getData("select * from interface", 1);
if (interface.size() > 0) {
std::cout << "interface existiert" << std::endl;
}
else {
std::cout << "interface existiert nicht" << std::endl;
// create interface
std::string statement =
"CREATE TABLE \"Interface\" ( \"id\" INTEGER PRIMARY KEY "
"AUTOINCREMENT, \"interface\" TEXT )";
this->db->setData(statement);
statement = "insert into interface (interface) values ('/dev/ttyAMC0')";
this->db->setData(statement);
}
}
void MainWindow::closeEvent(QCloseEvent * event) {
Q_UNUSED(event);