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;
*/
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:"<<coefficient;

View File

@ -628,18 +628,11 @@ void CentralWidget::clearData(const CentralWidget::ClearDataMode mode)
_line2->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

View File

@ -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()
<<coeff[1]<<","
<<coeff[2];
Global::_enthalpyCoefficientEnableFlag = false;
Global::_enthalpyCoefficientEnableFlag = true;
Global::_enthalpyCoefficientVtr.clear();
Global::_enthalpyCoefficientVtr.push_back(coeff[2]);
Global::_enthalpyCoefficientVtr.push_back(coeff[1]);
Global::_enthalpyCoefficientVtr.push_back(coeff[0]);
}
hide();
}
void CoefficientSelectionForm::on_pushButtonExit_clicked()
{
#if 0
ui->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)

View File

@ -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);