src/CalibrateiSpindel.cpp

changeset 503
61c114afb0ee
child 504
ea7cf64c9a6c
equal deleted inserted replaced
502:0f15edebc665 503:61c114afb0ee
1 /**
2 * CalibrateiSpindel.cpp is part of bmsapp.
3 *
4 * bmsapp is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * bmsapp is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include "CalibrateiSpindel.h"
18 #include "../ui/ui_CalibrateiSpindel.h"
19 #include "global.h"
20 #include "Utils.h"
21 #include "MainWindow.h"
22
23
24
25 CalibrateiSpindel::CalibrateiSpindel(int id, QWidget *parent) : QDialog(parent), ui(new Ui::CalibrateiSpindel)
26 {
27 QSqlQuery query;
28
29 #ifdef DEBUG_MONITOR
30 qDebug() << "CalibrateiSpindel record:" << id;
31 #endif
32 ui->setupUi(this);
33 this->recno = id;
34 setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
35 setWindowTitle(tr("BMSapp - Calibrate iSpindel"));
36
37 connect(parent, SIGNAL(updateiSpindel(QString)), this, SLOT(refreshiSpindel(QString)));
38 emit refreshTable();
39 }
40
41
42 void CalibrateiSpindel::refreshTable()
43 {
44 QSqlQuery query;
45
46 query.prepare("SELECT node,alias,calibrate FROM mon_ispindels WHERE record = :recno");
47 query.bindValue(":recno", this->recno);
48 query.exec();
49 if (query.next()) {
50
51 _node = query.value("node").toString();
52 _alias = query.value("alias").toString();
53 _data_old = query.value("calibrate").toString();
54 _data_new = query.value("calibrate").toString();
55
56 }
57
58 }
59
60
61 CalibrateiSpindel::~CalibrateiSpindel()
62 {
63 delete ui;
64 }
65
66
67 void CalibrateiSpindel::on_quitButton_clicked()
68 {
69 this->close();
70 this->setResult(1);
71 }
72
73

mercurial