2025-04-24T16:41:19
This commit is contained in:
parent
834751d2a8
commit
71c308ac2d
BIN
AnalysisTool-release/AnalysisTool.exe - Shortcut.lnk
Normal file
BIN
AnalysisTool-release/AnalysisTool.exe - Shortcut.lnk
Normal file
Binary file not shown.
BIN
AnalysisTool-release/bin/AnalysisTool.exe
Normal file
BIN
AnalysisTool-release/bin/AnalysisTool.exe
Normal file
Binary file not shown.
3
AnalysisTool-release/bin/config.json
Normal file
3
AnalysisTool-release/bin/config.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"InstrumentCoefficient": 1
|
||||||
|
}
|
||||||
11
AnalysisTool-release/bin/log.conf
Normal file
11
AnalysisTool-release/bin/log.conf
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
*GLOBAL:
|
||||||
|
ENABLED = true
|
||||||
|
TO_FILE = true
|
||||||
|
TO_STANDARD_OUTPUT = true
|
||||||
|
FORMAT = "[%datetime] %msg"
|
||||||
|
FILENAME = "log-sdk/%datetime{%Y%M%d}.log"
|
||||||
|
MILLISECONDS_WIDTH = 3
|
||||||
|
PERFORMANCE_TRACKING = false
|
||||||
|
MAX_LOG_FILE_SIZE = 104857600
|
||||||
|
LOG_FLUSH_THRESHOLD = 0
|
||||||
|
|
||||||
40492
AnalysisTool-release/bin/myeasylog.log
Normal file
40492
AnalysisTool-release/bin/myeasylog.log
Normal file
File diff suppressed because it is too large
Load Diff
1256
AnalysisTool-release/experiment_data/analysis_state/1-基线new 2.txt
Normal file
1256
AnalysisTool-release/experiment_data/analysis_state/1-基线new 2.txt
Normal file
File diff suppressed because it is too large
Load Diff
1264
AnalysisTool-release/experiment_data/analysis_state/1-标样new 2.txt
Normal file
1264
AnalysisTool-release/experiment_data/analysis_state/1-标样new 2.txt
Normal file
File diff suppressed because it is too large
Load Diff
1264
AnalysisTool-release/experiment_data/analysis_state/1-样品new 2.txt
Normal file
1264
AnalysisTool-release/experiment_data/analysis_state/1-样品new 2.txt
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1870
AnalysisTool-release/experiment_data/analysis_state/abs-new 2.txt
Normal file
1870
AnalysisTool-release/experiment_data/analysis_state/abs-new 2.txt
Normal file
File diff suppressed because it is too large
Load Diff
12704
AnalysisTool-release/experiment_data/analysis_state/ceshii-new 1.txt
Normal file
12704
AnalysisTool-release/experiment_data/analysis_state/ceshii-new 1.txt
Normal file
File diff suppressed because it is too large
Load Diff
6115
AnalysisTool-release/experiment_data/analysis_state/new 4.txt
Normal file
6115
AnalysisTool-release/experiment_data/analysis_state/new 4.txt
Normal file
File diff suppressed because it is too large
Load Diff
BIN
AnalysisTool-release/experiment_data/analysis_state/peak.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/analysis_state/peak.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/analysis_state/sample.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/analysis_state/sample.xlsx
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
AnalysisTool-release/experiment_data/analysis_state/基线.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/analysis_state/基线.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/analysis_state/标样.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/analysis_state/标样.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/analysis_state/样品.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/analysis_state/样品.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/analysis_state/玻璃化转变.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/analysis_state/玻璃化转变.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/1.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/1.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/1111new.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/1111new.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/22new.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/22new.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/23-1new.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/23-1new.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/24-new.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/24-new.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/333new.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/333new.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/new.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/new.xlsx
Normal file
Binary file not shown.
BIN
AnalysisTool-release/experiment_data/sample_data/锡.xlsx
Normal file
BIN
AnalysisTool-release/experiment_data/sample_data/锡.xlsx
Normal file
Binary file not shown.
Binary file not shown.
@ -1,37 +0,0 @@
|
|||||||
2025-04-15 16:25:15,306 DEBUG [default] main...
|
|
||||||
2025-04-15 16:25:15,558 DEBUG [default] setEventHandlerEnable...0
|
|
||||||
2025-04-15 16:25:15,558 DEBUG [default] xMax:5
|
|
||||||
2025-04-15 16:25:19,903 DEBUG [default] peakPoint:186.879,2.2
|
|
||||||
2025-04-15 16:25:20,731 DEBUG [default] peakPoint:33.156,-2.366
|
|
||||||
2025-04-15 16:25:21,296 DEBUG [default] peakPoint:136.386,-3.03
|
|
||||||
2025-04-15 17:09:54,935 DEBUG [default] main...
|
|
||||||
2025-04-15 17:09:54,952 DEBUG [default] setEventHandlerEnable...0
|
|
||||||
2025-04-15 17:09:54,953 DEBUG [default] xMax:5
|
|
||||||
2025-04-15 17:10:04,848 DEBUG [default] peakPoint:186.879,2.2
|
|
||||||
2025-04-15 17:10:05,521 DEBUG [default] peakPoint:33.156,-2.366
|
|
||||||
2025-04-15 17:10:06,448 DEBUG [default] peakPoint:136.386,-3.03
|
|
||||||
2025-04-15 17:10:09,876 DEBUG [default] context menu...
|
|
||||||
2025-04-15 17:10:09,876 DEBUG [default] selected...
|
|
||||||
2025-04-15 17:10:11,336 DEBUG [default] slotBaseLine...
|
|
||||||
2025-04-15 17:10:11,342 DEBUG [default] index:0
|
|
||||||
2025-04-15 17:10:12,838 DEBUG [default] context menu...
|
|
||||||
2025-04-15 17:10:12,838 DEBUG [default] selected...
|
|
||||||
2025-04-15 17:10:14,440 DEBUG [default] index:1
|
|
||||||
2025-04-15 17:10:15,719 DEBUG [default] context menu...
|
|
||||||
2025-04-15 17:10:15,719 DEBUG [default] selected...
|
|
||||||
2025-04-15 17:10:17,216 DEBUG [default] index:2
|
|
||||||
2025-04-15 17:10:25,154 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:28,909 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:30,014 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:33,063 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:33,241 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:33,424 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:33,595 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:33,782 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:33,952 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:45,031 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:45,194 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:10:45,371 DEBUG [default] Base,standard,sample not selected.
|
|
||||||
2025-04-15 17:25:42,781 DEBUG [default] main...
|
|
||||||
2025-04-15 17:25:42,794 DEBUG [default] setEventHandlerEnable...0
|
|
||||||
2025-04-15 17:25:42,794 DEBUG [default] xMax:5
|
|
||||||
BIN
experiment_data/sample_data/锡.xlsx
Normal file
BIN
experiment_data/sample_data/锡.xlsx
Normal file
Binary file not shown.
@ -1,113 +1,113 @@
|
|||||||
QT += core gui serialport printsupport
|
QT += core gui serialport printsupport
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
CONFIG+=precompile_header
|
CONFIG+=precompile_header
|
||||||
PRECOMPILED_HEADER=stable.h
|
PRECOMPILED_HEADER=stable.h
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
# The following define makes your compiler emit warnings if you use
|
||||||
# any Qt feature that has been marked deprecated (the exact warnings
|
# any Qt feature that has been marked deprecated (the exact warnings
|
||||||
# depend on your compiler). Please consult the documentation of the
|
# depend on your compiler). Please consult the documentation of the
|
||||||
# deprecated API in order to know how to port your code away from it.
|
# deprecated API in order to know how to port your code away from it.
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
|
||||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||||
# In order to do so, uncomment the following line.
|
# In order to do so, uncomment the following line.
|
||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
include(thirdparty\QtXlsxWriter-0.3.0\src\xlsx\qtxlsx.pri)
|
include(thirdparty\QtXlsxWriter-0.3.0\src\xlsx\qtxlsx.pri)
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
data/confighandler.cpp \
|
data/confighandler.cpp \
|
||||||
data/filemanager.cpp \
|
data/filemanager.cpp \
|
||||||
data/pointcalculate.cpp \
|
data/pointcalculate.cpp \
|
||||||
data/txthandler.cpp \
|
data/txthandler.cpp \
|
||||||
global.cpp \
|
global.cpp \
|
||||||
logger/logger.cpp \
|
logger/logger.cpp \
|
||||||
ui/aboutform.cpp \
|
ui/aboutform.cpp \
|
||||||
ui/coefficientselectionform.cpp \
|
ui/coefficientselectionform.cpp \
|
||||||
ui/enthalpydatacorrectionform.cpp \
|
ui/enthalpydatacorrectionform.cpp \
|
||||||
ui/rightwidget.cpp \
|
ui/rightwidget.cpp \
|
||||||
thirdparty/easylogging/easylogging++.cc \
|
thirdparty/easylogging/easylogging++.cc \
|
||||||
ui/analysissettingform.cpp \
|
ui/analysissettingform.cpp \
|
||||||
ui/centralwidget.cpp \
|
ui/centralwidget.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
serialport/dataparser.cpp \
|
serialport/dataparser.cpp \
|
||||||
serialport/serialport.cpp \
|
serialport/serialport.cpp \
|
||||||
thirdparty/qcustomplot/qcustomplot.cpp \
|
thirdparty/qcustomplot/qcustomplot.cpp \
|
||||||
ui/degreeofcrystallinityform.cpp \
|
ui/degreeofcrystallinityform.cpp \
|
||||||
ui/degreeofcureform.cpp \
|
ui/degreeofcureform.cpp \
|
||||||
ui/eventhandler.cpp \
|
ui/eventhandler.cpp \
|
||||||
ui/experimentsettingform.cpp \
|
ui/experimentsettingform.cpp \
|
||||||
ui/instrumentcoefficientform.cpp \
|
ui/instrumentcoefficientform.cpp \
|
||||||
ui/leftwidget.cpp \
|
ui/leftwidget.cpp \
|
||||||
ui/oitautoanalysisparamform.cpp \
|
ui/oitautoanalysisparamform.cpp \
|
||||||
ui/realtimedataform.cpp \
|
ui/realtimedataform.cpp \
|
||||||
ui/specificheatcomparisonmethodform.cpp \
|
ui/specificheatcomparisonmethodform.cpp \
|
||||||
data/xlsxhandler.cpp
|
data/xlsxhandler.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
data/confighandler.h \
|
data/confighandler.h \
|
||||||
data/txthandler.h \
|
data/txthandler.h \
|
||||||
global.h \
|
global.h \
|
||||||
data/filemanager.h \
|
data/filemanager.h \
|
||||||
data/pointcalculate.h \
|
data/pointcalculate.h \
|
||||||
defines.h \
|
defines.h \
|
||||||
logger/logger.h \
|
logger/logger.h \
|
||||||
ui/aboutform.h \
|
ui/aboutform.h \
|
||||||
ui/coefficientselectionform.h \
|
ui/coefficientselectionform.h \
|
||||||
ui/enthalpydatacorrectionform.h \
|
ui/enthalpydatacorrectionform.h \
|
||||||
ui/rightwidget.h \
|
ui/rightwidget.h \
|
||||||
thirdparty/easylogging/easylogging++.h \
|
thirdparty/easylogging/easylogging++.h \
|
||||||
ui/analysissettingform.h \
|
ui/analysissettingform.h \
|
||||||
ui/centralwidget.h \
|
ui/centralwidget.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
serialport/dataparser.h \
|
serialport/dataparser.h \
|
||||||
serialport/protocol.h \
|
serialport/protocol.h \
|
||||||
serialport/serialport.h \
|
serialport/serialport.h \
|
||||||
thirdparty/qcustomplot/qcustomplot.h \
|
thirdparty/qcustomplot/qcustomplot.h \
|
||||||
ui/degreeofcrystallinityform.h \
|
ui/degreeofcrystallinityform.h \
|
||||||
ui/degreeofcureform.h \
|
ui/degreeofcureform.h \
|
||||||
ui/eventhandler.h \
|
ui/eventhandler.h \
|
||||||
ui/experimentsettingform.h \
|
ui/experimentsettingform.h \
|
||||||
ui/instrumentcoefficientform.h \
|
ui/instrumentcoefficientform.h \
|
||||||
ui/leftwidget.h \
|
ui/leftwidget.h \
|
||||||
ui/oitautoanalysisparamform.h \
|
ui/oitautoanalysisparamform.h \
|
||||||
ui/realtimedataform.h \
|
ui/realtimedataform.h \
|
||||||
ui/specificheatcomparisonmethodform.h \
|
ui/specificheatcomparisonmethodform.h \
|
||||||
data/xlsxhandler.h
|
data/xlsxhandler.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
mainwindow.ui \
|
mainwindow.ui \
|
||||||
ui/aboutform.ui \
|
ui/aboutform.ui \
|
||||||
ui/coefficientselectionform.ui \
|
ui/coefficientselectionform.ui \
|
||||||
ui/degreeofcrystallinityform.ui \
|
ui/degreeofcrystallinityform.ui \
|
||||||
ui/degreeofcureform.ui \
|
ui/degreeofcureform.ui \
|
||||||
ui/enthalpydatacorrectionform.ui \
|
ui/enthalpydatacorrectionform.ui \
|
||||||
ui/experimentsettingform.ui \
|
ui/experimentsettingform.ui \
|
||||||
ui/instrumentcoefficientform.ui \
|
ui/instrumentcoefficientform.ui \
|
||||||
ui/oitautoanalysisparamform.ui \
|
ui/oitautoanalysisparamform.ui \
|
||||||
ui/realtimedataform.ui \
|
ui/realtimedataform.ui \
|
||||||
ui/specificheatcomparisonmethodform.ui
|
ui/specificheatcomparisonmethodform.ui
|
||||||
|
|
||||||
INCLUDEPATH += serialport \
|
INCLUDEPATH += serialport \
|
||||||
ui \
|
ui \
|
||||||
logger \
|
logger \
|
||||||
thirdparty/easylogging \
|
thirdparty/easylogging \
|
||||||
thirdparty/qcustomplot \
|
thirdparty/qcustomplot \
|
||||||
data
|
data
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
images.qrc
|
images.qrc
|
||||||
|
|
||||||
DISTFILES += \
|
DISTFILES += \
|
||||||
logger/log.conf
|
logger/log.conf
|
||||||
@ -14,7 +14,7 @@ void ConfigHandler::reader()
|
|||||||
if (QFile::exists(ConConfigFilePath)) {
|
if (QFile::exists(ConConfigFilePath)) {
|
||||||
logde << "config config file existed. ";
|
logde << "config config file existed. ";
|
||||||
}else{
|
}else{
|
||||||
writer(true);
|
writer(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取JSON文件
|
// 读取JSON文件
|
||||||
@ -37,7 +37,7 @@ void ConfigHandler::reader()
|
|||||||
|
|
||||||
_configMap[ConInstrumentCoefficientStr] = QVariant(obj[ConInstrumentCoefficientStr].toDouble());
|
_configMap[ConInstrumentCoefficientStr] = QVariant(obj[ConInstrumentCoefficientStr].toDouble());
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
void ConfigHandler::createDefaultFile()
|
void ConfigHandler::createDefaultFile()
|
||||||
{
|
{
|
||||||
logde<<"createDefaultFile";
|
logde<<"createDefaultFile";
|
||||||
@ -48,8 +48,12 @@ void ConfigHandler::createDefaultFile()
|
|||||||
// obj["age"] = 30;
|
// obj["age"] = 30;
|
||||||
// obj["city"] = "New York";
|
// obj["city"] = "New York";
|
||||||
|
|
||||||
obj[ConInstrumentCoefficientStr] =
|
double coefficient =
|
||||||
ConDefaultMap[ConInstrumentCoefficientStr].toFloat();
|
ConfigHandler::ConDefaultMap.value(ConInstrumentCoefficientStr).toDouble();
|
||||||
|
|
||||||
|
logde<<"coefficient:"<<coefficient;
|
||||||
|
|
||||||
|
obj[ConInstrumentCoefficientStr] =coefficient;
|
||||||
|
|
||||||
// 将 QJsonObject 转换为 QJsonDocument
|
// 将 QJsonObject 转换为 QJsonDocument
|
||||||
QJsonDocument doc(obj);
|
QJsonDocument doc(obj);
|
||||||
@ -65,6 +69,7 @@ void ConfigHandler::createDefaultFile()
|
|||||||
file.write(doc.toJson());
|
file.write(doc.toJson());
|
||||||
file.close(); // 确保文件关闭
|
file.close(); // 确保文件关闭
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ConfigHandler::writer(const bool writeRealDataFlag)
|
void ConfigHandler::writer(const bool writeRealDataFlag)
|
||||||
{
|
{
|
||||||
@ -76,7 +81,7 @@ void ConfigHandler::writer(const bool writeRealDataFlag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
obj[ConInstrumentCoefficientStr] =
|
obj[ConInstrumentCoefficientStr] =
|
||||||
(*mapPtr)[ConInstrumentCoefficientStr].toFloat();
|
(*mapPtr).value(ConInstrumentCoefficientStr).toFloat();
|
||||||
|
|
||||||
// 将 QJsonObject 转换为 QJsonDocument
|
// 将 QJsonObject 转换为 QJsonDocument
|
||||||
QJsonDocument doc(obj);
|
QJsonDocument doc(obj);
|
||||||
|
|||||||
@ -6,8 +6,17 @@
|
|||||||
const QString ConInstrumentCoefficientStr = "InstrumentCoefficient";
|
const QString ConInstrumentCoefficientStr = "InstrumentCoefficient";
|
||||||
|
|
||||||
namespace ConfigHandler {
|
namespace ConfigHandler {
|
||||||
|
const QString ConConfigFilePath = QDir::currentPath() + "/config.json";
|
||||||
|
|
||||||
|
const QMap<QString, QVariant> ConDefaultMap = {
|
||||||
|
{ConInstrumentCoefficientStr, QVariant(1.000f)},
|
||||||
|
};
|
||||||
|
|
||||||
|
extern QMap<QString, QVariant> _configMap;
|
||||||
|
|
||||||
|
//
|
||||||
void reader();
|
void reader();
|
||||||
void createDefaultFile();
|
//void createDefaultFile();
|
||||||
/**
|
/**
|
||||||
* @brief writer
|
* @brief writer
|
||||||
* @param writeRealDataFlag
|
* @param writeRealDataFlag
|
||||||
@ -15,14 +24,6 @@ void createDefaultFile();
|
|||||||
* false:Write ConDefaultMap content.
|
* false:Write ConDefaultMap content.
|
||||||
*/
|
*/
|
||||||
void writer(const bool writeRealDataFlag = true);
|
void writer(const bool writeRealDataFlag = true);
|
||||||
|
|
||||||
const QString ConConfigFilePath = QDir::currentPath() + "/config.json";
|
|
||||||
|
|
||||||
const QMap<QString, QVariant> ConDefaultMap = {
|
|
||||||
{ConInstrumentCoefficientStr, 1.001f},
|
|
||||||
};
|
|
||||||
|
|
||||||
extern QMap<QString, QVariant> _configMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -251,7 +251,9 @@ float PointCalculate::calculateArea() {
|
|||||||
/*
|
/*
|
||||||
* H = K * S / w;
|
* H = K * S / w;
|
||||||
*/
|
*/
|
||||||
float coefficient = ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat();
|
float coefficient = ConfigHandler::_configMap.value(ConInstrumentCoefficientStr).toFloat();
|
||||||
|
logde<<"coefficient:"<<coefficient;
|
||||||
|
|
||||||
if(Global::_enthalpyCoefficientEnableFlag){
|
if(Global::_enthalpyCoefficientEnableFlag){
|
||||||
logde<<"_enthalpyCoefficientEnableFlag...";
|
logde<<"_enthalpyCoefficientEnableFlag...";
|
||||||
|
|
||||||
@ -266,10 +268,8 @@ float PointCalculate::calculateArea() {
|
|||||||
value3;
|
value3;
|
||||||
}
|
}
|
||||||
|
|
||||||
logde<<"coefficient:"<<coefficient;
|
|
||||||
|
|
||||||
float weight = 1.0f;
|
float area = integral * coefficient ;
|
||||||
float area = integral * coefficient / weight;
|
|
||||||
|
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,21 +38,13 @@ int XlsxHandler::readFile(const QString sourceFilePath, Global::CurveFileData &c
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
// 获取工作表的行数和列数
|
|
||||||
int rowCount = workSheet->dimension().rowCount();
|
|
||||||
int colCount = workSheet->dimension().columnCount();
|
|
||||||
qDebug() << "row:" << rowCount << "col:" << colCount;
|
|
||||||
|
|
||||||
logde << "0:" << workSheet->cellAt(1, 1)->value().toString().toStdString();
|
|
||||||
qDebug() << workSheet->cellAt(1, 1)->value().toString();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
int index = 2;
|
int index = 2;
|
||||||
Global::ExperimentInfo& ei = cfd.ei;
|
Global::ExperimentInfo& ei = cfd.ei;
|
||||||
ei.sampleName = workSheet->cellAt(index++, 2)->value().toString();
|
ei.sampleName = workSheet->cellAt(index++, 2)->value().toString();
|
||||||
ei.sampleWeight = workSheet->cellAt(index++, 2)->value().toString();
|
ei.sampleWeight = workSheet->cellAt(index++, 2)->value().toString();
|
||||||
|
logde<<"xlsx sample weight:"<<ei.sampleWeight.toStdString();
|
||||||
|
|
||||||
index++; // skip crucible weight.
|
index++; // skip crucible weight.
|
||||||
ei.date = workSheet->cellAt(index++, 2)->value().toString();
|
ei.date = workSheet->cellAt(index++, 2)->value().toString();
|
||||||
ei.experimentor = workSheet->cellAt(index++, 2)->value().toString();
|
ei.experimentor = workSheet->cellAt(index++, 2)->value().toString();
|
||||||
|
|||||||
@ -8,9 +8,10 @@
|
|||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
|
||||||
namespace Global {
|
namespace Global {
|
||||||
const QString ConSoftVersion = "0.9.1";
|
const QString ConSoftVersion = "0.9.7";
|
||||||
|
|
||||||
const QString ExperimentDirPath = QDir::currentPath()+"/../experiment_data";
|
const QString ExperimentDirPath = QDir::currentPath()+"/../experiment_data";
|
||||||
|
|
||||||
const QString SampleDataFloder = ExperimentDirPath + "/sample_data";
|
const QString SampleDataFloder = ExperimentDirPath + "/sample_data";
|
||||||
const QString BaseLineFolder = ExperimentDirPath + "/base_line";
|
const QString BaseLineFolder = ExperimentDirPath + "/base_line";
|
||||||
const QString AnalysisStateFolder = ExperimentDirPath + "/analysis_state";
|
const QString AnalysisStateFolder = ExperimentDirPath + "/analysis_state";
|
||||||
|
|||||||
19
src/main.cpp
19
src/main.cpp
@ -22,8 +22,13 @@ int main(int argc, char *argv[])
|
|||||||
logde<<"main...";
|
logde<<"main...";
|
||||||
//
|
//
|
||||||
ConfigHandler::reader();
|
ConfigHandler::reader();
|
||||||
|
#if 0
|
||||||
logde<<"config,instrument coefficient:"
|
logde<<"config,instrument coefficient:"
|
||||||
<<ConfigHandler::_configMap[ConInstrumentCoefficientStr].toFloat();
|
<<ConfigHandler::_configMap.value(ConInstrumentCoefficientStr).toFloat();
|
||||||
|
|
||||||
|
logde<<"config,default coefficient:"
|
||||||
|
<<ConfigHandler::ConDefaultMap.value(ConInstrumentCoefficientStr).toFloat();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
ConfigHandler::_configMap[ConInstrumentCoefficientStr] = 2.001f;
|
ConfigHandler::_configMap[ConInstrumentCoefficientStr] = 2.001f;
|
||||||
@ -45,11 +50,11 @@ int main(int argc, char *argv[])
|
|||||||
w.show();
|
w.show();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// EnthalpyDataCorrectionForm edf;
|
// EnthalpyDataCorrectionForm edf;
|
||||||
// edf.show();
|
// edf.show();
|
||||||
|
|
||||||
// CoefficientSelectionForm csf;
|
// CoefficientSelectionForm csf;
|
||||||
// csf.show();
|
// csf.show();
|
||||||
|
|
||||||
// AboutForm af;
|
// AboutForm af;
|
||||||
// af.show();
|
// af.show();
|
||||||
@ -62,8 +67,8 @@ int main(int argc, char *argv[])
|
|||||||
// ExperimentSettingForm es;
|
// ExperimentSettingForm es;
|
||||||
// es.show();
|
// es.show();
|
||||||
|
|
||||||
// CentralWidget central;
|
// CentralWidget central;
|
||||||
// central.show();
|
// central.show();
|
||||||
|
|
||||||
// SerialPort::parserTest();
|
// SerialPort::parserTest();
|
||||||
|
|
||||||
|
|||||||
@ -44,29 +44,6 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
permenentLabel->setText("Software Ver:" + Global::ConSoftVersion);
|
permenentLabel->setText("Software Ver:" + Global::ConSoftVersion);
|
||||||
ui->statusbar->addPermanentWidget(permenentLabel);
|
ui->statusbar->addPermanentWidget(permenentLabel);
|
||||||
//
|
//
|
||||||
#if 0
|
|
||||||
_expertmentSettingForm->setWindowFlags(_expertmentSettingForm->windowFlags()|
|
|
||||||
Qt::Dialog);
|
|
||||||
_specificHeatComparisonMethodForm->setWindowFlags(
|
|
||||||
_specificHeatComparisonMethodForm->windowFlags()| Qt::Dialog);
|
|
||||||
|
|
||||||
_realTimeDataForm->setWindowFlags(_realTimeDataForm->windowFlags()|
|
|
||||||
Qt::Dialog);
|
|
||||||
|
|
||||||
_degreeOfCureForm->setWindowFlags(_degreeOfCureForm->windowFlags()|
|
|
||||||
Qt::Dialog);
|
|
||||||
_instrumentCoefficientForm->setWindowFlags(_instrumentCoefficientForm->windowFlags()|
|
|
||||||
Qt::Dialog);
|
|
||||||
_OITAutoAnalysisParamForm->setWindowFlags(_OITAutoAnalysisParamForm->windowFlags()|
|
|
||||||
Qt::Dialog);
|
|
||||||
// _degreeOfCrystallinityForm->setWindowFlags(_degreeOfCrystallinityForm->windowFlags()|
|
|
||||||
// Qt::Dialog);
|
|
||||||
|
|
||||||
// 设置子窗口为模态对话框
|
|
||||||
_degreeOfCrystallinityForm->setWindowModality(Qt::ApplicationModal);
|
|
||||||
_degreeOfCrystallinityForm->setWindowFlags(Qt::Dialog);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
setSubWidgetAttribute(_expertmentSettingForm);
|
setSubWidgetAttribute(_expertmentSettingForm);
|
||||||
setSubWidgetAttribute(_specificHeatComparisonMethodForm);
|
setSubWidgetAttribute(_specificHeatComparisonMethodForm);
|
||||||
setSubWidgetAttribute(_realTimeDataForm);
|
setSubWidgetAttribute(_realTimeDataForm);
|
||||||
@ -101,6 +78,11 @@ void MainWindow::slotContextMenuShow(const QPoint point)
|
|||||||
_contextMenu->exec(point);
|
_contextMenu->exec(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::slotStatusbarMesg(const QString)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *event)
|
void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
// 弹出确认对话框
|
// 弹出确认对话框
|
||||||
|
|||||||
@ -35,6 +35,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slotContextMenuShow(const QPoint);
|
void slotContextMenuShow(const QPoint);
|
||||||
|
void slotStatusbarMesg(const QString);
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event) override;
|
void closeEvent(QCloseEvent *event) override;
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
@ -140,6 +140,7 @@ QByteArray setDeviceStartStop(const DeviceStartMode mode)
|
|||||||
|
|
||||||
void experimentalStateSwitching(const CommonData &cd)
|
void experimentalStateSwitching(const CommonData &cd)
|
||||||
{
|
{
|
||||||
|
// Switch the software mode accord to the serial port data.
|
||||||
switch(cd.run_type){
|
switch(cd.run_type){
|
||||||
case DeviceRunStatus::Heat:
|
case DeviceRunStatus::Heat:
|
||||||
case DeviceRunStatus::ConstantTemp:
|
case DeviceRunStatus::ConstantTemp:
|
||||||
@ -152,10 +153,10 @@ void experimentalStateSwitching(const CommonData &cd)
|
|||||||
default:break;
|
default:break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If phase update, add new phase data to the global param.
|
||||||
if(Global::_currentPhase != (int)cd.current_phase){
|
if(Global::_currentPhase != (int)cd.current_phase){
|
||||||
Global::_currentPhase = (int)cd.current_phase;
|
Global::_currentPhase = (int)cd.current_phase;
|
||||||
|
|
||||||
// Global::CurveExperimentData ced{nullptr,"",QVector<Global::ExperimentData>()};
|
|
||||||
Global::CurveExperimentData ced;
|
Global::CurveExperimentData ced;
|
||||||
|
|
||||||
Global::_curveExperimentDataVtr.push_back(ced);
|
Global::_curveExperimentDataVtr.push_back(ced);
|
||||||
@ -210,43 +211,6 @@ QByteArray inquirePhaseInfo()
|
|||||||
QByteArray((char *)&crc, 2);
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
logde<<"phase:"<<(int)cd.current_phase;
|
|
||||||
logde<<"run type:"<<(int)cd.run_type;
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@ QByteArray inquirePhaseInfo();
|
|||||||
QByteArray setDeviceStartStop(const DeviceStartMode);
|
QByteArray setDeviceStartStop(const DeviceStartMode);
|
||||||
|
|
||||||
void experimentalStateSwitching(const CommonData&cd);
|
void experimentalStateSwitching(const CommonData&cd);
|
||||||
bool isDevExperimentEnded(const CommonData&cd);
|
|
||||||
bool commonDataParser(const QByteArray&ba,CommonData &cd);
|
bool commonDataParser(const QByteArray&ba,CommonData &cd);
|
||||||
|
|
||||||
unsigned short modbusCRC16(unsigned char *data,unsigned short length);
|
unsigned short modbusCRC16(unsigned char *data,unsigned short length);
|
||||||
|
|||||||
@ -129,6 +129,7 @@ void SerialPort::slotReadData()
|
|||||||
{
|
{
|
||||||
DataParser::experimentalStateSwitching(cd);
|
DataParser::experimentalStateSwitching(cd);
|
||||||
setAxis();
|
setAxis();
|
||||||
|
updateStatusbarMsg();
|
||||||
|
|
||||||
if (spp->addr == 0)
|
if (spp->addr == 0)
|
||||||
{
|
{
|
||||||
@ -141,6 +142,11 @@ void SerialPort::slotReadData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SerialPort::updateStatusbarMsg()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void SerialPort::commonDataParser(const int dataLength, const u16 addr,
|
void SerialPort::commonDataParser(const int dataLength, const u16 addr,
|
||||||
const CommonData &cd)
|
const CommonData &cd)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -44,6 +44,7 @@ private slots:
|
|||||||
void slotReadData();
|
void slotReadData();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void updateStatusbarMsg();
|
||||||
void commonDataParser(const int dataLength, const u16 addr, const CommonData &cd);
|
void commonDataParser(const int dataLength, const u16 addr, const CommonData &cd);
|
||||||
void to_hex(char *in_char, int char_length, char *out_char);
|
void to_hex(char *in_char, int char_length, char *out_char);
|
||||||
void displayPortInfo();
|
void displayPortInfo();
|
||||||
|
|||||||
@ -160,13 +160,13 @@ void CentralWidget::slotRecvCommonData(const CommonData &cd)
|
|||||||
// return;
|
// return;
|
||||||
|
|
||||||
// Record data.
|
// Record data.
|
||||||
// logde<<"record data...";
|
// logde<<"record data...";
|
||||||
|
|
||||||
if(!Global::_currentCurveExperimentDataPtr){
|
if(!Global::_currentCurveExperimentDataPtr){
|
||||||
logde<<"_currentCurveExperimentDataPtr is nullptr.";
|
logde<<"_currentCurveExperimentDataPtr is nullptr.";
|
||||||
exit(0);
|
exit(0);
|
||||||
}else{
|
}else{
|
||||||
// logde<<"add ed...";
|
// logde<<"add ed...";
|
||||||
|
|
||||||
Global::ExperimentData ed;
|
Global::ExperimentData ed;
|
||||||
ed.dsc = cd .dsc;
|
ed.dsc = cd .dsc;
|
||||||
@ -207,6 +207,7 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
|||||||
qDebug() << "slotRecvAnalysisFileName" << filePath;
|
qDebug() << "slotRecvAnalysisFileName" << filePath;
|
||||||
|
|
||||||
// todo.禁止重复文件添加。
|
// todo.禁止重复文件添加。
|
||||||
|
|
||||||
Global::CurveFileData cfd;
|
Global::CurveFileData cfd;
|
||||||
if(XlsxHandler::readFile(filePath,cfd) != 0){
|
if(XlsxHandler::readFile(filePath,cfd) != 0){
|
||||||
QMessageBox::warning((QWidget*)this->parent(), "warnning", "File parse error.");
|
QMessageBox::warning((QWidget*)this->parent(), "warnning", "File parse error.");
|
||||||
@ -249,9 +250,12 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
|||||||
|
|
||||||
// Add data to global parameter.
|
// Add data to global parameter.
|
||||||
QFileInfo fileInfo(filePath);
|
QFileInfo fileInfo(filePath);
|
||||||
Global::_curveExperimentDataVtr.push_back({_currentCurve,fileInfo.fileName(),pti.dataVtr});
|
|
||||||
|
pti.curve = _currentCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Global::_curveFileDataVtr.push_back(cfd);
|
||||||
|
|
||||||
_customPlot->rescaleAxes();
|
_customPlot->rescaleAxes();
|
||||||
_customPlot->replot();
|
_customPlot->replot();
|
||||||
}
|
}
|
||||||
@ -380,7 +384,18 @@ void CentralWidget::slotAnalysisSettingApply()
|
|||||||
PointCalculate::setRegionPointX(x1,x2);
|
PointCalculate::setRegionPointX(x1,x2);
|
||||||
|
|
||||||
//enthalpy
|
//enthalpy
|
||||||
double enthalpyValue = PointCalculate::calculateArea();
|
double sampleWeight = 0.0f;
|
||||||
|
for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){
|
||||||
|
for(Global::PhaseTotalInfo& pti:cfd.phaseTotalVtr){
|
||||||
|
if(_currentCurve && _currentCurve == pti.curve){
|
||||||
|
sampleWeight = cfd.ei.sampleWeight.toDouble();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logde<<"sample weight:"<<sampleWeight;
|
||||||
|
|
||||||
|
double enthalpyValue = PointCalculate::calculateArea() / sampleWeight;
|
||||||
|
|
||||||
//peak
|
//peak
|
||||||
QPointF peakPoint = PointCalculate::getPeakPoint();
|
QPointF peakPoint = PointCalculate::getPeakPoint();
|
||||||
|
|
||||||
@ -391,10 +406,11 @@ void CentralWidget::slotAnalysisSettingApply()
|
|||||||
logde<<"start,end:"<<startEndPointPair.first.x()<<","
|
logde<<"start,end:"<<startEndPointPair.first.x()<<","
|
||||||
<<startEndPointPair.second.x();
|
<<startEndPointPair.second.x();
|
||||||
|
|
||||||
drawText(peakPoint,PointCalculate::textFormatPeakPoint(enthalpyValue,
|
drawText(peakPoint,
|
||||||
peakPoint.x(),
|
PointCalculate::textFormatPeakPoint(enthalpyValue,
|
||||||
startEndPointPair.first.x(),
|
peakPoint.x(),
|
||||||
startEndPointPair.second.x()));
|
startEndPointPair.first.x(),
|
||||||
|
startEndPointPair.second.x()));
|
||||||
//
|
//
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -833,11 +849,11 @@ void CentralWidget::setEventHandlerEnable(const bool flag)
|
|||||||
double xMax = _customPlot->xAxis->range().upper;
|
double xMax = _customPlot->xAxis->range().upper;
|
||||||
double xMin = _customPlot->xAxis->range().lower;
|
double xMin = _customPlot->xAxis->range().lower;
|
||||||
|
|
||||||
logde<<"xMax:"<<xMax;
|
// logde<<"xMax:"<<xMax;
|
||||||
|
|
||||||
QVector<double> ticks = _customPlot->xAxis->tickVector();
|
// QVector<double> ticks = _customPlot->xAxis->tickVector();
|
||||||
int numTicks = ticks.size();
|
// int numTicks = ticks.size();
|
||||||
logde<<"ticks:"<<numTicks;
|
// logde<<"ticks:"<<numTicks;
|
||||||
|
|
||||||
double range = xMax - xMin;
|
double range = xMax - xMin;
|
||||||
double xLeft = xMin + range / 3;
|
double xLeft = xMin + range / 3;
|
||||||
|
|||||||
@ -43,12 +43,12 @@ public slots:
|
|||||||
void slotSelectionChanged();
|
void slotSelectionChanged();
|
||||||
|
|
||||||
//analysis setting
|
//analysis setting
|
||||||
void slotAnalysisSettingLineXPoint(const int index,const double);
|
|
||||||
|
|
||||||
void slotAnalysisSettingApply();
|
void slotAnalysisSettingApply();
|
||||||
void slotAnalysisSettingConfirm();
|
void slotAnalysisSettingConfirm();
|
||||||
void slotAnalysisSettingUndo();
|
void slotAnalysisSettingUndo();
|
||||||
void slotAnalysisSettingCancel();
|
void slotAnalysisSettingCancel();
|
||||||
|
|
||||||
|
void slotAnalysisSettingLineXPoint(const int index,const double);
|
||||||
protected:
|
protected:
|
||||||
void timerEvent(QTimerEvent* event);
|
void timerEvent(QTimerEvent* event);
|
||||||
void contextMenuEvent(QContextMenuEvent *event);
|
void contextMenuEvent(QContextMenuEvent *event);
|
||||||
|
|||||||
@ -15,7 +15,6 @@ RealTimeDataForm::~RealTimeDataForm()
|
|||||||
|
|
||||||
void RealTimeDataForm::slotRevCommonData(const CommonData &data)
|
void RealTimeDataForm::slotRevCommonData(const CommonData &data)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
#if 0
|
#if 0
|
||||||
qDebug()<<"rev-------------------------";
|
qDebug()<<"rev-------------------------";
|
||||||
// 格式化输出 double 类型,保留三位小数
|
// 格式化输出 double 类型,保留三位小数
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user