]> git.itanic.dy.fi Git - log-plotter/commitdiff
data.c: Reset time stamp when starting new log master
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Fri, 28 Feb 2014 19:16:04 +0000 (21:16 +0200)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Fri, 28 Feb 2014 19:16:04 +0000 (21:16 +0200)
Whenever we start logging a new charging session, start counting the
time from zero.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
data.c

diff --git a/data.c b/data.c
index c577a6eafccebc52643d82e065dc63430f80c2ce..56a6b72faeca6cd445135421bbc5910851c32dd3 100644 (file)
--- a/data.c
+++ b/data.c
@@ -328,6 +328,8 @@ static int read_data(struct eventhandler_entry *h)
                return 0;
 
        if (state_has_changed()) {
+               dt->start_time = time(NULL);
+               data.timestamp = 0;
                store_str_variable_value_to_array("status",
                        state_to_str(plotter_state.system_status), dt->cfg);