Implemented client datasource
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "HistoryWriter.h"
|
||||
#include "AdvancedErrorManagement.h"
|
||||
#include "UDPSProtocol.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -129,8 +130,8 @@ void HistoryWriter::OnSourceConfigured(uint32 sessionIdx, const char *sourceId,
|
||||
MARTe::UDPSSignalDescriptor desc;
|
||||
if (!sess.GetSignalDescriptor(s, desc)) { continue; }
|
||||
|
||||
/* Skip time-only signals (type uint64, typically TimeArray) */
|
||||
if (desc.typeCode == 13u) { continue; } /* uint64 = 13 in UDPS */
|
||||
/* Skip time-reference signals (uint64 type, typically TimeArray) */
|
||||
if (desc.typeCode == MARTe::UDPS_TYPECODE_UINT64) { continue; }
|
||||
|
||||
float64 estRate = static_cast<float64>(desc.samplingRate);
|
||||
if (estRate <= 0.0) { estRate = 1000.0; } /* fallback */
|
||||
@@ -490,8 +491,9 @@ void HistoryWriter::AppendInfoJSON(char *&buf, uint32 &off, uint32 &cap) const {
|
||||
for (uint32 s = 0u; s < kHistMaxSignals; s++) {
|
||||
if (!fileActive_[i][s]) { continue; }
|
||||
const SignalFile &sf = files_[i][s];
|
||||
if (sf.count == 0u) { continue; }
|
||||
|
||||
/* Report even when count==0 — the file exists but hasn't received
|
||||
* data yet (or was just created). Clients need the entry to enable
|
||||
* history UI; t0/t1 == 0 signals "still priming". */
|
||||
HistJsonAppendf(buf, off, cap,
|
||||
"%s\"%s:%s\":{\"t0\":%.17g,\"t1\":%.17g,\"count\":%u,\"capacity\":%u}",
|
||||
(first ? "" : ","),
|
||||
|
||||
Reference in New Issue
Block a user