Implemented history writer

This commit is contained in:
Martino Ferrari
2026-06-14 14:09:51 +02:00
parent f25bd7f08e
commit dd7dd22cb0
27 changed files with 1537 additions and 104 deletions
+20
View File
@@ -161,6 +161,10 @@ std::string BuildSetTrigger(const std::string& signalKey, const std::string& edg
/** signalsCsv: comma-separated full keys "src:sig,src:sig2"; n<=0 → raw. */
std::string BuildZoom(uint32_t reqId, double t0, double t1, int n,
const std::string& signalsCsv);
/** History zoom: same shape as zoom but reads from disk history. */
std::string BuildHistoryZoom(uint32_t reqId, double t0, double t1, int n,
const std::string& signalsCsv);
std::string BuildHistoryInfo();
std::string BuildSetMaxPoints(uint32_t n);
/*---------------------------------------------------------------------------*/
@@ -187,6 +191,22 @@ bool ParseTriggerState(const std::string& json, TriggerStateMsg& out);
/** @brief Parse a "zoom" response. */
bool ParseZoom(const std::string& json, ZoomResponse& out);
/** @brief Parse a "historyInfo" event. */
struct HistorySignalRange {
std::string key;
double t0 = 0.0, t1 = 0.0;
uint32_t count = 0, capacity = 0;
};
struct HistoryInfoMsg {
bool enabled = false;
double durationHours = 0.0;
uint32_t decimation = 0;
std::vector<HistorySignalRange> signals;
};
bool ParseHistoryInfo(const std::string& json, HistoryInfoMsg& out);
/** @brief Parse a "maxPointsUpdated" event. */
bool ParseMaxPointsUpdated(const std::string& json, uint32_t& maxPoints);