Implemented history writer
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user