2025-04-21T09:32:53

This commit is contained in:
yuntang 2025-04-21 09:32:54 +08:00
parent 8aee1d8048
commit 1e2a73bd02
4 changed files with 17 additions and 14 deletions

View File

@ -251,8 +251,10 @@ float PointCalculate::calculateArea() {
/* /*
* H = K * S / w; * H = K * S / w;
*/ */
float coefficient = 0.0f; float coefficient = ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat();
if(Global::_enthalpyCoefficientEnableFlag){ if(Global::_enthalpyCoefficientEnableFlag){
logde<<"_enthalpyCoefficientEnableFlag...";
float startTemp = _leftSelectedPoint.x(); float startTemp = _leftSelectedPoint.x();
float value1 = Global::_enthalpyCoefficientVtr.at(0); float value1 = Global::_enthalpyCoefficientVtr.at(0);
@ -262,9 +264,6 @@ float PointCalculate::calculateArea() {
coefficient = value1 * startTemp * startTemp + coefficient = value1 * startTemp * startTemp +
value2 * startTemp + value2 * startTemp +
value3; value3;
}else{
coefficient = ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat();
} }
logde<<"coefficient:"<<coefficient; logde<<"coefficient:"<<coefficient;

View File

@ -628,19 +628,12 @@ void CentralWidget::clearData(const CentralWidget::ClearDataMode mode)
_line2->setVisible(false); _line2->setVisible(false);
} }
#if 0 #if 1
// Clear filled area.
if(_currentGraph){
_currentGraph->setBrush(QBrush(Qt::transparent));
}
// Clear graph on plot. // Clear graph on plot.
for (int i = _customPlot->graphCount() - 1; i >= 0; --i) { for (int i = _customPlot->graphCount() - 1; i >= 0; --i) {
QCPGraph *graph = _customPlot->graph(i); QCPGraph *graph = _customPlot->graph(i);
if (graph != _currentGraph) {
_customPlot->removeGraph(graph); _customPlot->removeGraph(graph);
} }
}
#endif #endif
// Delete items. // Delete items.

View File

@ -35,6 +35,11 @@ CoefficientSelectionForm::~CoefficientSelectionForm()
delete ui; delete ui;
} }
void CoefficientSelectionForm::showEvent(QShowEvent *event)
{
}
void CoefficientSelectionForm::on_pushButtonCalculate_clicked() void CoefficientSelectionForm::on_pushButtonCalculate_clicked()
{ {
float theory = ui->LineEditTheory->text().toFloat(); float theory = ui->LineEditTheory->text().toFloat();
@ -70,17 +75,20 @@ void CoefficientSelectionForm::on_pushButtonConfirm_clicked()
<<coeff[1]<<"," <<coeff[1]<<","
<<coeff[2]; <<coeff[2];
Global::_enthalpyCoefficientEnableFlag = false; Global::_enthalpyCoefficientEnableFlag = true;
Global::_enthalpyCoefficientVtr.clear(); Global::_enthalpyCoefficientVtr.clear();
Global::_enthalpyCoefficientVtr.push_back(coeff[2]); Global::_enthalpyCoefficientVtr.push_back(coeff[2]);
Global::_enthalpyCoefficientVtr.push_back(coeff[1]); Global::_enthalpyCoefficientVtr.push_back(coeff[1]);
Global::_enthalpyCoefficientVtr.push_back(coeff[0]); Global::_enthalpyCoefficientVtr.push_back(coeff[0]);
} }
hide();
} }
void CoefficientSelectionForm::on_pushButtonExit_clicked() void CoefficientSelectionForm::on_pushButtonExit_clicked()
{ {
#if 0
ui->LineEditTheory->clear(); ui->LineEditTheory->clear();
ui->LineEditCoefficient->clear(); ui->LineEditCoefficient->clear();
@ -88,6 +96,7 @@ void CoefficientSelectionForm::on_pushButtonExit_clicked()
ui->textEditFileContent->clear(); ui->textEditFileContent->clear();
_jsonStr.clear(); _jsonStr.clear();
#endif
hide(); hide();
} }
@ -116,6 +125,7 @@ void CoefficientSelectionForm::on_pushButtonSelectFile_clicked()
// //
ui->labelFilePath->setText(filePath); ui->labelFilePath->setText(filePath);
ui->textEditFileContent->setText(_jsonStr); ui->textEditFileContent->setText(_jsonStr);
} }
void CoefficientSelectionForm::on_radioButtonSinglePointCoefficient_toggled(bool checked) void CoefficientSelectionForm::on_radioButtonSinglePointCoefficient_toggled(bool checked)

View File

@ -14,7 +14,8 @@ class CoefficientSelectionForm : public QWidget
public: public:
explicit CoefficientSelectionForm(QWidget *parent = nullptr); explicit CoefficientSelectionForm(QWidget *parent = nullptr);
~CoefficientSelectionForm(); ~CoefficientSelectionForm();
protected:
void showEvent(QShowEvent *event);
private slots: private slots:
void on_radioButtonSinglePointCoefficient_toggled(bool checked); void on_radioButtonSinglePointCoefficient_toggled(bool checked);
void on_radioButtonMultiPointCoefficient_toggled(bool checked); void on_radioButtonMultiPointCoefficient_toggled(bool checked);