2025-05-14T17:30:51
This commit is contained in:
parent
5ef859ae63
commit
f2344ce869
@ -6,6 +6,9 @@
|
|||||||
namespace AnaOpRecorder = AnalysisOperationRecorder;
|
namespace AnaOpRecorder = AnalysisOperationRecorder;
|
||||||
using AnaOpRecorderOperation = AnalysisOperationRecorder::AnalysisOperation;
|
using AnaOpRecorderOperation = AnalysisOperationRecorder::AnalysisOperation;
|
||||||
|
|
||||||
|
using AnalysisMode = Global::AnalysisMode;
|
||||||
|
|
||||||
|
|
||||||
QString XlsxHandler::_currentFilePath;
|
QString XlsxHandler::_currentFilePath;
|
||||||
|
|
||||||
void XlsxHandler::test()
|
void XlsxHandler::test()
|
||||||
@ -292,7 +295,7 @@ void XlsxHandler::writeAnalysisOperation(const QString filePath)
|
|||||||
QString analysisOpName;
|
QString analysisOpName;
|
||||||
|
|
||||||
switch(ao.mode){
|
switch(ao.mode){
|
||||||
case Global::NumericalLabel:
|
case AnalysisMode::NumericalLabel:
|
||||||
{
|
{
|
||||||
analysisOpName = AnalysisOperationRecorder::NumericalLabelStr;
|
analysisOpName = AnalysisOperationRecorder::NumericalLabelStr;
|
||||||
break;
|
break;
|
||||||
@ -406,6 +409,12 @@ QXlsx::Document* XlsxHandler::openXlsxFile(const QString& sourceFilePath) {
|
|||||||
|
|
||||||
void XlsxHandler::readAnalysisOperation(QXlsx::Worksheet *sheet, int &startLineIndex)
|
void XlsxHandler::readAnalysisOperation(QXlsx::Worksheet *sheet, int &startLineIndex)
|
||||||
{
|
{
|
||||||
|
QXlsx::Cell *cell = sheet->cellAt(startLineIndex, 2);
|
||||||
|
if (!cell) {
|
||||||
|
logde << "Cell does not exist.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int size = sheet->cellAt(startLineIndex++, 2)->value().toInt();
|
int size = sheet->cellAt(startLineIndex++, 2)->value().toInt();
|
||||||
|
|
||||||
logde<<"ana op size:"<<size;
|
logde<<"ana op size:"<<size;
|
||||||
@ -433,7 +442,7 @@ void XlsxHandler::readAnalysisOperation(QXlsx::Worksheet *sheet, int &startLineI
|
|||||||
ao.x1 = sheet->cellAt(startLineIndex, 2)->value().toDouble();
|
ao.x1 = sheet->cellAt(startLineIndex, 2)->value().toDouble();
|
||||||
ao.x2 = sheet->cellAt(startLineIndex, 3)->value().toDouble();
|
ao.x2 = sheet->cellAt(startLineIndex, 3)->value().toDouble();
|
||||||
|
|
||||||
AnaOpRecorder::_fileAnanlysisOperationVtr.push_back(ao);
|
AnaOpRecorder::_ananlysisOperationVtr.push_back(ao);
|
||||||
|
|
||||||
startLineIndex++;
|
startLineIndex++;
|
||||||
|
|
||||||
|
97
src/global.h
97
src/global.h
@ -7,6 +7,19 @@
|
|||||||
|
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
enum AnalysisMode{
|
||||||
|
Null,
|
||||||
|
NumericalLabel,
|
||||||
|
StartPoint,
|
||||||
|
StopPoint,
|
||||||
|
PeakSynthesisAnalysis,
|
||||||
|
GlassTransition,
|
||||||
|
OnsetTemperaturePoint,
|
||||||
|
EndsetTemperaturePoint
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Global {
|
namespace Global {
|
||||||
const QString ConSoftVersion = "0.9.7.1";
|
const QString ConSoftVersion = "0.9.7.1";
|
||||||
|
|
||||||
@ -43,7 +56,6 @@ enum AnalysisMode{
|
|||||||
OnsetTemperaturePoint,
|
OnsetTemperaturePoint,
|
||||||
EndsetTemperaturePoint
|
EndsetTemperaturePoint
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Mode{
|
enum Mode{
|
||||||
Analysis,
|
Analysis,
|
||||||
ConnectedToDev,
|
ConnectedToDev,
|
||||||
@ -123,86 +135,9 @@ QString converDoubleToStr(const double);
|
|||||||
void quadraticLeastSquaresFit(double x[], double y[], int n, double coeff[]);
|
void quadraticLeastSquaresFit(double x[], double y[], int n, double coeff[]);
|
||||||
double findNegativeStartPoint(double m, double b, double start, double end);
|
double findNegativeStartPoint(double m, double b, double start, double end);
|
||||||
|
|
||||||
}
|
|
||||||
#if 0
|
|
||||||
class Global:public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
Global();
|
|
||||||
static Global* instance();
|
|
||||||
|
|
||||||
enum Mode{
|
|
||||||
Analysis,
|
|
||||||
ConnectedToDev,
|
|
||||||
DeliveredData,
|
|
||||||
ExperimentStart
|
|
||||||
};
|
|
||||||
|
|
||||||
void setMode(const Mode);
|
|
||||||
Mode getMode(){return _mode;}
|
|
||||||
|
|
||||||
enum DeviceConnectionStatus{
|
|
||||||
Disconnected,
|
|
||||||
Connected
|
|
||||||
};
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
void setDeviceConnectionStatus(const DeviceConnectionStatus);
|
|
||||||
DeviceConnectionStatus getDeviceConnectionStatus(){return _deviceConnectStatus;}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct ExperimentData {
|
|
||||||
float runTime;
|
|
||||||
float sampleTemp;
|
|
||||||
float dsc;
|
|
||||||
};
|
|
||||||
|
|
||||||
// struct ExpeInfo
|
|
||||||
// {
|
|
||||||
// QString sampleName;
|
|
||||||
// float sampleWeight;
|
|
||||||
// QString date;
|
|
||||||
// QString userName;
|
|
||||||
// };
|
|
||||||
|
|
||||||
enum TestType{
|
|
||||||
OIT,
|
|
||||||
NoneOIT
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ExperimentInfo{
|
|
||||||
// experiment info
|
|
||||||
QString sampleName;
|
|
||||||
QString sampleWeight;
|
|
||||||
QString date;
|
|
||||||
QString experimentor;
|
|
||||||
// phase info
|
|
||||||
TestType testType;
|
|
||||||
GasType initialAtmosPhere;
|
|
||||||
int phaseSize;
|
|
||||||
|
|
||||||
QVector<Phase> phaseVtr;
|
|
||||||
};
|
|
||||||
|
|
||||||
ExperimentInfo _experimentInfo;
|
|
||||||
|
|
||||||
struct PhaseTotalInfo{
|
|
||||||
int phaseIndex; // from 1 to 6.
|
|
||||||
Phase phase;
|
|
||||||
QVector<ExperimentData> dataVtr;
|
|
||||||
};
|
|
||||||
|
|
||||||
QVector<QPair<QCPCurve*,QVector<Global::ExperimentData>>> _curveDataVtr;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void sigModeModify(const Mode);
|
|
||||||
void sigDeviceConnnectionStatusModify(const DeviceConnectionStatus);
|
|
||||||
public slots:
|
|
||||||
private:
|
|
||||||
Mode _mode;
|
|
||||||
DeviceConnectionStatus _deviceConnectStatus;
|
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // GLOBAL_H
|
#endif // GLOBAL_H
|
||||||
|
@ -2,8 +2,11 @@
|
|||||||
#define ANALYSISOPERATIONRECORDER_H
|
#define ANALYSISOPERATIONRECORDER_H
|
||||||
|
|
||||||
#include "centralwidget.h"
|
#include "centralwidget.h"
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
namespace AnalysisOperationRecorder {
|
namespace AnalysisOperationRecorder {
|
||||||
|
using AnalysisMode = Global::AnalysisMode;
|
||||||
|
|
||||||
const QString NumericalLabelStr("NumericalLabel");
|
const QString NumericalLabelStr("NumericalLabel");
|
||||||
const QString StartPointStr("StartPoint");
|
const QString StartPointStr("StartPoint");
|
||||||
const QString StopPointStr("StopPoint");
|
const QString StopPointStr("StopPoint");
|
||||||
@ -26,7 +29,7 @@ enum AnalysisMode{
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct AnalysisOperation{
|
struct AnalysisOperation{
|
||||||
CentralWidget::AnalysisMode mode;
|
AnalysisMode mode;
|
||||||
double x1,x2;
|
double x1,x2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
namespace AnaOpRecorder = AnalysisOperationRecorder;
|
namespace AnaOpRecorder = AnalysisOperationRecorder;
|
||||||
using AnaOpRecorderOperation = AnalysisOperationRecorder::AnalysisOperation;
|
using AnaOpRecorderOperation = AnalysisOperationRecorder::AnalysisOperation;
|
||||||
//using AnaOpAnalysisMode = AnalysisOperationRecorder::AnalysisMode;
|
|
||||||
|
|
||||||
CentralWidget::CentralWidget(QWidget *parent)
|
CentralWidget::CentralWidget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
@ -158,7 +157,7 @@ void CentralWidget::switchAxisMode()
|
|||||||
_customPlot->replot();
|
_customPlot->replot();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CentralWidget::setAnalysisMode(const CentralWidget::AnalysisMode mode)
|
void CentralWidget::setAnalysisMode(const AnalysisMode mode)
|
||||||
{
|
{
|
||||||
_analysisMode = mode;
|
_analysisMode = mode;
|
||||||
|
|
||||||
@ -264,7 +263,7 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
|||||||
for(int i = 0;i < cfd.phaseTotalVtr.size();i++){
|
for(int i = 0;i < cfd.phaseTotalVtr.size();i++){
|
||||||
Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i];
|
Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i];
|
||||||
|
|
||||||
// logde<<"data Vtr size:"<<pti.dataVtr.size();
|
// logde<<"data Vtr size:"<<pti.dataVtr.size();
|
||||||
|
|
||||||
PointCalculate::setExperimentData(pti.dataVtr);
|
PointCalculate::setExperimentData(pti.dataVtr);
|
||||||
|
|
||||||
@ -300,9 +299,11 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add analysis operation data.
|
// Add analysis operation data.
|
||||||
//loadAnalysisData(_analysisMode,x1,x2);
|
if(AnalysisOperationRecorder::_ananlysisOperationVtr.size() > 0){
|
||||||
for(AnaOpRecorder::AnalysisOperation& ao:AnalysisOperationRecorder::_ananlysisOperationVtr){
|
for(AnaOpRecorder::AnalysisOperation& ao
|
||||||
loadAnalysisData(ao.mode,ao.x1,ao.x2);
|
:AnalysisOperationRecorder::_ananlysisOperationVtr){
|
||||||
|
loadAnalysisData(ao.mode,ao.x1,ao.x2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Refresh ui.
|
// Refresh ui.
|
||||||
_customPlot->rescaleAxes();
|
_customPlot->rescaleAxes();
|
||||||
@ -496,7 +497,7 @@ void CentralWidget::slotAnalysisSettingConfirm()
|
|||||||
|
|
||||||
slotAnalysisSettingApply();
|
slotAnalysisSettingApply();
|
||||||
|
|
||||||
setAnalysisMode(CentralWidget::AnalysisMode::Null);
|
setAnalysisMode(AnalysisMode::Null);
|
||||||
|
|
||||||
_line1->setVisible(false);
|
_line1->setVisible(false);
|
||||||
_line2->setVisible(false);
|
_line2->setVisible(false);
|
||||||
@ -516,7 +517,7 @@ void CentralWidget::slotAnalysisSettingCancel()
|
|||||||
{
|
{
|
||||||
clearData(ClearDataMode::Undo);
|
clearData(ClearDataMode::Undo);
|
||||||
|
|
||||||
setAnalysisMode(CentralWidget::AnalysisMode::Null);
|
setAnalysisMode(AnalysisMode::Null);
|
||||||
|
|
||||||
_line1->setVisible(false);
|
_line1->setVisible(false);
|
||||||
_line2->setVisible(false);
|
_line2->setVisible(false);
|
||||||
@ -1130,11 +1131,11 @@ void CentralWidget::loadAnalysisData(const CentralWidget::AnalysisMode mode, con
|
|||||||
if(_analysisMode == AnalysisMode::StartPoint){
|
if(_analysisMode == AnalysisMode::StartPoint){
|
||||||
point = startEndPointPair.first;
|
point = startEndPointPair.first;
|
||||||
str = PointCalculate::textFormatStartPoint(point);
|
str = PointCalculate::textFormatStartPoint(point);
|
||||||
ao.mode = AnalysisMode::StartPoint;
|
ao.mode = Global::AnalysisMode::StartPoint;
|
||||||
}else{
|
}else{
|
||||||
point = startEndPointPair.second;
|
point = startEndPointPair.second;
|
||||||
str = PointCalculate::textFormatEndPoint(point);
|
str = PointCalculate::textFormatEndPoint(point);
|
||||||
ao.mode = AnalysisMode::StopPoint;
|
ao.mode = Global::AnalysisMode::StopPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawText(point,str);
|
drawText(point,str);
|
||||||
|
@ -11,11 +11,13 @@
|
|||||||
#include "filemanager.h"
|
#include "filemanager.h"
|
||||||
#include "pointcalculate.h"
|
#include "pointcalculate.h"
|
||||||
#include "localcustomplot.h"
|
#include "localcustomplot.h"
|
||||||
|
#include "analysisoperationrecorder.h"
|
||||||
|
|
||||||
class CentralWidget:public QWidget
|
class CentralWidget:public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
#if 0
|
||||||
enum AnalysisMode{
|
enum AnalysisMode{
|
||||||
Null,
|
Null,
|
||||||
NumericalLabel,
|
NumericalLabel,
|
||||||
@ -26,6 +28,11 @@ public:
|
|||||||
OnsetTemperaturePoint,
|
OnsetTemperaturePoint,
|
||||||
EndsetTemperaturePoint
|
EndsetTemperaturePoint
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using AnalysisMode = Global::AnalysisMode;
|
||||||
|
|
||||||
|
|
||||||
CentralWidget(QWidget *parent = nullptr);
|
CentralWidget(QWidget *parent = nullptr);
|
||||||
~CentralWidget();
|
~CentralWidget();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user