From 3a229c17c7e8af6707c1bacd0d4ab7ac3b197280 Mon Sep 17 00:00:00 2001 From: yuntang <123@qq.com> Date: Tue, 18 Mar 2025 11:43:14 +0800 Subject: [PATCH] 2025-03-18T11:43:14 --- src/.vscode/settings.json | 7 +- src/CMakeLists.txt | 85 +++- src/mainwindow.cpp | 53 ++- src/serialport/dataparser.cpp | 212 ++++----- src/serialport/dataparser.h | 27 +- src/serialport/protocol.h | 115 ++--- src/serialport/serialport.cpp | 53 ++- src/serialport/serialport.h | 35 +- src/src/main.cpp | 12 - src/src/qt_new_proj.cpp | 13 - src/src/qt_new_proj.h | 14 - src/src/qt_new_proj.ui | 22 - src/ui/experimentsettingform.cpp | 220 ++++++++-- src/ui/experimentsettingform.h | 18 +- src/ui/experimentsettingform.ui | 716 ++++++++++++++++++------------- 15 files changed, 949 insertions(+), 653 deletions(-) delete mode 100644 src/src/main.cpp delete mode 100644 src/src/qt_new_proj.cpp delete mode 100644 src/src/qt_new_proj.h delete mode 100644 src/src/qt_new_proj.ui diff --git a/src/.vscode/settings.json b/src/.vscode/settings.json index cb00389..3c02911 100644 --- a/src/.vscode/settings.json +++ b/src/.vscode/settings.json @@ -1,3 +1,8 @@ { - "qtConfigure.qtKitDir": "D:/qt/Qt5.14.2/5.14.2/mingw73_64" + "qtConfigure.qtKitDir": "D:/qt/Qt5.14.2/5.14.2/mingw73_64", + "files.associations": { + "array": "cpp", + "string": "cpp", + "string_view": "cpp" + } } \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c54ba15..9c81b16 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,21 +1,74 @@ -cmake_minimum_required(VERSION 3.5) # CMake install : https://cmake.org/download/ -project(qt_new_proj LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_PREFIX_PATH "D:/qt/Qt5.14.2/5.14.2/mingw73_64") # Qt Kit Dir +cmake_minimum_required(VERSION 3.5) + +project(AnalysisTool VERSION 1.0.0 LANGUAGES CXX) + +# Set C++11 as the minimum standard +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +# Find Qt libraries +find_package(Qt5 REQUIRED COMPONENTS Core Gui SerialPort PrintSupport Widgets) + set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -find_package(Qt5 COMPONENTS Widgets REQUIRED) # Qt COMPONENTS -aux_source_directory(./src srcs) -# Specify MSVC UTF-8 encoding -add_compile_options("$<$:/utf-8>") -add_compile_options("$<$:/utf-8>") +# 定义搜索的文件夹 +set(SEARCH_FOLDERS + ${CMAKE_SOURCE_DIR} + serialport + ui + thirdparty/qcustomplot + data +) +# 初始化空的源文件列表 +set(SOURCES "") +set(HEADERS "") + +# 分别搜索 .cpp 和 .h 文件 +foreach(FOLDER ${SEARCH_FOLDERS}) + file(GLOB_RECURSE TEMP_CPP ${FOLDER}/*.cpp) + file(GLOB_RECURSE TEMP_H ${FOLDER}/*.h) + list(APPEND SOURCES ${TEMP_CPP}) + list(APPEND HEADERS ${TEMP_H}) +endforeach() + + +set(FORMS + mainwindow.ui + ui/experimentsettingform.ui + ui/realtimedataform.ui +) + +# Resources +set(RESOURCES + images.qrc +) + +# Add UI files to the project and automatically run uic +qt5_wrap_ui(UI_HEADERS ${FORMS}) + +# Add resources to the project and automatically run rcc +qt5_add_resources(RESOURCES_RCC ${RESOURCES}) + +# Create the executable add_executable(${PROJECT_NAME} - WIN32 # If you need a terminal for debug, please comment this statement - ${srcs} -) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets) # Qt5 Shared Library \ No newline at end of file + ${SOURCES} + ${HEADERS} + ${UI_HEADERS} + ${RESOURCES_RCC} +) + +target_include_directories(${PROJECT_NAME} PRIVATE + ${SEARCH_FOLDERS} + ${CMAKE_CURRENT_BINARY_DIR}) + +# Link against Qt5 libraries +target_link_libraries(${PROJECT_NAME} + Qt5::Core + Qt5::Gui + Qt5::SerialPort + Qt5::PrintSupport + Qt5::Widgets +) + diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index df9e249..e998a49 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -8,12 +8,7 @@ #include "filemanager.h" MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) - , ui(new Ui::MainWindow) - , _centralWidget(new CentralWidget) - ,_leftWidget(new LeftWidget) - ,_expertmentSettingForm(new ExperimentSettingForm) - ,_realTimeDataForm(new RealTimeDataForm) + : QMainWindow(parent), ui(new Ui::MainWindow), _centralWidget(new CentralWidget), _leftWidget(new LeftWidget), _expertmentSettingForm(new ExperimentSettingForm), _realTimeDataForm(new RealTimeDataForm) { ui->setupUi(this); @@ -42,33 +37,40 @@ MainWindow::~MainWindow() void MainWindow::connections() { - //ui - connect(_expertmentSettingForm,&ExperimentSettingForm::sigDeliverData, - SerialPort::instance(),&SerialPort::slotDeliverData); + // ui + connect(_expertmentSettingForm, &ExperimentSettingForm::sigDeliverData, + SerialPort::instance(), &SerialPort::slotDeliverData); #if 1 - //dynamic data - connect(SerialPort::instance(),&SerialPort::sigSendCommonData, - _centralWidget,&CentralWidget::slotRevCommonData); - connect(SerialPort::instance(),&SerialPort::sigSendCommonData, - _realTimeDataForm,&RealTimeDataForm::slotRevCommonData); + // dynamic data + connect(SerialPort::instance(), &SerialPort::sigSendCommonData, + _centralWidget, &CentralWidget::slotRevCommonData); + connect(SerialPort::instance(), &SerialPort::sigSendCommonData, + _realTimeDataForm, &RealTimeDataForm::slotRevCommonData); + + connect(SerialPort::instance(), &SerialPort::sigSendCommonDataToRealDataForm, + _realTimeDataForm, &RealTimeDataForm::slotRevCommonData); + + connect(SerialPort::instance(), &SerialPort::sigSendPhaseInfo, + _expertmentSettingForm, &ExperimentSettingForm::slotRecvPhaseInfo); - connect(SerialPort::instance(),&SerialPort::sigSendCommonDataToRealDataForm, - _realTimeDataForm,&RealTimeDataForm::slotRevCommonData); #endif - //mode - connect(Global::instance(),&Global::sigModeModify, - _centralWidget,&CentralWidget::slotModeModify); + // mode + connect(Global::instance(), &Global::sigModeModify, + _centralWidget, &CentralWidget::slotModeModify); } void MainWindow::setActionEnable(const bool flag) { - if(flag){ + if (flag) + { ui->actionNew->setEnabled(true); ui->actionStart->setEnabled(true); ui->actionStop->setEnabled(true); ui->actionRealTimeWidget->setEnabled(true); - }else{ + } + else + { ui->actionNew->setEnabled(false); ui->actionStart->setEnabled(false); ui->actionStop->setEnabled(false); @@ -113,10 +115,15 @@ void MainWindow::on_actionRealTimeWidget_triggered() void MainWindow::on_actionConnectToDev_triggered() { - if(SerialPort::instance()->openSp()){ + if (SerialPort::instance()->openSp()) + { ui->actionNew->setEnabled(true); Global::instance()->setMode(Global::Mode::ConnectedToDev); - }else{ + QThread::msleep(300); + SerialPort::instance()->senddata(DataParser::inquirePhaseInfo()); + } + else + { QMessageBox::warning(this, "warnning", "Serial Port open failed."); } } diff --git a/src/serialport/dataparser.cpp b/src/serialport/dataparser.cpp index 34f4d72..cd3d131 100644 --- a/src/serialport/dataparser.cpp +++ b/src/serialport/dataparser.cpp @@ -6,35 +6,35 @@ #include "defines.h" #include "global.h" - -bool DataParser::commonDataParser(const QByteArray &ba, CommonData &cd) +namespace DataParser { - 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; + { + // 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; } - 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; -} - #if 0 bool DataParser::slotDataParser(const QByteArray &ba) @@ -64,80 +64,78 @@ bool DataParser::slotDataParser(const QByteArray &ba) } #endif -void DataParser::writeData(const QByteArray &) -{ - -} - - -QByteArray DataParser::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) + void writeData(const QByteArray &) { - memcpy(phaseArray + offset, &phase, sizeof(Phase)); - offset += phaseLength; } - // - // int totalDataLength = 0; - char totalData[300] = {}; + QByteArray connectToDevice(const QVector &vtr) + { + const int phaseLength = sizeof(Phase); + const int phaseArrayLength = vtr.size() * phaseLength; + char phaseArray[300] = {}; + int offset = 0; - u16 header = 0x5aa5; - memcpy(totalData, (char *)&header, sizeof(u16)); - // totalDataLength +=2; + for (const Phase &phase : vtr) + { + memcpy(phaseArray + offset, &phase, sizeof(Phase)); + offset += phaseLength; + } - totalData[2] = 1 + 2 + phaseArrayLength + 2; - // totalDataLength++; + // + // int totalDataLength = 0; + char totalData[300] = {}; - totalData[3] = 0x82; - // totalDataLength++; + u16 header = 0x5aa5; + memcpy(totalData, (char *)&header, sizeof(u16)); + // totalDataLength +=2; - u16 address = 0x0050; - memcpy(totalData + 4, (char *)&address, sizeof(u16)); + totalData[2] = 1 + 2 + phaseArrayLength + 2; + // totalDataLength++; - memcpy(totalData + 6, phaseArray, phaseArrayLength); + totalData[3] = 0x82; + // totalDataLength++; - // - char data[300] = {}; + u16 address = 0x0050; + memcpy(totalData + 4, (char *)&address, sizeof(u16)); - data[0] = 0x82; + memcpy(totalData + 6, phaseArray, phaseArrayLength); - // u16 address = 0x0050; - memcpy(data + 1, (char *)&address, sizeof(u16)); + // + char data[300] = {}; - memcpy(data + 3, phaseArray, phaseArrayLength); + data[0] = 0x82; - u16 crc = modbusCRC16((u8 *)data, 3 + phaseArrayLength); - // - memcpy(totalData + 6 + phaseArrayLength, (char *)&crc, sizeof(u16)); + // u16 address = 0x0050; + memcpy(data + 1, (char *)&address, sizeof(u16)); - // + memcpy(data + 3, phaseArray, phaseArrayLength); - return QByteArray(totalData, 6 + phaseArrayLength + 2); -} + u16 crc = modbusCRC16((u8 *)data, 3 + phaseArrayLength); + // + memcpy(totalData + 6 + phaseArrayLength, (char *)&crc, sizeof(u16)); -QByteArray DataParser::setDeviceStartStop(const DeviceStartMode mode) -{ + // + + 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 @@ -166,28 +164,50 @@ QByteArray DataParser::setDeviceStartStop(const DeviceStartMode mode) return QByteArray(data,length); #endif -} + } -unsigned short DataParser::modbusCRC16(unsigned char *data, unsigned short length) -{ - unsigned short crc = 0xFFFF; - unsigned char i; - for (unsigned short j = 0; j < length; j++) + unsigned short modbusCRC16(unsigned char *data, unsigned short length) { - crc ^= (unsigned short)data[j]; - for (i = 0; i < 8; i++) + unsigned short crc = 0xFFFF; + unsigned char i; + for (unsigned short j = 0; j < length; j++) { - if (crc & 0x0001) + crc ^= (unsigned short)data[j]; + for (i = 0; i < 8; i++) { - crc = (crc >> 1) ^ 0xA001; - } - else - { - crc = crc >> 1; + if (crc & 0x0001) + { + 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; + + // + int inquireDataLength = (u8)sizeof(Phase) * 6; + + spp.data_buf[0] = inquireDataLength; + spp.len = 5 + inquireDataLength; + // + int crcDataLength = 3 + inquireDataLength; + u8 *dataPtr = (u8 *)&spp; + u16 crc = modbusCRC16((u8 *)(dataPtr + 3), crcDataLength); + // + int sppValidLength = 6 + inquireDataLength; + return QByteArray((char *)&spp, sppValidLength) + + QByteArray((char *)&crc, 2); + } +}; diff --git a/src/serialport/dataparser.h b/src/serialport/dataparser.h index c39ece8..5b7bc9e 100644 --- a/src/serialport/dataparser.h +++ b/src/serialport/dataparser.h @@ -10,6 +10,7 @@ namespace DataParser { QByteArray connectToDevice(const QVector&); +QByteArray inquirePhaseInfo(); QByteArray setDeviceStartStop(const DeviceStartMode); bool commonDataParser(const QByteArray&ba,CommonData &cd); @@ -18,30 +19,4 @@ void writeData(const QByteArray&); unsigned short modbusCRC16(unsigned char *data,unsigned short length); } -#if 0 -class DataParser -{ -public: - void dataParser(const QByteArray& ba); - - static unsigned short modbusCRC16(unsigned char *data,unsigned short length); - static QByteArray connectToDevice(const QVector&); - static QByteArray setDeviceStartStop(const DeviceStartMode); - - static bool commonDataParser(const QByteArray&ba,CommonData &cd); - bool revDataParser(const QByteArray&ba); -#if 0 -public slots: - void slotDataParser(const QByteArray& ba); -signals: - void sigSendCommonData(const CommonData&); - void sigSendCommonDataToRealDataForm(const CommonData&); -#endif -private: - void writeData(const QByteArray&); - void readData(const QByteArray&); -}; -#endif - - #endif // DATAPARSER_H diff --git a/src/serialport/protocol.h b/src/serialport/protocol.h index b16b096..faa39f0 100644 --- a/src/serialport/protocol.h +++ b/src/serialport/protocol.h @@ -6,87 +6,88 @@ #define FRANE_HEAD 0x5AA5 //枕头 #define WRITE_CMD 0x82 //写指令 #define READ_CMD 0x83 //读指令 +#define PHASE_START_ADDR 0X0050 #pragma pack(push) #pragma pack(1) enum DeviceStartMode{ - Stop, - Start, - StartAutoTune, // 启动升温速率自整定 + Stop, + Start, + StartAutoTune, // 启动升温速率自整定 StopAutoTune // 停止升温速率自整定 }; typedef struct com_protocol { - uint16_t head; - uint8_t len; - uint8_t cmd; - uint16_t addr; - uint8_t data_buf[256]; + uint16_t head; + uint8_t len; + uint8_t cmd; + uint16_t addr; + uint8_t data_buf[256]; }SerialPortProtocol; typedef enum gas_type { - NC, - N2, - O2 + NC, + N2, + O2 }GasType; typedef struct control_data { - uint8_t onoff; - float cutoff_temp; - float temp_flow; - uint16_t constant_temp_time_min; - enum gas_type gas; + uint8_t onoff; + float cutoff_temp; + float temp_flow; + uint16_t constant_temp_time_min; + enum gas_type gas; }Phase; struct pid_data { - float kp; - float ki; - float kd; + float kp; + float ki; + float kd; }; typedef struct com_data { - uint8_t run_type; //0,运行状态 - uint8_t current_phase; //1,当前阶段 - float add_run_time; //2,累计运行时间 - float add_constan_temp_time; //6,当前阶段恒温时间 - double sample_temp; //A,样品温度 - double dsc; //12,热流 - double temp_flow; //1a,升温速率 - float cold_temp; //22,冷端温度 - uint8_t hardware_err; //26,硬件错误 - uint8_t current_gas; //27,当前气氛 - float auto_pid_temp_flow; //28,自整定升温速率 - uint8_t run_mode; //2c,启动模式 - uint8_t reserve_buf[35]; //2d-4f,保留 - struct control_data phase_data[6];//50-97,阶段控制数据 - uint8_t meas_type; //98,测试类型 - uint8_t init_gas; //99, 初始气氛 - struct pid_data temp_flow_pid_low;//9a-a5,升温速率 低pid - struct pid_data temp_flow_pid_high;//a6-B1,升温速率 高pid - float cold_temp_cali_standard; //B2,冷端标准温度 - float cold_temp_cali_meas; //B6,冷端测量温度 - uint8_t cold_cali_flag; //B7,冷端温度计算 - float cold_temp_slope; //B8,冷端温度倍率 - float sample_temp_calilow_standard;//BC,样品标准温度低倍率 - float sample_temp_calilow_meas; //C0,样品测量温度低倍率 - uint8_t sample_temp_cali_low_flag;//C4,样品温度计算低倍率 - float sample_temp_slope_low; //C5,样品温度低倍率低倍率 - float sample_temp_calimid_standard;//C9,样品标准温度中倍率 - float sample_temp_calimid_meas; //CD,样品测量温度中倍率 - uint8_t sample_temp_cali_mid_flag;//D1,样品温度计算中倍率 - float sample_temp_slope_middle; //D2,样品温度中倍率 - float sample_temp_calihigh_standard;//D6,样品标准温度高倍率 - float sample_temp_calihigh_meas; //样品测量温度高倍率 - uint8_t sample_temp_cali_high_flag; //样品温度计算高倍率 - float sample_temp_slope_high; //样品温度高倍率 - float enthalpy_equation_a; //热焓方程式系数a - float enthalpy_equation_b; //热焓方程式系数b - float enthalpy_equation_c; //热焓方程式系数c + uint8_t run_type; //0,运行状态 + uint8_t current_phase; //1,当前阶段 + float add_run_time; //2,累计运行时间 + float add_constan_temp_time; //6,当前阶段恒温时间 + double sample_temp; //A,样品温度 + double dsc; //12,热流 + double temp_flow; //1a,升温速率 + float cold_temp; //22,冷端温度 + uint8_t hardware_err; //26,硬件错误 + uint8_t current_gas; //27,当前气氛 + float auto_pid_temp_flow; //28,自整定升温速率 + uint8_t run_mode; //2c,启动模式 + uint8_t reserve_buf[35]; //2d-4f,保留 + struct control_data phase_data[6];//50-97,阶段控制数据 + uint8_t meas_type; //98,测试类型 + uint8_t init_gas; //99, 初始气氛 + struct pid_data temp_flow_pid_low;//9a-a5,升温速率 低pid + struct pid_data temp_flow_pid_high;//a6-B1,升温速率 高pid + float cold_temp_cali_standard; //B2,冷端标准温度 + float cold_temp_cali_meas; //B6,冷端测量温度 + uint8_t cold_cali_flag; //B7,冷端温度计算 + float cold_temp_slope; //B8,冷端温度倍率 + float sample_temp_calilow_standard;//BC,样品标准温度低倍率 + float sample_temp_calilow_meas; //C0,样品测量温度低倍率 + uint8_t sample_temp_cali_low_flag;//C4,样品温度计算低倍率 + float sample_temp_slope_low; //C5,样品温度低倍率低倍率 + float sample_temp_calimid_standard;//C9,样品标准温度中倍率 + float sample_temp_calimid_meas; //CD,样品测量温度中倍率 + uint8_t sample_temp_cali_mid_flag;//D1,样品温度计算中倍率 + float sample_temp_slope_middle; //D2,样品温度中倍率 + float sample_temp_calihigh_standard;//D6,样品标准温度高倍率 + float sample_temp_calihigh_meas; //样品测量温度高倍率 + uint8_t sample_temp_cali_high_flag; //样品温度计算高倍率 + float sample_temp_slope_high; //样品温度高倍率 + float enthalpy_equation_a; //热焓方程式系数a + float enthalpy_equation_b; //热焓方程式系数b + float enthalpy_equation_c; //热焓方程式系数c } CommonData; #pragma pack(pop) @@ -94,7 +95,7 @@ typedef struct com_data #if 0 struct com_device { - struct temp_control* temp; + struct temp_control* temp; }; struct com_data* com_data_get(void); void com_protocol_init(struct com_device* dev); diff --git a/src/serialport/serialport.cpp b/src/serialport/serialport.cpp index ce41e92..2df4000 100644 --- a/src/serialport/serialport.cpp +++ b/src/serialport/serialport.cpp @@ -121,11 +121,20 @@ void SerialPort::slotReadData() } else { - if (Global::Mode::ExperimentStart == Global::instance()->getMode()) + // read data + if (spp->addr == 0) { - emit sigSendCommonData(cd); + + if (Global::Mode::ExperimentStart == Global::instance()->getMode()) + { + emit sigSendCommonData(cd); + } + emit sigSendCommonDataToRealDataForm(cd); + } + else if(spp->addr == PHASE_START_ADDR) + { + emit sigSendPhaseInfo(ba); } - emit sigSendCommonDataToRealDataForm(cd); } #endif } @@ -137,14 +146,15 @@ void SerialPort::writeCmdHandle(const int dataLength, const u16 addr, int localAddr = addr; int phaseByteSize = sizeof(Phase); - auto phaseParserFunc = [&](const int index){ + auto phaseParserFunc = [&](const int index) + { Phase phase; phase.onoff = 1; - phase.gas = cd.phase_data[index].gas; + phase.gas = cd.phase_data[index].gas; phase.temp_flow = cd.phase_data[index].temp_flow; - phase.cutoff_temp = cd.phase_data[index].cutoff_temp; + phase.cutoff_temp = cd.phase_data[index].cutoff_temp; phase.constant_temp_time_min = - cd.phase_data[index].constant_temp_time_min; + cd.phase_data[index].constant_temp_time_min; localLength -= phaseByteSize; localAddr += phaseByteSize; @@ -154,12 +164,12 @@ void SerialPort::writeCmdHandle(const int dataLength, const u16 addr, { switch (localAddr) { - case offsetof(CommonData, current_gas): //当前气氛 + case offsetof(CommonData, current_gas): // 当前气氛 // gas_type_set(dev->temp, msg_data.current_gas); localAddr += 1; localLength -= 1; break; - case offsetof(CommonData, auto_pid_temp_flow): //自整定升温速率 + case offsetof(CommonData, auto_pid_temp_flow): // 自整定升温速率 localAddr += 4; localLength -= 4; break; @@ -185,18 +195,25 @@ void SerialPort::writeCmdHandle(const int dataLength, const u16 addr, break; } case offsetof(CommonData, phase_data[0].onoff): - phaseParserFunc(0); break; + phaseParserFunc(0); + break; case offsetof(CommonData, phase_data[1].onoff): - phaseParserFunc(1); break; + phaseParserFunc(1); + break; case offsetof(CommonData, phase_data[2].onoff): - phaseParserFunc(2); break; + phaseParserFunc(2); + break; case offsetof(CommonData, phase_data[3].onoff): - phaseParserFunc(3); break; + phaseParserFunc(3); + break; case offsetof(CommonData, phase_data[4].onoff): - phaseParserFunc(4); break; + phaseParserFunc(4); + break; case offsetof(CommonData, phase_data[5].onoff): - phaseParserFunc(5); break; - default:break; + phaseParserFunc(5); + break; + default: + break; }; } } @@ -407,7 +424,8 @@ void SerialPort::slotSendData(const QByteArray &ba) * 写入的数据有 * 1、阶段设置。 */ - if(WRITE_CMD == ba.at(3)){ + if (WRITE_CMD == ba.at(3)) + { _lastWriteBa = ba; } qDebug() << "slotSendData:" << ba.size(); @@ -419,7 +437,6 @@ void SerialPort::slotSendData(const QByteArray &ba) else { qDebug() << "sp not open."; - // qErrnoWarning("sp not open."); return; } } diff --git a/src/serialport/serialport.h b/src/serialport/serialport.h index 9d06c4e..4ac6812 100644 --- a/src/serialport/serialport.h +++ b/src/serialport/serialport.h @@ -8,11 +8,12 @@ #include "defines.h" #include "protocol.h" -class SerialPort:public QObject +class SerialPort : public QObject { Q_OBJECT public: - enum E_CMD_TYPE{ + enum E_CMD_TYPE + { e_zero, e_forward, e_back @@ -21,27 +22,35 @@ public: static SerialPort *instance(); ~SerialPort(); + void sendData(const QByteArray &data) + { + slotSendData(data); + } void sendCmd(const E_CMD_TYPE e); static void parserTest(); bool openSp(); -public slots: - void slotDeliverData(const QByteArray&); -// void slotConnectToDevice(const QByteArray&); - void slotSendData(const QByteArray&); - void slotCloseSp(); -signals: - void sigSendCommonData(const CommonData&); - void sigSendCommonDataToRealDataForm(const CommonData&); + protected: void timerEvent(QTimerEvent *event); +signals: + void sigSendCommonData(const CommonData &); + void sigSendCommonDataToRealDataForm(const CommonData &); + void sigSendPhaseInfo(const QByteArray &); +public slots: + void slotDeliverData(const QByteArray &); + // void slotConnectToDevice(const QByteArray&); + void slotSendData(const QByteArray &); + void slotCloseSp(); private slots: void slotReadData(); + private: - void writeCmdHandle(const int dataLength,const u16 addr,const CommonData&cd); - void to_hex(char* in_char, int char_length, char* out_char); + void writeCmdHandle(const int dataLength, const u16 addr, const CommonData &cd); + void to_hex(char *in_char, int char_length, char *out_char); void displayPortInfo(); + private: - SerialPort(QObject* parent=nullptr); + SerialPort(QObject *parent = nullptr); QSerialPort *_sp; QByteArray _lastWriteBa; }; diff --git a/src/src/main.cpp b/src/src/main.cpp deleted file mode 100644 index 10481e3..0000000 --- a/src/src/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "qt_new_proj.h" - -#include -#pragma comment(lib, "user32.lib") - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - qt_new_proj w; - w.show(); - return a.exec(); -} \ No newline at end of file diff --git a/src/src/qt_new_proj.cpp b/src/src/qt_new_proj.cpp deleted file mode 100644 index dc33ef8..0000000 --- a/src/src/qt_new_proj.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "qt_new_proj.h" - -qt_new_proj::qt_new_proj(QWidget* parent) - : QMainWindow(parent) - , ui(new Ui_qt_new_proj) -{ - ui->setupUi(this); -} - -qt_new_proj::~qt_new_proj() -{ - delete ui; -} \ No newline at end of file diff --git a/src/src/qt_new_proj.h b/src/src/qt_new_proj.h deleted file mode 100644 index 9b7e3de..0000000 --- a/src/src/qt_new_proj.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once -#include "ui_qt_new_proj.h" -#include - -class qt_new_proj : public QMainWindow { - Q_OBJECT - -public: - qt_new_proj(QWidget* parent = nullptr); - ~qt_new_proj(); - -private: - Ui_qt_new_proj* ui; -}; \ No newline at end of file diff --git a/src/src/qt_new_proj.ui b/src/src/qt_new_proj.ui deleted file mode 100644 index ef76f54..0000000 --- a/src/src/qt_new_proj.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - qt_new_proj - - - - 0 - 0 - 800 - 600 - - - - qt_new_proj - - - - - - - - \ No newline at end of file diff --git a/src/ui/experimentsettingform.cpp b/src/ui/experimentsettingform.cpp index bdaba9b..2e4bdba 100644 --- a/src/ui/experimentsettingform.cpp +++ b/src/ui/experimentsettingform.cpp @@ -8,24 +8,27 @@ #include "global.h" #include "filemanager.h" -ExperimentSettingForm::ExperimentSettingForm(QWidget *parent) : - QWidget(parent), - ui(new Ui::ExperimentSettingForm) +ExperimentSettingForm::ExperimentSettingForm(QWidget *parent) : QWidget(parent), + ui(new Ui::ExperimentSettingForm) { ui->setupUi(this); uiReset(); - connect(ui->checkBox_phase_2,&QCheckBox::clicked, - this,&ExperimentSettingForm::slotPhase2StateChanged); - connect(ui->checkBox_phase_3,&QCheckBox::clicked, - this,&ExperimentSettingForm::slotPhase3StateChanged); - connect(ui->checkBox_phase_4,&QCheckBox::clicked, - this,&ExperimentSettingForm::slotPhase4StateChanged); + connect(ui->checkBox_phase_2, &QCheckBox::clicked, + this, &ExperimentSettingForm::slotPhase2StateChanged); + connect(ui->checkBox_phase_3, &QCheckBox::clicked, + this, &ExperimentSettingForm::slotPhase3StateChanged); + connect(ui->checkBox_phase_4, &QCheckBox::clicked, + this, &ExperimentSettingForm::slotPhase4StateChanged); + connect(ui->checkBox_phase_5, &QCheckBox::clicked, + this, &ExperimentSettingForm::slotPhase5StateChanged); + connect(ui->checkBox_phase_6, &QCheckBox::clicked, + this, &ExperimentSettingForm::slotPhase6StateChanged); // connect(ui->pushButton_connect_to_device,&QPushButton::clicked, // this,&ExperimentSettingForm::slotConnectToDevice); - connect(ui->pushButton_cancel,&QPushButton::clicked, - this,&ExperimentSettingForm::slotCancel); + connect(ui->pushButton_cancel, &QPushButton::clicked, + this, &ExperimentSettingForm::slotCancel); } ExperimentSettingForm::~ExperimentSettingForm() @@ -35,7 +38,7 @@ ExperimentSettingForm::~ExperimentSettingForm() void ExperimentSettingForm::uiReset() { - //init data and status. + // init data and status. ui->checkBox_phase_1->setChecked(true); ui->checkBox_phase_1->setEnabled(false); @@ -43,52 +46,89 @@ void ExperimentSettingForm::uiReset() ui->phase_2_cutoff_temp->setText("0"); ui->phase_3_cutoff_temp->setText("0"); ui->phase_4_cutoff_temp->setText("0"); + ui->phase_5_cutoff_temp->setText("0"); + ui->phase_6_cutoff_temp->setText("0"); ui->phase_1_scan_rate->setText("0"); ui->phase_2_scan_rate->setText("0"); ui->phase_3_scan_rate->setText("0"); ui->phase_4_scan_rate->setText("0"); + ui->phase_5_scan_rate->setText("0"); + ui->phase_6_scan_rate->setText("0"); ui->phase_1_constant_temp->setText("0"); ui->phase_2_constant_temp->setText("0"); ui->phase_3_constant_temp->setText("0"); ui->phase_4_constant_temp->setText("0"); + ui->phase_5_constant_temp->setText("0"); + ui->phase_6_constant_temp->setText("0"); ui->phase_2_cutoff_temp->setEnabled(false); ui->phase_3_cutoff_temp->setEnabled(false); ui->phase_4_cutoff_temp->setEnabled(false); + ui->phase_5_cutoff_temp->setEnabled(false); + ui->phase_6_cutoff_temp->setEnabled(false); ui->phase_2_scan_rate->setEnabled(false); ui->phase_3_scan_rate->setEnabled(false); ui->phase_4_scan_rate->setEnabled(false); + ui->phase_5_scan_rate->setEnabled(false); + ui->phase_6_scan_rate->setEnabled(false); ui->phase_2_constant_temp->setEnabled(false); ui->phase_3_constant_temp->setEnabled(false); ui->phase_4_constant_temp->setEnabled(false); + ui->phase_5_constant_temp->setEnabled(false); + ui->phase_6_constant_temp->setEnabled(false); ui->comboBox_phase_2_atmosphere->setEnabled(false); ui->comboBox_phase_3_atmosphere->setEnabled(false); ui->comboBox_phase_4_atmosphere->setEnabled(false); + ui->comboBox_phase_5_atmosphere->setEnabled(false); + ui->comboBox_phase_6_atmosphere->setEnabled(false); ui->radioButton_OIT_not->setChecked(true); ui->checkBox_phase_2->setTristate(false); ui->checkBox_phase_3->setTristate(false); ui->checkBox_phase_4->setTristate(false); + ui->checkBox_phase_5->setTristate(false); + ui->checkBox_phase_6->setTristate(false); +} +void ExperimentSettingForm::uiUpdatePhase(QVector &vtr) +{ + for(int i = 0; i< vtr.size(); i++){ + const Phase &phase = vtr[i]; + if(phase.onoff == 0){ + return; + } + + QString checkBoxName = QString("checkBox_phase_%1").arg(i); + QCheckBox *checkBox = ui->findChild(checkBoxName); + if (checkBox) { + checkBox->setTristate(false); + } + } } void ExperimentSettingForm::slotPhase2StateChanged(int state) { - qDebug()<<"slotPhase2StateChanged:"<phase_2_cutoff_temp->setEnabled(true); ui->phase_2_scan_rate->setEnabled(true); ui->phase_2_constant_temp->setEnabled(true); ui->comboBox_phase_2_atmosphere->setEnabled(true); - }else{ - if(ui->checkBox_phase_3->isChecked()){ + } + else + { + if (ui->checkBox_phase_3->isChecked()) + { ui->checkBox_phase_2->setCheckState(Qt::Checked); - }else { + } + else + { ui->phase_2_cutoff_temp->setEnabled(false); ui->phase_2_scan_rate->setEnabled(false); ui->phase_2_constant_temp->setEnabled(false); @@ -99,19 +139,28 @@ void ExperimentSettingForm::slotPhase2StateChanged(int state) void ExperimentSettingForm::slotPhase3StateChanged(int state) { - if(state == Qt::PartiallyChecked){ - if(ui->checkBox_phase_2->isChecked()){ + if (state == Qt::PartiallyChecked) + { + if (ui->checkBox_phase_2->isChecked()) + { ui->phase_3_cutoff_temp->setEnabled(true); ui->phase_3_scan_rate->setEnabled(true); ui->phase_3_constant_temp->setEnabled(true); ui->comboBox_phase_3_atmosphere->setEnabled(true); - }else{ + } + else + { ui->checkBox_phase_3->setChecked(false); } - }else{ - if(ui->checkBox_phase_4->isChecked()){ + } + else + { + if (ui->checkBox_phase_4->isChecked()) + { ui->checkBox_phase_3->setChecked(true); - }else{ + } + else + { ui->phase_3_cutoff_temp->setEnabled(false); ui->phase_3_scan_rate->setEnabled(false); ui->phase_3_constant_temp->setEnabled(false); @@ -122,16 +171,22 @@ void ExperimentSettingForm::slotPhase3StateChanged(int state) void ExperimentSettingForm::slotPhase4StateChanged(int state) { - if(state == Qt::PartiallyChecked){ - if(ui->checkBox_phase_3->isChecked()){ + if (state == Qt::PartiallyChecked) + { + if (ui->checkBox_phase_3->isChecked()) + { ui->phase_4_cutoff_temp->setEnabled(true); ui->phase_4_scan_rate->setEnabled(true); ui->phase_4_constant_temp->setEnabled(true); ui->comboBox_phase_4_atmosphere->setEnabled(true); - }else{ + } + else + { ui->checkBox_phase_4->setChecked(false); } - }else{ + } + else + { ui->phase_4_cutoff_temp->setEnabled(false); ui->phase_4_scan_rate->setEnabled(false); ui->phase_4_constant_temp->setEnabled(false); @@ -139,10 +194,61 @@ void ExperimentSettingForm::slotPhase4StateChanged(int state) } } +void ExperimentSettingForm::slotPhase5StateChanged(int state) +{ + if (state == Qt::PartiallyChecked) + { + if (ui->checkBox_phase_4->isChecked()) + { + ui->phase_5_cutoff_temp->setEnabled(true); + ui->phase_5_scan_rate->setEnabled(true); + ui->phase_5_constant_temp->setEnabled(true); + ui->comboBox_phase_5_atmosphere->setEnabled(true); + } + else + { + ui->checkBox_phase_5->setChecked(false); + } + } + else + { + ui->phase_5_cutoff_temp->setEnabled(false); + ui->phase_5_scan_rate->setEnabled(false); + ui->phase_5_constant_temp->setEnabled(false); + ui->comboBox_phase_5_atmosphere->setEnabled(false); + } +} + +void ExperimentSettingForm::slotPhase6StateChanged(int state) +{ + if (state == Qt::PartiallyChecked) + { + if (ui->checkBox_phase_5->isChecked()) + { + ui->phase_6_cutoff_temp->setEnabled(true); + ui->phase_6_scan_rate->setEnabled(true); + ui->phase_6_constant_temp->setEnabled(true); + ui->comboBox_phase_6_atmosphere->setEnabled(true); + } + else + { + ui->checkBox_phase_6->setChecked(false); + } + } + else + { + ui->phase_6_cutoff_temp->setEnabled(false); + ui->phase_6_scan_rate->setEnabled(false); + ui->phase_6_constant_temp->setEnabled(false); + ui->comboBox_phase_6_atmosphere->setEnabled(false); + } +} + void ExperimentSettingForm::slotConnectToDevice() { QVector phaseVtr; - if(ui->checkBox_phase_1->checkState()){ + if (ui->checkBox_phase_1->checkState()) + { Phase phase; phase.onoff = 1; phase.cutoff_temp = ui->phase_1_cutoff_temp->text().toFloat(); @@ -153,7 +259,8 @@ void ExperimentSettingForm::slotConnectToDevice() phaseVtr.push_back(phase); } - if(ui->checkBox_phase_2->checkState()){ + if (ui->checkBox_phase_2->checkState()) + { Phase phase; phase.onoff = 1; phase.cutoff_temp = ui->phase_2_cutoff_temp->text().toFloat(); @@ -166,7 +273,7 @@ void ExperimentSettingForm::slotConnectToDevice() } QByteArray ba = DataParser::connectToDevice(phaseVtr); - qDebug()<<"ba size:"<setMode(Global::Mode::ConnectedToDev); @@ -185,37 +292,51 @@ void ExperimentSettingForm::slotCancel() } void ExperimentSettingForm::slotPhaseCheck() { - if(sender() == ui->checkBox_phase_2){ - if(ui->checkBox_phase_2->isChecked()){ + if (sender() == ui->checkBox_phase_2) + { + if (ui->checkBox_phase_2->isChecked()) + { ui->phase_2_cutoff_temp->setEnabled(true); ui->phase_2_scan_rate->setEnabled(true); ui->phase_2_constant_temp->setEnabled(true); ui->comboBox_phase_2_atmosphere->setEnabled(true); - }else{ + } + else + { ui->phase_2_cutoff_temp->setEnabled(false); ui->phase_2_scan_rate->setEnabled(false); ui->phase_2_constant_temp->setEnabled(false); ui->comboBox_phase_2_atmosphere->setEnabled(false); } - }else if(sender() == ui->checkBox_phase_3){ - if(ui->checkBox_phase_3->isChecked()){ + } + else if (sender() == ui->checkBox_phase_3) + { + if (ui->checkBox_phase_3->isChecked()) + { ui->phase_3_cutoff_temp->setEnabled(true); ui->phase_3_scan_rate->setEnabled(true); ui->phase_3_constant_temp->setEnabled(true); ui->comboBox_phase_3_atmosphere->setEnabled(true); - }else{ + } + else + { ui->phase_3_cutoff_temp->setEnabled(false); ui->phase_3_scan_rate->setEnabled(false); ui->phase_3_constant_temp->setEnabled(false); ui->comboBox_phase_3_atmosphere->setEnabled(false); } - }else if(sender() == ui->checkBox_phase_4){ - if(ui->checkBox_phase_4->isChecked()){ + } + else if (sender() == ui->checkBox_phase_4) + { + if (ui->checkBox_phase_4->isChecked()) + { ui->phase_4_cutoff_temp->setEnabled(true); ui->phase_4_scan_rate->setEnabled(true); ui->phase_4_constant_temp->setEnabled(true); ui->comboBox_phase_4_atmosphere->setEnabled(true); - }else{ + } + else + { ui->phase_4_cutoff_temp->setEnabled(false); ui->phase_4_scan_rate->setEnabled(false); ui->phase_4_constant_temp->setEnabled(false); @@ -228,8 +349,23 @@ void ExperimentSettingForm::on_pushButton_deliverData_clicked() { slotConnectToDevice(); - FileManager::_expeInfo.sampleName= ui->sampleNameLineEdit->text(); - FileManager::_expeInfo.sampleWeight = ui->sampleWeightLineEdit->text().toInt(nullptr,16); + FileManager::_expeInfo.sampleName = ui->sampleNameLineEdit->text(); + FileManager::_expeInfo.sampleWeight = ui->sampleWeightLineEdit->text().toInt(nullptr, 16); FileManager::_expeInfo.date = ui->dateTimeLineEdit->text(); - FileManager::_expeInfo.userName = ui->userLineEdit->text(); + FileManager::_expeInfo.userName = ui->userLineEdit->text(); +} + +void ExperimentSettingForm::slotRecvPhaseInfo(const QByteArray &ba) +{ + QByteArray localba = ba; + SerialPortProtocol *spp = localba.data(); + + u8 *data = spp->data_buf; + + vector phaseVtr; + for (int i = 0; i < 6; i++) + { + Phase *phase = (Phase *)(data + i * sizeof(Phase)); + phaseVtr.push_back(*phase); + } } diff --git a/src/ui/experimentsettingform.h b/src/ui/experimentsettingform.h index ca0bf26..2b9396c 100644 --- a/src/ui/experimentsettingform.h +++ b/src/ui/experimentsettingform.h @@ -2,8 +2,12 @@ #define EXPERIMENTSETTINGFORM_H #include +#include -namespace Ui { +#include "protocol.h" + +namespace Ui +{ class ExperimentSettingForm; } @@ -15,22 +19,28 @@ public: explicit ExperimentSettingForm(QWidget *parent = nullptr); ~ExperimentSettingForm(); - signals: - void sigDeliverData(const QByteArray&); + void sigDeliverData(const QByteArray &); +public slots: + void slotRecvPhaseInfo(const QByteArray &); private slots: void on_pushButton_deliverData_clicked(); private: + //ui void uiReset(); - //slot + void uiUpdatePhase(QVector &); + // slot void slotPhaseCheck(); void slotPhase2StateChanged(int state); void slotPhase3StateChanged(int state); void slotPhase4StateChanged(int state); + void slotPhase5StateChanged(int state); + void slotPhase6StateChanged(int state); void slotConnectToDevice(); void slotCancel(); + private: Ui::ExperimentSettingForm *ui; }; diff --git a/src/ui/experimentsettingform.ui b/src/ui/experimentsettingform.ui index 8237f08..140ac35 100644 --- a/src/ui/experimentsettingform.ui +++ b/src/ui/experimentsettingform.ui @@ -7,7 +7,7 @@ 0 0 851 - 338 + 356 @@ -19,7 +19,7 @@ 10 10 821 - 271 + 291 @@ -93,263 +93,14 @@ 10 40 491 - 211 + 238 - + QLayout::SetDefaultConstraint - - - - - 0 - 0 - - - - 阶段 - - - Qt::AlignCenter - - - - - - - - 100 - 0 - - - - - - - - 截止温度 - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - 气氛 - - - Qt::AlignCenter - - - - - - - 恒温时间 - - - Qt::AlignCenter - - - - - - - 扫描速率 - - - Qt::AlignCenter - - - - - - - 测试类型: - - - - - - - - 100 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - 100 - 0 - - - - - - - - - 100 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - OIT - - - - - - - 非OIT - - - - - - - - 0 - 0 - - - - 1 - - - - - - - - 0 - 0 - - - - 2 - - - - - - - - 0 - 0 - - - - 3 - - - - - - - - 0 - 0 - - - - 4 - - - - + @@ -368,42 +119,37 @@ - - - - - NC - - - - - N2 - - - - - O2 - - + + + + + 0 + 0 + + - - - - - NC - - - - - N2 - - - - - O2 - - + + + + + 0 + 0 + + + + 2 + + + + + + + + 0 + 0 + + @@ -425,6 +171,82 @@ + + + + + 0 + 0 + + + + 4 + + + + + + + 初始气氛: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 100 + 0 + + + + + + + + + 100 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + 3 + + + + + + + 截止温度 + + + Qt::AlignCenter + + + @@ -444,13 +266,315 @@ - - + + + + + 0 + 0 + + - 初始气氛: + 阶段 - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignCenter + + + + + + + + 100 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + NC + + + + + N2 + + + + + O2 + + + + + + + + 气氛 + + + Qt::AlignCenter + + + + + + + 非OIT + + + + + + + + NC + + + + + N2 + + + + + O2 + + + + + + + + + 0 + 0 + + + + 5 + + + + + + + OIT + + + + + + + + 0 + 0 + + + + + + + + 测试类型: + + + + + + + + 100 + 0 + + + + + + + + + 0 + 0 + + + + 1 + + + + + + + + 100 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 100 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 100 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 100 + 0 + + + + + + + + 恒温时间 + + + Qt::AlignCenter + + + + + + + + NC + + + + + N2 + + + + + O2 + + + + + + + + + 0 + 0 + + + + 6 + + + + + + + + 100 + 0 + + + + + + + + 扫描速率 + + + Qt::AlignCenter + + + + + + + + NC + + + + + N2 + + + + + O2 + + + + + + + + + 100 + 0 + @@ -463,8 +587,8 @@ - 471 - 300 + 470 + 320 80 20 @@ -476,8 +600,8 @@ - 580 - 300 + 579 + 320 81 20