RBT - Add load/save in git storage support

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Salvador Cuñat 2015-07-22 17:23:20 +02:00 committed by Dirk Hohndel
parent 25f3038d40
commit a09cfb8e98
2 changed files with 9 additions and 0 deletions

View file

@ -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;

View file

@ -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];