实现策略配置功能

This commit is contained in:
lixiaoyuan
2025-08-28 18:42:37 +08:00
parent 8f6c83147b
commit dda905cda0
47 changed files with 1311 additions and 863 deletions

View File

@@ -2,27 +2,35 @@
#include <memory>
#include <unordered_map>
#include "common/Fields.h"
class Device;
class Station
{
public:
Station(int id);
Station();
void setFields(Fields& fields);
void addDevice(int deviceId, std::shared_ptr<Device> device);
std::shared_ptr<Device> getDevice(int deviceId);
void getDeviceByType(int typeId, std::vector<std::shared_ptr<Device>>& res);
int getDeviceNumByGroup(std::string name);
void getDeviceByGroup(std::string name, std::vector<std::shared_ptr<Device>>& res);
void setWorkMode(int modeId);
void setPolicy(int policyId);
public:
int id {};
std::string name;
int workModeId; // 运行模式
int runPolicyId; // 运行策略
int workModeId {}; // 运行模式
int runPolicyId {}; // 运行策略
// 储能容量
double energyCapacity {};
@@ -77,5 +85,7 @@ public:
///////////////////////////////////////////////////////////////////////////////////////////////
/// === 设备信息 ===
std::unordered_map<int, std::shared_ptr<Device>> mapDevice_;
std::unordered_map<int, std::shared_ptr<Device>> mapDevice;
std::map<std::string, int> mapDeviceGroupNum;
};