#ifndef GLOBAL_H #define GLOBAL_H #include #include #include #include #include "qmap.h" #define SAVE_SPEEDTIME //存储转速时间戳 enum Except{ EXCEP_ZERO,EXCEP_ONE}; extern bool AddFlag; extern QString DeviceNO; typedef struct tag_WAVE_DATA{ QString channelId; QString channelName; int wavesize; int SamleRate; int SamleRateRealTime; float mean; QString sensorType; int channelNo; int Time; QString pairChannelID; QVector waveData; QVector waveDataRealTime; QColor linColor; QVector SpeedProfileSpeed; QString sensorEngineeringUnit; QString speedRefChannelId; double sensorGapVoltage; double sensorSensitivity; int iTrigger; int iKeyCount; float iTriggerValue; float iHysteresis; bool tachAutoTach; QVector TimeStamp; QVector RMSValue; tag_WAVE_DATA(){ channelId = ""; channelName = ""; wavesize = 0; SamleRate = 0; mean = 0.0; sensorType = ""; channelNo = 0; Time = 0; pairChannelID = ""; sensorEngineeringUnit = ""; speedRefChannelId = ""; iTrigger = -1; iKeyCount= 0; iTriggerValue = 0.0; iHysteresis = 0.0; } } WAVE_DATA; typedef struct { QString channelId; float wavedata; } WAVE_ALLDATA; typedef struct { int Second; QString channelId; QVector waveData; QVector TimeStamp; } WAVE_CHNDATA; //实时数据 typedef struct { int total; int count; int type; // 1: 转速通道 0:其他 int number; // 原始数据量 int flag; // 平台标识 char channelId[16]; char SensorEngineeringUnit[32]; float waveData[32768]; } WAVE_CONTAIN; typedef struct { QString channelId; QVector wavedata; } WAVE_CSVDATA; typedef struct { QVector Key; QVector wavedata; //原始数据 QVector wavedataEnv;//包络数据 QVector wavedata_DC; QVector wavedataFre;//频域数据 QVector TimeStamp; QColor linColor; QString channelType; QString sensorEngineeringUnit; int SamleRate; double mean; double meanRpm; QString channleName; int iTrigger; int iKeyCount; float iTriggerValue; float iHysteresis; bool tachAutoTach; double RMS; } WAVE_DISPALYDATA; typedef struct{ QString channelId; QString channelType; QString channelName; int channelSamleRate; QString sensorType; QString pairChannelID; QString equipmentName; int TachTriggerPerRev; QString sensorEngineeringUnit; QString speedRefChannelId; bool tachAutoTach; QVector SpeedProfileSpeed; QVector RMSValue; double sensorGapVoltage; double sensorSensitivity; int iTrigger; int iKeyCount; double iTriggerValue; double iHysteresis; }WAVE_INFO; typedef struct tag_DEVICE_INFO{ QString DeviceMac; QString DeviceName; QString DeviceIP; QString DeviceType; tag_DEVICE_INFO(){ DeviceMac = ""; DeviceName = ""; DeviceIP = ""; DeviceType = ""; } }DEVICE_INFO; typedef struct tag_REPORT_INFO{ QString DeviceMac; QString DeviceName; QString DevicemCollectTime; tag_REPORT_INFO(){ DeviceMac = ""; DeviceName = ""; DevicemCollectTime = ""; } }REPORT_INFO; typedef struct { QVector key; QVector value; } KeyPhasor; typedef struct tag_RotatingSpeed{ int iTrigger; int iTriggerValue; int iKeyCount; int iHysteresis; tag_RotatingSpeed(){ iTrigger = -1; iTriggerValue = 0; iKeyCount = 0; iHysteresis = 0; } }RotatingSpeed ; class global { public: global(); ~global(); void Sleep(int msec); public: static quint16 port; static QString IpAddr_G; //设备IP static QString MacAddr_G; //设备MAC地址 static QString FilePath_G; //文件路径 static int m_nowChannel; //当前通道 static int Count_G; //dat文件总共秒数 static QVector m_featureData; static RotatingSpeed rotatingSpeed; }; #endif // GLOBAL_H