mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
实现策略配置功能
This commit is contained in:
@@ -11,12 +11,9 @@
|
||||
|
||||
void TestPage(PARAM* p)
|
||||
{
|
||||
auto& appdata = Application::data();
|
||||
auto pagination = new PvPagination(p, 0, 600, 160, 20);
|
||||
pagination->setPage(5, 10);
|
||||
|
||||
int id = PvApp::label(p, 0, 0, 0, 1920, 800, "", qss::label(14, "", "rgb(15, 50, 68)"));
|
||||
new PanelPolicyPeak(p, id, 0, 0, 1920, 1080);
|
||||
//auto& appdata = Application::data();
|
||||
//auto pagination = new PvPagination(p, 0, 600, 160, 20);
|
||||
//pagination->setPage(5, 10);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +189,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0,stop:1 rgba(0,255,240,200),stop:0 rgba(0,255,240,0));
|
||||
int MaskPageHome::initUI(EPvCode pvcode)
|
||||
{
|
||||
@@ -317,11 +313,8 @@ int MaskPageHome::initUI(EPvCode pvcode)
|
||||
|
||||
this->updateUI();
|
||||
|
||||
|
||||
|
||||
TestPage(p);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -342,7 +335,7 @@ void MaskPageHome::updateUI()
|
||||
}
|
||||
|
||||
pvSetText(p, ui.labelRunDays, "100 天");
|
||||
pvSetText(p, ui.labelRunDays, (Utils::toStr(stationNum) + " 个").c_str());
|
||||
pvSetText(p, ui.labelStationNum, (Utils::toStr(stationNum) + " 个").c_str());
|
||||
pvSetText(p, ui.labelEnergyCapacity, (Utils::toStr(energyCapacity) + " kWh").c_str());
|
||||
pvSetText(p, ui.labelIncome, (Utils::toStr(incomeTotal) + " 元").c_str());
|
||||
pvSetText(p, ui.labelStorageIn, (Utils::toStr(electStorageIn) + " kWh").c_str());
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "MaskPageRunning.h"
|
||||
#include "app/Application.h"
|
||||
#include "app/AppData.h"
|
||||
#include "app/Station.h"
|
||||
#include "app/Device.h"
|
||||
#include "common/JsonN.h"
|
||||
|
||||
|
||||
static int CreateParamLabel(PARAM* p, int parent, int x, int y, std::string k, std::string v)
|
||||
{
|
||||
@@ -8,21 +12,21 @@ static int CreateParamLabel(PARAM* p, int parent, int x, int y, std::string k, s
|
||||
return PvApp::label(p, parent, x += 70, y, 120, 30, v, qss::LABEL_VAL);
|
||||
}
|
||||
|
||||
class BoxCard : PvObject
|
||||
class CardDevice : PvObject
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<BoxCard> create(PARAM* p, int parent, int x, int y)
|
||||
static std::shared_ptr<CardDevice> create(PARAM* p, int parent, int x, int y)
|
||||
{
|
||||
return std::make_shared<BoxCard>(p, parent, x, y);
|
||||
return std::make_shared<CardDevice>(p, parent, x, y);
|
||||
}
|
||||
|
||||
BoxCard(PARAM* p, int parent, int x, int y) : PvObject(p)
|
||||
CardDevice(PARAM* p, int parent, int x, int y) : PvObject(p)
|
||||
{
|
||||
card_ = PvApp::label(p, parent, x, y, 400, 250, "", qss::QSS_CARD_DEVICE);
|
||||
|
||||
PvApp::label(p, card_, 10, 10, 60, 60, "", "border:none; background-color: rgb(39, 158, 145);");
|
||||
ui.code = PvApp::label(p, card_, 80, 10, 100, 20, "");
|
||||
ui.name = PvApp::label(p, card_, 80, 30, 100, 20, "");
|
||||
ui.name = PvApp::label(p, card_, 80, 10, 100, 20, "");
|
||||
ui.code = PvApp::label(p, card_, 80, 30, 100, 20, "");
|
||||
ui.type = PvApp::label(p, card_, 80, 50, 100, 20, "", qss::label(14, "rgb(8, 161, 249)"));
|
||||
|
||||
int x1 = 190;
|
||||
@@ -40,14 +44,14 @@ public:
|
||||
|
||||
// 默认创建 10 个参数标签:
|
||||
int n = 10;
|
||||
vecParamLabel_.resize(n);
|
||||
vecParamLabel.resize(n);
|
||||
for (int i = 0; i<n; i++)
|
||||
{
|
||||
int row = i/2;
|
||||
int col = i%2;
|
||||
int h = 25;
|
||||
vecParamLabel_[i].first = PvApp::label(p, card_, 10 + 200*col, 115 + h*row, 70, h, "参数"+std::to_string(i) + ":", qss::LABEL_KEY);
|
||||
vecParamLabel_[i].second = PvApp::label(p, card_, 10 + 200*col + 70, 115 + h*row, 120, h, "---", qss::LABEL_VAL);
|
||||
vecParamLabel[i].first = PvApp::label(p, card_, 10 + 200*col, 115 + h*row, 70, h, "参数"+std::to_string(i) + ":", qss::LABEL_KEY);
|
||||
vecParamLabel[i].second = PvApp::label(p, card_, 10 + 200*col + 70, 115 + h*row, 120, h, "---", qss::LABEL_VAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,10 +64,10 @@ public:
|
||||
|
||||
void setParamkeys(std::vector<std::string> vecKeys)
|
||||
{
|
||||
for (int i = 0; i<vecParamLabel_.size(); i++)
|
||||
for (int i = 0; i<vecParamLabel.size(); i++)
|
||||
{
|
||||
auto& labelKey = vecParamLabel_[i].first;
|
||||
auto& labelVal = vecParamLabel_[i].second;
|
||||
auto& labelKey = vecParamLabel[i].first;
|
||||
auto& labelVal = vecParamLabel[i].second;
|
||||
if (i<vecKeys.size())
|
||||
{
|
||||
std::string& title = vecKeys[i] + ":";
|
||||
@@ -96,7 +100,7 @@ public:
|
||||
|
||||
int card_;
|
||||
|
||||
std::vector<std::pair<int, int>> vecParamLabel_;
|
||||
std::vector<std::pair<int, int>> vecParamLabel;
|
||||
std::map<std::string, int> mapParam_;
|
||||
};
|
||||
|
||||
@@ -106,135 +110,199 @@ MaskPageRunning::MaskPageRunning(PARAM* p) : PvMask(p)
|
||||
|
||||
int MaskPageRunning::initUI(EPvCode pvcode)
|
||||
{
|
||||
auto& appdata = Application::data();
|
||||
|
||||
PvApp::label(p, 0, 10, 100, 1900, 850, "", "background-color: rgb(5, 47, 77); border-radius: 10px;");
|
||||
PvApp::label(p, 0, 10, 150, 220, 790, "", "background-color: rgb(8, 54, 91); border-radius: 10px;");
|
||||
int workspace = PvApp::label(p, 0, 240, 150, 1670, 790, "", "background-color: rgba(8, 54, 91, 0); border-radius: 10px;");
|
||||
|
||||
std::vector<std::string> vecStationNames = Application::data().getStationNames();
|
||||
std::vector<std::string> vecStationNames = appdata.getStationNames();
|
||||
PvApp::label(p, 0, 20, 110, 80, 30, "场站切换", "color:white; font: bold 16px;");
|
||||
PvApp::combox(p, 0, 100, 110, 150, 30, vecStationNames);
|
||||
ui.comboxStation = PvApp::combox(p, 0, 100, 110, 150, 30, vecStationNames);
|
||||
if (vecStationNames.size() > 0)
|
||||
{
|
||||
station_ = Application::data().getStationByName(vecStationNames[0]);
|
||||
activeStation = appdata.getStationByName(vecStationNames[0]);
|
||||
}
|
||||
|
||||
PvApp::label(p, 0, 320, 110, 80, 30, "运行模式", "color:white; font: bold 16px;");
|
||||
PvApp::combox(p, 0, 400, 110, 200, 30, Application::data().getWorkModes());
|
||||
ui.comboxWorkMode = PvApp::combox(p, 0, 400, 110, 200, 30, appdata.getWorkModes(), activeStation->id - 1);
|
||||
|
||||
PvApp::label(p, 0, 670, 110, 80, 30, "策略名称", "color:white; font: bold 16px;");
|
||||
PvApp::combox(p, 0, 750, 110, 200, 30, Application::data().getPolicyNames());
|
||||
PvApp::combox(p, 0, 750, 110, 200, 30, appdata.getPolicyNames());
|
||||
|
||||
int x = 20, y = 160, w = 200, h = 180;
|
||||
// 储能设备
|
||||
{
|
||||
ui.storage.name = "储能设备";
|
||||
int pid = ui.storage.box = PvApp::label(p, 0, x, y, w, h, "", qss::LABEL_BOX);
|
||||
PvApp::label(p, pid, 10, 0, w-10, 30, ui.storage.name, qss::LABEL_TITLE);
|
||||
|
||||
ui.storage.btn = PvApp::button(p, pid, 0, 0, w, h, "", "background-color: transparent;");
|
||||
ui.storage.workspace = PvApp::widget(p, workspace, 0, 0, 1670, 790);
|
||||
pvHide(p, ui.storage.workspace);
|
||||
this->initModule(storage, "储能设备", x, y, w, h);
|
||||
storage.workspace = PvApp::widget(p, workspace, 0, 0, 1670, 790);
|
||||
pvHide(p, storage.workspace);
|
||||
|
||||
// 创建信息卡片
|
||||
{
|
||||
vecCard_.resize(12);
|
||||
for (int i=0; i<vecCard_.size(); ++i)
|
||||
{
|
||||
vecCard_[i] = BoxCard::create(p, ui.storage.workspace, (i%4)*410, (i/4)*260);
|
||||
vecCard_[i] = CardDevice::create(p, storage.workspace, (i%4)*410, (i/4)*260);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 光伏设备
|
||||
{
|
||||
ui.solar.name = "光伏设备";
|
||||
int pid = ui.solar.box = PvApp::label(p, 0, x, y += (h+10), w, h, "", qss::LABEL_BOX);
|
||||
PvApp::label(p, pid, 10, 0, w-10, 30, ui.solar.name, qss::LABEL_TITLE);
|
||||
|
||||
ui.solar.btn = PvApp::button(p, pid, 0, 0, w, h, "", "background-color: transparent;");
|
||||
ui.solar.workspace = ui.storage.workspace;
|
||||
pvHide(p, ui.solar.workspace);
|
||||
this->initModule(solar, "光伏设备", x, y += (h+10), w, h);
|
||||
solar.workspace = storage.workspace;
|
||||
pvHide(p, solar.workspace);
|
||||
}
|
||||
// 充电设备
|
||||
{
|
||||
ui.charge.name = "充电设备";
|
||||
int pid = ui.charge.box = PvApp::label(p, 0, x, y += (h+10), w, h, "", qss::LABEL_BOX);
|
||||
PvApp::label(p, pid, 10, 0, w-10, 30, ui.solar.name, qss::LABEL_TITLE);
|
||||
|
||||
ui.charge.btn = PvApp::button(p, pid, 0, 0, w, h, "", "background-color: transparent;");
|
||||
ui.charge.workspace = ui.storage.workspace;
|
||||
pvHide(p, ui.charge.workspace);
|
||||
this->initModule(charge, "充电设备", x, y += (h+10), w, h);
|
||||
charge.workspace = storage.workspace;
|
||||
pvHide(p, charge.workspace);
|
||||
}
|
||||
// 环境与安防设备
|
||||
{
|
||||
ui.security.name = "环境与安防设备";
|
||||
int pid = ui.security.box = PvApp::label(p, 0, x, y += (h+10), w, h, "", qss::LABEL_BOX);
|
||||
PvApp::label(p, pid, 10, 0, w-10, 30, ui.security.name, qss::LABEL_TITLE);
|
||||
this->initModule(security, "环境与安防设备", x, y += (h+10), w, h);
|
||||
security.workspace = PvApp::widget(p, workspace, 0, 0, 1670, 790);
|
||||
pvHide(p, security.workspace);
|
||||
|
||||
ui.security.btn = PvApp::button(p, pid, 0, 0, w, h, "", "background-color: transparent;");
|
||||
ui.security.workspace = PvApp::widget(p, workspace, 0, 0, 1670, 790);
|
||||
pvHide(p, ui.security.workspace);
|
||||
{
|
||||
std::string style = qss::label(20, "white; padding: 0px 0px 0px 10px;", "rgb(8, 54, 91)", "none; border-radius: 5px;");
|
||||
for (int i = 0; i<12; ++i)
|
||||
{
|
||||
int w = 320, h = 240;
|
||||
int x = 0+(w+10)*(i%4), y = 0+(h+10)*(i/4);
|
||||
int cardId = PvApp::label(p, security.workspace, x, y, w, h, "监控点 " + std::to_string(i+1), style);
|
||||
pvSetAlignment(p, cardId, AlignLeft | AlignTop);
|
||||
|
||||
PvApp::label(p, cardId, 10, 40, w-20, h-50, "", qss::label(14, "", "", "8px solid black; border-radius: 0px;"));
|
||||
PvApp::image(p, cardId, (w-77)*0.5, 40+(h-40-77)*0.5, 77, 77, "play1.png");
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
int w = 320, h = 50;
|
||||
int pid = PvApp::label(p, security.workspace, 1320, 10, w, 200, "环境温度信息", qss::label(20, "", "", "none;"));
|
||||
pvSetAlignment(p, pid, AlignLeft | AlignTop);
|
||||
PvApp::label(p, pid, 0, 30, w, 5, "", qss::QSS_UNDERLINE);
|
||||
|
||||
int x = 0, y = 50;
|
||||
PvApp::label(p, pid, x, y, w, h, "", qss::label(14, "", "rgb(16, 105, 125)", "none; border-radius: 5px 5px 0px 0px;"));
|
||||
PvApp::label(p, pid, x, y, w, h*2, "", qss::label(14, "", "", "1px solid rgb(12, 255, 251); border-radius: 5px;"));
|
||||
{
|
||||
w = w/3;
|
||||
PvApp::labelCenter(p, pid, x, y, w, h, "点位");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "温度");
|
||||
PvApp::labelCenter(p, pid, x+w*2, y, w, h, "湿度");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#1");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "20 ℃");
|
||||
PvApp::labelCenter(p, pid, x+w*2, y, w, h, "30 %");
|
||||
}
|
||||
}
|
||||
{
|
||||
int w = 320, h = 50;
|
||||
int pid = PvApp::label(p, security.workspace, 1320, 200, w, 500, "消防信息", qss::label(20, "", "", "none;"));
|
||||
pvSetAlignment(p, pid, AlignLeft | AlignTop);
|
||||
PvApp::label(p, pid, 0, 30, w, 5, "", qss::QSS_UNDERLINE);
|
||||
|
||||
int x = 0, y = 50;
|
||||
PvApp::label(p, pid, x, y, w, h, "", qss::label(14, "", "rgb(16, 105, 125)", "none; border-radius: 5px 5px 0px 0px;"));
|
||||
PvApp::label(p, pid, x, y, w, h*9, "", qss::label(14, "", "", "1px solid rgb(12, 255, 251); border-radius: 5px;"));
|
||||
{
|
||||
w = w/2;
|
||||
PvApp::labelCenter(p, pid, x, y, w, h, "点位");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "烟感状态");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#1");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#2");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#3");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#4");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#5");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#6");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#7");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
PvApp::labelCenter(p, pid, x, y += h, w, h, "#8");
|
||||
PvApp::labelCenter(p, pid, x+w, y, w, h, "XXX");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
activeBoxPanel(ui.storage);
|
||||
activeBoxPanel(&storage);
|
||||
|
||||
{
|
||||
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.comboxStation, [=](std::string s) { this->onComboxStation(s); });
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.comboxWorkMode, [=](std::string s) { this->onComboxWorkMode(s); });
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MaskPageRunning::initModule(Module& module, std::string name, int x, int y, int w, int h)
|
||||
{
|
||||
module.name = name;
|
||||
|
||||
int deviceNum = activeStation->getDeviceNumByGroup(name);
|
||||
int pid = module.widget = PvApp::label(p, 0, x, y, w, h, "", qss::LABEL_BOX);
|
||||
PvApp::label(p, module.widget, 10, 20, w, 30, module.name, qss::LABEL_TITLE);
|
||||
pvSetAlignment(p, module.widget, AlignTop | AlignLeft);
|
||||
module.labelPower = PvApp::lineLabel(p, pid, PvRect(10, 80, 180, 30), 70, "总功率:", "60 W");
|
||||
module.labelNum = PvApp::lineLabel(p, pid, PvRect(10, 110, 180, 30), 70, "设备数量:", std::to_string(deviceNum).c_str());
|
||||
module.btn = PvApp::button(p, pid, 0, 0, w, h, "", "background-color: transparent;");
|
||||
}
|
||||
|
||||
|
||||
EPvCode MaskPageRunning::onEventButton(int pvid)
|
||||
{
|
||||
if (pvid == ui.storage.btn) { activeBoxPanel(ui.storage); }
|
||||
else if (pvid == ui.solar.btn) { activeBoxPanel(ui.solar); }
|
||||
else if (pvid == ui.charge.btn) { activeBoxPanel(ui.charge); }
|
||||
else if (pvid == ui.security.btn) { activeBoxPanel(ui.security); }
|
||||
|
||||
if (pvid == storage.btn) { activeBoxPanel(&storage); }
|
||||
else if (pvid == solar.btn) { activeBoxPanel(&solar); }
|
||||
else if (pvid == charge.btn) { activeBoxPanel(&charge); }
|
||||
else if (pvid == security.btn) { activeBoxPanel(&security); }
|
||||
return EPvCode::NUL;
|
||||
}
|
||||
|
||||
std::map<std::string, std::vector<std::string>> mapDeviceTypes =
|
||||
void MaskPageRunning::activeBoxPanel(Module* module)
|
||||
{
|
||||
{"储能设备", {"储能预制舱", "储能电池", "储能电池", "储能电池"}},
|
||||
{"光伏设备", {"光伏板", "光伏板", "光伏板", "光伏板", "光伏板", "光伏板", "光伏板", "光伏板"}},
|
||||
{"充电设备", {"充电桩", "充电桩", "充电桩", "充电桩", "充电桩", "充电桩", "充电桩", "充电桩", "充电桩", "充电桩"}},
|
||||
};
|
||||
std::map<std::string, std::vector<std::string>> mapDeviceParams =
|
||||
{
|
||||
{"储能预制舱", {"运行模式", "冷却方式", "实时电压", "额定电压", "实时电流", "额定电流", "实时功率", "额定功率", "功率因数", "电池容量"}},
|
||||
{"储能电池", {"实时电压", "额定电压", "实时电流", "额定电流", "实时功率", "额定功率", "功率因数", "电池容量"}},
|
||||
{"逆变器", {"实时电压", "额定电压", "实时电流", "额定电流", "实时功率", "额定功率", "功率因数"}},
|
||||
{"光伏板", {"实时电压", "额定电压", "实时电流", "额定电流", "实时功率", "额定功率", "功率因数"}},
|
||||
{"充电桩", {"实时电压", "额定电压", "实时电流", "额定电流", "实时功率", "额定功率", "功率因数"}},
|
||||
};
|
||||
if (activeBox)
|
||||
{
|
||||
pvSetStyleSheet(p, activeBox->widget, qss::LABEL_BOX.c_str());
|
||||
pvHide(p, activeBox->workspace);
|
||||
}
|
||||
activeBox = module;
|
||||
if (activeBox)
|
||||
{
|
||||
pvSetStyleSheet(p, activeBox->widget, qss::QSS_BOX_ACTIVE.c_str());
|
||||
pvShow(p, activeBox->workspace);
|
||||
}
|
||||
|
||||
void MaskPageRunning::activeBoxPanel(BoxPanel& panel)
|
||||
{
|
||||
static int activeBox = PV_ID_NUL;
|
||||
static int activeWorkspace = PV_ID_NUL;
|
||||
if (activeBox != PV_ID_NUL) { pvSetStyleSheet(p, activeBox, qss::LABEL_BOX.c_str()); }
|
||||
if (activeBox = panel.box) { pvSetStyleSheet(p, activeBox, qss::QSS_BOX_ACTIVE.c_str()); }
|
||||
|
||||
if (activeWorkspace != PV_ID_NUL) { pvHide(p, activeWorkspace); }
|
||||
if (activeWorkspace = panel.workspace) { pvShow(p, activeWorkspace); }
|
||||
|
||||
|
||||
if (panel.workspace != ui.security.workspace)
|
||||
auto& appdata = Application::data();
|
||||
if (activeBox->workspace != security.workspace)
|
||||
{
|
||||
std::vector<std::string> vecDeviceInfo = mapDeviceTypes[panel.name];
|
||||
// 更新卡片:
|
||||
std::vector<std::shared_ptr<Device>> vecDevice;
|
||||
activeStation->getDeviceByGroup(module->name, vecDevice);
|
||||
|
||||
pvSetText(p, module->labelNum, std::to_string(vecDevice.size()).c_str());
|
||||
|
||||
// 读取储能设备信息
|
||||
for (int i = 0; i<vecCard_.size(); ++i)
|
||||
{
|
||||
auto& card = vecCard_[i];
|
||||
if (i < vecDeviceInfo.size())
|
||||
if (i < vecDevice.size())
|
||||
{
|
||||
std::string type = vecDeviceInfo[i];
|
||||
auto device = vecDevice[i];
|
||||
auto typeDef = appdata.getDeviceTypeDef(device->type);
|
||||
if (typeDef)
|
||||
{
|
||||
std::vector<std::string> vecKeys;
|
||||
NJson::parse(typeDef->fieldsAttr.value("key"), vecKeys);
|
||||
card->setCard(typeDef->name, device->name, device->code);
|
||||
card->setParamkeys(vecKeys);
|
||||
}
|
||||
card->show(1);
|
||||
card->setCard(type, type+"-"+std::to_string(i), type+"-"+std::to_string(i));
|
||||
card->setParamkeys(mapDeviceParams[type]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -242,4 +310,38 @@ void MaskPageRunning::activeBoxPanel(BoxPanel& panel)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MaskPageRunning::updateWorkspace()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MaskPageRunning::onComboxStation(std::string stationName)
|
||||
{
|
||||
if (!activeStation) return;
|
||||
|
||||
auto& appdata = Application::data();
|
||||
activeStation = appdata.getStationByName(stationName);
|
||||
|
||||
// 更新运行模式和策略
|
||||
{
|
||||
int index = activeStation->workModeId - 1;
|
||||
if (index < 0) { index = 0; }
|
||||
pvSetCurrentItem(p, ui.comboxWorkMode, index);
|
||||
}
|
||||
|
||||
this->activeBoxPanel(activeBox);
|
||||
}
|
||||
|
||||
void MaskPageRunning::onComboxWorkMode(std::string modeName)
|
||||
{
|
||||
if (!activeStation) return;
|
||||
|
||||
auto& appdata = Application::data();
|
||||
|
||||
int workModeId = appdata.getWorkModeIdByName(modeName);
|
||||
activeStation->setWorkMode(workModeId);
|
||||
|
||||
|
||||
}
|
||||
@@ -2,34 +2,48 @@
|
||||
|
||||
#include "pv/PvApp.h"
|
||||
|
||||
class BoxCard;
|
||||
class CardDevice;
|
||||
class Station;
|
||||
|
||||
class MaskPageRunning : public PvMask
|
||||
{
|
||||
public:
|
||||
struct BoxPanel {
|
||||
struct Module {
|
||||
std::string name;
|
||||
int box;
|
||||
int widget;
|
||||
int btn;
|
||||
int workspace;
|
||||
|
||||
int labelPower;
|
||||
int labelNum;
|
||||
};
|
||||
|
||||
MaskPageRunning(PARAM* p);
|
||||
int initUI(EPvCode pvcode);
|
||||
void initModule(Module& module, std::string name, int x, int y, int w, int h);
|
||||
|
||||
virtual EPvCode onEventButton(int pvid);
|
||||
|
||||
void activeBoxPanel(BoxPanel& panel);
|
||||
void activeBoxPanel(Module* module);
|
||||
|
||||
void updateWorkspace();
|
||||
|
||||
void onComboxStation(std::string stationName);
|
||||
void onComboxWorkMode(std::string modeName);
|
||||
|
||||
|
||||
struct {
|
||||
BoxPanel storage;
|
||||
BoxPanel solar;
|
||||
BoxPanel charge;
|
||||
BoxPanel security;
|
||||
int comboxStation;
|
||||
int comboxWorkMode;
|
||||
} ui;
|
||||
|
||||
std::vector<std::shared_ptr<BoxCard>> vecCard_;
|
||||
std::shared_ptr<Station> station_ = nullptr;
|
||||
Module storage;
|
||||
Module solar;
|
||||
Module charge;
|
||||
Module security;
|
||||
|
||||
Module* activeBox {};
|
||||
|
||||
std::vector<std::shared_ptr<CardDevice>> vecCard_;
|
||||
std::shared_ptr<Station> activeStation = nullptr;
|
||||
};
|
||||
@@ -5,7 +5,9 @@
|
||||
#include "database/Dao.h"
|
||||
#include "database/DataModelDef.h"
|
||||
#include "common/Snowflake.h"
|
||||
#include "pv/pages/PanelPolicy.h"
|
||||
|
||||
std::vector<std::string> g_comboxList_isOpen = {"启用", "禁用"};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// === PageUser ===
|
||||
@@ -42,7 +44,7 @@ void PageUser::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
DAO::queryUserList(pageInfo, result);
|
||||
}
|
||||
void PageUser::onOperate(int row, int col, std::string oper)
|
||||
void PageUser::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
@@ -52,7 +54,7 @@ void PageUser::onOperate(int row, int col, std::string oper)
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
this->showPop(0, oper, table->getRowData(row));
|
||||
this->showPop(0, oper, table->row(irow));
|
||||
}
|
||||
};
|
||||
std::string PageUser::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
@@ -84,7 +86,7 @@ PageRole::PageRole(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
{
|
||||
auto& appdata = Application::data();
|
||||
|
||||
table->addHead(DMRole::ROLE_ID, "角色编号", 200, {});
|
||||
table->addHead(DMRole::ROLE_ID, "角色编号", 180, {});
|
||||
table->addHead(DMRole::NAME, "角色名称", 200, {});
|
||||
table->addHead(DMRole::DESCRIBE, "角色描述", 900, {});
|
||||
table->addHead(DMRole::IS_OPEN, "是否启用", 200, appdata.mapping.isopen);
|
||||
@@ -97,7 +99,7 @@ PageRole::PageRole(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
auto pop = this->addPop(500, 600, 180, "角色信息", {DMUser::USER_ID});
|
||||
pop->addParamLineEdit(DMRole::ROLE_ID, "编号", x, y, false);
|
||||
pop->addParamLineEdit(DMRole::NAME, "名称", x, y += h);
|
||||
pop->addParamCombox(DMUser::IS_OPEN, "是否启用", x, y += h, {"启用", "禁用"});
|
||||
pop->addParamCombox(DMUser::IS_OPEN, "是否启用", x, y += h, g_comboxList_isOpen);
|
||||
pop->addParamTextEdit(DMRole::DESCRIBE, "描述", x, y += h);
|
||||
|
||||
}
|
||||
@@ -105,7 +107,7 @@ void PageRole::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
DAO::queryRoleList(pageInfo, result);
|
||||
}
|
||||
void PageRole::onOperate(int row, int col, std::string oper)
|
||||
void PageRole::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
@@ -115,7 +117,7 @@ void PageRole::onOperate(int row, int col, std::string oper)
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
this->showPop(0, oper, table->getRowData(row));
|
||||
this->showPop(0, oper, table->row(irow));
|
||||
}
|
||||
}
|
||||
std::string PageRole::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
@@ -133,7 +135,7 @@ std::string PageRole::onPopConfirm(std::shared_ptr<PvPopWidget> pop, Fields& fie
|
||||
PagePermission::PagePermission(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
{
|
||||
auto& appdata = Application::data();
|
||||
table->addHead(DMPermission::PERMISSION_ID, "权限编号", 200, {});
|
||||
table->addHead(DMPermission::PERMISSION_ID, "权限编号", 180, {});
|
||||
table->addHead(DMPermission::NAME, "权限名称", 200, {});
|
||||
table->addHead(DMPermission::DESCRIBE, "权限描述", 900, {});
|
||||
table->addHead(DMPermission::IS_OPEN, "是否启用", 200, appdata.mapping.isopen);
|
||||
@@ -143,17 +145,17 @@ PagePermission::PagePermission(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
PvApp::bind(p, PvEvent::BUTTON_EVENT, btnNew, [=](std::string) { this->onOperate(-1, -1, POP_OPER_NEW); });
|
||||
|
||||
int x = 80, y = 80, h = 60;
|
||||
auto pop = this->addPop(500, 600, 180, "角色信息", {DMPermission::PERMISSION_ID});
|
||||
auto pop = this->addPop(500, 600, 240, "角色信息", {DMPermission::PERMISSION_ID});
|
||||
pop->addParamLineEdit(DMPermission::PERMISSION_ID, "编号", x, y, false);
|
||||
pop->addParamLineEdit(DMPermission::NAME, "名称", x, y += h);
|
||||
pop->addParamCombox(DMPermission::IS_OPEN, "是否启用", x, y += h, {"启用", "禁用"});
|
||||
pop->addParamCombox(DMPermission::IS_OPEN, "是否启用", x, y += h, g_comboxList_isOpen);
|
||||
pop->addParamTextEdit(DMPermission::DESCRIBE, "描述", x, y += h);
|
||||
}
|
||||
void PagePermission::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
DAO::queryPermissionList(pageInfo, result);
|
||||
}
|
||||
void PagePermission::onOperate(int row, int col, std::string oper)
|
||||
void PagePermission::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
@@ -163,7 +165,7 @@ void PagePermission::onOperate(int row, int col, std::string oper)
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
this->showPop(0, oper, table->getRowData(row));
|
||||
this->showPop(0, oper, table->row(irow));
|
||||
}
|
||||
}
|
||||
std::string PagePermission::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
@@ -180,7 +182,7 @@ std::string PagePermission::onPopConfirm(std::shared_ptr<PvPopWidget> pop, Field
|
||||
PageStation::PageStation(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
{
|
||||
auto& appdata = Application::data();
|
||||
table->addHead(DMStation::STATION_ID, "场站编号", 200, {});
|
||||
table->addHead(DMStation::STATION_ID, "场站编号", 180, {});
|
||||
table->addHead(DMStation::NAME, "场站名称", 200, {});
|
||||
table->addHead(DMStation::ADDRESS, "地址", 200, {});
|
||||
table->addHead(DMStation::LONGITUDE, "经度", 200, {});
|
||||
@@ -200,13 +202,13 @@ PageStation::PageStation(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
pop->addParamLineEdit(DMStation::LONGITUDE, "经度", x, y += h);
|
||||
pop->addParamLineEdit(DMStation::LATITUDE, "维度", x, y += h);
|
||||
pop->addParamLineEdit(DMStation::TEL, "电话", x, y += h);
|
||||
pop->addParamCombox(DMStation::STATUS, "状态", x, y += h, {"启用", "禁用"});
|
||||
pop->addParamCombox(DMStation::STATUS, "状态", x, y += h, g_comboxList_isOpen);
|
||||
}
|
||||
void PageStation::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
DAO::queryStationList(pageInfo, result);
|
||||
}
|
||||
void PageStation::onOperate(int row, int col, std::string oper)
|
||||
void PageStation::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
@@ -216,7 +218,7 @@ void PageStation::onOperate(int row, int col, std::string oper)
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
this->showPop(0, oper, table->getRowData(row));
|
||||
this->showPop(0, oper, table->row(irow));
|
||||
}
|
||||
}
|
||||
std::string PageStation::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
@@ -246,6 +248,7 @@ PageDevice::PageDevice(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
{
|
||||
auto& appdata = Application::data();
|
||||
table->addHead(DMDevice::DEVICE_ID, "设备编号", 120, {});
|
||||
table->addHead(DMDevice::STATION_ID, "所属场站", 120, appdata.mapping.stationName);
|
||||
table->addHead(DMDevice::TYPE, "设备类型", 120, appdata.mapping.deviceType);
|
||||
table->addHead(DMDevice::NAME, "设备名称", 180, {});
|
||||
table->addHead(DMDevice::CODE, "设备编码", 160, {});
|
||||
@@ -262,20 +265,21 @@ PageDevice::PageDevice(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
int x = 50, y = 80, w = 350, h = 60;
|
||||
auto pop = this->addPop(700, 520, 180, "设备信息", {DMDevice::DEVICE_ID});
|
||||
pop->addParamLineEdit(DMDevice::DEVICE_ID, "设备编号", x, y, false);
|
||||
pop->addParamCombox(DMDevice::TYPE, "类型", x+w, y, appdata.getDeviceTypeNames());
|
||||
pop->addParamLineEdit(DMDevice::NAME, "设备名称", x, y += h);
|
||||
pop->addParamLineEdit(DMDevice::CODE, "设备编码", x+w, y);
|
||||
pop->addParamLineEdit(DMDevice::MODEL, "设备型号", x, y += h);
|
||||
pop->addParamLineEdit(DMDevice::FACTORY, "厂家", x+w, y);
|
||||
pop->addParamLineEdit(DMDevice::TEL, "厂家电话", x, y += h);
|
||||
pop->addParamCombox(DMDevice::IS_OPEN, "是否启用", x+w, y, {"启用", "禁用"});
|
||||
pop->addParamLineEdit(DMDevice::ATTRS, "设备参数", x, y += h);
|
||||
pop->addParamCombox(DMDevice::STATION_ID, "所属场站", x+w, y, appdata.getStationNames());
|
||||
pop->addParamCombox(DMDevice::TYPE, "类型", x, y += h, appdata.getDeviceTypeNames());
|
||||
pop->addParamLineEdit(DMDevice::NAME, "设备名称", x+w, y);
|
||||
pop->addParamLineEdit(DMDevice::CODE, "设备编码", x, y += h);
|
||||
pop->addParamLineEdit(DMDevice::MODEL, "设备型号", x+w, y);
|
||||
pop->addParamLineEdit(DMDevice::FACTORY, "厂家", x, y += h);
|
||||
pop->addParamLineEdit(DMDevice::TEL, "厂家电话", x+w, y);
|
||||
pop->addParamCombox(DMDevice::IS_OPEN, "是否启用", x, y += h, g_comboxList_isOpen);
|
||||
pop->addParamLineEdit(DMDevice::ATTRS, "设备参数", x + w, y);
|
||||
}
|
||||
void PageDevice::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
DAO::queryDeviceList(pageInfo, result);
|
||||
}
|
||||
void PageDevice::onOperate(int row, int col, std::string oper)
|
||||
void PageDevice::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
@@ -285,7 +289,7 @@ void PageDevice::onOperate(int row, int col, std::string oper)
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
this->showPop(0, oper, table->getRowData(row));
|
||||
this->showPop(0, oper, table->row(irow));
|
||||
}
|
||||
}
|
||||
std::string PageDevice::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
@@ -316,12 +320,12 @@ std::string PageDevice::onPopConfirm(std::shared_ptr<PvPopWidget> pop, Fields& f
|
||||
PagePolicy::PagePolicy(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
{
|
||||
auto& appdata = Application::data();
|
||||
table->addHead(DMPolicy::POLICY_ID, "策略编号", 200, {});
|
||||
table->addHead(DMPolicy::TYPE, "策略类型", 200, {});
|
||||
table->addHead(DMPolicy::NAME, "策略名称", 200, {});
|
||||
table->addHead(DMPolicy::DESCRIBE, "策略描述", 400, {});
|
||||
table->addHead(DMPolicy::VALUE, "策略参数", 400, {});
|
||||
table->addHead(DMPolicy::IS_OPEN, "是否启用", 200, appdata.mapping.isopen);
|
||||
table->addHead(DMPolicy::POLICY_ID, "策略编号", 120, {});
|
||||
table->addHead(DMPolicy::TYPE, "策略类型", 120, appdata.mapping.policyType);
|
||||
table->addHead(DMPolicy::NAME, "策略名称", 160, {});
|
||||
table->addHead(DMPolicy::DESCRIBE, "策略描述", 300, {});
|
||||
table->addHead(DMPolicy::VALUE, "策略参数", 900, {});
|
||||
table->addHead(DMPolicy::IS_OPEN, "是否启用", 80, appdata.mapping.isopen);
|
||||
table->addOperate({ "编辑"});
|
||||
|
||||
int btnNew = PvApp::button(p, PV_ID_MAIN, 20, 160, 80, 35, POP_OPER_NEW);
|
||||
@@ -331,36 +335,78 @@ PagePolicy::PagePolicy(PARAM* p, EPvCode pvcode) : PageTable(p)
|
||||
auto pop = this->addPop(1620, 800, 180, "策略信息", {DMPolicy::POLICY_ID});
|
||||
//pop->addParamLineEdit(DMPolicy::POLICY_ID, "编号", x, y, false);
|
||||
{
|
||||
pop->addParamLineEdit("1", "策略名称", x, y);
|
||||
pop->addParamCombox("2", "策略类型", x+w, y, {"峰谷套利"});
|
||||
pop->addParamLineEdit("3", "尖峰电价", x, y += 50);
|
||||
pop->addParamLineEdit("4", "高峰电价", x+w, y);
|
||||
pop->addParamLineEdit("5", "平段电价", x+w*2, y);
|
||||
pop->addParamLineEdit("6", "低谷电价", x+w*3, y);
|
||||
pop->addParamLineEdit(DMPolicy::NAME, "策略名称", x, y);
|
||||
pop->addParamCombox(DMPolicy::TYPE, "策略类型", x+w, y, Application::data().getPolicyTypeNames());
|
||||
pop->addParamCombox(DMPolicy::IS_OPEN, "是否启用", x, y+=40, g_comboxList_isOpen),
|
||||
//pop->addParamLineEdit("3", "尖峰电价", x, y += 50);
|
||||
//pop->addParamLineEdit("4", "高峰电价", x+w, y);
|
||||
//pop->addParamLineEdit("5", "平段电价", x+w*2, y);
|
||||
//pop->addParamLineEdit("6", "低谷电价", x+w*3, y);
|
||||
|
||||
pop->setCallbackTextEvent([=](std::string k, std::string text) {
|
||||
if (k == DMPolicy::TYPE)
|
||||
{
|
||||
int policyTypeId = Application::data().getPolicyTypeId(text);
|
||||
this->setPanel(policyTypeId, "{}");
|
||||
}
|
||||
});
|
||||
|
||||
panelPeak = std::make_shared<PanelPolicyPeak>(p, pop->widget(), 10, y+=40, 1600, 540);
|
||||
panelRequire = std::make_shared<PanelPolicyRequire>(p, pop->widget(), 10, y, 620, 220);
|
||||
panelSelf = std::make_shared<PanelPolicySelf>(p, pop->widget(), 10, y, 620, 220);
|
||||
}
|
||||
|
||||
}
|
||||
void PagePolicy::setPanel(int policyTypeId, std::string attrVal)
|
||||
{
|
||||
auto pop = vecPop[0];
|
||||
panelPeak->show(0);
|
||||
panelRequire->show(0);
|
||||
panelSelf->show(0);
|
||||
if (policyTypeId == 1)
|
||||
{
|
||||
panelPeak->parseAttr(attrVal);
|
||||
panelPeak->show(1);
|
||||
pop->resize(1620, 800);
|
||||
}
|
||||
else if (policyTypeId == 2)
|
||||
{
|
||||
panelRequire->parseAttr(attrVal);
|
||||
panelRequire->show(1);
|
||||
pop->resize(640, 600);
|
||||
}
|
||||
else if (policyTypeId == 3)
|
||||
{
|
||||
panelSelf->parseAttr(attrVal);
|
||||
panelSelf->show(1);
|
||||
pop->resize(640, 600);
|
||||
}
|
||||
}
|
||||
std::string PagePolicy::getPanelAttr(int policyTypeId)
|
||||
{
|
||||
std::string attrVal = "{}";
|
||||
if (policyTypeId == 1) { attrVal = panelPeak->dumpAttr(); }
|
||||
else if (policyTypeId == 2) { attrVal = panelRequire->dumpAttr(); }
|
||||
else if (policyTypeId == 3) { attrVal = panelSelf->dumpAttr(); }
|
||||
return attrVal;
|
||||
}
|
||||
void PagePolicy::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
DAO::queryPolicyList(pageInfo, result);
|
||||
}
|
||||
void PagePolicy::onOperate(int row, int col, std::string oper)
|
||||
void PagePolicy::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
Fields fields;
|
||||
this->showPop(0, oper, fields);
|
||||
this->showPop(0, oper, Fields());
|
||||
this->setPanel(1, {});
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
table->getRowData(row);
|
||||
auto& appdata = Application::data();
|
||||
Fields fields;
|
||||
fields.set("3", appdata.electPriceSuperPeak);
|
||||
fields.set("4", appdata.electPricePeak);
|
||||
fields.set("5", appdata.electPriceShoulder);
|
||||
fields.set("6", appdata.electPriceOffPeak);
|
||||
this->showPop(0, oper, fields);
|
||||
int policyTypeId = curRowData.get<int>(DMPolicy::TYPE);
|
||||
std::string attrVal = curRowData.value(DMPolicy::VALUE);
|
||||
|
||||
this->setPanel(policyTypeId, attrVal);
|
||||
this->showPop(0, oper, curRowData);
|
||||
}
|
||||
}
|
||||
std::string PagePolicy::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
@@ -369,9 +415,23 @@ std::string PagePolicy::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& f
|
||||
};
|
||||
std::string PagePolicy::onPopConfirm(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (pop->status == POP_OPER_NEW)
|
||||
{
|
||||
int policyTypeId = fields.get<int>(DMPolicy::TYPE);
|
||||
fields.set(DMPolicy::VALUE, this->getPanelAttr(policyTypeId));
|
||||
Errcode err = DAO::insertPolicy(fields);
|
||||
if (err == Errcode::OK) { return ""; }
|
||||
else { return "系统错误"; }
|
||||
}
|
||||
else if (pop->status == POP_OPER_EDIT)
|
||||
{
|
||||
int policyTypeId = curRowData.get<int>(DMPolicy::TYPE);
|
||||
fields.set(DMPolicy::POLICY_ID, policyTypeId);
|
||||
fields.set(DMPolicy::VALUE, this->getPanelAttr(policyTypeId));
|
||||
Errcode err = DAO::updatePolicyById(fields);
|
||||
if (err == Errcode::OK) { return ""; }
|
||||
else { return "系统错误"; }
|
||||
}
|
||||
return "";
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -390,7 +450,7 @@ void PageSyslog::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
DAO::querySystemLogList(pageInfo, result);
|
||||
}
|
||||
void PageSyslog::onOperate(int row, int col, std::string oper)
|
||||
void PageSyslog::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
@@ -400,7 +460,7 @@ void PageSyslog::onOperate(int row, int col, std::string oper)
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
this->showPop(0, oper, table->getRowData(row));
|
||||
this->showPop(0, oper, table->row(irow));
|
||||
}
|
||||
}
|
||||
std::string PageSyslog::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
@@ -429,7 +489,7 @@ void PageAlertlog::onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result)
|
||||
{
|
||||
//DAO::queryAlertLogList(pageInfo, result);
|
||||
}
|
||||
void PageAlertlog::onOperate(int row, int col, std::string oper)
|
||||
void PageAlertlog::onOperate(int irow, int icol, std::string oper)
|
||||
{
|
||||
if (oper == POP_OPER_NEW)
|
||||
{
|
||||
@@ -439,7 +499,7 @@ void PageAlertlog::onOperate(int row, int col, std::string oper)
|
||||
}
|
||||
else if (oper == POP_OPER_EDIT)
|
||||
{
|
||||
this->showPop(0, oper, table->getRowData(row));
|
||||
this->showPop(0, oper, table->row(irow));
|
||||
}
|
||||
}
|
||||
std::string PageAlertlog::onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields)
|
||||
|
||||
@@ -71,17 +71,24 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// === PagePolicy ===
|
||||
class PanelPolicyPeak;
|
||||
class PanelPolicyRequire;
|
||||
class PanelPolicySelf;
|
||||
class PagePolicy : public PageTable
|
||||
{
|
||||
public:
|
||||
PagePolicy(PARAM* p, EPvCode pvcode);
|
||||
void setPanel(int policyTypeId, std::string attrVal);
|
||||
std::string getPanelAttr(int policyTypeId);
|
||||
|
||||
virtual void onQueryTable(PageInfo& pageInfo, std::vector<Fields>& result) override;
|
||||
virtual void onOperate(int row, int col, std::string oper) override;
|
||||
virtual std::string onValidation(std::shared_ptr<PvPopWidget> pop, Fields& fields) override;
|
||||
virtual std::string onPopConfirm(std::shared_ptr<PvPopWidget> pop, Fields& fields) override;
|
||||
|
||||
|
||||
std::shared_ptr<PanelPolicyPeak> panelPeak {};
|
||||
std::shared_ptr<PanelPolicyRequire> panelRequire {};
|
||||
std::shared_ptr<PanelPolicySelf> panelSelf {};
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -2,30 +2,55 @@
|
||||
#include "app/Application.h"
|
||||
#include "app/AppData.h"
|
||||
#include "common/JsonN.h"
|
||||
#include "common/Utils.h"
|
||||
|
||||
//const std::string QSS_COMBOX_1 =
|
||||
//"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(255, 89, 0); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
//"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
//"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
//"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
//
|
||||
//const std::string QSS_COMBOX_2 =
|
||||
//"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(255, 255, 0); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
//"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
//"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
//"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
//
|
||||
//const std::string QSS_COMBOX_3 =
|
||||
//"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(121, 191, 226); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
//"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
//"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
//"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
//
|
||||
//const std::string QSS_COMBOX_4 =
|
||||
//"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(0, 255, 58); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
//"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
//"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
//"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
|
||||
const std::string QSS_COMBOX_1 =
|
||||
"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(255, 89, 0); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
"QComboBox { background-color: transparent; border: 1px solid rgb(255, 89, 0); color: rgb(255, 89, 0); border-radius: 3px; font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 3px; color:white;}"
|
||||
"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
"QComboBox:disabled {border: none; color: gray;}";
|
||||
|
||||
const std::string QSS_COMBOX_2 =
|
||||
"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(255, 255, 0); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
"QComboBox { background-color: transparent; border: 1px solid rgb(255, 255, 0); color: rgb(255, 255, 0); border-radius: 3px; font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 3px; color:white;}"
|
||||
"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
"QComboBox:disabled { border: none; color: gray;}";
|
||||
|
||||
const std::string QSS_COMBOX_3 =
|
||||
"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(121, 191, 226); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
"QComboBox { background-color: transparent; border: 1px solid rgb(121, 191, 226); color: rgb(121, 191, 226); border-radius: 3px; font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 3px; color:white;}"
|
||||
"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
"QComboBox:disabled { border: none; color: gray;}";
|
||||
|
||||
const std::string QSS_COMBOX_4 =
|
||||
"QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(0, 255, 58); border-radius: 3px; color: rgb(30,30,30); font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
|
||||
"QComboBox { background-color: transparent; border: 1px solid rgb(0, 255, 58);color: rgb(0, 255, 58); border-radius: 3px; font: bold 14px;}"
|
||||
"QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 3px; color:white;}"
|
||||
"QComboBox::drop-down { border-radius: 5px; width: 30px; }"
|
||||
"QComboBox:disabled { color:rgb(150,150,150);}";
|
||||
"QComboBox:disabled { border: none; color: gray;}";
|
||||
|
||||
static std::string GetPeriodQss(int v)
|
||||
{
|
||||
@@ -51,182 +76,180 @@ static int GetPeriod(std::string text)
|
||||
else if (text == "低谷") { return 4; }
|
||||
else { return 3; }
|
||||
}
|
||||
PanelPolicyPeak::PanelPolicyPeak(PARAM* p, int parent, int x, int y, int w, int h) : PvObject(p)
|
||||
PanelPolicyPeak::PanelPolicyPeak(PARAM* p, int parent, int ix, int iy, int iw, int ih) : PvObject(p)
|
||||
{
|
||||
data.vecPeriods.resize(12, std::vector<int>(24, 3));
|
||||
ui.parent = parent;
|
||||
ui.widget = PvApp::widget(p, parent, x, y, w, h);
|
||||
pvid = PvApp::widget(p, parent, ix, iy, iw, ih);
|
||||
|
||||
auto& appdata = Application::data();
|
||||
std::vector<std::string> vecPeriods = {"尖峰", "高峰", "平段", "低谷"};
|
||||
|
||||
ui.vecComboxs.resize(12, std::vector<int>(24, PV_ID_NUL));
|
||||
|
||||
int x = 0, y = 10, w = 64, h = 30;
|
||||
for (int row = 0; row<=12; row++)
|
||||
{
|
||||
int parent = ui.widget;
|
||||
int x = 10, y = 180, w = 64, h = 30;
|
||||
for (int row = 0; row<=12; row++)
|
||||
for (int col = 0; col<=24; ++col)
|
||||
{
|
||||
for (int col = 0; col<=24; ++col)
|
||||
std::string text;
|
||||
if (row == 0)
|
||||
{
|
||||
std::string text;
|
||||
if (row == 0)
|
||||
{
|
||||
text = (col == 0) ? "月份" : std::to_string(col-1) + "-" + std::to_string(col) + "时";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = (col == 0) ? std::to_string(row) : "";
|
||||
}
|
||||
if (row == 0 || col == 0)
|
||||
{
|
||||
std::string qssLabel = (row==0) ? qss::label(14, "", "rgb(19, 93, 114)") : "";
|
||||
int label = PvApp::label(p, parent, x+w*col, y+h*row, w, h, text, qssLabel);
|
||||
pvSetAlignment(p, label, AlignCenter);
|
||||
}
|
||||
else
|
||||
{
|
||||
int periodVal = data.vecPeriods[row-1][col-1];
|
||||
int combox = PvApp::combox(p, parent, x+w*col, y+h*row+3, w-3, 24, vecPeriods, periodVal);
|
||||
pvSetStyleSheet(p, combox, GetPeriodQss(periodVal).c_str());
|
||||
ui.vecComboxs[row-1][col-1] = combox;
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, combox, [=](std::string text) {
|
||||
pvSetStyleSheet(p, combox, GetPeriodQss(text).c_str());
|
||||
data.vecPeriods[row-1][col-1] = GetPeriod(text);
|
||||
});
|
||||
}
|
||||
|
||||
text = (col == 0) ? "月份" : std::to_string(col-1) + "-" + std::to_string(col) + "时";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = (col == 0) ? std::to_string(row) : "";
|
||||
}
|
||||
if (row == 0 || col == 0)
|
||||
{
|
||||
std::string qssLabel = (row==0) ? qss::label(14, "", "rgb(19, 93, 114)") : "";
|
||||
int label = PvApp::label(p, pvid, x+w*col, y+h*row, w, h, text, qssLabel);
|
||||
pvSetAlignment(p, label, AlignCenter);
|
||||
}
|
||||
else
|
||||
{
|
||||
int periodVal = data.vecPeriods[row-1][col-1];
|
||||
int combox = PvApp::combox(p, pvid, x+w*col, y+h*row+3, w-3, 24, vecPeriods, periodVal-1);
|
||||
pvSetStyleSheet(p, combox, GetPeriodQss(periodVal).c_str());
|
||||
ui.vecComboxs[row-1][col-1] = combox;
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, combox, [=](std::string text) {
|
||||
pvSetStyleSheet(p, combox, GetPeriodQss(text).c_str());
|
||||
data.vecPeriods[row-1][col-1] = GetPeriod(text);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const int H = 24;
|
||||
int labelPolicy = PvApp::label(p, parent, 20, 600, 300, H, "充电策略");
|
||||
ui.radioPolicy1 = PvApp::radioButton(p, labelPolicy, 80, 0, 80, H, "一充一放");
|
||||
ui.radioPolicy2 = PvApp::radioButton(p, labelPolicy, 170, 0, 80, H, "两充两放");
|
||||
|
||||
ui.label1 = PvApp::label(p, parent, 10, 640, 610, 90, "第一次充放电过程", qss::label(14, "", "", "1px solid rgb(49, 130, 141)"));
|
||||
pvSetAlignment(p, ui.label1, AlignLeft | AlignTop);
|
||||
{
|
||||
int y0 = 70;
|
||||
int labelChargeT = PvApp::label(p, ui.label1, 10, 30, 300, H, "充电时间");
|
||||
ui.attr1TimeCharge0 = PvApp::timeEdit(p, labelChargeT, y0, 0, 60, H);
|
||||
PvApp::label(p, labelChargeT, 150, 0, 10, H, "--");
|
||||
ui.attr1TimeCharge1 = PvApp::timeEdit(p, labelChargeT, 170, 0, 60, H);
|
||||
|
||||
int labelDischargeT = PvApp::label(p, ui.label1, 320, 30, 300, H, "放电时间");
|
||||
ui.attr1TimeDischarge0 = PvApp::timeEdit(p, labelDischargeT, y0 = 70, 0, 60, H);
|
||||
PvApp::label(p, labelDischargeT, y0+=70, 0, 10, H, "--");
|
||||
ui.attr1TimeDischarge1 = PvApp::timeEdit(p, labelDischargeT, y0+=20, 0, 60, H);
|
||||
|
||||
int labelPowerIn = PvApp::label(p, ui.label1, 10, 60, 300, H, "充电功率");
|
||||
ui.attr1RadioPowerInAuto = PvApp::radioButton(p, labelPowerIn, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr1RadioPowerIn = PvApp::radioButton(p, labelPowerIn, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt1LabelPowerIn = PvApp::lineEdit(p, labelPowerIn, y0 += 70, 0, 80, H, "");
|
||||
|
||||
int labelPowerOut = PvApp::label(p, ui.label1, 320, 60, 300, H, "放电功率");
|
||||
ui.attr1RadioPowerOutAuto = PvApp::radioButton(p, labelPowerOut, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr1RadioPowerOut = PvApp::radioButton(p, labelPowerOut, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt1LabelPowerOut = PvApp::lineEdit(p, labelPowerOut, y0 += 70, 0, 80, H, "");
|
||||
}
|
||||
|
||||
ui.label2 = PvApp::label(p, parent, 630, 640, 610, 90, "第二次充放电过程", qss::label(14, "", "", "1px solid rgb(49, 130, 141)"));
|
||||
pvSetAlignment(p, ui.label2, AlignLeft | AlignTop);
|
||||
{
|
||||
int y0 = 70;
|
||||
int labelChargeT = PvApp::label(p, ui.label2, 10, 30, 300, H, "充电时间");
|
||||
XLOGD() << "labelChargeT=" << labelChargeT;
|
||||
ui.attr2TimeCharge0 = PvApp::timeEdit(p, labelChargeT, y0, 0, 60, H);
|
||||
PvApp::label(p, labelChargeT, 150, 0, 10, H, "--");
|
||||
ui.attr2TimeCharge1 = PvApp::timeEdit(p, labelChargeT, 170, 0, 60, H);
|
||||
|
||||
|
||||
|
||||
|
||||
int labelDischargeT = PvApp::label(p, ui.label2, 320, 30, 300, H, "放电时间");
|
||||
ui.attr2TimeDischarge0 = PvApp::timeEdit(p, labelDischargeT, y0 = 70, 0, 60, H);
|
||||
PvApp::label(p, labelDischargeT, y0 += 70, 0, 10, H, "--");
|
||||
ui.attr2TimeDischarge1 = PvApp::timeEdit(p, labelDischargeT, y0 += 20, 0, 60, H);
|
||||
|
||||
int labelPowerIn = PvApp::label(p, ui.label2, 10, 60, 300, H, "充电功率");
|
||||
ui.attr2RadioPowerInAuto = PvApp::radioButton(p, labelPowerIn, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr2RadioPowerIn = PvApp::radioButton(p, labelPowerIn, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt2LabelPowerIn = PvApp::lineEdit(p, labelPowerIn, y0 += 70, 0, 80, H, "");
|
||||
|
||||
int labelPowerOut = PvApp::label(p, ui.label2, 320, 60, 300, H, "放电功率");
|
||||
ui.attr2RadioPowerOutAuto = PvApp::radioButton(p, labelPowerOut, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr2RadioPowerOut = PvApp::radioButton(p, labelPowerOut, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt2LabelPowerOut = PvApp::lineEdit(p, labelPowerOut, y0 += 70, 0, 80, H, "");
|
||||
}
|
||||
|
||||
|
||||
PvApp::bind(p, PvEvent::RADIOBUTTON_EVENT, ui.radioPolicy1, [=](std::string s) {
|
||||
this->data.times = 1;
|
||||
pvHide(p, ui.label2);
|
||||
//setTimeText(ui.attr2TimeCharge0, "");
|
||||
//setTimeText(ui.attr2TimeCharge1, "");
|
||||
//setTimeText(ui.attr2TimeDischarge0, "");
|
||||
//setTimeText(ui.attr2TimeDischarge1, "");
|
||||
//pvSetChecked(p, ui.attr2RadioPowerInAuto, 1);
|
||||
//pvSetChecked(p, ui.attr2RadioPowerOutAuto, 1);
|
||||
//pvSetText(p, ui.arrt2LabelPowerOut, "");
|
||||
//data.attr2.chargePower = data.attr2.dischargePower = 0.0;
|
||||
//data.attr2.chargeTimeStart = data.attr2.chargeTimeEnd = data.attr2.dischargeTimeStart = data.attr2.dischargeTimeEnd = "";
|
||||
});
|
||||
|
||||
PvApp::bind(p, PvEvent::RADIOBUTTON_EVENT, ui.radioPolicy2, [=](std::string s) {
|
||||
this->data.times = 2;
|
||||
pvShow(p, ui.label2);
|
||||
});
|
||||
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeCharge0, [=](std::string s) {
|
||||
data.attr1.chargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeCharge1, [=](std::string s) {
|
||||
data.attr1.chargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeDischarge0, [=](std::string s) {
|
||||
data.attr1.dischargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeDischarge1, [=](std::string s) {
|
||||
data.attr1.dischargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeCharge0, [=](std::string s) {
|
||||
data.attr2.chargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeCharge1, [=](std::string s) {
|
||||
data.attr2.chargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeDischarge0, [=](std::string s) {
|
||||
data.attr2.dischargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeDischarge1, [=](std::string s) {
|
||||
data.attr2.dischargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
|
||||
{
|
||||
int btn = PvApp::button(p, ui.widget, 10, 750, 100, 30, "DUMP");
|
||||
PvApp::bind(p, PvEvent::BUTTON_EVENT, btn, [=](std::string) {
|
||||
XLOGD() << dumpAttr();
|
||||
});
|
||||
}
|
||||
{
|
||||
int btn = PvApp::button(p, ui.widget, 110, 750, 100, 30, "PARSE1");
|
||||
PvApp::bind(p, PvEvent::BUTTON_EVENT, btn, [=](std::string) {
|
||||
std::string s = R"({"cycle":[{"charge_end":"","charge_power":0.0,"charge_start":"","discharge_end":"","discharge_power":0.0,"discharge_start":""}],
|
||||
"period":[[1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]],
|
||||
"times":1})";
|
||||
parseAttr(s);
|
||||
});
|
||||
}
|
||||
{
|
||||
int btn = PvApp::button(p, ui.widget, 210, 750, 100, 30, "PARSE2");
|
||||
PvApp::bind(p, PvEvent::BUTTON_EVENT, btn, [=](std::string) {
|
||||
std::string s = R"({"cycle":[{"charge_end":"09:00:00","charge_power":0.0,"charge_start":"00:00:00","discharge_end":"","discharge_power":0.0,"discharge_start":""}],
|
||||
"period":[[1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]],
|
||||
"times":2})";
|
||||
parseAttr(s);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const int H = 24;
|
||||
int labelPolicy = PvApp::label(p, pvid, 20, y = 420, 300, H, "充电策略");
|
||||
ui.radioPolicy1 = PvApp::radioButton(p, labelPolicy, 80, 0, 80, H, "一充一放");
|
||||
ui.radioPolicy2 = PvApp::radioButton(p, labelPolicy, 170, 0, 80, H, "两充两放");
|
||||
|
||||
ui.label1 = PvApp::label(p, pvid, 10, y+=30, 610, 90, "第一次充放电过程", qss::label(14, "", "", "1px solid rgb(49, 130, 141)"));
|
||||
pvSetAlignment(p, ui.label1, AlignLeft | AlignTop);
|
||||
{
|
||||
int y0 = 70;
|
||||
int labelChargeT = PvApp::label(p, ui.label1, 10, 30, 300, H, "充电时间");
|
||||
ui.attr1TimeCharge0 = PvApp::timeEdit(p, labelChargeT, y0, 0, 90, H);
|
||||
PvApp::label(p, labelChargeT, y0 += 100, 0, 10, H, "--");
|
||||
ui.attr1TimeCharge1 = PvApp::timeEdit(p, labelChargeT, y0 =+ 20, 0, 90, H);
|
||||
|
||||
int labelDischargeT = PvApp::label(p, ui.label1, 320, 30, 300, H, "放电时间");
|
||||
ui.attr1TimeDischarge0 = PvApp::timeEdit(p, labelDischargeT, y0 = 70, 0, 90, H);
|
||||
PvApp::label(p, labelDischargeT, y0 += 100, 0, 10, H, "--");
|
||||
ui.attr1TimeDischarge1 = PvApp::timeEdit(p, labelDischargeT, y0 += 20, 0, 90, H);
|
||||
|
||||
int labelPowerIn = PvApp::label(p, ui.label1, 10, 60, 300, H, "充电功率");
|
||||
ui.attr1RadioPowerInAuto = PvApp::radioButton(p, labelPowerIn, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr1RadioPowerIn = PvApp::radioButton(p, labelPowerIn, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt1LabelPowerIn = PvApp::textedit(p, labelPowerIn, y0 += 70, 0, 80, H, "");
|
||||
|
||||
int labelPowerOut = PvApp::label(p, ui.label1, 320, 60, 300, H, "放电功率");
|
||||
ui.attr1RadioPowerOutAuto = PvApp::radioButton(p, labelPowerOut, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr1RadioPowerOut = PvApp::radioButton(p, labelPowerOut, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt1LabelPowerOut = PvApp::textedit(p, labelPowerOut, y0 += 70, 0, 80, H, "");
|
||||
}
|
||||
|
||||
ui.label2 = PvApp::label(p, pvid, 630, y, 610, 90, "第二次充放电过程", qss::label(14, "", "", "1px solid rgb(49, 130, 141)"));
|
||||
pvSetAlignment(p, ui.label2, AlignLeft | AlignTop);
|
||||
{
|
||||
int y0 = 70;
|
||||
int labelChargeT = PvApp::label(p, ui.label2, 10, 30, 300, H, "充电时间");
|
||||
XLOGD() << "labelChargeT=" << labelChargeT;
|
||||
ui.attr2TimeCharge0 = PvApp::timeEdit(p, labelChargeT, y0, 0, 60, H);
|
||||
PvApp::label(p, labelChargeT, 150, 0, 10, H, "--");
|
||||
ui.attr2TimeCharge1 = PvApp::timeEdit(p, labelChargeT, 170, 0, 60, H);
|
||||
|
||||
int labelDischargeT = PvApp::label(p, ui.label2, 320, 30, 300, H, "放电时间");
|
||||
ui.attr2TimeDischarge0 = PvApp::timeEdit(p, labelDischargeT, y0 = 70, 0, 60, H);
|
||||
PvApp::label(p, labelDischargeT, y0 += 70, 0, 10, H, "--");
|
||||
ui.attr2TimeDischarge1 = PvApp::timeEdit(p, labelDischargeT, y0 += 20, 0, 60, H);
|
||||
|
||||
int labelPowerIn = PvApp::label(p, ui.label2, 10, 60, 300, H, "充电功率");
|
||||
ui.attr2RadioPowerInAuto = PvApp::radioButton(p, labelPowerIn, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr2RadioPowerIn = PvApp::radioButton(p, labelPowerIn, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt2LabelPowerIn = PvApp::textedit(p, labelPowerIn, y0 += 70, 0, 80, H, "");
|
||||
|
||||
int labelPowerOut = PvApp::label(p, ui.label2, 320, 60, 300, H, "放电功率");
|
||||
ui.attr2RadioPowerOutAuto = PvApp::radioButton(p, labelPowerOut, y0 = 70, 0, 60, H, "自动");
|
||||
ui.attr2RadioPowerOut = PvApp::radioButton(p, labelPowerOut, y0 += 60, 0, 64, H, "自定义");
|
||||
ui.arrt2LabelPowerOut = PvApp::textedit(p, labelPowerOut, y0 += 70, 0, 80, H, "");
|
||||
}
|
||||
|
||||
|
||||
PvApp::bind(p, PvEvent::RADIOBUTTON_EVENT, ui.radioPolicy1, [=](std::string s) {
|
||||
this->data.times = 1;
|
||||
pvHide(p, ui.label2);
|
||||
//setTimeText(ui.attr2TimeCharge0, "");
|
||||
//setTimeText(ui.attr2TimeCharge1, "");
|
||||
//setTimeText(ui.attr2TimeDischarge0, "");
|
||||
//setTimeText(ui.attr2TimeDischarge1, "");
|
||||
//pvSetChecked(p, ui.attr2RadioPowerInAuto, 1);
|
||||
//pvSetChecked(p, ui.attr2RadioPowerOutAuto, 1);
|
||||
//pvSetText(p, ui.arrt2LabelPowerOut, "");
|
||||
//data.attr2.chargePower = data.attr2.dischargePower = 0.0;
|
||||
//data.attr2.chargeTimeStart = data.attr2.chargeTimeEnd = data.attr2.dischargeTimeStart = data.attr2.dischargeTimeEnd = "";
|
||||
});
|
||||
|
||||
PvApp::bind(p, PvEvent::RADIOBUTTON_EVENT, ui.radioPolicy2, [=](std::string s) {
|
||||
this->data.times = 2;
|
||||
pvShow(p, ui.label2);
|
||||
});
|
||||
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeCharge0, [=](std::string s) {
|
||||
data.attr1.chargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeCharge1, [=](std::string s) {
|
||||
data.attr1.chargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeDischarge0, [=](std::string s) {
|
||||
data.attr1.dischargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr1TimeDischarge1, [=](std::string s) {
|
||||
data.attr1.dischargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeCharge0, [=](std::string s) {
|
||||
data.attr2.chargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeCharge1, [=](std::string s) {
|
||||
data.attr2.chargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeDischarge0, [=](std::string s) {
|
||||
data.attr2.dischargeTimeStart = s.substr(0, 8);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.attr2TimeDischarge1, [=](std::string s) {
|
||||
data.attr2.dischargeTimeEnd = s.substr(0, 8);
|
||||
});
|
||||
|
||||
// {
|
||||
// int btn = PvApp::button(p, pvid, 10, y+=100, 90, 30, "DUMP");
|
||||
// PvApp::bind(p, PvEvent::BUTTON_EVENT, btn, [=](std::string) {
|
||||
// XLOGD() << dumpAttr();
|
||||
// });
|
||||
// }
|
||||
// {
|
||||
// int btn = PvApp::button(p, pvid, 110, y, 90, 30, "PARSE1");
|
||||
// PvApp::bind(p, PvEvent::BUTTON_EVENT, btn, [=](std::string) {
|
||||
// std::string s = R"({"cycle":[{"charge_end":"","charge_power":0.0,"charge_start":"","discharge_end":"","discharge_power":0.0,"discharge_start":""}],
|
||||
//"period":[[1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]],
|
||||
//"times":1})";
|
||||
// parseAttr(s);
|
||||
// });
|
||||
// }
|
||||
// {
|
||||
// int btn = PvApp::button(p, pvid, 210, y, 90, 30, "PARSE2");
|
||||
// PvApp::bind(p, PvEvent::BUTTON_EVENT, btn, [=](std::string) {
|
||||
// std::string s = R"({"cycle":[
|
||||
//{"charge_end":"09:00:00","charge_power":0.0,"charge_start":"00:00:00","discharge_end":"","discharge_power":0.0,"discharge_start":""},
|
||||
//{"charge_end":"23:59:00","charge_power":0.0,"charge_start":"20:00:00","discharge_end":"13:00","discharge_power":0.0,"discharge_start":"09:00"}
|
||||
//],
|
||||
//"period":[[1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]],
|
||||
//"times":2})";
|
||||
// parseAttr(s);
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
void PanelPolicyPeak::updateUI()
|
||||
@@ -284,7 +307,7 @@ void PanelPolicyPeak::parseAttr(std::string str)
|
||||
periodVal = tmpVal;
|
||||
// 更新UI (时段下拉列表)
|
||||
auto combox = ui.vecComboxs[row][col];
|
||||
pvSetCurrentItem(p, combox, periodVal);
|
||||
pvSetCurrentItem(p, combox, periodVal-1);
|
||||
pvSetStyleSheet(p, combox, GetPeriodQss(periodVal).c_str());
|
||||
}
|
||||
}
|
||||
@@ -333,7 +356,6 @@ void PanelPolicyPeak::parseAttr(std::string str)
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::string PanelPolicyPeak::dumpAttr()
|
||||
{
|
||||
NJsonNode jsonroot;
|
||||
@@ -363,4 +385,117 @@ std::string PanelPolicyPeak::dumpAttr()
|
||||
}
|
||||
jsonroot["cycle"] = nodeCycle;
|
||||
return jsonroot.dump();
|
||||
}
|
||||
|
||||
|
||||
PanelPolicyRequire::PanelPolicyRequire(PARAM* p, int parent, int ix, int iy, int iw, int ih) : PvObject(p)
|
||||
{
|
||||
pvid = PvApp::widget(p, parent, ix, iy, iw, ih);
|
||||
|
||||
int y = 10;
|
||||
const int H = 24;
|
||||
ui.label1 = PvApp::label(p, pvid, 10, y, 600, 80, "响应削峰指令", qss::label(14, "", "", "1px solid rgb(49, 130, 141)"));
|
||||
pvSetAlignment(p, ui.label1, AlignLeft | AlignTop);
|
||||
{
|
||||
ui.dischargeSoc = PvApp::lineTextedit(p, ui.label1, PvRect(10, 40, 270, H), 100, "电池SOC阈值", "");
|
||||
ui.dischargePower = PvApp::lineTextedit(p, ui.label1, PvRect(300, 40, 270, H), 70, "放电功率", "");
|
||||
}
|
||||
|
||||
ui.label2 = PvApp::label(p, pvid, 10, y += 90, 600, 90, "响应填谷指令", qss::label(14, "", "", "1px solid rgb(49, 130, 141)"));
|
||||
pvSetAlignment(p, ui.label2, AlignLeft | AlignTop);
|
||||
{
|
||||
ui.chargeSoc = PvApp::lineTextedit(p, ui.label2, PvRect(10, 40, 270, H), 100, "电池SOC阈值", "");
|
||||
ui.chargePower = PvApp::lineTextedit(p, ui.label2, PvRect(300, 40, 270, H), 70, "充电功率", "");
|
||||
}
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.dischargeSoc, [=](std::string s) {
|
||||
data.dischargeSoc = Utils::toInt(s);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.dischargePower, [=](std::string s) {
|
||||
data.dischargePower = Utils::toInt(s);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.chargeSoc, [=](std::string s) {
|
||||
data.chargeSoc = Utils::toInt(s);
|
||||
});
|
||||
PvApp::bind(p, PvEvent::TEXT_EVENT, ui.chargePower, [=](std::string s) {
|
||||
data.chargePower = Utils::toInt(s);
|
||||
});
|
||||
}
|
||||
|
||||
void PanelPolicyRequire::parseAttr(std::string str)
|
||||
{
|
||||
NJsonNode jsonroot;
|
||||
bool ret = NJson::parse(str, jsonroot);
|
||||
if (!ret)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NJson::read(jsonroot, "charge_soc", data.chargeSoc);
|
||||
NJson::read(jsonroot, "charge_power", data.chargePower);
|
||||
NJson::read(jsonroot, "discharge_soc", data.dischargeSoc);
|
||||
NJson::read(jsonroot, "discharge_power", data.dischargePower);
|
||||
|
||||
// 更新UI
|
||||
pvSetText(p, ui.chargeSoc, std::to_string(data.chargeSoc).c_str());
|
||||
pvSetText(p, ui.chargePower, std::to_string(data.chargePower).c_str());
|
||||
pvSetText(p, ui.dischargeSoc, std::to_string(data.dischargeSoc).c_str());
|
||||
pvSetText(p, ui.dischargePower, std::to_string(data.dischargePower).c_str());
|
||||
}
|
||||
|
||||
std::string PanelPolicyRequire::dumpAttr()
|
||||
{
|
||||
NJsonNode jsonroot;
|
||||
jsonroot["discharge_soc"] = data.dischargeSoc;
|
||||
jsonroot["discharge_power"] = data.dischargePower;
|
||||
jsonroot["charge_soc"] = data.chargeSoc;
|
||||
jsonroot["charge_power"] = data.chargePower;
|
||||
return jsonroot.dump();
|
||||
}
|
||||
|
||||
PanelPolicySelf::PanelPolicySelf(PARAM* p, int parent, int ix, int iy, int iw, int ih) : PvObject(p)
|
||||
{
|
||||
pvid = PvApp::widget(p, parent, ix, iy, iw, ih);
|
||||
|
||||
int y = 10;
|
||||
const int H = 24;
|
||||
ui.label1 = PvApp::label(p, pvid, 10, y, 600, 120, "响应削峰指令", qss::label(14, "", "", "1px solid rgb(49, 130, 141)"));
|
||||
pvSetAlignment(p, ui.label1, AlignLeft | AlignTop);
|
||||
{
|
||||
ui.usedSoc = PvApp::lineTextedit(p, ui.label1, PvRect(10, 40, 270, H), 100, "自用电量比值", "");
|
||||
ui.gridSoc = PvApp::lineTextedit(p, ui.label1, PvRect(10, 80, 270, H), 100, "上网电量比值", "");
|
||||
|
||||
ui.chargePower = PvApp::lineTextedit(p, ui.label1, PvRect(320, 40, 250, H), 70, "充电功率", "");
|
||||
ui.dischargePower = PvApp::lineTextedit(p, ui.label1, PvRect(320, 80, 250, H), 70, "放电功率", "");
|
||||
}
|
||||
}
|
||||
|
||||
void PanelPolicySelf::parseAttr(std::string str)
|
||||
{
|
||||
NJsonNode jsonroot;
|
||||
bool ret = NJson::parse(str, jsonroot);
|
||||
if (!ret)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
NJson::read(jsonroot, "used_soc", data.usedSoc);
|
||||
NJson::read(jsonroot, "grid_soc", data.gridSoc);
|
||||
NJson::read(jsonroot, "charge_power", data.chargePower);
|
||||
NJson::read(jsonroot, "discharge_power", data.dischargePower);
|
||||
|
||||
// 更新UI
|
||||
pvSetText(p, ui.usedSoc, std::to_string(data.usedSoc).c_str());
|
||||
pvSetText(p, ui.gridSoc, std::to_string(data.gridSoc).c_str());
|
||||
pvSetText(p, ui.chargePower, std::to_string(data.chargePower).c_str());
|
||||
pvSetText(p, ui.dischargePower, std::to_string(data.dischargePower).c_str());
|
||||
}
|
||||
|
||||
std::string PanelPolicySelf::dumpAttr()
|
||||
{
|
||||
NJsonNode jsonroot;
|
||||
jsonroot["used_soc"] = data.usedSoc;
|
||||
jsonroot["grid_soc"] = data.gridSoc;
|
||||
jsonroot["charge_power"] = data.chargePower;
|
||||
jsonroot["discharge_power"] = data.dischargePower;
|
||||
return jsonroot.dump();
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
class PanelPolicyPeak : public PvObject
|
||||
{
|
||||
public:
|
||||
PanelPolicyPeak(PARAM* p, int parent, int x, int y, int w, int h);
|
||||
PanelPolicyPeak(PARAM* p, int parent, int ix, int iy, int iw, int ih);
|
||||
|
||||
void updateUI();
|
||||
|
||||
@@ -17,7 +17,6 @@ public:
|
||||
|
||||
struct {
|
||||
int parent {};
|
||||
int widget {PV_ID_NUL};
|
||||
|
||||
int label1 {PV_ID_NUL};
|
||||
int label2 {PV_ID_NUL};
|
||||
@@ -72,4 +71,59 @@ public:
|
||||
ChargeAttr attr2;
|
||||
std::vector<std::vector<int>> vecPeriods;
|
||||
} data;
|
||||
};
|
||||
|
||||
|
||||
class PanelPolicyRequire : public PvObject
|
||||
{
|
||||
public:
|
||||
PanelPolicyRequire(PARAM* p, int parent, int ix, int iy, int iw, int ih);
|
||||
|
||||
void parseAttr(std::string str);
|
||||
std::string dumpAttr();
|
||||
|
||||
struct {
|
||||
int label1;
|
||||
int label2;
|
||||
|
||||
int chargeSoc;
|
||||
int chargePower;
|
||||
|
||||
int dischargeSoc;
|
||||
int dischargePower;
|
||||
} ui;
|
||||
|
||||
struct {
|
||||
int chargeSoc {};
|
||||
int chargePower {};
|
||||
|
||||
int dischargeSoc {};
|
||||
int dischargePower {};
|
||||
} data;
|
||||
};
|
||||
|
||||
class PanelPolicySelf : public PvObject
|
||||
{
|
||||
public:
|
||||
PanelPolicySelf(PARAM* p, int parent, int x, int y, int w, int h);
|
||||
|
||||
void parseAttr(std::string str);
|
||||
std::string dumpAttr();
|
||||
|
||||
struct {
|
||||
int label1;
|
||||
int usedSoc;
|
||||
int gridSoc;
|
||||
|
||||
int chargePower;
|
||||
int dischargePower;
|
||||
} ui;
|
||||
|
||||
struct {
|
||||
int usedSoc {};
|
||||
int gridSoc {};
|
||||
|
||||
int chargePower {};
|
||||
int dischargePower {};
|
||||
} data;
|
||||
};
|
||||
Reference in New Issue
Block a user