98 lines
2.7 KiB
C++
98 lines
2.7 KiB
C++
#ifndef DATAGRAPHVIEW_H
|
|
#define DATAGRAPHVIEW_H
|
|
|
|
#include <QWidget>
|
|
#include <QMap>
|
|
#include <QTableWidgetItem>
|
|
#include "qcustomplot.h"
|
|
#include "global.h"
|
|
#include "commonfun.h"
|
|
|
|
namespace Ui {
|
|
class CDataGraphView;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enum FormType
|
|
{
|
|
TimeDomainPlot, //时域图
|
|
FrequencyDomainPlot, //频域图
|
|
TrendChartPlot, //趋势图
|
|
SpecChartPlot, //频谱图
|
|
EnvChartPlot, //包络图
|
|
WaterFallPlot, //瀑布图
|
|
OrbitPlot, //轴心轨迹
|
|
PolarPlot, //极坐标
|
|
BodePlot, //伯德图
|
|
ShaftCenterline, //轴心位置图
|
|
AllWavePlot , //全谱图
|
|
TimeWavePlot //时域长波形
|
|
};
|
|
|
|
|
|
class CDataGraphView : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit CDataGraphView(QWidget *parent = nullptr);
|
|
~CDataGraphView();
|
|
void ReadDat();
|
|
void SetDataIDs(const QStringList &strIDList, QString strTitle,const QStringList& strChannleTypeList,\
|
|
const QStringList& strChannleNameList);
|
|
void ViewData(QString& strChannelID,QVector<WAVE_DATA>& wavedata);
|
|
void ReadDatFile(QString strFileName);
|
|
|
|
QMap<QString,QVector<WAVE_DATA>> m_mapWaveData;
|
|
signals:
|
|
void ItemCheckStateSignal(QString strID, bool bChecked);
|
|
public slots:
|
|
void ItemChangedSlot(QTableWidgetItem *item);
|
|
void ItemPressSlot(QTableWidgetItem *item);
|
|
void mouseMoveEvent(QMouseEvent *event);
|
|
void mouseMoveEvent2(QMouseEvent *event);
|
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
|
|
|
private:
|
|
Ui::CDataGraphView *ui;
|
|
QCPItemTracer *tracer,*tracer2; //游标
|
|
QCPItemText *tracerLabel,*tracerLabel2; //游标标签
|
|
QStringList m_listChannelID;
|
|
QMap<QString, QTableWidgetItem*> m_mapChannelIDtoLabel;
|
|
FormType m_iFormType;
|
|
QList<QString> listChannelID;
|
|
QCPGraph *TimeGraph,*FreGraph;
|
|
|
|
QString m_strChannelID;
|
|
|
|
QTableWidgetItem * AddTableWgtItem(QString strText, QString clolor, QString strID);
|
|
|
|
void RemoveSeries();
|
|
|
|
CCommonFun comFun;
|
|
|
|
QVector<WAVE_DATA> m_vecPushData; //推送的原始数据
|
|
QVector<WAVE_ALLDATA> m_vecAllData; //推送的原始数据
|
|
QMap<QString,QVector<WAVE_DATA>> mapWaveData;
|
|
QVector<GroupData> m_vecGroupdata; //趋势数据
|
|
QVector<WAVE_INFO> m_vecWaveInfo;
|
|
|
|
int m_iCount; //总时间
|
|
int m_iCurCount; //当前时间
|
|
int m_iRealCount; //实际读出的秒数
|
|
|
|
int channelwork[64];
|
|
int channelEnabled[64];
|
|
QString m_strFileName;
|
|
|
|
QVector<WAVE_DATA> m_wavedata;
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif // DATAGRAPHVIEW_H
|