2025-04-09 05:58:05 +00:00
|
|
|
#include "instrumentcoefficientform.h"
|
|
|
|
#include "ui_instrumentcoefficientform.h"
|
2025-04-17 09:31:46 +00:00
|
|
|
#include "confighandler.h"
|
2025-04-09 05:58:05 +00:00
|
|
|
|
|
|
|
InstrumentCoefficientForm::InstrumentCoefficientForm(QWidget *parent) :
|
|
|
|
QWidget(parent),
|
|
|
|
ui(new Ui::InstrumentCoefficientForm)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2025-04-17 09:31:46 +00:00
|
|
|
|
|
|
|
setWindowTitle("仪器系数");
|
|
|
|
|
|
|
|
ui->LineEditCoefficient->setText(
|
|
|
|
QString::number(
|
|
|
|
ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat(),
|
|
|
|
'f',3));
|
2025-04-18 09:30:35 +00:00
|
|
|
|
|
|
|
ui->LineEditTheory->text().clear();
|
|
|
|
ui->LineEditActualMeasurement->text().clear();
|
2025-04-09 05:58:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
InstrumentCoefficientForm::~InstrumentCoefficientForm()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void InstrumentCoefficientForm::on_pushButtonCalculate_clicked()
|
|
|
|
{
|
2025-04-17 09:31:46 +00:00
|
|
|
float theory = ui->LineEditTheory->text().toFloat();
|
|
|
|
float measure = ui->LineEditActualMeasurement->text().toFloat();
|
|
|
|
|
|
|
|
float instrumentCoefficient = theory/measure;
|
|
|
|
ConfigHandler::_configMap[ConInstrumentCoefficientStr] = instrumentCoefficient;
|
|
|
|
ConfigHandler::writer();
|
2025-04-09 05:58:05 +00:00
|
|
|
|
2025-04-17 09:31:46 +00:00
|
|
|
ui->LineEditCoefficient->setText(QString::number(instrumentCoefficient,'f',3));
|
2025-04-09 05:58:05 +00:00
|
|
|
}
|
|
|
|
|
2025-04-11 09:17:37 +00:00
|
|
|
void InstrumentCoefficientForm::on_pushButtonCancel_clicked()
|
|
|
|
{
|
|
|
|
hide();
|
|
|
|
}
|