diff -r 0f15edebc665 -r 61c114afb0ee src/CalibrateiSpindel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/CalibrateiSpindel.cpp Fri Oct 13 14:47:21 2023 +0200 @@ -0,0 +1,73 @@ +/** + * CalibrateiSpindel.cpp is part of bmsapp. + * + * bmsapp is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * bmsapp is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "CalibrateiSpindel.h" +#include "../ui/ui_CalibrateiSpindel.h" +#include "global.h" +#include "Utils.h" +#include "MainWindow.h" + + + +CalibrateiSpindel::CalibrateiSpindel(int id, QWidget *parent) : QDialog(parent), ui(new Ui::CalibrateiSpindel) +{ + QSqlQuery query; + +#ifdef DEBUG_MONITOR + qDebug() << "CalibrateiSpindel record:" << id; +#endif + ui->setupUi(this); + this->recno = id; + setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); + setWindowTitle(tr("BMSapp - Calibrate iSpindel")); + + connect(parent, SIGNAL(updateiSpindel(QString)), this, SLOT(refreshiSpindel(QString))); + emit refreshTable(); +} + + +void CalibrateiSpindel::refreshTable() +{ + QSqlQuery query; + + query.prepare("SELECT node,alias,calibrate FROM mon_ispindels WHERE record = :recno"); + query.bindValue(":recno", this->recno); + query.exec(); + if (query.next()) { + + _node = query.value("node").toString(); + _alias = query.value("alias").toString(); + _data_old = query.value("calibrate").toString(); + _data_new = query.value("calibrate").toString(); + + } + +} + + +CalibrateiSpindel::~CalibrateiSpindel() +{ + delete ui; +} + + +void CalibrateiSpindel::on_quitButton_clicked() +{ + this->close(); + this->setResult(1); +} + +