mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
实现削峰套利策略的编辑页面
This commit is contained in:
@@ -132,7 +132,7 @@ int PvApp::image(PARAM* p, int parent, int x, int y, int w, int h, const char* f
|
||||
return id;
|
||||
}
|
||||
|
||||
int PvApp::combox(PARAM* p, int parent, int x, int y, int w, int h, const std::vector<std::string>& vecItems)
|
||||
int PvApp::combox(PARAM* p, int parent, int x, int y, int w, int h, const std::vector<std::string>& vecItems, int index /*= 0*/)
|
||||
{
|
||||
int id = PvApp::pvid(p);
|
||||
pvQComboBox(p, id, parent, 0, 0);
|
||||
@@ -141,8 +141,9 @@ int PvApp::combox(PARAM* p, int parent, int x, int y, int w, int h, const std::v
|
||||
for (int i=0; i<vecItems.size(); ++i)
|
||||
{
|
||||
pvInsertItem(p, id, i, NULL, vecItems[i].c_str());
|
||||
if (index == i) pvSetCurrentItem(p, id, i);
|
||||
}
|
||||
PvApp::image(p, id, w-h, 0, h, h, "downFill.png");
|
||||
PvApp::image(p, id, w-18, (h-9)*0.5, 14, 9, "downFill.png");
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -158,17 +159,44 @@ int PvApp::lineEdit(PARAM* p, int parent, int x, int y, int w, int h, std::strin
|
||||
|
||||
int PvApp::textEdit(PARAM* p, int parent, int x, int y, int w, int h, std::string text, std::string qss)
|
||||
{
|
||||
static std::string qssTextEdit =
|
||||
static std::string style =
|
||||
"QTextEdit { background-color: rgb(12, 39, 58); border: 1px solid rgb(18, 251, 255); border-radius: 5px; color:white; font: bold 15px;}"
|
||||
"QTextEdit:disabled { border: 1px solid gray; color:rgb(150,150,150);}";
|
||||
int id = PvApp::pvid(p);
|
||||
pvQMultiLineEdit(p, id, parent, true, 10);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
pvSetStyleSheet(p, id, qssTextEdit.c_str());
|
||||
pvSetStyleSheet(p, id, style.c_str());
|
||||
if (!text.empty()) { pvSetText(p, id, text.c_str()); }
|
||||
return id;
|
||||
}
|
||||
|
||||
int PvApp::radioButton(PARAM* p, int parent, int x, int y, int w, int h, std::string text)
|
||||
{
|
||||
static std::string style =
|
||||
"QRadioButton { background-color: transparent; color:white; font: bold 14px \"微软雅黑\";}"
|
||||
"QRadioButton:disabled { border: none; color:rgb(150,150,150);}";
|
||||
|
||||
int id = PvApp::pvid(p);
|
||||
pvQRadioButton(p, id, parent);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
if (!text.empty()) { pvSetText(p, id, text.c_str()); }
|
||||
pvSetStyleSheet(p, id, style.c_str());
|
||||
return id;
|
||||
}
|
||||
|
||||
int PvApp::timeEdit(PARAM* p, int parent, int x, int y, int w, int h)
|
||||
{
|
||||
static std::string style =
|
||||
"QTimeEdit { background-color: rgb(17, 55, 73); border: 1px solid rgb(0, 185, 208); color:white; font: normal 14px \"微软雅黑\";}"
|
||||
"QTimeEdit:disabled { border: none; color:rgb(150,150,150);}";
|
||||
|
||||
int id = PvApp::pvid(p);
|
||||
pvQTimeEdit(p, id, parent);
|
||||
pvSetGeometry(p, id, x, y, w, h);
|
||||
pvSetStyleSheet(p, id, style.c_str());
|
||||
return id;
|
||||
}
|
||||
|
||||
PvRect::PvRect()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user