From a09cfb8e98dea0fdc5133d08690262cd7e9260e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Salvador=20Cu=C3=B1at?= Date: Wed, 22 Jul 2015 17:23:20 +0200 Subject: [PATCH] RBT - Add load/save in git storage support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Salvador Cuñat Signed-off-by: Dirk Hohndel --- load-git.c | 6 ++++++ save-git.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/load-git.c b/load-git.c index d1fa3e3dd..c4bbf1616 100644 --- a/load-git.c +++ b/load-git.c @@ -497,6 +497,12 @@ static void parse_sample_keyvalue(void *_sample, const char *key, const char *va sample->cns = atoi(value); return; } + + if (!strcmp(key, "rbt")) { + sample->rbt = get_duration(value); + return; + } + if (!strcmp(key, "po2")) { pressure_t p = get_pressure(value); sample->setpoint.mbar = p.mbar; diff --git a/save-git.c b/save-git.c index c47d89980..559666d0e 100644 --- a/save-git.c +++ b/save-git.c @@ -303,6 +303,9 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl old->cns = sample->cns; } + if (sample->rbt.seconds) + put_format(b, " rbt=%u:%02u", FRACTION(sample->rbt.seconds, 60)); + if (sample->o2sensor[0].mbar != old->o2sensor[0].mbar) { put_milli(b, " sensor1=", sample->o2sensor[0].mbar, "bar"); old->o2sensor[0] = sample->o2sensor[0];