PowerMaster/dataPanel/dpGlobals.h

83 lines
1.8 KiB
C
Raw Normal View History

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