summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2024-10-19 16:13:55 -0700
committerVito Caputo <vcaputo@pengaru.com>2024-10-19 16:13:55 -0700
commit1123184e5092aabe12b50ffb356213a74a26862f (patch)
tree2ea8c5793a4811816417a8974edd50616425a6cc /src
parentb6ad75354b961603dd813b8f473e439d0f33651c (diff)
charts: stub out marker API
This introduces the concept of border markers intended to serve as timeline references/milestones. Here only the minimal API for setting their distance is added, nothing is actually implemented yet.
Diffstat (limited to 'src')
-rw-r--r--src/charts.c10
-rw-r--r--src/charts.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/charts.c b/src/charts.c
index 8001526..9d31603 100644
--- a/src/charts.c
+++ b/src/charts.c
@@ -65,6 +65,7 @@ typedef struct _vwm_charts_t {
vmon_t vmon;
float prev_sampling_interval_secs, sampling_interval_secs;
int sampling_paused, contiguous_drops, primed;
+ unsigned marker_distance;
float inv_ticks_per_sec, inv_total_delta;
unsigned defer_maintenance:1;
} vwm_charts_t;
@@ -1300,6 +1301,15 @@ void vwm_charts_rate_set(vwm_charts_t *charts, unsigned hertz)
}
+/* set an arbitrary marker spacing in pixels, 0 disables markers (default) */
+void vwm_charts_marker_distance_set(vwm_charts_t *charts, unsigned distance)
+{
+ assert(charts);
+
+ charts->marker_distance = distance;
+}
+
+
/* convenience function for returning the time delta as a seconds.fraction float */
static float delta(struct timespec *cur, struct timespec *prev)
{
diff --git a/src/charts.h b/src/charts.h
index e175d18..888fc9d 100644
--- a/src/charts.h
+++ b/src/charts.h
@@ -18,6 +18,7 @@ void vwm_charts_destroy(vwm_charts_t *charts);
void vwm_charts_rate_increase(vwm_charts_t *charts);
void vwm_charts_rate_decrease(vwm_charts_t *charts);
void vwm_charts_rate_set(vwm_charts_t *charts, unsigned hertz);
+void vwm_charts_marker_distance_set(vwm_charts_t *charts, unsigned distance);
int vwm_charts_update(vwm_charts_t *charts, int *desired_delay_us);
vwm_chart_t * vwm_chart_create(vwm_charts_t *charts, int pid, int width, int height, const char *name);
© All Rights Reserved