#ifndef __GLOBAL_H #define __GLOBAL_H #include #include #include #include "protocol.h" #if 0 enum AnalysisMode{ Null, NumericalLabel, StartPoint, StopPoint, PeakSynthesisAnalysis, GlassTransition, OnsetTemperaturePoint, EndsetTemperaturePoint }; #endif namespace Global { const QString ExperimentDirPath = QDir::currentPath()+"/../experiment_data"; const QString SampleDataFloder = ExperimentDirPath + "/sample_data"; const QString BaseLineFolder = ExperimentDirPath + "/base_line"; const QString AnalysisStateFolder = ExperimentDirPath + "/analysis_state"; const QString CurveOfTimeTypeObjectName("curve_time"); // json string. const QString AtomsphereData("atomsphereData"); const QString SampleData("sampleData"); const QString Atmosphere("atmosphere"); const QString HeatingRate("heatingRate"); const QString SampleName("sampleName"); const QString TemperatureStr("temperature"); const QString RateStr("rate"); // const double DefaultParamter = 1.0; // enum AnalysisMode{ Null, NumericalLabel, StartPoint, StopPoint, PeakSynthesisAnalysis, GlassTransition, OnsetTemperaturePoint, EndsetTemperaturePoint }; enum Mode{ Analysis, ConnectedToDev, DeliveredData, Experiment }; 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 phaseVtr; }; struct PhaseTotalInfo{ int phaseIndex; // from 1 to 6. Phase phase; QVector dataVtr; QCPCurve * curve; }; struct CurveFileData{ QString fileName; Global::ExperimentInfo ei; QVector phaseTotalVtr; }; struct CurveExperimentData{ QCPCurve * curve; QString fileName; // discard QVector dataVtr; }; // Soft mode. extern Mode _mode; // Xlsx file data. extern QVector _curveFileDataVtr; // Experiment setting data. extern int _currentPhase; extern ExperimentInfo _experimentInfo; extern QVector _curveExperimentDataVtr; extern CurveExperimentData* _currentCurveExperimentDataPtr; // Instrument coefficient. extern bool _enthalpyCoefficientEnableFlag; ///abc extern QVector _enthalpyCoefficientVtr; // peak comprehensive ananlysis extern bool _displayTimeValue; // common func QString converDoubleToStr(const double); void quadraticLeastSquaresFit(double x[], double y[], int n, double coeff[]); double findNegativeStartPoint(double m, double b, double start, double end); }; #endif // GLOBAL_H