2025-06-26T08:58:59

This commit is contained in:
yuntang 2025-06-26 08:58:59 +08:00
parent 25d9fe5166
commit 3551a87337
10 changed files with 40 additions and 21 deletions

View File

@ -9,7 +9,7 @@ CONFIG+=precompile_header
PRECOMPILED_HEADER=stable.h
#
VERSION = 1.0.6
VERSION = 1.0.8
# 设置目标文件名,包含版本号
TARGET = DSCAnalysisTool_$${VERSION}

View File

@ -37,6 +37,7 @@ void ConfigHandler::reader()
_configMap[ConInstrumentCoefficientStr] = QVariant(obj[ConInstrumentCoefficientStr].toDouble());
}
#if 0
void ConfigHandler::createDefaultFile()
{

View File

@ -3,9 +3,9 @@
#include <QtCore>
const QString ConInstrumentCoefficientStr = "InstrumentCoefficient";
namespace ConfigHandler {
const QString ConInstrumentCoefficientStr = "InstrumentCoefficient";
const float ConInstrumentCoefficientDefaultValue = 1.0;
const QString ConConfigFilePath = QDir::currentPath() + "/config.json";
const QMap<QString, QVariant> ConDefaultMap = {
@ -17,6 +17,7 @@ extern QMap<QString, QVariant> _configMap;
//
void reader();
//void createDefaultFile();
/**
* @brief writer
* @param writeRealDataFlag

View File

@ -253,8 +253,8 @@ float PointCalculate::calculateArea() {
/*
* H = K * S / w;
*/
float coefficient = ConfigHandler::_configMap.value(ConInstrumentCoefficientStr).toFloat();
logde<<"coefficient:"<<coefficient;
float coefficient = ConfigHandler::_configMap.value(ConfigHandler::ConInstrumentCoefficientStr).toFloat();
logde<<"coefficient 1:"<<coefficient;
if(Global::_enthalpyCoefficientEnableFlag){
logde<<"_enthalpyCoefficientEnableFlag...";
@ -271,11 +271,15 @@ float PointCalculate::calculateArea() {
b * startTemp +
c;
logde<<"coefficient:"<<coefficient;
if(coefficient <= 0.0){
coefficient = 1.0;
}
logde<<"coefficient 2:"<<coefficient;
}
logde<<"integral:"<<integral;
logde<<"coefficient:"<<coefficient;
logde<<"coefficient 3:"<<coefficient;
logde<<"Global::DefaultParamter:"<<Global::DefaultParamter;
float area = integral * coefficient * Global::DefaultParamter;

View File

@ -26,6 +26,7 @@ const QString SampleData("sampleData");
const QString Atmosphere("atmosphere");
const QString HeatingRate("heatingRate");
const QString ElementName("elementName");
const QString SampleName("sampleName");
const QString TemperatureStr("temperature");
const QString RateStr("rate");

View File

@ -1412,7 +1412,7 @@ void CentralWidget::calculateAnalysisResult(
//enthalpy
double sampleWeight = 1.0f;
if(Global::_curveFileDataVtr.empty()){
sampleWeight = Global::converStrToDouble(Global::_experimentInfo.sampleWeight);
sampleWeight = Global::converStrToDouble(Global::_experimentInfo.sampleWeight);
}else{
for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){
for(Global::PhaseTotalInfo& pti:cfd.phaseTotalVtr){
@ -1477,7 +1477,7 @@ void CentralWidget::calculateAnalysisResult(
double startPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(startEndPointPair.first.x());
double endPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(startEndPointPair.second.x());
str = PointCalculate::textFormatPeakPointWithTime(
str = PointCalculate::textFormatPeakPointWithTime(
enthalpyValue,
peakPointTime,
startPointTime,
@ -1486,10 +1486,11 @@ void CentralWidget::calculateAnalysisResult(
drawText(peakPoint,str,objectName);
}else{
str = PointCalculate::textFormatPeakPoint(enthalpyValue,
peakPoint.x(),
startEndPointPair.first.x(),
startEndPointPair.second.x());
str = PointCalculate::textFormatPeakPoint(
enthalpyValue,
peakPoint.x(),
startEndPointPair.first.x(),
startEndPointPair.second.x());
drawText(peakPoint,str,objectName);
}

View File

@ -9,6 +9,7 @@
CoefficientSelectionForm::CoefficientSelectionForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::CoefficientSelectionForm)
,_instrumentCoefficient(ConfigHandler::ConInstrumentCoefficientDefaultValue)
{
ui->setupUi(this);
@ -17,7 +18,7 @@ CoefficientSelectionForm::CoefficientSelectionForm(QWidget *parent) :
#if 1
ui->LineEditCoefficient->setText(
QString::number(
ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat(),
ConfigHandler::_configMap[ConfigHandler::ConInstrumentCoefficientStr].toFloat(),
'f',3));
#endif
@ -42,18 +43,25 @@ void CoefficientSelectionForm::showEvent(QShowEvent *event)
void CoefficientSelectionForm::on_pushButtonCalculate_clicked()
{
float theory = ui->LineEditTheory->text().toFloat();
float measure = ui->LineEditActualMeasurement->text().toFloat();
bool ok;
float theory = ui->LineEditTheory->text().toFloat(&ok);
if(!ok){
theory = 1.0;
}
float measure = ui->LineEditActualMeasurement->text().toFloat(&ok);
if(!ok){
measure = 1.0;
}
_instrumentCoefficient = theory/measure;
ui->LineEditCoefficient->setText(QString::number(_instrumentCoefficient,'f',3));
}
void CoefficientSelectionForm::on_pushButtonConfirm_clicked()
{
if(ui->radioButtonSinglePointCoefficient->isChecked()){
ConfigHandler::_configMap[ConInstrumentCoefficientStr] = _instrumentCoefficient;
ConfigHandler::_configMap[ConfigHandler::ConInstrumentCoefficientStr] = _instrumentCoefficient;
ConfigHandler::writer();
Global::_enthalpyCoefficientEnableFlag = false;
@ -155,6 +163,8 @@ void CoefficientSelectionForm::on_pushButtonSelectFile_clicked()
ui->labelFilePath->setToolTip(filePath);
ui->textEditFileContent->setText(_jsonStr);
_instrumentCoefficient = ConfigHandler::ConInstrumentCoefficientDefaultValue;
}
void CoefficientSelectionForm::on_radioButtonSinglePointCoefficient_toggled(bool checked)

View File

@ -185,6 +185,7 @@ void EnthalpyDataCorrectionForm::saveJson()
QJsonArray jsonArray;
for (const TheoryData &data : _theoryDataVtr) {
QJsonObject jsonObj;
jsonObj[Global::ElementName] = data.elementName;
jsonObj[Global::TemperatureStr] = data.temperature;
jsonObj[Global::RateStr] = data.rate;
jsonArray.append(jsonObj);

View File

@ -25,7 +25,7 @@ private:
double _atmosphere;
double _heatingRate;
struct TheoryData{
QString sampleName;
QString elementName;
double temperature;
double rate;
};

View File

@ -12,7 +12,7 @@ InstrumentCoefficientForm::InstrumentCoefficientForm(QWidget *parent) :
ui->LineEditCoefficient->setText(
QString::number(
ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat(),
ConfigHandler::_configMap[ConfigHandler::ConInstrumentCoefficientStr].toFloat(),
'f',3));
ui->LineEditTheory->text().clear();
@ -30,7 +30,7 @@ void InstrumentCoefficientForm::on_pushButtonCalculate_clicked()
float measure = ui->LineEditActualMeasurement->text().toFloat();
float instrumentCoefficient = theory/measure;
ConfigHandler::_configMap[ConInstrumentCoefficientStr] = instrumentCoefficient;
ConfigHandler::_configMap[ConfigHandler::ConInstrumentCoefficientStr] = instrumentCoefficient;
ConfigHandler::writer();
ui->LineEditCoefficient->setText(QString::number(instrumentCoefficient,'f',3));