diff --git a/bin/myeasylog.log b/bin/myeasylog.log index 30196c7..20e5c07 100644 --- a/bin/myeasylog.log +++ b/bin/myeasylog.log @@ -32,3 +32,6 @@ 2025-04-15 17:10:45,031 DEBUG [default] Base,standard,sample not selected. 2025-04-15 17:10:45,194 DEBUG [default] Base,standard,sample not selected. 2025-04-15 17:10:45,371 DEBUG [default] Base,standard,sample not selected. +2025-04-15 17:25:42,781 DEBUG [default] main... +2025-04-15 17:25:42,794 DEBUG [default] setEventHandlerEnable...0 +2025-04-15 17:25:42,794 DEBUG [default] xMax:5 diff --git a/src/AnalysTool.pro b/src/AnalysTool.pro index 00970e7..b468633 100644 --- a/src/AnalysTool.pro +++ b/src/AnalysTool.pro @@ -24,6 +24,7 @@ SOURCES += \ global.cpp \ logger/logger.cpp \ ui/aboutform.cpp \ + ui/enthalpydatacorrectionform.cpp \ ui/rightwidget.cpp \ thirdparty/easylogging/easylogging++.cc \ ui/analysissettingform.cpp \ @@ -52,6 +53,7 @@ HEADERS += \ defines.h \ logger/logger.h \ ui/aboutform.h \ + ui/enthalpydatacorrectionform.h \ ui/rightwidget.h \ thirdparty/easylogging/easylogging++.h \ ui/analysissettingform.h \ @@ -77,6 +79,7 @@ FORMS += \ ui/aboutform.ui \ ui/degreeofcrystallinityform.ui \ ui/degreeofcureform.ui \ + ui/enthalpydatacorrectionform.ui \ ui/experimentsettingform.ui \ ui/instrumentcoefficientform.ui \ ui/oitautoanalysisparamform.ui \ diff --git a/src/defines.h b/src/defines.h index 05bcc6e..016e42b 100644 --- a/src/defines.h +++ b/src/defines.h @@ -10,6 +10,5 @@ typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; -const QString ConSoftVersion = "0.9.0"; #endif // DEFINES_H diff --git a/src/global.h b/src/global.h index e913186..dd1c9c1 100644 --- a/src/global.h +++ b/src/global.h @@ -8,6 +8,8 @@ #include "protocol.h" namespace Global { +const QString ConSoftVersion = "0.9.1"; + const QString ExperimentDirPath = QDir::currentPath()+"/../experiment_data"; const QString SampleDataFloder = ExperimentDirPath + "/sample_data"; const QString BaseLineFolder = ExperimentDirPath + "/base_line"; diff --git a/src/images.qrc b/src/images.qrc index f739f40..9518c7e 100644 --- a/src/images.qrc +++ b/src/images.qrc @@ -5,5 +5,6 @@ images/connect.png images/new.png images/real_time_widget.png + images/logo.png diff --git a/src/images/logo.png b/src/images/logo.png new file mode 100644 index 0000000..bbc1bce Binary files /dev/null and b/src/images/logo.png differ diff --git a/src/main.cpp b/src/main.cpp index 6392895..773f91e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,6 +10,7 @@ #include "filemanager.h" #include "logger.h" #include "xlsxhandler.h" +#include "aboutform.h" int main(int argc, char *argv[]) { @@ -21,11 +22,18 @@ int main(int argc, char *argv[]) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // 启用高DPI缩放 QApplication a(argc, argv); + a.setWindowIcon(QIcon(":/images/logo.png")); MainWindow w; + w.setWindowTitle("Analysis Tool"); + w.setWindowIcon(QIcon(":/images/logo.png")); w.show(); -// XlsxHandler::test(); + + // AboutForm af; + // af.show(); + + // XlsxHandler::test(); // FileManager::test(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 09ffbee..f4c1adf 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -23,6 +23,7 @@ MainWindow::MainWindow(QWidget *parent) ,_OITAutoAnalysisParamForm(new OITAutoAnalysisParamForm(this)) ,_degreeOfCrystallinityForm(new DegreeOfCrystallinityForm(this)) ,_aboutForm(new AboutForm(this)) + ,_enthalpyDataCorrectionForm(new EnthalpyDataCorrectionForm(this)) { ui->setupUi(this); this->setToolTip("....."); @@ -37,7 +38,7 @@ MainWindow::MainWindow(QWidget *parent) ui->statusbar->showMessage("showMessage show temp message!"); // permenent show QLabel *permenentLabel = new QLabel(this); - permenentLabel->setText("Software Ver:" + ConSoftVersion); + permenentLabel->setText("Software Ver:" + Global::ConSoftVersion); ui->statusbar->addPermanentWidget(permenentLabel); // #if 0 @@ -71,6 +72,7 @@ MainWindow::MainWindow(QWidget *parent) setSubWidgetAttribute(_OITAutoAnalysisParamForm); setSubWidgetAttribute(_degreeOfCrystallinityForm); setSubWidgetAttribute(_aboutForm); + setSubWidgetAttribute(_enthalpyDataCorrectionForm); // setActionEnable(true); @@ -94,6 +96,19 @@ void MainWindow::slotContextMenuShow(const QPoint point) _contextMenu->exec(point); } +void MainWindow::closeEvent(QCloseEvent *event) +{ + // 弹出确认对话框 + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, "确认退出", "你确定要退出吗?", + QMessageBox::Yes | QMessageBox::No); + if (reply == QMessageBox::Yes) { + event->accept(); // 接受关闭事件,关闭窗口 + } else { + event->ignore(); // 忽略关闭事件,不关闭窗口 + } +} + void MainWindow::connections() { // ui @@ -314,3 +329,8 @@ void MainWindow::on_actionAbout_triggered() { _aboutForm->show(); } + +void MainWindow::on_actionEnthalpyCorrection_triggered() +{ + _enthalpyDataCorrectionForm->show(); +} diff --git a/src/mainwindow.h b/src/mainwindow.h index 9dcbc17..9cb2390 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -18,6 +18,7 @@ #include "degreeofcureform.h" #include "oitautoanalysisparamform.h" #include "aboutform.h" +#include "enthalpydatacorrectionform.h" QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } @@ -33,6 +34,8 @@ public: public slots: void slotContextMenuShow(const QPoint); +protected: + void closeEvent(QCloseEvent *event) override; private slots: //experiment void on_actionConnectToDev_triggered(); @@ -72,6 +75,8 @@ private slots: void on_actionAbout_triggered(); + void on_actionEnthalpyCorrection_triggered(); + private: void connections(); void setActionEnable(const bool); @@ -92,5 +97,6 @@ private: DegreeOfCureForm *_degreeOfCureForm; OITAutoAnalysisParamForm* _OITAutoAnalysisParamForm; AboutForm *_aboutForm; + EnthalpyDataCorrectionForm* _enthalpyDataCorrectionForm; }; #endif // MAINWINDOW_H diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 4d3f3e8..2e765c3 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -39,6 +39,7 @@ 测量 + @@ -66,7 +67,7 @@ 工具 - + @@ -253,6 +254,11 @@ 关于 + + + 热焓校正 + + diff --git a/src/ui/aboutform.cpp b/src/ui/aboutform.cpp index a065d6a..421b78b 100644 --- a/src/ui/aboutform.cpp +++ b/src/ui/aboutform.cpp @@ -1,6 +1,7 @@ #include "aboutform.h" #include "ui_aboutform.h" #include "defines.h" +#include "global.h" AboutForm::AboutForm(QWidget *parent) : QWidget(parent), @@ -8,9 +9,38 @@ AboutForm::AboutForm(QWidget *parent) : { ui->setupUi(this); - // ui->labelContent->setText(ConSoftVersion); + setFixedSize(geometry().width(),geometry().height()); + + setWindowTitle("About"); + + QPixmap pixmap(":/images/logo.png"); // 假设图片在资源文件中 + ui->labelLogo->setPixmap(pixmap); + ui->labelLogo->resize(pixmap.size()); + + // + ui->labelTitle->setAlignment(Qt::AlignHCenter); + ui->labelTitle->setText(QString("

