diff --git a/src/data/pointcalculate.cpp b/src/data/pointcalculate.cpp index a2ecc53..8a36033 100644 --- a/src/data/pointcalculate.cpp +++ b/src/data/pointcalculate.cpp @@ -251,8 +251,10 @@ float PointCalculate::calculateArea() { /* * H = K * S / w; */ - float coefficient = 0.0f; + float coefficient = ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat(); if(Global::_enthalpyCoefficientEnableFlag){ + logde<<"_enthalpyCoefficientEnableFlag..."; + float startTemp = _leftSelectedPoint.x(); float value1 = Global::_enthalpyCoefficientVtr.at(0); @@ -262,9 +264,6 @@ float PointCalculate::calculateArea() { coefficient = value1 * startTemp * startTemp + value2 * startTemp + value3; - - }else{ - coefficient = ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat(); } logde<<"coefficient:"<setVisible(false); } -#if 0 - // Clear filled area. - if(_currentGraph){ - _currentGraph->setBrush(QBrush(Qt::transparent)); - } - +#if 1 // Clear graph on plot. for (int i = _customPlot->graphCount() - 1; i >= 0; --i) { QCPGraph *graph = _customPlot->graph(i); - if (graph != _currentGraph) { _customPlot->removeGraph(graph); - } } #endif diff --git a/src/ui/coefficientselectionform.cpp b/src/ui/coefficientselectionform.cpp index d326881..4f24051 100644 --- a/src/ui/coefficientselectionform.cpp +++ b/src/ui/coefficientselectionform.cpp @@ -35,6 +35,11 @@ CoefficientSelectionForm::~CoefficientSelectionForm() delete ui; } +void CoefficientSelectionForm::showEvent(QShowEvent *event) +{ + +} + void CoefficientSelectionForm::on_pushButtonCalculate_clicked() { float theory = ui->LineEditTheory->text().toFloat(); @@ -70,17 +75,20 @@ void CoefficientSelectionForm::on_pushButtonConfirm_clicked() <LineEditTheory->clear(); ui->LineEditCoefficient->clear(); @@ -88,6 +96,7 @@ void CoefficientSelectionForm::on_pushButtonExit_clicked() ui->textEditFileContent->clear(); _jsonStr.clear(); +#endif hide(); } @@ -116,6 +125,7 @@ void CoefficientSelectionForm::on_pushButtonSelectFile_clicked() // ui->labelFilePath->setText(filePath); ui->textEditFileContent->setText(_jsonStr); + } void CoefficientSelectionForm::on_radioButtonSinglePointCoefficient_toggled(bool checked) diff --git a/src/ui/coefficientselectionform.h b/src/ui/coefficientselectionform.h index 08fb3b4..c5ae511 100644 --- a/src/ui/coefficientselectionform.h +++ b/src/ui/coefficientselectionform.h @@ -14,7 +14,8 @@ class CoefficientSelectionForm : public QWidget public: explicit CoefficientSelectionForm(QWidget *parent = nullptr); ~CoefficientSelectionForm(); - +protected: + void showEvent(QShowEvent *event); private slots: void on_radioButtonSinglePointCoefficient_toggled(bool checked); void on_radioButtonMultiPointCoefficient_toggled(bool checked);