// // Created by lenovo on 2024-12-20. // #ifndef DEVICES_INFO_H #define DEVICES_INFO_H #include #include #include #include #include using namespace std; using json = nlohmann::json; // 模拟的数据结构 struct Measure { string point; string value; }; struct Device { string device_name; vector measures; }; struct AllowDevice { string device_name; }; // 定义 HistoryItem 结构体 struct HistoryItem { string time; // 时间戳 map values; // 测点名称 -> 测点值的映射 }; // 定义 DeviceMeasurement 结构体 struct DeviceMeasurement { string name; // 测点名称(如 "湿度"、"温度" 等) vector historyItems; // 多个时间点的历史数据 }; // 定义 DeviceHistory 结构体 struct DeviceHistory { string device_name; // 设备名称(如 "温湿度-1"、"烟感-1" 等) vector measurements; // 该设备的所有测点数据 }; vector control_devices_status(); json deviceInfoToJson(const vector& devices); vector createDeviceInfo(); vector allowDevice(); json createDeviceHistoryData(); json deviceHistoryToJson(const vector& devices_history); json allowDeviceInfoToJson(const vector& devices); #endif //DEVICES_INFO_H