关于差示扫描量热仪数据分析软件

")); + + +//#define COMPILE_TIME QString("编译时间:%1 %2").arg(__DATE__).arg(__TIME__) + + QString ConCompleTime = QString("编译时间:%1 %2").arg(__DATE__).arg(__TIME__); + + QString aboutText = QString( + "

软件版本:%1

" + "

%2

" + "

版权所有 © 2025 山东云唐智能科技有限公司 保留所有权

" + "
" + "

本软件基于 Qt 框架开发,Qt 遵循 " + "LGPL 协议

" + "

Qt 官网:www.qt.io

") + .arg(Global::ConSoftVersion).arg(ConCompleTime); + ui->labelContent->setAlignment(Qt::AlignTop | Qt::AlignLeft); - ui->labelContent->setText(QString("软件版本:%1").arg(ConSoftVersion)); + ui->labelContent->setTextFormat(Qt::RichText); + ui->labelContent->setText(aboutText); + ui->labelContent->setStyleSheet("p { line-height: 1em; }"); + ui->labelContent->setOpenExternalLinks(true); // 允许用户点击链接 } AboutForm::~AboutForm() diff --git a/src/ui/aboutform.ui b/src/ui/aboutform.ui index 3c4d380..c41b4a5 100644 --- a/src/ui/aboutform.ui +++ b/src/ui/aboutform.ui @@ -6,7 +6,7 @@ 0 0 - 428 + 498 290 @@ -17,7 +17,7 @@ 20 - 70 + 80 131 101 @@ -30,9 +30,9 @@ 150 - 20 - 261 - 251 + 60 + 331 + 171 @@ -42,8 +42,8 @@ - 300 - 240 + 310 + 250 80 20 @@ -52,6 +52,19 @@ 关闭 + + + + 20 + 10 + 511 + 31 + + + + TextLabel + + diff --git a/src/ui/centralwidget.cpp b/src/ui/centralwidget.cpp index 78a9ac9..efcd010 100644 --- a/src/ui/centralwidget.cpp +++ b/src/ui/centralwidget.cpp @@ -176,6 +176,7 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName) Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i]; PointCalculate::setExperimentData(pti.dataVtr); + QPairstartEndPointPair = PointCalculate::getStartAndEndPoint(); QPointF endPoint = startEndPointPair.second; @@ -189,6 +190,7 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName) _customPlot->yAxis->setLabel("DSC/mW"); _customPlot->xAxis->setLabel("Temp/℃"); + QVector dataVtr; QVector tVtr,xVtr, yVtr; int index = 0; for (Global::ExperimentData &ed : pti.dataVtr) @@ -196,32 +198,17 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName) tVtr.push_back(index++); xVtr.push_back(ed.sampleTemp); yVtr.push_back(ed.dsc); + } _currentCurve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis); _currentCurve->setData(tVtr, xVtr, yVtr); - // _currentCurve->setPen(QPen(Qt::red)); // 设置线条颜色为红色 - // _currentCurve->setBrush(QBrush(QColor(255, 0, 0, 20))); // 设置填充颜色并带有透明度 _currentCurve->setSelectable(QCP::stWhole); // 设置曲线可选 - // _currentCurve->setSelectable(QCP::stPlottable); // 设置曲线可选 + // +// Global::_curveExperimentDataVtr.push_back(); } - // 清除第一个图表上的数据 -#if 0 - if (_customPlot->graphCount() > 0 && _graph) - { - // 清除第一个图表上的数据 - _graph->setData(QVector(), QVector()); - } -#endif - -#if 0 - _currentGraph = _customPlot->addGraph(); - _graphVtr.push_back(_currentGraph); - - _currentGraph->addData(xVtr, yVtr); -#endif _customPlot->replot(); } @@ -308,6 +295,8 @@ void CentralWidget::slotAnalysisSettingApply() QPointF selectPoint = PointCalculate::getClosestPointByX( _line1->point1->coords().x()); + logde<<"lin1 x:"<<_line1->point1->coords().x(); + drawText(selectPoint,PointCalculate::textFormatNumbericalLabel(selectPoint)); break; diff --git a/src/ui/enthalpydatacorrectionform.cpp b/src/ui/enthalpydatacorrectionform.cpp new file mode 100644 index 0000000..61e6693 --- /dev/null +++ b/src/ui/enthalpydatacorrectionform.cpp @@ -0,0 +1,30 @@ +#include "enthalpydatacorrectionform.h" +#include "ui_enthalpydatacorrectionform.h" + +EnthalpyDataCorrectionForm::EnthalpyDataCorrectionForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::EnthalpyDataCorrectionForm) +{ + ui->setupUi(this); + +// ui->lineEditTheoryIn->setText("28.6"); +// ui->lineEditTheorySn->setText("60.5"); +// ui->lineEditTheoryBi->setText("53.3"); + + +} + +EnthalpyDataCorrectionForm::~EnthalpyDataCorrectionForm() +{ + delete ui; +} + +void EnthalpyDataCorrectionForm::on_pushButtonSave_clicked() +{ + +} + +void EnthalpyDataCorrectionForm::on_pushButtonExit_clicked() +{ + hide(); +} diff --git a/src/ui/enthalpydatacorrectionform.h b/src/ui/enthalpydatacorrectionform.h new file mode 100644 index 0000000..07553bf --- /dev/null +++ b/src/ui/enthalpydatacorrectionform.h @@ -0,0 +1,27 @@ +#ifndef ENTHALPYDATACORRECTIONFORM_H +#define ENTHALPYDATACORRECTIONFORM_H + +#include + +namespace Ui { +class EnthalpyDataCorrectionForm; +} + +class EnthalpyDataCorrectionForm : public QWidget +{ + Q_OBJECT + +public: + explicit EnthalpyDataCorrectionForm(QWidget *parent = nullptr); + ~EnthalpyDataCorrectionForm(); + +private slots: + void on_pushButtonSave_clicked(); + + void on_pushButtonExit_clicked(); + +private: + Ui::EnthalpyDataCorrectionForm *ui; +}; + +#endif // ENTHALPYDATACORRECTIONFORM_H diff --git a/src/ui/enthalpydatacorrectionform.ui b/src/ui/enthalpydatacorrectionform.ui new file mode 100644 index 0000000..1ed6870 --- /dev/null +++ b/src/ui/enthalpydatacorrectionform.ui @@ -0,0 +1,630 @@ + + + EnthalpyDataCorrectionForm + + + + 0 + 0 + 514 + 626 + + + + Form + + + + + 40 + 50 + 431 + 518 + + + + + + + 7 + + + + + + + K2SO4 + + + + + + + Sn + + + + + + + CsCl + + + + + + + In + + + + + + + 573.0 + + + + + + + + + + 299.5 + + + + + + + 8 + + + + + + + + + + 13 + + + + + + + 476.0 + + + + + + + 5 + + + + + + + C6H5COOH + + + + + + + 327.4 + + + + + + + + + + + + + 430.0 + + + + + + + 28.42 + + + + + + + 理论温度(℃) + + + + + + + 665.0 + + + + + + + + + + 11 + + + + + + + 11.47 + + + + + + + Cu + + + + + + + + + + 10 + + + + + + + C6H12 + + + + + + + 231.9 + + + + + + + 15 + + + + + + + 122.1 + + + + + + + + + + 4 + + + + + + + 16 + + + + + + + + + + 810.0 + + + + + + + + + + + + + + + + 标样 + + + + + + + 1 + + + + + + + SiO2 + + + + + + + 583.0 + + + + + + + KC1O3 + + + + + + + 334.0 + + + + + + + + + + 3 + + + + + + + -86.0 + + + + + + + + + + 实测热焓(J/g) + + + + + + + BaCO3 + + + + + + + Ag + + + + + + + KNO3 + + + + + + + Zn + + + + + + + 961.8 + + + + + + + + + + 9 + + + + + + + Bi + + + + + + + + + + + + + 271.4 + + + + + + + Hg + + + + + + + 1083.0 + + + + + + + 60.22 + + + + + + + 14 + + + + + + + 6 + + + + + + + + + + 419.5 + + + + + + + + + + + + + + 12 + + + + + + + + + + K2CrO4 + + + + + + + Pb + + + + + + + + + + Ag2SO4 + + + + + + + + + + + + + -38.8 + + + + + + + 17 + + + + + + + 18 + + + + + + + 理论热焓(J/g) + + + + + + + + + + 2 + + + + + + + 156.6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 107.38 + + + + + + + + + + 23.16 + + + + + + + + + 210 + 590 + 80 + 20 + + + + 保存 + + + + + + 320 + 590 + 80 + 20 + + + + 退出 + + + + + + 40 + 10 + 344 + 24 + + + + + + + 气氛: + + + + + + + + + + 速率(℃/min): + + + + + + + + + + + +