diff --git a/AnalysisTool-release/bin/log/20250618.log b/AnalysisTool-release/bin/log/20250618.log index 2b1b55f..ef16774 100644 --- a/AnalysisTool-release/bin/log/20250618.log +++ b/AnalysisTool-release/bin/log/20250618.log @@ -36,3 +36,90 @@ [2025-06-18 10:04:14,239] Selected Curve:new.xlsx [2025-06-18 10:04:17,332] xMax:94.8474 [2025-06-18 10:04:25,159] Selected Curve:new.xlsx +[2025-06-18 14:20:14,656] main... +[2025-06-18 14:20:14,656] config file existed. +[2025-06-18 14:20:14,667] version:1.0.4.0 +[2025-06-18 14:20:14,676] setEventHandlerEnable...0 +[2025-06-18 14:20:53,900] slotSendData:9 +[2025-06-18 14:20:53,900] slotSendData:a5 5a 06 83 50 00 4a a8 46 +[2025-06-18 14:20:53,900] All data writen. +[2025-06-18 14:20:53,901] open serial port. +[2025-06-18 14:25:16,037] main... +[2025-06-18 14:25:16,039] config file existed. +[2025-06-18 14:25:16,049] version:1.0.4.0 +[2025-06-18 14:25:16,059] setEventHandlerEnable...0 +[2025-06-18 14:25:28,907] main... +[2025-06-18 14:25:28,907] config file existed. +[2025-06-18 14:25:28,918] version:1.0.4.0 +[2025-06-18 14:25:28,927] setEventHandlerEnable...0 +[2025-06-18 14:25:55,875] slotSendData:9 +[2025-06-18 14:25:55,875] slotSendData:a5 5a 06 83 50 00 4a a8 46 +[2025-06-18 14:25:55,875] All data writen. +[2025-06-18 14:25:55,876] open serial port. +[2025-06-18 14:26:36,472] phase 2 enable. +[2025-06-18 14:26:36,472] slotSendData:82 +[2025-06-18 14:26:36,472] slotSendData:a5 5a 4f 82 50 00 01 00 00 48 43 00 00 a0 41 05 00 01 01 00 00 48 43 00 00 80 3f 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 a2 34 +[2025-06-18 14:26:36,472] All data writen. +[2025-06-18 14:29:32,803] phase 2 enable. +[2025-06-18 14:29:32,803] slotSendData:82 +[2025-06-18 14:29:32,803] slotSendData:a5 5a 4f 82 50 00 01 00 00 48 43 00 00 a0 41 05 00 01 01 00 00 48 43 00 00 80 3f 3d 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 3a 91 +[2025-06-18 14:29:32,803] All data writen. +[2025-06-18 14:29:47,987] start experiment,set soft into experiment mode. +[2025-06-18 14:29:47,987] clearExperimentData... +[2025-06-18 14:29:47,990] slotSendData:9 +[2025-06-18 14:29:47,990] slotSendData:a5 5a 06 82 2c 00 01 28 55 +[2025-06-18 14:29:47,990] All data writen. +[2025-06-18 14:31:02,677] Stop experiment ... +[2025-06-18 14:31:02,677] slotSendData:9 +[2025-06-18 14:31:02,677] slotSendData:a5 5a 06 82 2c 00 00 e9 95 +[2025-06-18 14:31:02,677] All data writen. +[2025-06-18 14:31:05,153] filePath:D:/gitfile/analysis_tool/AnalysisTool-release/experiment_data/sample_data/氧化诱导期33.xlsx +[2025-06-18 14:31:05,153] writeFile... +[2025-06-18 14:31:05,153] write file... +[2025-06-18 14:31:05,154] phase vtr size:0 +[2025-06-18 14:31:05,154] before xlsx save as... +[2025-06-18 14:31:15,551] xlsx sample weight:7 +[2025-06-18 14:31:15,551] Cell does not exist. +[2025-06-18 14:31:17,743] xlsx sample weight:1 +[2025-06-18 14:31:17,743] startLineIndex:11 +[2025-06-18 14:31:17,743] data size:298 +[2025-06-18 14:31:17,743] Cell does not exist. +[2025-06-18 14:31:19,256] xlsx sample weight:0 +[2025-06-18 14:31:19,256] startLineIndex:11 +[2025-06-18 14:31:19,256] data size:3550 +[2025-06-18 14:31:19,259] Cell does not exist. +[2025-06-18 14:31:20,971] clearExperimentData... +[2025-06-18 14:31:21,999] xlsx sample weight:7 +[2025-06-18 14:31:21,999] Cell does not exist. +[2025-06-18 14:39:44,122] start experiment,set soft into experiment mode. +[2025-06-18 14:39:44,122] clearExperimentData... +[2025-06-18 14:39:44,125] slotSendData:9 +[2025-06-18 14:39:44,125] slotSendData:a5 5a 06 82 2c 00 01 28 55 +[2025-06-18 14:39:44,125] All data writen. +[2025-06-18 14:39:56,333] Stop experiment ... +[2025-06-18 14:39:56,333] slotSendData:9 +[2025-06-18 14:39:56,333] slotSendData:a5 5a 06 82 2c 00 00 e9 95 +[2025-06-18 14:39:56,333] All data writen. +[2025-06-18 14:40:02,447] filePath:D:/gitfile/analysis_tool/AnalysisTool-release/experiment_data/sample_data/氧化诱导期33.xlsx +[2025-06-18 14:40:02,447] writeFile... +[2025-06-18 14:40:02,447] write file... +[2025-06-18 14:40:02,447] phase vtr size:0 +[2025-06-18 14:40:02,447] before xlsx save as... +[2025-06-18 14:40:16,204] phase 2 enable. +[2025-06-18 14:40:16,204] slotSendData:82 +[2025-06-18 14:40:16,204] slotSendData:a5 5a 4f 82 50 00 01 00 00 48 43 00 00 a0 41 05 00 01 01 00 00 48 43 00 00 80 3f 3d 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 01 3a 91 +[2025-06-18 14:40:16,204] All data writen. +[2025-06-18 14:40:20,620] start experiment,set soft into experiment mode. +[2025-06-18 14:40:20,620] clearExperimentData... +[2025-06-18 14:40:20,625] slotSendData:9 +[2025-06-18 14:40:20,625] slotSendData:a5 5a 06 82 2c 00 01 28 55 +[2025-06-18 14:40:20,625] All data writen. +[2025-06-18 14:40:47,212] Stop experiment ... +[2025-06-18 14:40:47,212] slotSendData:9 +[2025-06-18 14:40:47,212] slotSendData:a5 5a 06 82 2c 00 00 e9 95 +[2025-06-18 14:40:47,212] All data writen. +[2025-06-18 14:40:50,598] filePath:D:/gitfile/analysis_tool/AnalysisTool-release/experiment_data/sample_data/氧化诱导期33.xlsx +[2025-06-18 14:40:50,598] writeFile... +[2025-06-18 14:40:50,598] write file... +[2025-06-18 14:40:50,598] phase vtr size:0 +[2025-06-18 14:40:50,598] before xlsx save as... diff --git a/AnalysisTool-release/experiment_data/sample_data/氧化诱导期33.xlsx b/AnalysisTool-release/experiment_data/sample_data/氧化诱导期33.xlsx new file mode 100644 index 0000000..28cc029 Binary files /dev/null and b/AnalysisTool-release/experiment_data/sample_data/氧化诱导期33.xlsx differ diff --git a/experiment_data/sample_data/new.xlsx b/experiment_data/sample_data/new.xlsx index 3685f14..db680cd 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 3a62cfb..3ba6576 100644 --- a/src/data/xlsxhandler.cpp +++ b/src/data/xlsxhandler.cpp @@ -251,6 +251,10 @@ void XlsxHandler::writeExperimentFile(const QString filePath) row++; // phase data. + if(Global::_curveExperimentDataVtr.size() < i + 1){ + continue; + } + QVector edVtr = Global::_curveExperimentDataVtr.at(i).dataVtr; diff --git a/src/global.cpp b/src/global.cpp index e4ff3f7..bb7b2d5 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -26,6 +26,8 @@ bool _displayTimeValue = false; LanguageType _languageType = LanguageType::Chinese; +bool _experimentOITFlag = false; + QString converDoubleToStr(const double num) { return QString::number(num,'f',3); diff --git a/src/global.h b/src/global.h index 9789697..dd3a5b3 100644 --- a/src/global.h +++ b/src/global.h @@ -158,6 +158,8 @@ extern LanguageType _languageType; extern AxisMode _axisMode; +extern bool _experimentOITFlag; + // common func QString converDoubleToStr(const double); void quadraticLeastSquaresFit(double x[], double y[], int n, double coeff[]); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index cafcf6b..28b41b3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -478,6 +478,8 @@ void MainWindow::on_actionStart_triggered() Global::_mode = Global::Mode::Experiment; _manuallyStopTheExperimentFlag = false; + + _centralWidget->startExperiment(); } void MainWindow::on_actionReadOnly_triggered() diff --git a/src/serialport/serialport.h b/src/serialport/serialport.h index 45612e6..aa02476 100644 --- a/src/serialport/serialport.h +++ b/src/serialport/serialport.h @@ -22,8 +22,7 @@ public: static SerialPort *instance(); ~SerialPort(); - void sendData(const QByteArray &data) - { slotSendData(data); } + void sendData(const QByteArray &data){slotSendData(data);} void sendCmd(const E_CMD_TYPE e); static void parserTest(); bool openSp(); diff --git a/src/ui/centralwidget.cpp b/src/ui/centralwidget.cpp index 1b9cd4f..8f618c6 100644 --- a/src/ui/centralwidget.cpp +++ b/src/ui/centralwidget.cpp @@ -197,6 +197,22 @@ QCPCurve* CentralWidget::addCurveData( return _currentCurve; } +void CentralWidget::startExperiment() +{ + if(Global::_experimentOITFlag){ + setAxisMode(Global::AxisMode::DoubleY); + }else{ + setAxisMode(Global::AxisMode::SingleY); + } + + if(_yAxis2Curve != nullptr){ + _yAxis2Curve = nullptr; + } + _customPlot->yAxis2->setRange(0, 400); + _customPlot->xAxis->setRange(-5, 400); + _customPlot->yAxis->setRange(-20, 20); +} + void CentralWidget::setAnalysisMode(const AnalysisMode mode) { _analysisMode = mode; @@ -260,19 +276,7 @@ void CentralWidget::slotModeModify(const Global::Mode mode) void CentralWidget::slotRecvCommonData(const CommonData &cd) { - static double index = 0.0; - - if(!_currentCurve){ - logde<<"_currentCurve is nullptr"; - _currentCurve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis); - _currentCurve->setObjectName(Global::ObjectNameExperiemnt); - } - - // logde<<"temp:"<addData(index++,cd.sample_temp, cd.dsc); - - // _customPlot->rescaleAxes(); - _customPlot->replot(); + logde<<"slotRecvCommonData run time:"<dataVtr.empty()){ ed.phaseIndex = Global::_currentCurveExperimentDataPtr->phaseIndex; + logde<<"current phase index:"<phaseIndex; + _currentCurve = nullptr; } Global::_currentCurveExperimentDataPtr->dataVtr.push_back(ed); + } + + // Update ui. + static double index = 0.0; + + if(!_currentCurve){ + logde<<"_currentCurve is nullptr"; + _currentCurve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis); + _currentCurve->setObjectName(Global::ObjectNameExperiemnt); + Global::_currentCurveExperimentDataPtr->curve = _currentCurve; } + if(!Global::_experimentOITFlag){ + _currentCurve->addData(index++,cd.sample_temp, cd.dsc); + }else{ + if(_yAxis2Curve == nullptr){ + _yAxis2Curve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis2); + _yAxis2Curve->setSelectable(QCP::stWhole); // 设置曲线可选 + _yAxis2Curve->setLineStyle(QCPCurve::lsLine); // 线性连接 + + _yAxis2Curve->setObjectName(Global::ObjectNameExperiemnt); + + // 设置曲线颜色 + QPen pen(Qt::red); // 创建一个红色的画笔 + pen.setWidth(1); // 设置画笔宽度 + _yAxis2Curve->setPen(pen); // 将画笔应用到曲线 + } + _yAxis2Curve->addData(index++,cd.add_run_time, cd.sample_temp); + + _currentCurve->addData(index++,cd.add_run_time, cd.dsc); + + // _customPlot->yAxis2->setRange(0, 400); + } + + // Set asis xy range. + // axis dsc -20 20 + // time 0 100 + // temp 0 400 + + // _customPlot->xAxis->setRange(0, 400); + // _customPlot->yAxis->setRange(-20, 20); + + + // _customPlot->rescaleAxes(); + _customPlot->replot(); + + + #if 0 logde<<"_curveExperimentDataVtr size:" <yAxis->setVisible(true); _customPlot->yAxis->setLabel(AxisDSC); @@ -597,8 +650,12 @@ void CentralWidget::uiLoadXlsxFileData() _customPlot->yAxis2->setVisible(true); _customPlot->yAxis2->setLabel(AxisTemperature); } +#endif #if 1 + if(Global::_curveFileDataVtr.empty()){ + return; + } // Load xlsx file data. QVector allDataVtr; for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){ @@ -608,26 +665,48 @@ void CentralWidget::uiLoadXlsxFileData() allDataVtr.append(pti.dataVtr); // Load data. - QVector tVtr,xVtr, yVtr; + QVector tVtr,tempVtr,timeVtr,dscVtr; int index = 0; for (Global::ExperimentData &ed : pti.dataVtr) { tVtr.push_back(index++); +#if 0 if(_axisMode == AxisMode::SingleY){ - xVtr.push_back(ed.sampleTemp); + xTempVtr.push_back(ed.sampleTemp); }else{ - xVtr.push_back(ed.runTime); + xTimeVtr.push_back(ed.runTime); } - yVtr.push_back(ed.dsc); +#endif + tempVtr.push_back(ed.sampleTemp); + timeVtr.push_back(ed.runTime); + + dscVtr.push_back(ed.dsc); } _currentCurve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis); - _currentCurve->setData(tVtr, xVtr, yVtr); + if(_axisMode == AxisMode::SingleY){ + _currentCurve->setData(tVtr, tempVtr, dscVtr); + }else{ + _currentCurve->setData(tVtr, timeVtr, dscVtr); + } _currentCurve->setSelectable(QCP::stWhole); // 设置曲线可选 _currentCurve->setLineStyle(QCPCurve::lsLine); // 线性连接 - _currentCurve->setObjectName(cfd.filePath); + // add the second axis y curve data. + if(_axisMode == AxisMode::DoubleY){ + QCPCurve *secondCurve = new QCPCurve(_customPlot->xAxis, _customPlot->yAxis2); + secondCurve->setData(tVtr, timeVtr, tempVtr); + secondCurve->setSelectable(QCP::stWhole); // 设置曲线可选 + secondCurve->setLineStyle(QCPCurve::lsLine); // 线性连接 + + secondCurve->setObjectName(cfd.filePath); + + // 设置曲线颜色 + QPen pen(Qt::red); // 创建一个红色的画笔 + pen.setWidth(1); // 设置画笔宽度 + secondCurve->setPen(pen); // 将画笔应用到曲线 + } #if 0 // Set axis range. QPair minMaxXAxisPair; @@ -662,6 +741,13 @@ void CentralWidget::uiLoadXlsxFileData() }else{ // Axis x is time value. minMaxXAxisPair = PointCalculate::getMinAndMaxOfRunTime(); + + // Set yAxis2 range. + QPair minAndMaxPair = PointCalculate::getMinAndMaxOfSampleTemp(); + QPairy2AxisPair = PointCalculate::getMinAndMaxOfAxis( + minAndMaxPair.first,minAndMaxPair.second); + + _customPlot->yAxis2->setRange(y2AxisPair.first,y2AxisPair.second); } QPairnewXAxisPair = PointCalculate::getMinAndMaxOfAxis( minMaxXAxisPair.first,minMaxXAxisPair.second); @@ -689,15 +775,6 @@ void CentralWidget::uiLoadXlsxFileData() #endif } -#if 0 -void CentralWidget::contextMenuEvent(QContextMenuEvent *event) -{ - qDebug()<<"left menu..."; - QPoint point = event->globalPos(); - emit sigContextMenuShow(point); -} -#endif - void CentralWidget::glassTransitionHandle(const double x1,const double x2,const QString objectName) { QPointF point1 = PointCalculate::getClosestPointByX(x1); @@ -1502,7 +1579,6 @@ void CentralWidget::drawOITLine( logde<<"start/end offset:" <yAxis->setVisible(true); + _customPlot->yAxis->setLabel(AxisDSC); + + if(_axisMode == AxisMode::SingleY){ + _customPlot->xAxis->setLabel(AxisTemperature); + + _customPlot->yAxis2->setVisible(false); + }else{ + _customPlot->xAxis->setLabel(AxisTime); + + _customPlot->yAxis2->setVisible(true); + _customPlot->yAxis2->setLabel(AxisTemperature); + } + + _customPlot->replot(); + uiLoadXlsxFileData(); } } @@ -1575,6 +1669,8 @@ QPixmap CentralWidget::getPixMap() void CentralWidget::slotAxisModify(const float temp) { + logde<<"slotAxisModify..."; + _customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables); float value = temp + 20; diff --git a/src/ui/centralwidget.h b/src/ui/centralwidget.h index 3d55c42..eb581d9 100644 --- a/src/ui/centralwidget.h +++ b/src/ui/centralwidget.h @@ -51,6 +51,8 @@ public: QCPCurve* addCurveData(const QVector &,const QString objectName); QCPCurve * getCurrentCurve(){return _currentCurve;} + + void startExperiment(); signals: void sigContextMenuShow(const QPoint); void sigSendLineXCoord(const int,const double); @@ -122,7 +124,7 @@ private: private: AnalysisOperationRecorder::AnalysisMode _analysisMode; LocalCustomPlot *_customPlot; - QCPCurve * _currentCurve; + QCPCurve * _currentCurve,*_yAxis2Curve; EventHandler* _eventHandler; QCPItemStraightLine *_line1,*_line2; QVector _lineVtr; diff --git a/src/ui/experimentsettingform.cpp b/src/ui/experimentsettingform.cpp index bfdeaa8..8af35be 100644 --- a/src/ui/experimentsettingform.cpp +++ b/src/ui/experimentsettingform.cpp @@ -212,6 +212,36 @@ void ExperimentSettingForm::uiSetPhaseEnable(const int index) } } +GasType ExperimentSettingForm::conver2GasType(const int index) +{ + switch (index) { + case 0: return GasType::NC; break; // 假设 GAS_AIR 是 gas_type 的枚举值 + case 1: return GasType::N2; break; + case 2: return GasType::O2; break; + default: return GasType::NC; break; // 处理未知情况 + } + return GasType::NC; +} + +bool ExperimentSettingForm::phaseCufoffTempAndTempFlowCheck(const int phaseIndex, + const float prePhaseCufoffTemp, + const float currentPhaseCufoffTemp, + const float tempFlow) +{ + if(tempFlow < 0){ + phaseScanRateErrorMesgBox(phaseIndex); + return false; + } + + if(prePhaseCufoffTemp != currentPhaseCufoffTemp + && tempFlow == 0){ + phaseScanRateErrorMesgBox(phaseIndex); + return false; + } + + return true; +} + void ExperimentSettingForm::slotPhase2StateChanged(int state) { qDebug() << "slotPhase2StateChanged:" << state; @@ -379,8 +409,8 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phase.cutoff_temp = ui->phase_1_cutoff_temp->text().toFloat(); phase.temp_flow = ui->phase_1_scan_rate->text().toFloat(); phase.constant_temp_time_min = (uint16_t)ui->phase_1_constant_temp->text().toInt(); - // phase.gas = ui->comboBox_phase_1_atmosphere->currentIndex(); - phase.gas = GasType::N2; + + phase.gas = conver2GasType(ui->comboBox_phase_1_atmosphere->currentIndex()); phaseVtr.push_back(phase); // @@ -390,6 +420,7 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phaseScanRateErrorMesgBox(1); return; } + } { @@ -398,8 +429,7 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phase.cutoff_temp = ui->phase_2_cutoff_temp->text().toFloat(); phase.temp_flow = ui->phase_2_scan_rate->text().toFloat(); phase.constant_temp_time_min = (uint16_t)ui->phase_2_constant_temp->text().toInt(); - // phase.gas = ui->comboBox_phase_1_atmosphere->currentIndex(); - phase.gas = GasType::N2; + phase.gas = conver2GasType(ui->comboBox_phase_2_atmosphere->currentIndex()); phaseVtr.push_back(phase); // @@ -411,10 +441,26 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() return; } - if(phase.temp_flow <= 0){ + // +#if 0 + if(phase.temp_flow < 0){ phaseScanRateErrorMesgBox(2); return; } + + if(phase2CutoffTemp != phase1CutoffTemp + && phase.temp_flow == 0){ + phaseScanRateErrorMesgBox(2); + return; + } +#endif + if(!phaseCufoffTempAndTempFlowCheck(2, + phase1CutoffTemp, + phase2CutoffTemp, + phase.temp_flow)){ + return; + } + } } @@ -424,7 +470,7 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phase.cutoff_temp = ui->phase_3_cutoff_temp->text().toFloat(); phase.temp_flow = ui->phase_3_scan_rate->text().toFloat(); phase.constant_temp_time_min = (uint16_t)ui->phase_3_constant_temp->text().toInt(); - phase.gas = GasType::N2; + phase.gas = conver2GasType(ui->comboBox_phase_3_atmosphere->currentIndex()); phaseVtr.push_back(phase); // @@ -435,11 +481,18 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phaseCufoffTempErrorMesgBox(3); return; } - +#if 0 if(phase.temp_flow <= 0){ phaseScanRateErrorMesgBox(3); return; } +#endif + if(!phaseCufoffTempAndTempFlowCheck(3, + phase2CutoffTemp, + phase3CutoffTemp, + phase.temp_flow)){ + return; + } } } @@ -449,8 +502,8 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phase.cutoff_temp = ui->phase_4_cutoff_temp->text().toFloat(); phase.temp_flow = ui->phase_4_scan_rate->text().toFloat(); phase.constant_temp_time_min = (uint16_t)ui->phase_4_constant_temp->text().toInt(); - // phase.gas = ui->comboBox_phase_1_atmosphere->currentIndex(); - phase.gas = GasType::N2; + phase.gas = conver2GasType(ui->comboBox_phase_4_atmosphere->currentIndex()); + phaseVtr.push_back(phase); // if(phase.onoff){ @@ -460,11 +513,18 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phaseCufoffTempErrorMesgBox(4); return; } - +#if 0 if(phase.temp_flow <= 0){ phaseScanRateErrorMesgBox(4); return; } +#endif + if(!phaseCufoffTempAndTempFlowCheck(4, + phase3CutoffTemp, + phase4CutoffTemp, + phase.temp_flow)){ + return; + } } } @@ -474,8 +534,7 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phase.cutoff_temp = ui->phase_5_cutoff_temp->text().toFloat(); phase.temp_flow = ui->phase_5_scan_rate->text().toFloat(); phase.constant_temp_time_min = (uint16_t)ui->phase_5_constant_temp->text().toInt(); - // phase.gas = ui->comboBox_phase_1_atmosphere->currentIndex(); - phase.gas = GasType::N2; + phase.gas = conver2GasType(ui->comboBox_phase_5_atmosphere->currentIndex()); phaseVtr.push_back(phase); // @@ -486,11 +545,18 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phaseCufoffTempErrorMesgBox(5); return; } - +#if 0 if(phase.temp_flow <= 0){ phaseScanRateErrorMesgBox(5); return; } +#endif + if(!phaseCufoffTempAndTempFlowCheck(5, + phase4CutoffTemp, + phase5CutoffTemp, + phase.temp_flow)){ + return; + } } } @@ -500,8 +566,7 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phase.cutoff_temp = ui->phase_6_cutoff_temp->text().toFloat(); phase.temp_flow = ui->phase_6_scan_rate->text().toFloat(); phase.constant_temp_time_min = (uint16_t)ui->phase_6_constant_temp->text().toInt(); - // phase.gas = ui->comboBox_phase_1_atmosphere->currentIndex(); - phase.gas = GasType::N2; + phase.gas = conver2GasType(ui->comboBox_phase_6_atmosphere->currentIndex()); phaseVtr.push_back(phase); // @@ -512,11 +577,18 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() phaseCufoffTempErrorMesgBox(6); return; } - +#if 0 if(phase.temp_flow <= 0){ phaseScanRateErrorMesgBox(6); return; } +#endif + if(!phaseCufoffTempAndTempFlowCheck(6, + phase5CutoffTemp, + phase6CutoffTemp, + phase.temp_flow)){ + return; + } } } // @@ -541,8 +613,16 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() QByteArray initialBa; if(ui->radioButton_OIT->isChecked()){ initialBa.append((char)0); + + Global::_experimentOITFlag = true; + + logde<<"Global::_experimentOITFlag = true;"; }else{ initialBa.append((char)1); + + Global::_experimentOITFlag = false; + + logde<<"Global::_experimentOITFlag = false;"; } char index = ui->comboBox_initial_atmosphere->currentIndex(); @@ -805,6 +885,9 @@ void ExperimentSettingForm::slotRecvPhaseInfo(const QByteArray &ba) }else{ ui->radioButton_OIT->setChecked(true); ui->radioButton_OIT_not->setChecked(false); + Global::_experimentOITFlag = true; + + logde<<"Global::_experimentOITFlag = true;"; #if 0 QString oitNotRadioButtonName("radioButton_OIT_not"); QRadioButton *oitNotRadioButton = diff --git a/src/ui/experimentsettingform.h b/src/ui/experimentsettingform.h index 2844315..ec292ac 100644 --- a/src/ui/experimentsettingform.h +++ b/src/ui/experimentsettingform.h @@ -31,6 +31,11 @@ private: //ui void uiReset(); void uiSetPhaseEnable(const int index); + GasType conver2GasType(const int index); + bool phaseCufoffTempAndTempFlowCheck(const int phaseIndex, + const float prePhaseCufoffTemp, + const float currentPhaseCufoffTemp, + const float tempFlow); // slot void slotPhaseCheck(); void slotPhase2StateChanged(int state);