projects
/
psensor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6673a1b
)
added comments
author
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 10 Sep 2014 19:45:51 +0000
(21:45 +0200)
committer
Jean-Philippe Orsini
<jeanfi@gmail.com>
Wed, 10 Sep 2014 19:45:51 +0000
(21:45 +0200)
src/graph.c
patch
|
blob
|
history
diff --git
a/src/graph.c
b/src/graph.c
index
a69b65a
..
f26e9cf
100644
(file)
--- a/
src/graph.c
+++ b/
src/graph.c
@@
-170,8
+170,11
@@
static void draw_background_lines(cairo_t *cr,
cairo_set_dash(cr, 0, 0, 0);
}
cairo_set_dash(cr, 0, 0, 0);
}
-/* contains the time_t of the measures which have been draw ie not the
- * bezier control points for each sensor. */
+/* Keys: sensor identifier.
+ *
+ * Values: array of time_t. Each time_t is corresponding to a sensor
+ * measure which has been used as the start point of a Bezier curve.
+ */
static GHashTable *times;
static void draw_sensor_smooth_curve(struct psensor *s,
static GHashTable *times;
static void draw_sensor_smooth_curve(struct psensor *s,
@@
-202,6
+205,10
@@
static void draw_sensor_smooth_curve(struct psensor *s,
s->color->green,
s->color->blue);
s->color->green,
s->color->blue);
+ /* search the index of the first measure used as a start point
+ * of a Bezier curve. The start and end points of the Bezier
+ * curves must be preserved to ensure the same overall shape
+ * of the graph. */
i = 0;
if (stimes) {
while (i < s->values_max_length) {
i = 0;
if (stimes) {
while (i < s->values_max_length) {
@@
-253,7
+260,6
@@
static void draw_sensor_smooth_curve(struct psensor *s,
x[0 + j] = ((double)vdt * g_width) / dt + g_xoff;
y[0 + j] = compute_y(v, min, max, g_height, g_yoff);
x[0 + j] = ((double)vdt * g_width) / dt + g_xoff;
y[0 + j] = compute_y(v, min, max, g_height, g_yoff);
-
if (j == 0)
t0 = t;
if (j == 0)
t0 = t;