src/CalibrateiSpindel.cpp

Fri, 13 Oct 2023 14:47:21 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 13 Oct 2023 14:47:21 +0200
changeset 503
61c114afb0ee
child 504
ea7cf64c9a6c
permissions
-rw-r--r--

Basic setup for iSpindel calibration.

/**
 * 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 "../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);
}

mercurial