Fri, 13 Oct 2023 15:36:15 +0200
Attempt 1
/** * 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 <http://www.gnu.org/licenses/>. */ #include "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 gridLayout = new QGridLayout(this); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); tableCalData = new QTableWidget(this); tableCalData->setObjectName(QString::fromUtf8("tableCalData")); tableCalData->setEnabled(true); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); tableCalData->setSizePolicy(sizePolicy); tableCalData->setMinimumSize(QSize(1024, 0)); gridLayout->addWidget(tableCalData, 0, 0, 1, 1); // 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); }