diff --git a/experiment_data/sample_data/23-1new.xlsx b/experiment_data/sample_data/23-1new.xlsx new file mode 100644 index 0000000..6f26f36 Binary files /dev/null and b/experiment_data/sample_data/23-1new.xlsx differ diff --git a/experiment_data/sample_data/new.xlsx b/experiment_data/sample_data/new.xlsx index 3660b25..259bed6 100644 Binary files a/experiment_data/sample_data/new.xlsx and b/experiment_data/sample_data/new.xlsx differ diff --git a/src/data/xlsxhandler.cpp b/src/data/xlsxhandler.cpp index 2cabf0c..3ee25ca 100644 --- a/src/data/xlsxhandler.cpp +++ b/src/data/xlsxhandler.cpp @@ -195,7 +195,10 @@ void XlsxHandler::writeFile(const QString filePath) xlsx.write(row , 2, edVtr.size()); row++; + logde<<"edVtr size:"< _curveFileDataVtr; +int _currentPhase = 0; ExperimentInfo _experimentInfo; QVector _curveExperimentDataVtr; +CurveExperimentData* _currentCurveExperimentDataPtr = nullptr; bool _enthalpyCoefficientEnableFlag = false; QVector _enthalpyCoefficientVtr; diff --git a/src/global.h b/src/global.h index 0536e2c..d157deb 100644 --- a/src/global.h +++ b/src/global.h @@ -76,8 +76,10 @@ extern Mode _mode; // Xlsx file data. extern QVector _curveFileDataVtr; // Experiment setting data. +extern int _currentPhase; extern ExperimentInfo _experimentInfo; extern QVector _curveExperimentDataVtr; +extern CurveExperimentData* _currentCurveExperimentDataPtr; // Instrument coefficient. extern bool _enthalpyCoefficientEnableFlag; diff --git a/src/main.cpp b/src/main.cpp index 348ee67..2ca4436 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -62,8 +62,8 @@ int main(int argc, char *argv[]) // ExperimentSettingForm es; // es.show(); - // CentralWidget central; - // central.show(); +// CentralWidget central; +// central.show(); // SerialPort::parserTest(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 33029c5..01982a3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -132,11 +132,14 @@ void MainWindow::connections() connect(SerialPort::instance(), &SerialPort::sigSendPhaseInfo, _expertmentSettingForm, &ExperimentSettingForm::slotRecvPhaseInfo); + connect(SerialPort::instance(), &SerialPort::sigAxisModify, + _centralWidget, &CentralWidget::slotAxisModify); #endif // mode // connect(Global::instance(), &Global::sigModeModify, // _centralWidget, &CentralWidget::slotModeModify); + //analysis connect(_leftWidget,&LeftWidget::sigSendAnalysisFileName, _centralWidget,&CentralWidget::slotRecvAnalysisFileName); @@ -216,7 +219,7 @@ void MainWindow::on_actionStop_triggered() QByteArray ba = DataParser::setDeviceStartStop(DeviceStartMode::Stop); SerialPort::instance()->slotSendData(ba); -#if 0 +#if 1 // Save data. if(saveExperimentFile(Global::_experimentInfo.sampleName)){ _leftWidget->reloadFileName(); @@ -376,3 +379,10 @@ void MainWindow::on_actionEnthalpyCorrectionSelection_triggered() { _coefficientSelectionForm->show(); } + +void MainWindow::on_actionSaveExperimentData_triggered() +{ + if(saveExperimentFile(Global::_experimentInfo.sampleName)){ + _leftWidget->reloadFileName(); + } +} diff --git a/src/mainwindow.h b/src/mainwindow.h index 631d9e2..56776bc 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -81,6 +81,8 @@ private slots: void on_actionEnthalpyCorrectionSelection_triggered(); + void on_actionSaveExperimentData_triggered(); + private: void connections(); void setActionEnable(const bool); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 8fe642a..f0df28d 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -28,6 +28,7 @@ 文件 + @@ -265,6 +266,14 @@ 热焓校正系数选择 + + + 保存实验数据 + + + 保存实验数据 + + diff --git a/src/serialport/dataparser.cpp b/src/serialport/dataparser.cpp index d24328d..d1edb63 100644 --- a/src/serialport/dataparser.cpp +++ b/src/serialport/dataparser.cpp @@ -9,104 +9,104 @@ namespace DataParser { - bool commonDataParser(const QByteArray &ba, CommonData &cd) - { - const char *charArray = ba.data(); +bool commonDataParser(const QByteArray &ba, CommonData &cd) +{ + const char *charArray = ba.data(); - // 判断前两个字节是否为 0xA5 和 0x5A (小端格式) - if (static_cast(charArray[0]) == 0xA5 && + // 判断前两个字节是否为 0xA5 和 0x5A (小端格式) + if (static_cast(charArray[0]) == 0xA5 && static_cast(charArray[1]) == 0x5A) - { - // std::cout << "前两个字节是 0x5AA5 (小端)" << std::endl; - } - else - { - // std::cout << "前两个字节不是 0x5AA5 (小端)" << std::endl; - qDebug() << "header failed."; - return false; - } - - if (static_cast(charArray[3]) != 0x83) - { - qDebug() << "mark failed."; - return false; - } - - memcpy(&cd, charArray + 6, sizeof(CommonData)); - - return true; + { + // std::cout << "前两个字节是 0x5AA5 (小端)" << std::endl; + } + else + { + // std::cout << "前两个字节不是 0x5AA5 (小端)" << std::endl; + qDebug() << "header failed."; + return false; } - - - QByteArray connectToDevice(const QVector &vtr) + if (static_cast(charArray[3]) != 0x83) { - const int phaseLength = sizeof(Phase); - const int phaseArrayLength = vtr.size() * phaseLength; - char phaseArray[300] = {}; - int offset = 0; - - for (const Phase &phase : vtr) - { - memcpy(phaseArray + offset, &phase, sizeof(Phase)); - offset += phaseLength; - } - - // - // int totalDataLength = 0; - char totalData[300] = {}; - - u16 header = 0x5aa5; - memcpy(totalData, (char *)&header, sizeof(u16)); - // totalDataLength +=2; - - totalData[2] = 1 + 2 + phaseArrayLength + 2; - // totalDataLength++; - - totalData[3] = 0x82; - // totalDataLength++; - - u16 address = 0x0050; - memcpy(totalData + 4, (char *)&address, sizeof(u16)); - - memcpy(totalData + 6, phaseArray, phaseArrayLength); - - // - char data[300] = {}; - - data[0] = 0x82; - - // u16 address = 0x0050; - memcpy(data + 1, (char *)&address, sizeof(u16)); - - memcpy(data + 3, phaseArray, phaseArrayLength); - - u16 crc = modbusCRC16((u8 *)data, 3 + phaseArrayLength); - // - memcpy(totalData + 6 + phaseArrayLength, (char *)&crc, sizeof(u16)); - - // - - return QByteArray(totalData, 6 + phaseArrayLength + 2); + qDebug() << "mark failed."; + return false; } - QByteArray setDeviceStartStop(const DeviceStartMode mode) + memcpy(&cd, charArray + 6, sizeof(CommonData)); + + return true; +} + + + +QByteArray connectToDevice(const QVector &vtr) +{ + const int phaseLength = sizeof(Phase); + const int phaseArrayLength = vtr.size() * phaseLength; + char phaseArray[300] = {}; + int offset = 0; + + for (const Phase &phase : vtr) { + memcpy(phaseArray + offset, &phase, sizeof(Phase)); + offset += phaseLength; + } + + // + // int totalDataLength = 0; + char totalData[300] = {}; + + u16 header = 0x5aa5; + memcpy(totalData, (char *)&header, sizeof(u16)); + // totalDataLength +=2; + + totalData[2] = 1 + 2 + phaseArrayLength + 2; + // totalDataLength++; + + totalData[3] = 0x82; + // totalDataLength++; + + u16 address = 0x0050; + memcpy(totalData + 4, (char *)&address, sizeof(u16)); + + memcpy(totalData + 6, phaseArray, phaseArrayLength); + + // + char data[300] = {}; + + data[0] = 0x82; + + // u16 address = 0x0050; + memcpy(data + 1, (char *)&address, sizeof(u16)); + + memcpy(data + 3, phaseArray, phaseArrayLength); + + u16 crc = modbusCRC16((u8 *)data, 3 + phaseArrayLength); + // + memcpy(totalData + 6 + phaseArrayLength, (char *)&crc, sizeof(u16)); + + // + + return QByteArray(totalData, 6 + phaseArrayLength + 2); +} + +QByteArray setDeviceStartStop(const DeviceStartMode mode) +{ #if 1 - SerialPortProtocol spp; - spp.head = FRANE_HEAD; - spp.len = 1 + 2 + 1 + 2; - spp.cmd = WRITE_CMD; - spp.addr = 0x002c; - spp.data_buf[0] = mode; + SerialPortProtocol spp; + spp.head = FRANE_HEAD; + spp.len = 1 + 2 + 1 + 2; + spp.cmd = WRITE_CMD; + spp.addr = 0x002c; + spp.data_buf[0] = mode; - int sppValidLength = 6 + 1; + int sppValidLength = 6 + 1; - u8 *dataPtr = (u8 *)&spp; - u16 crc = modbusCRC16((u8 *)(dataPtr + 3), 4); + u8 *dataPtr = (u8 *)&spp; + u16 crc = modbusCRC16((u8 *)(dataPtr + 3), 4); - return QByteArray((char *)&spp, sppValidLength) + - QByteArray((char *)&crc, 2); + return QByteArray((char *)&spp, sppValidLength) + + QByteArray((char *)&crc, 2); #endif #if 0 @@ -135,62 +135,118 @@ namespace DataParser return QByteArray(data,length); #endif +} + +void experimentalStateSwitching(const CommonData &cd) +{ + switch(cd.run_type){ + case DeviceRunStatus::Heat: + case DeviceRunStatus::ConstantTemp: + Global::_mode = Global::Mode::Experiment; + break; + case DeviceRunStatus::Idle: + case DeviceRunStatus::Cooling: + Global::_mode = Global::Mode::Analysis; + break; + default:break; } - unsigned short modbusCRC16(unsigned char *data, unsigned short length) + if(Global::_currentPhase != (int)cd.current_phase){ + Global::_currentPhase = (int)cd.current_phase; + +// Global::CurveExperimentData ced{nullptr,"",QVector()}; + Global::CurveExperimentData ced; + + Global::_curveExperimentDataVtr.push_back(ced); + Global::_currentCurveExperimentDataPtr = &Global::_curveExperimentDataVtr.last(); + + Global::_currentCurveExperimentDataPtr->fileName = Global::_experimentInfo.sampleName; + } + + logde<<"phase:"<<(int)cd.current_phase; + logde<<"run type:"<<(int)cd.run_type; + logde<<"software mode:"<> 1) ^ 0xA001; - } - else - { - crc = crc >> 1; - } + crc = (crc >> 1) ^ 0xA001; + } + else + { + crc = crc >> 1; } } - // CRC结果低字节在前,高字节在后 - return crc; + } + // CRC结果低字节在前,高字节在后 + return crc; +} + +QByteArray inquirePhaseInfo() +{ + SerialPortProtocol spp; + spp.head = FRANE_HEAD; + spp.cmd = READ_CMD; + spp.addr = 0x0050; + spp.len = 6; + // + spp.data_buf[0] = PHASE_BYTE_SIZE * 6 + 2; + // + u8 *dataPtr = (u8 *)&spp; + u16 crc = modbusCRC16((u8 *)(dataPtr + 3), 4); + // + int sppValidLength = 6 + 1; + return QByteArray((char *)&spp, sppValidLength) + + QByteArray((char *)&crc, 2); +} + +bool isDevExperimentEnded(const CommonData &cd) +{ + switch(cd.run_type){ + case DeviceRunStatus::Heat: + case DeviceRunStatus::ConstantTemp: + Global::_mode = Global::Mode::Experiment; + break; + case DeviceRunStatus::Idle: + logde<<"idle..."; + case DeviceRunStatus::Cooling: + Global::_mode = Global::Mode::Analysis; + logde<<"cooling..."; + // return true; + break; + default:break; } - QByteArray inquirePhaseInfo() - { - SerialPortProtocol spp; - spp.head = FRANE_HEAD; - spp.cmd = READ_CMD; - spp.addr = 0x0050; - spp.len = 6; - // - spp.data_buf[0] = PHASE_BYTE_SIZE * 6 + 2; - // - u8 *dataPtr = (u8 *)&spp; - u16 crc = modbusCRC16((u8 *)(dataPtr + 3), 4); - // - int sppValidLength = 6 + 1; - return QByteArray((char *)&spp, sppValidLength) + - QByteArray((char *)&crc, 2); - } +#if 0 + logde<<"phase:"<<(int)cd.current_phase; + logde<<"run type:"<<(int)cd.run_type; - bool isDevExperimentEnded(const CommonData &cd) - { - switch(cd.run_type){ - case DeviceRunStatus::Idle: - case DeviceRunStatus::Cooling: -// Global::instance()->setMode(Global::Mode::Analysis); -// Global::_mode = Global::Mode::Analysis; -// logde<<"Device into cooling status,then set the software into annlysis mode."; - return true; - break; - default:break; - } - return false; + switch(cd.run_type){ + case DeviceRunStatus::Idle: + logde<<"idle..."; + // break; + case DeviceRunStatus::Cooling: + // Global::instance()->setMode(Global::Mode::Analysis); + // Global::_mode = Global::Mode::Analysis; + // logde<<"Device into cooling status,then set the software into annlysis mode."; + logde<<"cooling..."; + // return true; + break; + default:break; } + return false; +#endif +} + + }; diff --git a/src/serialport/dataparser.h b/src/serialport/dataparser.h index cd9fc2e..80b7ff2 100644 --- a/src/serialport/dataparser.h +++ b/src/serialport/dataparser.h @@ -13,6 +13,7 @@ QByteArray connectToDevice(const QVector&); QByteArray inquirePhaseInfo(); QByteArray setDeviceStartStop(const DeviceStartMode); +void experimentalStateSwitching(const CommonData&cd); bool isDevExperimentEnded(const CommonData&cd); bool commonDataParser(const QByteArray&ba,CommonData &cd); diff --git a/src/serialport/serialport.cpp b/src/serialport/serialport.cpp index d62ae49..75b94d2 100644 --- a/src/serialport/serialport.cpp +++ b/src/serialport/serialport.cpp @@ -94,12 +94,11 @@ void SerialPort::timerEvent(QTimerEvent *event) void SerialPort::slotReadData() { -#if 1 QByteArray ba = _sp->readAll(); if(ba.size() == 0){ return; } -#if 1 +#if 0 QString hexData = ba.toHex(' '); // ' ' 作为分隔符,可选参数 qDebug() << "receive info (hex):" << hexData; #endif @@ -128,19 +127,18 @@ void SerialPort::slotReadData() } else if (READ_CMD == spp->cmd) { - // judge the device status. - DataParser::isDevExperimentEnded(cd); - // read data + DataParser::experimentalStateSwitching(cd); + setAxis(); + if (spp->addr == 0) { if (Global::Mode::Experiment == Global::_mode) { emit sigSendCommonData(cd); } - emit sigSendCommonDataToRealDataForm(cd); + // emit sigSendCommonDataToRealDataForm(cd); } } -#endif } void SerialPort::commonDataParser(const int dataLength, const u16 addr, @@ -173,7 +171,7 @@ void SerialPort::commonDataParser(const int dataLength, const u16 addr, { switch(cd.run_type){ case DeviceRunStatus::Cooling: -// Global::instance()->setMode(Global::Mode::Analysis); + // Global::instance()->setMode(Global::Mode::Analysis); Global::_mode = Global::Mode::Analysis; logde<<"set global mode analysis.common data parser."; break; @@ -201,12 +199,12 @@ void SerialPort::commonDataParser(const int dataLength, const u16 addr, switch (mode) { case DeviceStartMode::Stop: -// Global::instance()->setMode(Global::Mode::Analysis); + // Global::instance()->setMode(Global::Mode::Analysis); Global::_mode = Global::Mode::Analysis; logde<<"set global mode analysis."; break; case DeviceStartMode::Start: -// Global::instance()->setMode(Global::Mode::ExperimentStart); + // Global::instance()->setMode(Global::Mode::ExperimentStart); Global::_mode = Global::Mode::Experiment; break; default: @@ -394,6 +392,26 @@ void SerialPort::displayPortInfo() } } } + +void SerialPort::setAxis() +{ + static Global::Mode previousMode = Global::Analysis; // 记录上一次的模式 + + if (previousMode == Global::Analysis && + Global::_mode == Global::Experiment) { + // std::cout << "Mode has changed from Analysis to Experiment!" << std::endl; + Global::ExperimentInfo & eti = Global::_experimentInfo; + if(eti.phaseVtr.size() > 0){ + logde<<"serialport set axis."; + float temp = eti.phaseVtr.at(0).cutoff_temp; + emit sigAxisModify(temp); + } + } + + if(previousMode != Global::_mode){ + previousMode = Global::_mode; + } +} void SerialPort::parserTest() { const uchar data[] = {0xa5, 0x5a, 0x2d, 0x83, diff --git a/src/serialport/serialport.h b/src/serialport/serialport.h index 885941c..dd9530c 100644 --- a/src/serialport/serialport.h +++ b/src/serialport/serialport.h @@ -34,6 +34,7 @@ signals: void sigSendCommonData(const CommonData &); void sigSendCommonDataToRealDataForm(const CommonData &); void sigSendPhaseInfo(const QByteArray &); + void sigAxisModify(const float temp); public slots: void slotDeliverData(const QByteArray &); // void slotConnectToDevice(const QByteArray&); @@ -46,7 +47,7 @@ private: void commonDataParser(const int dataLength, const u16 addr, const CommonData &cd); void to_hex(char *in_char, int char_length, char *out_char); void displayPortInfo(); - + void setAxis(); private: SerialPort(QObject *parent = nullptr); QSerialPort *_sp; diff --git a/src/ui/aboutform.cpp b/src/ui/aboutform.cpp index 40b5b08..84c7a03 100644 --- a/src/ui/aboutform.cpp +++ b/src/ui/aboutform.cpp @@ -9,8 +9,6 @@ AboutForm::AboutForm(QWidget *parent) : { ui->setupUi(this); -// setFixedSize(geometry().width(),geometry().height()); - setWindowTitle("About"); QPixmap pixmap(":/images/logo.png"); // 假设图片在资源文件中 @@ -22,19 +20,16 @@ AboutForm::AboutForm(QWidget *parent) : 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); + .arg(Global::ConSoftVersion); ui->labelContent->setAlignment(Qt::AlignTop | Qt::AlignLeft); ui->labelContent->setTextFormat(Qt::RichText); diff --git a/src/ui/centralwidget.cpp b/src/ui/centralwidget.cpp index fc56882..dfc0149 100644 --- a/src/ui/centralwidget.cpp +++ b/src/ui/centralwidget.cpp @@ -74,15 +74,15 @@ CentralWidget::CentralWidget(QWidget *parent) _customPlot->yAxis->setRange(0, 100); _customPlot->replot(); #endif - // startTimer(1000); - // 设置坐标轴标签 _customPlot->xAxis->setLabel("Temp/℃"); _customPlot->yAxis->setLabel("DSC/mW"); // 设置坐标轴范围,以便我们可以看到全部数据 - _customPlot->xAxis->setRange(0, 400); - _customPlot->yAxis->setRange(-100,200); + _customPlot->xAxis->setRange(0,100); + _customPlot->yAxis->setRange(0,20); + + // startTimer(300); } CentralWidget::~CentralWidget() @@ -137,30 +137,47 @@ void CentralWidget::slotModeModify(const Global::Mode mode) void CentralWidget::slotRecvCommonData(const CommonData &cd) { - qDebug() << "slotRevCommonData"; + // logde<<"slotRecvCommonData..."; static double index = 0.0; if(!_currentCurve){ + logde<<"_currentCurve is nullptr"; _currentCurve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis); } logde<<"temp:"<addData(cd.sample_temp, cd.dsc); - // _currentCurve->data()->add(QCPCurveData(index++, cd.sample_temp, cd.dsc)); + _currentCurve->addData(index++,cd.sample_temp, cd.dsc); -// _currentCurve->addData(index++,cd.sample_temp, cd.dsc); + // _customPlot->rescaleAxes(); + _customPlot->replot(); - // 设置曲线数据 -// _currentCurve->setData(data); - - -// _customPlot->rescaleAxes(); -// _customPlot->replot(); + // return; // Record data. + logde<<"record data..."; + + if(!Global::_currentCurveExperimentDataPtr){ + logde<<"_currentCurveExperimentDataPtr is nullptr."; + exit(0); + }else{ + logde<<"add ed..."; + + Global::ExperimentData ed; + ed.dsc = cd .dsc; + ed.sampleTemp = cd.sample_temp; + ed.runTime = cd.add_run_time; + ed.constantTempTime = cd.add_constan_temp_time; + + Global::_currentCurveExperimentDataPtr->dataVtr.push_back(ed); + logde<<"111"; + Global::_currentCurveExperimentDataPtr->curve = _currentCurve; + logde<<"222"; + } + +#if 0 + logde<<"record data..."; QVector* pEdVtr = nullptr; // 声明指针变量 for(auto item:Global::_curveExperimentDataVtr){ if(item.curve == _currentCurve){ @@ -180,12 +197,15 @@ void CentralWidget::slotRecvCommonData(const CommonData &cd) ed.constantTempTime = cd.add_constan_temp_time; pEdVtr->push_back(ed); +#endif } void CentralWidget::slotRecvAnalysisFileName(const QString &filePath) { qDebug() << "slotRecvAnalysisFileName" << filePath; + _customPlot->setInteractions(QCP::iSelectPlottables); + // todo.禁止重复文件添加。 Global::CurveFileData cfd; if(XlsxHandler::readFile(filePath,cfd) != 0){ @@ -417,6 +437,9 @@ void CentralWidget::slotAnalysisSettingLineXPoint(const int index, const double) void CentralWidget::timerEvent(QTimerEvent *event) { + _customPlot->replot(); + +#if 0 // key的单位是秒 double key = QDateTime::currentDateTime().toMSecsSinceEpoch() / 1000.0; // 添加数据 @@ -439,6 +462,7 @@ void CentralWidget::timerEvent(QTimerEvent *event) _customPlot->yAxis->setRange(0, 20); // 设定x轴的范围 _customPlot->xAxis->setRange(key + 0.25, 80, Qt::AlignRight); // 设定x轴的范围 _customPlot->replot(); +#endif } void CentralWidget::contextMenuEvent(QContextMenuEvent *event) @@ -901,6 +925,7 @@ void CentralWidget::clearData(const CentralWidget::ClearDataMode mode) QCPGraph *graph = _customPlot->graph(i); _customPlot->removeGraph(graph); } + _currentCurve = nullptr; #endif // Delete items. @@ -922,3 +947,13 @@ void CentralWidget::clearAllData() { clearData(ClearDataMode::All); } + +void CentralWidget::slotAxisModify(const float temp) +{ + _customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables); + + float value = temp + 20; + + _customPlot->xAxis->setRange(10,value); + _customPlot->yAxis->setRange(-5,5); +} diff --git a/src/ui/centralwidget.h b/src/ui/centralwidget.h index fabf77f..e4ea755 100644 --- a/src/ui/centralwidget.h +++ b/src/ui/centralwidget.h @@ -35,6 +35,8 @@ signals: void sigSendLineXCoord(const int,const double); void sigRightDockWidgetHide(); public slots: + // experiment + void slotAxisModify(const float temp); void slotModeModify(const Global::Mode); void slotRecvCommonData(const CommonData&); void slotRecvAnalysisFileName(const QString&); diff --git a/src/ui/experimentsettingform.cpp b/src/ui/experimentsettingform.cpp index 32369af..f7fa538 100644 --- a/src/ui/experimentsettingform.cpp +++ b/src/ui/experimentsettingform.cpp @@ -404,12 +404,12 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() } // Global::ExperimentInfo& ei = Global::_experimentInfo; - ei.phaseVtr = phaseVtr; ei.sampleName = ui->sampleNameLineEdit->text(); ei.sampleWeight = ui->sampleWeightLineEdit->text(); ei.date = ui->dateTimeLineEdit->text(); ei.experimentor = ui->userLineEdit->text(); - +#if 0 + ei.phaseVtr = phaseVtr; if(ui->radioButton_OIT->isChecked()){ ei.testType = Global::TestType::OIT; } else if(ui->radioButton_OIT_not->isChecked()){ @@ -417,7 +417,7 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() } ei.initialAtmosPhere = (GasType)(ui->comboBox_phase_1_atmosphere->currentIndex()); - +#endif // QByteArray ba = DataParser::connectToDevice(phaseVtr); qDebug() << "ba size:" << ba.size(); @@ -497,6 +497,7 @@ void ExperimentSettingForm::slotRecvPhaseInfo(const QByteArray &ba) Phase *phase = (Phase *)(data + i * PHASE_BYTE_SIZE); phaseVtr.push_back(*phase); } + Global::_experimentInfo.phaseVtr = phaseVtr; //ui update for(int i = 0; i< phaseVtr.size();){