Application-Owned Trend Data
The Zeus point table keeps the current snapshot for each point. It no longer includes built-in point-history buffers, history-file persistence, or chart-sample caches. Trend charts, reports, audit trails, retention limits, and storage cleanup belong to the application.
Subscribe To Point Changes
For one point, subscribe to Changed:
var samples = new List<(DateTimeOffset Timestamp, double Value)>();
points.Changed += (_, e) =>
{
if (e.Current.Definition.Name != "temperature" || e.Current.Error is not null)
{
return;
}
if (e.Current.Value is IConvertible value && e.Current.UpdatedAt is { } timestamp)
{
samples.Add((timestamp, Convert.ToDouble(value, CultureInfo.InvariantCulture)));
}
};
For tables or multi-point trends, prefer BatchChanged so one polling batch updates storage or charts once:
points.BatchChanged += (_, e) =>
{
foreach (var change in e.Changes)
{
var snapshot = change.Current;
if (snapshot.Error is not null || snapshot.UpdatedAt is null)
{
continue;
}
// Write to a database, JSONL, CSV, time-series store, or chart series.
SaveSample(snapshot);
}
};
Desktop UI
WinForms keeps direct control bindings for current values, alarm colors, and write-back state:
points.BindText("temperature", temperatureLabel, value => $"{value:0.0} C");
points.BindAlarmBackColor("temperature", temperatureLabel);
WPF exposes current-value sources from the ViewModel:
Temperature = points.AsBindingSource("temperature", dispatcher, value => $"{value:0.0} C");
Current-value labels stay on per-point bindings. Trend series and multi-point reports should subscribe to the core BatchChanged event instead of appending on every point change. That choice does not depend on desktop binding helpers. See Point Tables and Acquisition.
If a view needs a chart, the ViewModel owns an ObservableCollection or the chart library's series type and appends samples from e.Changes inside BatchChanged. Zeus does not choose a charting library or history capacity for the application.
Persistence Options
- Short-term charts: in-memory ring buffers or the chart control's own series.
- Reports: CSV, JSONL, SQLite, SQL Server, InfluxDB, or another application-owned store.
- Auditing: persist point name, timestamp, value, alarm state, and error fields explicitly.
- Retention: enforce by days, row counts, partitions, or archival jobs.
Next: WinForms Adapter or WPF Adapter.