2025-01-04 18:18:19 +08:00
|
|
|
|
#ifndef DP_GLOBALS_H
|
|
|
|
|
|
#define DP_GLOBALS_H
|
|
|
|
|
|
|
|
|
|
|
|
enum DataPanelType
|
|
|
|
|
|
{
|
2025-09-01 19:57:02 +08:00
|
|
|
|
lineChart = 0, //曲线图
|
|
|
|
|
|
//curveChart, //曲线图
|
2025-01-04 18:18:19 +08:00
|
|
|
|
barChart, //柱状图
|
|
|
|
|
|
dotChart, //点图
|
|
|
|
|
|
pieChart, //饼图
|
|
|
|
|
|
heatMap, //热力图
|
|
|
|
|
|
dial, //仪表图
|
|
|
|
|
|
table, //数据表
|
|
|
|
|
|
map //地图
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-03-28 17:17:44 +08:00
|
|
|
|
enum RealTimeDataType
|
|
|
|
|
|
{
|
|
|
|
|
|
power = 0, //功率
|
|
|
|
|
|
voltage, //电压
|
2025-07-25 17:42:15 +08:00
|
|
|
|
current, //电流
|
|
|
|
|
|
temperature //温度
|
2025-03-28 17:17:44 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-07-15 19:35:37 +08:00
|
|
|
|
enum AxisArrangementMode //坐标轴排列方式
|
|
|
|
|
|
{
|
|
|
|
|
|
AlternateSides = 0, //左右交替排列
|
|
|
|
|
|
AllRight //右侧排列
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-09-01 19:57:02 +08:00
|
|
|
|
enum BarOrientation //直方图方向
|
|
|
|
|
|
{
|
2025-09-05 14:54:34 +08:00
|
|
|
|
Vertical = 0,
|
|
|
|
|
|
Horizontal
|
2025-09-01 19:57:02 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2025-01-16 20:26:17 +08:00
|
|
|
|
#include <QStandardItemModel>
|
2025-07-15 19:35:37 +08:00
|
|
|
|
struct AxisCfgInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
QString name;
|
|
|
|
|
|
QString unit;
|
|
|
|
|
|
};
|
2025-01-16 20:26:17 +08:00
|
|
|
|
struct configurationResults
|
|
|
|
|
|
{
|
|
|
|
|
|
QStandardItemModel* m_pModel_dataType;
|
|
|
|
|
|
QStandardItemModel* m_pModel_dataSource;
|
2025-07-04 17:48:57 +08:00
|
|
|
|
QString dataServiceIP;
|
|
|
|
|
|
int dataServicePort;
|
2025-08-07 11:48:08 +08:00
|
|
|
|
bool showLegend;
|
2025-09-02 16:28:32 +08:00
|
|
|
|
bool groupByType;
|
2025-09-01 19:57:02 +08:00
|
|
|
|
AxisArrangementMode axisArrangement;
|
|
|
|
|
|
BarOrientation barOrientataion;
|
2025-07-25 17:42:15 +08:00
|
|
|
|
QHash<RealTimeDataType, AxisCfgInfo> axisCfgMap; //可能有多个轴(数据类别)
|
2025-07-14 15:02:29 +08:00
|
|
|
|
|
2025-01-16 20:26:17 +08:00
|
|
|
|
configurationResults()
|
|
|
|
|
|
{
|
|
|
|
|
|
m_pModel_dataType = nullptr;
|
|
|
|
|
|
m_pModel_dataSource = nullptr;
|
2025-07-04 17:48:57 +08:00
|
|
|
|
|
|
|
|
|
|
dataServiceIP = "127.0.0.1";
|
|
|
|
|
|
dataServicePort = 1987;
|
2025-07-14 15:02:29 +08:00
|
|
|
|
|
2025-08-07 11:48:08 +08:00
|
|
|
|
showLegend = false;
|
2025-09-02 16:28:32 +08:00
|
|
|
|
groupByType = false;
|
2025-09-01 19:57:02 +08:00
|
|
|
|
axisArrangement = AlternateSides;
|
|
|
|
|
|
barOrientataion = Vertical;
|
2025-01-16 20:26:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-07-15 19:35:37 +08:00
|
|
|
|
void setModelParent(QObject* parent) //为QStandardItemModel对象构造对象树,从而利用QT的资源自动管理
|
2025-01-16 20:26:17 +08:00
|
|
|
|
{
|
|
|
|
|
|
m_pModel_dataType = new QStandardItemModel(parent);
|
|
|
|
|
|
m_pModel_dataSource = new QStandardItemModel(parent);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2025-01-22 15:40:50 +08:00
|
|
|
|
#define itemRole_tag 1
|
|
|
|
|
|
#define itemRole_stationID 2
|
|
|
|
|
|
#define itemRole_componentID 3
|
|
|
|
|
|
#define itemRole_pointID 4
|
2025-03-28 17:17:44 +08:00
|
|
|
|
#define itemRole_dataType 5
|
2025-01-22 15:40:50 +08:00
|
|
|
|
|
2025-01-04 18:18:19 +08:00
|
|
|
|
#endif
|