diff --git a/experiment_data/sample_data/new_2025_06_27_17_03_15.xlsx b/experiment_data/sample_data/new_2025_06_27_17_03_15.xlsx new file mode 100644 index 0000000..4f2f3a6 Binary files /dev/null and b/experiment_data/sample_data/new_2025_06_27_17_03_15.xlsx differ diff --git a/experiment_data/sample_data/new_2025_06_27_17_05_03.xlsx b/experiment_data/sample_data/new_2025_06_27_17_05_03.xlsx new file mode 100644 index 0000000..089756f Binary files /dev/null and b/experiment_data/sample_data/new_2025_06_27_17_05_03.xlsx differ diff --git a/src/DSCAnalysisTool.pro b/src/DSCAnalysisTool.pro index 27dd395..3fb11e3 100644 --- a/src/DSCAnalysisTool.pro +++ b/src/DSCAnalysisTool.pro @@ -9,7 +9,7 @@ CONFIG+=precompile_header PRECOMPILED_HEADER=stable.h # -VERSION = 1.1.0 +VERSION = 1.2.0 # 设置目标文件名,包含版本号 TARGET = DSCAnalysisTool_$${VERSION} diff --git a/src/data/lowesssmoother.h b/src/data/lowesssmoother.h index 853a0b6..34e24cb 100644 --- a/src/data/lowesssmoother.h +++ b/src/data/lowesssmoother.h @@ -6,6 +6,7 @@ #include #include +// lowess namespace Lowess { // 配置参数结构体 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index eaec0c6..9f2d06f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -101,6 +101,11 @@ void MainWindow::slotOITAutoAnalysis(const double x1,const double x2) _centralWidget->setVerticalLineRange(x1,x2); } +void MainWindow::slotStartExperiment() +{ + startExperiment(); +} + void MainWindow::closeEvent(QCloseEvent *event) { // 弹出确认对话框 @@ -140,6 +145,10 @@ void MainWindow::connections() connect(SerialPort::instance(), &SerialPort::sigSaveExperimentalDataMsgBox, this,&MainWindow::slotSaveExperimentalDataMsgBox); + + connect(SerialPort::instance(), &SerialPort::sigStartExperiment, + this,&MainWindow::slotStartExperiment); + #endif // mode @@ -428,6 +437,22 @@ void MainWindow::smoothnessExperimentData(const int level) } +void MainWindow::startExperiment() +{ + QByteArray ba = DataParser::setDeviceStartStop(DeviceStartMode::Start); + + QString hexData = ba.toHex(' '); + qDebug() << "on_actionStart_triggered info (hex):" << hexData; + + SerialPort::instance()->slotSendData(ba); + + Global::_mode = Global::Mode::Experiment; + + _manuallyStopTheExperimentFlag = false; + + _centralWidget->startExperiment(); +} + void MainWindow::on_actionStop_triggered() { logde<<" Stop experiment ..."; @@ -470,18 +495,7 @@ void MainWindow::on_actionStart_triggered() on_actionClearAllData_triggered(); - QByteArray ba = DataParser::setDeviceStartStop(DeviceStartMode::Start); - - QString hexData = ba.toHex(' '); // ' ' 作为分隔符,可选参数 - qDebug() << "on_actionStart_triggered info (hex):" << hexData; - - SerialPort::instance()->slotSendData(ba); - - Global::_mode = Global::Mode::Experiment; - - _manuallyStopTheExperimentFlag = false; - - _centralWidget->startExperiment(); +startExperiment(); } void MainWindow::on_actionReadOnly_triggered() diff --git a/src/mainwindow.h b/src/mainwindow.h index e3d7ab7..a8a40e5 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -42,6 +42,7 @@ public slots: void slotOITAutoAnalysis(const double,const double); + void slotStartExperiment(); protected: void closeEvent(QCloseEvent *event) override; private slots: @@ -128,7 +129,7 @@ private: QVector smoothnessDetail(const int level,const QVector&); void smoothnessExperimentData(const int level); - + void startExperiment(); private: bool _manuallyStopTheExperimentFlag; Ui::MainWindow *ui; diff --git a/src/serialport/serialport.cpp b/src/serialport/serialport.cpp index 8d1e356..66040b7 100644 --- a/src/serialport/serialport.cpp +++ b/src/serialport/serialport.cpp @@ -131,7 +131,7 @@ void SerialPort::slotReadData() } else if (READ_CMD == spp->cmd) { - DataParser::experimentalStateSwitching(cd); + // DataParser::experimentalStateSwitching(cd); updateStatus(cd); if (spp->addr == 0) @@ -156,9 +156,29 @@ void SerialPort::updateStatus(const CommonData &cd) logde<<"software mode:"<setPort(info); + _sp->setPort(info); break; } } diff --git a/src/serialport/serialport.h b/src/serialport/serialport.h index aa02476..2797c66 100644 --- a/src/serialport/serialport.h +++ b/src/serialport/serialport.h @@ -37,6 +37,7 @@ signals: void sigAxisModify(const float temp); void sigUpdateStatusbarMsg(const QString &); void sigSaveExperimentalDataMsgBox(); + void sigStartExperiment(); public slots: void slotDeliverData(const QByteArray &); void slotSendData(const QByteArray &); diff --git a/src/ui/centralwidget.cpp b/src/ui/centralwidget.cpp index b960bf7..b5d9afc 100644 --- a/src/ui/centralwidget.cpp +++ b/src/ui/centralwidget.cpp @@ -299,7 +299,7 @@ void CentralWidget::slotRecvCommonData(const CommonData &cd) { // Record data. if(!Global::_currentCurveExperimentDataPtr){ - loger<<"_currentCurveExperimentDataPtr is nullptr."; + loger<<"_currentCurveExperimentDataPtr is nullptr.Soft exit."; exit(0); }else{ Global::ExperimentData ed;