2025-05-21T16:36:47
This commit is contained in:
parent
81d4b13cbd
commit
4f15bc595f
BIN
experiment_data/analysis_state/21-new.xlsx
Normal file
BIN
experiment_data/analysis_state/21-new.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/analysis_state/铟分析后.xlsx
Normal file
BIN
experiment_data/analysis_state/铟分析后.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/sample_data/铟测试1.xlsx
Normal file
BIN
experiment_data/sample_data/铟测试1.xlsx
Normal file
Binary file not shown.
@ -9,7 +9,7 @@ QVector<Global::ExperimentData>PointCalculate:: _dataVtr;
|
|||||||
QPointF PointCalculate::_peakPoint;
|
QPointF PointCalculate::_peakPoint;
|
||||||
QPointF PointCalculate::_leftSelectedPoint,PointCalculate::_rightSelectedPoint;
|
QPointF PointCalculate::_leftSelectedPoint,PointCalculate::_rightSelectedPoint;
|
||||||
|
|
||||||
void PointCalculate::setExperimentData(const QVector<Global::ExperimentData> &dataVtr)
|
void PointCalculate::setAnalysisData(const QVector<Global::ExperimentData> &dataVtr)
|
||||||
{
|
{
|
||||||
_dataVtr = dataVtr;
|
_dataVtr = dataVtr;
|
||||||
|
|
||||||
@ -263,6 +263,8 @@ float PointCalculate::calculateArea() {
|
|||||||
float b = Global::_enthalpyCoefficientVtr.at(1);
|
float b = Global::_enthalpyCoefficientVtr.at(1);
|
||||||
float c = Global::_enthalpyCoefficientVtr.at(2);
|
float c = Global::_enthalpyCoefficientVtr.at(2);
|
||||||
|
|
||||||
|
logde<<"a,b,c:"<<a<<","<<b<<","<<c;
|
||||||
|
|
||||||
coefficient = a * startTemp * startTemp +
|
coefficient = a * startTemp * startTemp +
|
||||||
b * startTemp +
|
b * startTemp +
|
||||||
c;
|
c;
|
||||||
@ -273,6 +275,8 @@ float PointCalculate::calculateArea() {
|
|||||||
|
|
||||||
float area = integral * coefficient * Global::DefaultParamter;
|
float area = integral * coefficient * Global::DefaultParamter;
|
||||||
|
|
||||||
|
logde<<"area:"<<area;
|
||||||
|
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +645,7 @@ QString PointCalculate::textFormatPeakPointWithTime(const float enthalpyValue, c
|
|||||||
"起始点:%3min \n"
|
"起始点:%3min \n"
|
||||||
"终止点:%4min"
|
"终止点:%4min"
|
||||||
)
|
)
|
||||||
.arg(QString::number(enthalpyValue, 'f', 3))
|
.arg(QString::number(enthalpyValue, 'f', 4))
|
||||||
.arg(QString::number(peakValue, 'f', 3))
|
.arg(QString::number(peakValue, 'f', 3))
|
||||||
.arg(QString::number(startPoint, 'f', 3))
|
.arg(QString::number(startPoint, 'f', 3))
|
||||||
.arg(QString::number(endPoint, 'f', 3));
|
.arg(QString::number(endPoint, 'f', 3));
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
namespace PointCalculate{
|
namespace PointCalculate{
|
||||||
void setExperimentData(const QVector<Global::ExperimentData>&);
|
void setAnalysisData(const QVector<Global::ExperimentData>&);
|
||||||
|
|
||||||
QPair<QPointF,QPointF> getStartAndEndPoint();
|
QPair<QPointF,QPointF> getStartAndEndPoint();
|
||||||
QVector<Global::ExperimentData> getDataInXRange(const float, const float);
|
QVector<Global::ExperimentData> getDataInXRange(const float, const float);
|
||||||
|
|||||||
@ -213,6 +213,7 @@ void XlsxHandler::writeFile(const QString filePath)
|
|||||||
xlsx.write(row , 1, ConPhaseIndex);
|
xlsx.write(row , 1, ConPhaseIndex);
|
||||||
xlsx.write(row , 2, i + 1);
|
xlsx.write(row , 2, i + 1);
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
// phase info
|
// phase info
|
||||||
xlsx.write(row , 1, ConPhaseCutoffTemp);
|
xlsx.write(row , 1, ConPhaseCutoffTemp);
|
||||||
xlsx.write(row , 2, phase.cutoff_temp);
|
xlsx.write(row , 2, phase.cutoff_temp);
|
||||||
|
|||||||
16
src/global.h
16
src/global.h
@ -32,18 +32,6 @@ const QString RateStr("rate");
|
|||||||
const double DefaultParamter = 8.177;
|
const double DefaultParamter = 8.177;
|
||||||
|
|
||||||
//
|
//
|
||||||
#if 0
|
|
||||||
enum AnalysisMode{
|
|
||||||
Null,
|
|
||||||
NumericalLabel,
|
|
||||||
StartPoint,
|
|
||||||
StopPoint,
|
|
||||||
PeakSynthesisAnalysis,
|
|
||||||
GlassTransition,
|
|
||||||
OnsetTemperaturePoint,
|
|
||||||
EndsetTemperaturePoint
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
enum Mode{
|
enum Mode{
|
||||||
Analysis,
|
Analysis,
|
||||||
ConnectedToDev,
|
ConnectedToDev,
|
||||||
@ -126,10 +114,6 @@ extern bool _displayTimeValue;
|
|||||||
QString converDoubleToStr(const double);
|
QString converDoubleToStr(const double);
|
||||||
void quadraticLeastSquaresFit(double x[], double y[], int n, double coeff[]);
|
void quadraticLeastSquaresFit(double x[], double y[], int n, double coeff[]);
|
||||||
double findNegativeStartPoint(double m, double b, double start, double end);
|
double findNegativeStartPoint(double m, double b, double start, double end);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // GLOBAL_H
|
#endif // GLOBAL_H
|
||||||
|
|||||||
@ -348,6 +348,7 @@ void MainWindow::slotSaveExperimentalDataMsgBox()
|
|||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if (reply == QMessageBox::Yes) {
|
if (reply == QMessageBox::Yes) {
|
||||||
saveFile(Global::_experimentInfo.sampleName,Global::Mode::Experiment);
|
saveFile(Global::_experimentInfo.sampleName,Global::Mode::Experiment);
|
||||||
|
_leftWidget->reloadFileName();
|
||||||
} else {
|
} else {
|
||||||
on_actionClearAllData_triggered();
|
on_actionClearAllData_triggered();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,10 +98,6 @@ private:
|
|||||||
void connections();
|
void connections();
|
||||||
void setActionEnable(const bool);
|
void setActionEnable(const bool);
|
||||||
void setSubWidgetAttribute(QWidget *);
|
void setSubWidgetAttribute(QWidget *);
|
||||||
#if 0
|
|
||||||
bool saveExperimentFile(const QString fileName);
|
|
||||||
bool saveAnalysisFile(const QString fileName);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool saveFile(const QString fileName,const Global::Mode);
|
bool saveFile(const QString fileName,const Global::Mode);
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -110,6 +110,12 @@ void CentralWidget::switchAxisMode()
|
|||||||
if(_axisMode == AxisMode::SingleY){
|
if(_axisMode == AxisMode::SingleY){
|
||||||
_axisMode = AxisMode::DoubleY;
|
_axisMode = AxisMode::DoubleY;
|
||||||
|
|
||||||
|
_customPlot->yAxis2->setVisible(true);
|
||||||
|
_customPlot->yAxis2->setLabel(XlsxHandler::ConPhaseHeaderTemp);
|
||||||
|
|
||||||
|
_customPlot->yAxis->setLabel(XlsxHandler::ConPhaseHeaderTime);
|
||||||
|
|
||||||
|
#if 0
|
||||||
_customPlot->yAxis2->setVisible(true);
|
_customPlot->yAxis2->setVisible(true);
|
||||||
_customPlot->yAxis2->setLabel("Time/min");
|
_customPlot->yAxis2->setLabel("Time/min");
|
||||||
|
|
||||||
@ -142,6 +148,7 @@ void CentralWidget::switchAxisMode()
|
|||||||
// logde<<"plottableCount count:"<<_customPlot->plottableCount();
|
// logde<<"plottableCount count:"<<_customPlot->plottableCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}else{
|
}else{
|
||||||
_axisMode = AxisMode::SingleY;
|
_axisMode = AxisMode::SingleY;
|
||||||
|
|
||||||
@ -272,7 +279,7 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
|||||||
for(int i = 0;i < cfd.phaseTotalVtr.size();i++){
|
for(int i = 0;i < cfd.phaseTotalVtr.size();i++){
|
||||||
Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i];
|
Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i];
|
||||||
|
|
||||||
PointCalculate::setExperimentData(pti.dataVtr);
|
PointCalculate::setAnalysisData(pti.dataVtr);
|
||||||
|
|
||||||
QPair<QPointF,QPointF>startEndPointPair = PointCalculate::getStartAndEndPoint();
|
QPair<QPointF,QPointF>startEndPointPair = PointCalculate::getStartAndEndPoint();
|
||||||
|
|
||||||
@ -306,6 +313,9 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
|||||||
pti.curve = _currentCurve;
|
pti.curve = _currentCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add data to global parameter.
|
||||||
|
Global::_curveFileDataVtr.push_back(cfd);
|
||||||
|
|
||||||
// Add analysis operation data.
|
// Add analysis operation data.
|
||||||
if(cfd.analysisOperationVtr.size() > 0){
|
if(cfd.analysisOperationVtr.size() > 0){
|
||||||
for(AnaOpRecorder::AnalysisOperation& ao
|
for(AnaOpRecorder::AnalysisOperation& ao
|
||||||
@ -316,13 +326,26 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
|||||||
// Refresh ui.
|
// Refresh ui.
|
||||||
_customPlot->rescaleAxes();
|
_customPlot->rescaleAxes();
|
||||||
_customPlot->replot();
|
_customPlot->replot();
|
||||||
|
|
||||||
// Add data to global parameter.
|
|
||||||
Global::_curveFileDataVtr.push_back(cfd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CentralWidget::slotAnalysisSettingApply()
|
void CentralWidget::slotAnalysisSettingApply()
|
||||||
{
|
{
|
||||||
|
//Set the analysis data corresponding current curve.
|
||||||
|
if(!_currentCurve){
|
||||||
|
logde<<"failed. current curve is nullptr.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVector<Global::ExperimentData> dataVtr;
|
||||||
|
for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){
|
||||||
|
for(Global::PhaseTotalInfo& pti:cfd.phaseTotalVtr){
|
||||||
|
if(pti.curve == _currentCurve){
|
||||||
|
PointCalculate::setAnalysisData(pti.dataVtr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
double x1 = _line1->point1->coords().x();
|
double x1 = _line1->point1->coords().x();
|
||||||
double x2 = _line2->point1->coords().x();
|
double x2 = _line2->point1->coords().x();
|
||||||
|
|
||||||
@ -1097,16 +1120,33 @@ void CentralWidget::loadAnalysisData(
|
|||||||
//enthalpy
|
//enthalpy
|
||||||
double sampleWeight = 0.0f;
|
double sampleWeight = 0.0f;
|
||||||
for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){
|
for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){
|
||||||
|
|
||||||
for(Global::PhaseTotalInfo& pti:cfd.phaseTotalVtr){
|
for(Global::PhaseTotalInfo& pti:cfd.phaseTotalVtr){
|
||||||
|
#if 0
|
||||||
if(_currentCurve && _currentCurve == pti.curve){
|
if(_currentCurve && _currentCurve == pti.curve){
|
||||||
sampleWeight = cfd.ei.sampleWeight.toDouble();
|
sampleWeight = cfd.ei.sampleWeight.toDouble();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
if(_currentCurve){
|
||||||
|
if(_currentCurve == pti.curve){
|
||||||
|
sampleWeight = cfd.ei.sampleWeight.toDouble();
|
||||||
|
}else{
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
// logde<<"current curve nullptr.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// logde<<"sample weight:"<<sampleWeight;
|
|
||||||
|
if(sampleWeight <= 0){
|
||||||
|
logde<<"sample weight set value 1,"<<sampleWeight;
|
||||||
|
sampleWeight = 1;
|
||||||
|
}
|
||||||
|
|
||||||
double enthalpyValue = PointCalculate::calculateArea() / sampleWeight;
|
double enthalpyValue = PointCalculate::calculateArea() / sampleWeight;
|
||||||
|
|
||||||
|
// logde<<"enthalpyValue:"<<enthalpyValue;
|
||||||
|
|
||||||
// peak
|
// peak
|
||||||
QPointF peakPoint = PointCalculate::getPeakPoint();
|
QPointF peakPoint = PointCalculate::getPeakPoint();
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
#include "experimentsettingform.h"
|
#include "experimentsettingform.h"
|
||||||
#include "ui_experimentsettingform.h"
|
#include "ui_experimentsettingform.h"
|
||||||
@ -22,6 +23,13 @@ ExperimentSettingForm::ExperimentSettingForm(QWidget *parent) : QWidget(parent),
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
uiReset();
|
uiReset();
|
||||||
|
|
||||||
|
ui->checkBox_phase_1->setTristate(false);
|
||||||
|
ui->checkBox_phase_2->setTristate(false);
|
||||||
|
ui->checkBox_phase_3->setTristate(false);
|
||||||
|
ui->checkBox_phase_4->setTristate(false);
|
||||||
|
ui->checkBox_phase_5->setTristate(false);
|
||||||
|
ui->checkBox_phase_6->setTristate(false);
|
||||||
|
|
||||||
connect(ui->checkBox_phase_2, &QCheckBox::clicked,
|
connect(ui->checkBox_phase_2, &QCheckBox::clicked,
|
||||||
this, &ExperimentSettingForm::slotPhase2StateChanged);
|
this, &ExperimentSettingForm::slotPhase2StateChanged);
|
||||||
connect(ui->checkBox_phase_3, &QCheckBox::clicked,
|
connect(ui->checkBox_phase_3, &QCheckBox::clicked,
|
||||||
@ -217,9 +225,10 @@ void ExperimentSettingForm::slotPhase2StateChanged(int state)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// unchecked
|
||||||
if (ui->checkBox_phase_3->isChecked())
|
if (ui->checkBox_phase_3->isChecked())
|
||||||
{
|
{
|
||||||
ui->checkBox_phase_2->setCheckState(Qt::Checked);
|
ui->checkBox_phase_2->setChecked(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -281,10 +290,17 @@ void ExperimentSettingForm::slotPhase4StateChanged(int state)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->phase_4_cutoff_temp->setEnabled(false);
|
if (ui->checkBox_phase_5->isChecked())
|
||||||
ui->phase_4_scan_rate->setEnabled(false);
|
{
|
||||||
ui->phase_4_constant_temp->setEnabled(false);
|
ui->checkBox_phase_4->setChecked(true);
|
||||||
ui->comboBox_phase_4_atmosphere->setEnabled(false);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->phase_4_cutoff_temp->setEnabled(false);
|
||||||
|
ui->phase_4_scan_rate->setEnabled(false);
|
||||||
|
ui->phase_4_constant_temp->setEnabled(false);
|
||||||
|
ui->comboBox_phase_4_atmosphere->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,15 +322,24 @@ void ExperimentSettingForm::slotPhase5StateChanged(int state)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui->phase_5_cutoff_temp->setEnabled(false);
|
if (ui->checkBox_phase_6->isChecked())
|
||||||
ui->phase_5_scan_rate->setEnabled(false);
|
{
|
||||||
ui->phase_5_constant_temp->setEnabled(false);
|
ui->checkBox_phase_5->setChecked(true);
|
||||||
ui->comboBox_phase_5_atmosphere->setEnabled(false);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->phase_5_cutoff_temp->setEnabled(false);
|
||||||
|
ui->phase_5_scan_rate->setEnabled(false);
|
||||||
|
ui->phase_5_constant_temp->setEnabled(false);
|
||||||
|
ui->comboBox_phase_5_atmosphere->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExperimentSettingForm::slotPhase6StateChanged(int state)
|
void ExperimentSettingForm::slotPhase6StateChanged(int state)
|
||||||
{
|
{
|
||||||
|
qDebug() << "slotPhase2StateChanged:" << state;
|
||||||
|
|
||||||
if (state == Qt::PartiallyChecked)
|
if (state == Qt::PartiallyChecked)
|
||||||
{
|
{
|
||||||
if (ui->checkBox_phase_5->isChecked())
|
if (ui->checkBox_phase_5->isChecked())
|
||||||
@ -340,6 +365,13 @@ void ExperimentSettingForm::slotPhase6StateChanged(int state)
|
|||||||
|
|
||||||
void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
||||||
{
|
{
|
||||||
|
float phase1CutoffTemp = 0.0;
|
||||||
|
float phase2CutoffTemp = 0.0;
|
||||||
|
float phase3CutoffTemp = 0.0;
|
||||||
|
float phase4CutoffTemp = 0.0;
|
||||||
|
float phase5CutoffTemp = 0.0;
|
||||||
|
float phase6CutoffTemp = 0.0;
|
||||||
|
|
||||||
QVector<Phase> phaseVtr;
|
QVector<Phase> phaseVtr;
|
||||||
{
|
{
|
||||||
Phase phase;
|
Phase phase;
|
||||||
@ -351,6 +383,13 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
|||||||
phase.gas = GasType::N2;
|
phase.gas = GasType::N2;
|
||||||
|
|
||||||
phaseVtr.push_back(phase);
|
phaseVtr.push_back(phase);
|
||||||
|
//
|
||||||
|
phase1CutoffTemp = phase.cutoff_temp;
|
||||||
|
//
|
||||||
|
if(phase.temp_flow <= 0){
|
||||||
|
phaseScanRateErrorMesgBox(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Phase phase;
|
Phase phase;
|
||||||
@ -362,6 +401,17 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
|||||||
phase.gas = GasType::N2;
|
phase.gas = GasType::N2;
|
||||||
|
|
||||||
phaseVtr.push_back(phase);
|
phaseVtr.push_back(phase);
|
||||||
|
//
|
||||||
|
phase2CutoffTemp = phase.cutoff_temp;
|
||||||
|
if(phase2CutoffTemp < phase1CutoffTemp){
|
||||||
|
phaseCufoffTempErrorMesgBox(2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(phase.temp_flow <= 0){
|
||||||
|
phaseScanRateErrorMesgBox(2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -373,6 +423,17 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
|||||||
phase.gas = GasType::N2;
|
phase.gas = GasType::N2;
|
||||||
|
|
||||||
phaseVtr.push_back(phase);
|
phaseVtr.push_back(phase);
|
||||||
|
//
|
||||||
|
phase3CutoffTemp = phase.cutoff_temp;
|
||||||
|
if(phase3CutoffTemp < phase2CutoffTemp){
|
||||||
|
phaseCufoffTempErrorMesgBox(3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(phase.temp_flow <= 0){
|
||||||
|
phaseScanRateErrorMesgBox(3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -384,6 +445,17 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
|||||||
// phase.gas = ui->comboBox_phase_1_atmosphere->currentIndex();
|
// phase.gas = ui->comboBox_phase_1_atmosphere->currentIndex();
|
||||||
phase.gas = GasType::N2;
|
phase.gas = GasType::N2;
|
||||||
phaseVtr.push_back(phase);
|
phaseVtr.push_back(phase);
|
||||||
|
//
|
||||||
|
phase4CutoffTemp = phase.cutoff_temp;
|
||||||
|
if(phase4CutoffTemp < phase3CutoffTemp){
|
||||||
|
phaseCufoffTempErrorMesgBox(4);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(phase.temp_flow <= 0){
|
||||||
|
phaseScanRateErrorMesgBox(4);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -396,6 +468,17 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
|||||||
phase.gas = GasType::N2;
|
phase.gas = GasType::N2;
|
||||||
|
|
||||||
phaseVtr.push_back(phase);
|
phaseVtr.push_back(phase);
|
||||||
|
//
|
||||||
|
phase5CutoffTemp = phase.cutoff_temp;
|
||||||
|
if(phase5CutoffTemp < phase4CutoffTemp){
|
||||||
|
phaseCufoffTempErrorMesgBox(5);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(phase.temp_flow <= 0){
|
||||||
|
phaseScanRateErrorMesgBox(5);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -408,6 +491,17 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked()
|
|||||||
phase.gas = GasType::N2;
|
phase.gas = GasType::N2;
|
||||||
|
|
||||||
phaseVtr.push_back(phase);
|
phaseVtr.push_back(phase);
|
||||||
|
//
|
||||||
|
phase6CutoffTemp = phase.cutoff_temp;
|
||||||
|
if(phase6CutoffTemp < phase5CutoffTemp){
|
||||||
|
phaseCufoffTempErrorMesgBox(6);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(phase.temp_flow <= 0){
|
||||||
|
phaseScanRateErrorMesgBox(6);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
Global::ExperimentInfo& ei = Global::_experimentInfo;
|
Global::ExperimentInfo& ei = Global::_experimentInfo;
|
||||||
@ -451,6 +545,22 @@ void ExperimentSettingForm::slotCancel()
|
|||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExperimentSettingForm::phaseCufoffTempErrorMesgBox(const int phaseNum)
|
||||||
|
{
|
||||||
|
QString title = QString("阶段%1截止温度错误").arg(QString::number(phaseNum));
|
||||||
|
QString text = QString("阶段%1截止温度不能小于上一阶段截止温度! ").arg(QString::number(phaseNum));
|
||||||
|
QMessageBox::question(this, title, text,
|
||||||
|
QMessageBox::Yes);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExperimentSettingForm::phaseScanRateErrorMesgBox(const int phaseNum)
|
||||||
|
{
|
||||||
|
QString title = QString("阶段%1扫描速率错误").arg(QString::number(phaseNum));
|
||||||
|
QString text = QString("阶段%1扫描速率必须大于0! ").arg(QString::number(phaseNum));
|
||||||
|
QMessageBox::question(this, title, text,
|
||||||
|
QMessageBox::Yes);
|
||||||
|
}
|
||||||
void ExperimentSettingForm::slotPhaseCheck()
|
void ExperimentSettingForm::slotPhaseCheck()
|
||||||
{
|
{
|
||||||
if (sender() == ui->checkBox_phase_2)
|
if (sender() == ui->checkBox_phase_2)
|
||||||
@ -605,7 +715,7 @@ void ExperimentSettingForm::slotRecvPhaseInfo(const QByteArray &ba)
|
|||||||
Global::_experimentInfo.phaseVtr = phaseVtr;
|
Global::_experimentInfo.phaseVtr = phaseVtr;
|
||||||
|
|
||||||
//ui update
|
//ui update
|
||||||
// logde<<"phaseVtr size:"<<phaseVtr.size();
|
// logde<<"phaseVtr size:"<<phaseVtr.size();
|
||||||
|
|
||||||
uiReset();
|
uiReset();
|
||||||
|
|
||||||
@ -616,15 +726,15 @@ void ExperimentSettingForm::slotRecvPhaseInfo(const QByteArray &ba)
|
|||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
// qDebug()<<"index :"<<i;
|
// qDebug()<<"index :"<<i;
|
||||||
|
|
||||||
QString checkBoxName = QString("checkBox_phase_%1").arg(i);
|
QString checkBoxName = QString("checkBox_phase_%1").arg(i);
|
||||||
QCheckBox *checkBox_phase = qobject_cast<QCheckBox*>(this->findChild<QObject*>(checkBoxName));
|
QCheckBox *checkBox_phase = qobject_cast<QCheckBox*>(this->findChild<QObject*>(checkBoxName));
|
||||||
if (checkBox_phase) {
|
if (checkBox_phase) {
|
||||||
checkBox_phase->setChecked(true);
|
checkBox_phase->setChecked(true);
|
||||||
// qDebug()<<"found...";
|
// qDebug()<<"found...";
|
||||||
}else{
|
}else{
|
||||||
// qDebug()<<"not found...";
|
// qDebug()<<"not found...";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString cutOffTempLineEditName = QString("phase_%1_cutoff_temp").arg(i);
|
QString cutOffTempLineEditName = QString("phase_%1_cutoff_temp").arg(i);
|
||||||
@ -703,3 +813,11 @@ void ExperimentSettingForm::slotRecvPhaseInfo(const QByteArray &ba)
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ExperimentSettingForm::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||||
|
QString internationalFormat = currentDateTime.toString("yyyy/MM/dd hh:mm:ss");
|
||||||
|
|
||||||
|
ui->dateTimeLineEdit->setText(internationalFormat);
|
||||||
|
}
|
||||||
|
|||||||
@ -23,6 +23,8 @@ signals:
|
|||||||
void sigDeliverData(const QByteArray &);
|
void sigDeliverData(const QByteArray &);
|
||||||
public slots:
|
public slots:
|
||||||
void slotRecvPhaseInfo(const QByteArray &);
|
void slotRecvPhaseInfo(const QByteArray &);
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent *event) override;
|
||||||
private slots:
|
private slots:
|
||||||
void on_pushButton_deliverData_clicked();
|
void on_pushButton_deliverData_clicked();
|
||||||
private:
|
private:
|
||||||
@ -38,6 +40,9 @@ private:
|
|||||||
void slotPhase6StateChanged(int state);
|
void slotPhase6StateChanged(int state);
|
||||||
|
|
||||||
void slotCancel();
|
void slotCancel();
|
||||||
|
|
||||||
|
void phaseCufoffTempErrorMesgBox(const int);
|
||||||
|
void phaseScanRateErrorMesgBox(const int);
|
||||||
private:
|
private:
|
||||||
Ui::ExperimentSettingForm *ui;
|
Ui::ExperimentSettingForm *ui;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,13 +10,15 @@ PrintPreviewForm::PrintPreviewForm(QWidget *parent) :
|
|||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::PrintPreviewForm)
|
ui(new Ui::PrintPreviewForm)
|
||||||
,_printer(new QPrinter(QPrinter::HighResolution))
|
,_printer(new QPrinter(QPrinter::HighResolution))
|
||||||
,_customPrintPreviewDialog(new QPrintPreviewDialog(_printer,this))
|
// ,_customPrintPreviewDialog(new QPrintPreviewDialog(_printer,this))
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
_printer->setPageSize(QPageSize(QPageSize::A4));
|
_printer->setPageSize(QPageSize(QPageSize::A4));
|
||||||
_printer->setOrientation(QPrinter::Landscape);
|
_printer->setOrientation(QPrinter::Landscape);
|
||||||
|
|
||||||
|
_customPrintPreviewDialog = new QPrintPreviewDialog(_printer,this);
|
||||||
|
|
||||||
QObject::connect(_customPrintPreviewDialog, &QPrintPreviewDialog::paintRequested,
|
QObject::connect(_customPrintPreviewDialog, &QPrintPreviewDialog::paintRequested,
|
||||||
this,&PrintPreviewForm::slotPaintRequested);
|
this,&PrintPreviewForm::slotPaintRequested);
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
#include "ui_realtimedataform.h"
|
#include "ui_realtimedataform.h"
|
||||||
|
|
||||||
RealTimeDataForm::RealTimeDataForm(QWidget *parent) : QWidget(parent),
|
RealTimeDataForm::RealTimeDataForm(QWidget *parent) : QWidget(parent),
|
||||||
ui(new Ui::RealTimeDataForm)
|
ui(new Ui::RealTimeDataForm)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
}
|
}
|
||||||
@ -100,5 +100,20 @@ void RealTimeDataForm::slotRevCommonData(const CommonData &data)
|
|||||||
// 扫描速率
|
// 扫描速率
|
||||||
ui->scanRateLineEdit->setText("--");
|
ui->scanRateLineEdit->setText("--");
|
||||||
// 当前气氛
|
// 当前气氛
|
||||||
ui->currentAtmosphereLineEdit->setText(QString::number(data.current_gas));
|
QString gasName;
|
||||||
|
switch(data.current_gas){
|
||||||
|
case GasType::NC:
|
||||||
|
gasName = "NC";
|
||||||
|
break;
|
||||||
|
case GasType::N2:
|
||||||
|
gasName = "N2";
|
||||||
|
break;
|
||||||
|
case GasType::O2:
|
||||||
|
gasName = "O2";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gasName = "NC";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ui->currentAtmosphereLineEdit->setText(gasName);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -144,13 +144,13 @@ void SpecificHeatComparisonMethodForm::on_pushButtonCalculate_clicked()
|
|||||||
//
|
//
|
||||||
float targetTemperature = ui->LineEditTemperature->text().toFloat();
|
float targetTemperature = ui->LineEditTemperature->text().toFloat();
|
||||||
|
|
||||||
PointCalculate::setExperimentData(*_baseLineDataVtr);
|
PointCalculate::setAnalysisData(*_baseLineDataVtr);
|
||||||
QPointF baseLinePoint = PointCalculate::getClosestPointByX(targetTemperature);
|
QPointF baseLinePoint = PointCalculate::getClosestPointByX(targetTemperature);
|
||||||
|
|
||||||
PointCalculate::setExperimentData(*_standardSampleDataVtr);
|
PointCalculate::setAnalysisData(*_standardSampleDataVtr);
|
||||||
QPointF standardSamplePoint = PointCalculate::getClosestPointByX(targetTemperature);
|
QPointF standardSamplePoint = PointCalculate::getClosestPointByX(targetTemperature);
|
||||||
|
|
||||||
PointCalculate::setExperimentData(*_sampleDataVtr);
|
PointCalculate::setAnalysisData(*_sampleDataVtr);
|
||||||
QPointF samplePoint = PointCalculate::getClosestPointByX(targetTemperature);
|
QPointF samplePoint = PointCalculate::getClosestPointByX(targetTemperature);
|
||||||
|
|
||||||
logde<<"baseLinePoint:"<<baseLinePoint.x()<<","<<baseLinePoint.y();
|
logde<<"baseLinePoint:"<<baseLinePoint.x()<<","<<baseLinePoint.y();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user