2025-04-12 13:02:37 +00:00
|
|
|
#ifndef __GLOBAL_H
|
|
|
|
|
#define __GLOBAL_H
|
2025-03-12 09:29:52 +00:00
|
|
|
|
|
|
|
|
#include <qobject.h>
|
2025-03-17 13:16:16 +00:00
|
|
|
#include <qfile.h>
|
2025-04-10 09:33:38 +00:00
|
|
|
#include <qcustomplot.h>
|
|
|
|
|
|
2025-04-13 10:10:29 +00:00
|
|
|
#include "protocol.h"
|
2025-03-12 09:29:52 +00:00
|
|
|
|
2025-04-14 09:11:01 +00:00
|
|
|
namespace Global {
|
|
|
|
|
enum Mode{
|
|
|
|
|
Analysis,
|
|
|
|
|
ConnectedToDev,
|
|
|
|
|
DeliveredData,
|
|
|
|
|
ExperimentStart
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum DeviceConnectionStatus{
|
|
|
|
|
Disconnected,
|
|
|
|
|
Connected
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ExperimentData {
|
|
|
|
|
float runTime;
|
|
|
|
|
float constantTempTime;
|
|
|
|
|
float sampleTemp;
|
|
|
|
|
float dsc;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct PhaseTotalInfo{
|
|
|
|
|
int phaseIndex; // from 1 to 6.
|
|
|
|
|
Phase phase;
|
|
|
|
|
QVector<ExperimentData> dataVtr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
extern QVector<QPair<QCPCurve*,QVector<Global::ExperimentData>>> _curveDataVtr;
|
|
|
|
|
extern ExperimentInfo _experimentInfo;
|
|
|
|
|
extern Mode _mode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 0
|
2025-03-12 09:29:52 +00:00
|
|
|
class Global:public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
Global();
|
|
|
|
|
static Global* instance();
|
|
|
|
|
|
|
|
|
|
enum Mode{
|
2025-03-13 09:27:31 +00:00
|
|
|
Analysis,
|
|
|
|
|
ConnectedToDev,
|
2025-03-17 09:30:54 +00:00
|
|
|
DeliveredData,
|
2025-03-17 13:16:16 +00:00
|
|
|
ExperimentStart
|
2025-03-12 09:29:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void setMode(const Mode);
|
2025-03-13 09:27:31 +00:00
|
|
|
Mode getMode(){return _mode;}
|
|
|
|
|
|
|
|
|
|
enum DeviceConnectionStatus{
|
|
|
|
|
Disconnected,
|
|
|
|
|
Connected
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
void setDeviceConnectionStatus(const DeviceConnectionStatus);
|
|
|
|
|
DeviceConnectionStatus getDeviceConnectionStatus(){return _deviceConnectStatus;}
|
|
|
|
|
#endif
|
2025-03-17 09:30:54 +00:00
|
|
|
|
2025-04-12 13:02:37 +00:00
|
|
|
struct ExperimentData {
|
2025-04-13 10:10:29 +00:00
|
|
|
float runTime;
|
2025-04-12 13:02:37 +00:00
|
|
|
float sampleTemp;
|
|
|
|
|
float dsc;
|
|
|
|
|
};
|
|
|
|
|
|
2025-04-14 09:11:01 +00:00
|
|
|
// struct ExpeInfo
|
|
|
|
|
// {
|
|
|
|
|
// QString sampleName;
|
|
|
|
|
// float sampleWeight;
|
|
|
|
|
// QString date;
|
|
|
|
|
// QString userName;
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
enum TestType{
|
|
|
|
|
OIT,
|
|
|
|
|
NoneOIT
|
2025-04-12 13:02:37 +00:00
|
|
|
};
|
2025-04-14 09:11:01 +00:00
|
|
|
|
2025-04-12 13:02:37 +00:00
|
|
|
struct ExperimentInfo{
|
2025-04-14 09:11:01 +00:00
|
|
|
// experiment info
|
2025-04-12 13:02:37 +00:00
|
|
|
QString sampleName;
|
|
|
|
|
QString sampleWeight;
|
|
|
|
|
QString date;
|
2025-04-14 09:11:01 +00:00
|
|
|
QString experimentor;
|
|
|
|
|
// phase info
|
|
|
|
|
TestType testType;
|
|
|
|
|
GasType initialAtmosPhere;
|
2025-04-12 13:02:37 +00:00
|
|
|
int phaseSize;
|
2025-04-14 09:11:01 +00:00
|
|
|
|
|
|
|
|
QVector<Phase> phaseVtr;
|
2025-04-12 13:02:37 +00:00
|
|
|
};
|
2025-04-14 09:11:01 +00:00
|
|
|
|
|
|
|
|
ExperimentInfo _experimentInfo;
|
|
|
|
|
|
2025-04-13 08:15:54 +00:00
|
|
|
struct PhaseTotalInfo{
|
2025-04-14 09:11:01 +00:00
|
|
|
int phaseIndex; // from 1 to 6.
|
2025-04-13 08:15:54 +00:00
|
|
|
Phase phase;
|
|
|
|
|
QVector<ExperimentData> dataVtr;
|
|
|
|
|
};
|
2025-04-12 13:02:37 +00:00
|
|
|
|
|
|
|
|
QVector<QPair<QCPCurve*,QVector<Global::ExperimentData>>> _curveDataVtr;
|
2025-03-17 13:16:16 +00:00
|
|
|
|
2025-03-12 09:29:52 +00:00
|
|
|
signals:
|
|
|
|
|
void sigModeModify(const Mode);
|
2025-03-13 09:27:31 +00:00
|
|
|
void sigDeviceConnnectionStatusModify(const DeviceConnectionStatus);
|
2025-03-12 09:29:52 +00:00
|
|
|
public slots:
|
|
|
|
|
private:
|
|
|
|
|
Mode _mode;
|
2025-03-13 09:27:31 +00:00
|
|
|
DeviceConnectionStatus _deviceConnectStatus;
|
2025-03-12 09:29:52 +00:00
|
|
|
};
|
2025-04-14 09:11:01 +00:00
|
|
|
#endif
|
2025-03-12 09:29:52 +00:00
|
|
|
|
|
|
|
|
#endif // GLOBAL_H
|