2025-05-14T17:30:51
This commit is contained in:
parent
5ef859ae63
commit
f2344ce869
@ -6,6 +6,9 @@
|
||||
namespace AnaOpRecorder = AnalysisOperationRecorder;
|
||||
using AnaOpRecorderOperation = AnalysisOperationRecorder::AnalysisOperation;
|
||||
|
||||
using AnalysisMode = Global::AnalysisMode;
|
||||
|
||||
|
||||
QString XlsxHandler::_currentFilePath;
|
||||
|
||||
void XlsxHandler::test()
|
||||
@ -292,7 +295,7 @@ void XlsxHandler::writeAnalysisOperation(const QString filePath)
|
||||
QString analysisOpName;
|
||||
|
||||
switch(ao.mode){
|
||||
case Global::NumericalLabel:
|
||||
case AnalysisMode::NumericalLabel:
|
||||
{
|
||||
analysisOpName = AnalysisOperationRecorder::NumericalLabelStr;
|
||||
break;
|
||||
@ -406,6 +409,12 @@ QXlsx::Document* XlsxHandler::openXlsxFile(const QString& sourceFilePath) {
|
||||
|
||||
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();
|
||||
|
||||
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.x2 = sheet->cellAt(startLineIndex, 3)->value().toDouble();
|
||||
|
||||
AnaOpRecorder::_fileAnanlysisOperationVtr.push_back(ao);
|
||||
AnaOpRecorder::_ananlysisOperationVtr.push_back(ao);
|
||||
|
||||
startLineIndex++;
|
||||
|
||||
|
97
src/global.h
97
src/global.h
@ -7,6 +7,19 @@
|
||||
|
||||
#include "protocol.h"
|
||||
|
||||
#if 0
|
||||
enum AnalysisMode{
|
||||
Null,
|
||||
NumericalLabel,
|
||||
StartPoint,
|
||||
StopPoint,
|
||||
PeakSynthesisAnalysis,
|
||||
GlassTransition,
|
||||
OnsetTemperaturePoint,
|
||||
EndsetTemperaturePoint
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace Global {
|
||||
const QString ConSoftVersion = "0.9.7.1";
|
||||
|
||||
@ -43,7 +56,6 @@ enum AnalysisMode{
|
||||
OnsetTemperaturePoint,
|
||||
EndsetTemperaturePoint
|
||||
};
|
||||
|
||||
enum Mode{
|
||||
Analysis,
|
||||
ConnectedToDev,
|
||||
@ -123,86 +135,9 @@ QString converDoubleToStr(const double);
|
||||
void quadraticLeastSquaresFit(double x[], double y[], int n, double coeff[]);
|
||||
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
|
||||
|
@ -2,8 +2,11 @@
|
||||
#define ANALYSISOPERATIONRECORDER_H
|
||||
|
||||
#include "centralwidget.h"
|
||||
#include "global.h"
|
||||
|
||||
namespace AnalysisOperationRecorder {
|
||||
using AnalysisMode = Global::AnalysisMode;
|
||||
|
||||
const QString NumericalLabelStr("NumericalLabel");
|
||||
const QString StartPointStr("StartPoint");
|
||||
const QString StopPointStr("StopPoint");
|
||||
@ -26,7 +29,7 @@ enum AnalysisMode{
|
||||
#endif
|
||||
|
||||
struct AnalysisOperation{
|
||||
CentralWidget::AnalysisMode mode;
|
||||
AnalysisMode mode;
|
||||
double x1,x2;
|
||||
};
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
namespace AnaOpRecorder = AnalysisOperationRecorder;
|
||||
using AnaOpRecorderOperation = AnalysisOperationRecorder::AnalysisOperation;
|
||||
//using AnaOpAnalysisMode = AnalysisOperationRecorder::AnalysisMode;
|
||||
|
||||
CentralWidget::CentralWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
@ -158,7 +157,7 @@ void CentralWidget::switchAxisMode()
|
||||
_customPlot->replot();
|
||||
}
|
||||
|
||||
void CentralWidget::setAnalysisMode(const CentralWidget::AnalysisMode mode)
|
||||
void CentralWidget::setAnalysisMode(const AnalysisMode mode)
|
||||
{
|
||||
_analysisMode = mode;
|
||||
|
||||
@ -300,10 +299,12 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath)
|
||||
}
|
||||
|
||||
// Add analysis operation data.
|
||||
//loadAnalysisData(_analysisMode,x1,x2);
|
||||
for(AnaOpRecorder::AnalysisOperation& ao:AnalysisOperationRecorder::_ananlysisOperationVtr){
|
||||
if(AnalysisOperationRecorder::_ananlysisOperationVtr.size() > 0){
|
||||
for(AnaOpRecorder::AnalysisOperation& ao
|
||||
:AnalysisOperationRecorder::_ananlysisOperationVtr){
|
||||
loadAnalysisData(ao.mode,ao.x1,ao.x2);
|
||||
}
|
||||
}
|
||||
// Refresh ui.
|
||||
_customPlot->rescaleAxes();
|
||||
_customPlot->replot();
|
||||
@ -496,7 +497,7 @@ void CentralWidget::slotAnalysisSettingConfirm()
|
||||
|
||||
slotAnalysisSettingApply();
|
||||
|
||||
setAnalysisMode(CentralWidget::AnalysisMode::Null);
|
||||
setAnalysisMode(AnalysisMode::Null);
|
||||
|
||||
_line1->setVisible(false);
|
||||
_line2->setVisible(false);
|
||||
@ -516,7 +517,7 @@ void CentralWidget::slotAnalysisSettingCancel()
|
||||
{
|
||||
clearData(ClearDataMode::Undo);
|
||||
|
||||
setAnalysisMode(CentralWidget::AnalysisMode::Null);
|
||||
setAnalysisMode(AnalysisMode::Null);
|
||||
|
||||
_line1->setVisible(false);
|
||||
_line2->setVisible(false);
|
||||
@ -1130,11 +1131,11 @@ void CentralWidget::loadAnalysisData(const CentralWidget::AnalysisMode mode, con
|
||||
if(_analysisMode == AnalysisMode::StartPoint){
|
||||
point = startEndPointPair.first;
|
||||
str = PointCalculate::textFormatStartPoint(point);
|
||||
ao.mode = AnalysisMode::StartPoint;
|
||||
ao.mode = Global::AnalysisMode::StartPoint;
|
||||
}else{
|
||||
point = startEndPointPair.second;
|
||||
str = PointCalculate::textFormatEndPoint(point);
|
||||
ao.mode = AnalysisMode::StopPoint;
|
||||
ao.mode = Global::AnalysisMode::StopPoint;
|
||||
}
|
||||
|
||||
drawText(point,str);
|
||||
|
@ -11,11 +11,13 @@
|
||||
#include "filemanager.h"
|
||||
#include "pointcalculate.h"
|
||||
#include "localcustomplot.h"
|
||||
#include "analysisoperationrecorder.h"
|
||||
|
||||
class CentralWidget:public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
#if 0
|
||||
enum AnalysisMode{
|
||||
Null,
|
||||
NumericalLabel,
|
||||
@ -26,6 +28,11 @@ public:
|
||||
OnsetTemperaturePoint,
|
||||
EndsetTemperaturePoint
|
||||
};
|
||||
#endif
|
||||
|
||||
using AnalysisMode = Global::AnalysisMode;
|
||||
|
||||
|
||||
CentralWidget(QWidget *parent = nullptr);
|
||||
~CentralWidget();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user