mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
搭建PVB架构,实现前端的基础布局、菜单、表格、图示等功能
This commit is contained in:
44
src/pv/pages/MaskPageForecast.cpp
Normal file
44
src/pv/pages/MaskPageForecast.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
#include "MaskPageForecast.h"
|
||||
|
||||
#include "pv/PvChart.h"
|
||||
|
||||
static int CreatePanel(PARAM* p, int parentId, int x, int y, int w, int h, std::string title)
|
||||
{
|
||||
int id = PvApp::label(p, parentId, x, y, w, h, "", QSS_LABEL_BKG_2);
|
||||
PvApp::label(p, id, 10, 10, w, 20, title, STYLE_TITLE_ICON);
|
||||
PvApp::label(p, id, 20, 30, w, 2, "", QSS_UNDERLINE);
|
||||
return id;
|
||||
}
|
||||
|
||||
MaskPageForecast::MaskPageForecast(PARAM* p) : PvMask(p)
|
||||
{
|
||||
}
|
||||
|
||||
int MaskPageForecast::initUI(EPvCode pvcode)
|
||||
{
|
||||
int x = 10, y = 100, w = 1900, h = 420;
|
||||
int delta = 40;
|
||||
{
|
||||
int panel = CreatePanel(p, 0, x, y, w, h, "储能充放电预测");
|
||||
chart1_ = std::make_shared<PvChartCurve>(p, panel, 0, delta, w, h-delta);
|
||||
chart1_->setBackground(p, 8, 54, 91);
|
||||
chart1_->setLabelYLeft("电量(kWh)", 0, 10, 2);
|
||||
chart1_->insertItem(0, "充电电量", 120, 10, 80);
|
||||
chart1_->insertItem(0, "放电电量", 200, 10, 80);
|
||||
}
|
||||
{
|
||||
int panel = CreatePanel(p, 0, x, y+=(h+10), w = 945, h, "光伏发电预测");
|
||||
chart2_ = std::make_shared<PvChartCurve>(p, panel, 0, delta, w, h-delta);
|
||||
chart2_->setBackground(p, 8, 54, 91);
|
||||
chart2_->setLabelYLeft("电量(kWh)", 0, 10, 2);
|
||||
chart2_->insertItem(0, "发电电量", 120, 10, 80);
|
||||
}
|
||||
{
|
||||
int panel = CreatePanel(p, 0, x+=(w+10), y, w, h, "充电负荷预测");
|
||||
chart3_ = std::make_shared<PvChartCurve>(p, panel, 0, delta, w, h-delta);
|
||||
chart3_->setBackground(p, 8, 54, 91);
|
||||
chart3_->setLabelYLeft("电量(kWh)", 0, 10, 2);
|
||||
chart3_->insertItem(0, "充电电量", 120, 10, 80);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user