2025-06-27T17:22:06
This commit is contained in:
parent
330b4a3195
commit
229f08e616
BIN
experiment_data/sample_data/new_2025_06_27_17_03_15.xlsx
Normal file
BIN
experiment_data/sample_data/new_2025_06_27_17_03_15.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/sample_data/new_2025_06_27_17_05_03.xlsx
Normal file
BIN
experiment_data/sample_data/new_2025_06_27_17_05_03.xlsx
Normal file
Binary file not shown.
@ -9,7 +9,7 @@ CONFIG+=precompile_header
|
||||
PRECOMPILED_HEADER=stable.h
|
||||
|
||||
#
|
||||
VERSION = 1.1.0
|
||||
VERSION = 1.2.0
|
||||
# 设置目标文件名,包含版本号
|
||||
TARGET = DSCAnalysisTool_$${VERSION}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <cmath>
|
||||
#include <stdexcept>
|
||||
|
||||
// lowess
|
||||
namespace Lowess {
|
||||
|
||||
// 配置参数结构体
|
||||
|
@ -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()
|
||||
|
@ -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<Global::ExperimentData> smoothnessDetail(const int level,const QVector<Global::ExperimentData>&);
|
||||
void smoothnessExperimentData(const int level);
|
||||
|
||||
|
||||
void startExperiment();
|
||||
private:
|
||||
bool _manuallyStopTheExperimentFlag;
|
||||
Ui::MainWindow *ui;
|
||||
|
@ -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:"<<Global::_mode;
|
||||
#endif
|
||||
|
||||
// Switch the software mode accord to the serial port data.
|
||||
switch(cd.run_type){
|
||||
case DeviceRunStatus::Heat:
|
||||
case DeviceRunStatus::ConstantTemp:
|
||||
if(Global::_mode != Global::Mode::Experiment){
|
||||
Global::_mode = Global::Mode::Experiment;
|
||||
}
|
||||
break;
|
||||
case DeviceRunStatus::Idle:
|
||||
case DeviceRunStatus::Cooling:
|
||||
if(Global::_mode != Global::Mode::Analysis){
|
||||
Global::_mode = Global::Mode::Analysis;
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
|
||||
// If phase update, add new phase data to the global param.
|
||||
if(Global::_mode == Global::Mode::Experiment){
|
||||
if(Global::_currentPhase != (int)cd.current_phase){
|
||||
|
||||
logde<<"mode experiment,phase not equeal.";
|
||||
|
||||
Global::_currentPhase = (int)cd.current_phase;
|
||||
|
||||
Global::CurveExperimentData ced;
|
||||
@ -217,6 +237,9 @@ void SerialPort::updateStatus(const CommonData &cd)
|
||||
if(preMode == Global::Mode::Experiment
|
||||
&& Global::_mode == Global::Mode::Analysis){
|
||||
sendSaveSignalFlag = true;
|
||||
}else if(preMode == Global::Mode::Analysis
|
||||
&& Global::_mode == Global::Mode::Experiment){
|
||||
emit sigStartExperiment();
|
||||
}
|
||||
|
||||
preMode = Global::_mode;
|
||||
@ -339,7 +362,7 @@ bool SerialPort::openSp()
|
||||
|
||||
if ((pid == conPid) && (vid == conVid))
|
||||
{
|
||||
_sp->setPort(info);
|
||||
_sp->setPort(info);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -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 &);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user