实现削峰套利策略的编辑页面

This commit is contained in:
lixiaoyuan
2025-08-26 18:36:25 +08:00
parent 7fe51ea362
commit 8f6c83147b
37 changed files with 1506 additions and 729 deletions

View File

@@ -18,23 +18,41 @@
#include "pv/PvApp.h"
#include "pv/PvUser.h"
int main(int argc, char** argv)
{
std::string str = "用户编号";
int a = str.size();
int b = str.length();
int x = 5/10 + int(6%10 != 0);
// 设置控制台输出为 UTF-8 编码
SetConsoleOutputCP(CP_UTF8);
// 设置控制台输入为 UTF-8 编码(如果需要输入中文)
SetConsoleCP(CP_UTF8);
NJson jsonroot;
NJsonParse(R"({"name": "Alice", "age": 25, 111,})", jsonroot);
std::cout << (jsonroot.is_null() ? "ERROR" : "OK") << std::endl;
{
NJsonNode jsonroot;
NJson::parse(R"({"name": "Alice", "age": 25, "data":[["1","1","1"],["1","1","1"],["1","1","1"]]})", jsonroot);
std::cout << (jsonroot.is_null() ? "ERROR" : "OK") << std::endl;
std::vector<std::vector<std::string>> v1;
NJson::read<std::vector<std::vector<std::string>>>(jsonroot, "data", v1);
std::vector<std::vector<std::string>> vec = {
{"1", "1", "1", "1", "1", "1", "1", "1"},
{"1", "1", "1", "1", "1", "1", "1", "1"},
{"1", "1", "1", "1", "1", "1", "1", "1"},
{"1", "1", "1", "1", "1", "1", "1", "1"}
};
NJsonNode jsonroot1;
jsonroot1["price_super_peak"] = 0.53;
jsonroot1["price_peak"] = 0.53;
jsonroot1["price_shoulder"] = 0.53;
jsonroot1["price_off_peak"] = 0.53;
jsonroot1["periods"] = vec;
std::cout << jsonroot1.dump();
}
std::cout << "===>>> main start ... " << std::endl;
////std::cout << Snowflake::instance().getId() << std::endl;
//for (int i = 0; i<=10; ++i) {
@@ -83,7 +101,7 @@ int main(int argc, char** argv)
//mainWin.show();
//qapp.exec();
// 运行pv主流程
PARAM p;
int s;
pvInit(argc, argv, &p);