- correct graph data on unexact variables
This commit is contained in:
9
logger.c
9
logger.c
@ -86,7 +86,7 @@ void LoggerSetDir(char *dirarg) {
|
|||||||
}
|
}
|
||||||
fclose(fil);
|
fclose(fil);
|
||||||
} else {
|
} else {
|
||||||
perror("open read error \n");
|
printf("can not read %s\n", path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
@ -104,8 +104,7 @@ char *LoggerGetDir(void) {
|
|||||||
fprintf(fil, "%s%ld\n", LASTLOGTXT, (long)now);
|
fprintf(fil, "%s%ld\n", LASTLOGTXT, (long)now);
|
||||||
fclose(fil);
|
fclose(fil);
|
||||||
} else {
|
} else {
|
||||||
printf("can not open %s\n", path);
|
printf("can not write %s\n", path);
|
||||||
perror("open write error \n");
|
|
||||||
}
|
}
|
||||||
last = now;
|
last = now;
|
||||||
}
|
}
|
||||||
@ -259,7 +258,7 @@ int LoggerWrite(Logger *log, time_t now, int period, char *value) {
|
|||||||
|
|
||||||
int l;
|
int l;
|
||||||
FILE *fil;
|
FILE *fil;
|
||||||
char path[PATH_MAX];
|
char path[256];
|
||||||
char tim[256];
|
char tim[256];
|
||||||
|
|
||||||
tm = localtime(&now);
|
tm = localtime(&now);
|
||||||
@ -417,7 +416,7 @@ static void LoggerOut(Compressor *c, time_t t, float y) {
|
|||||||
char line[80];
|
char line[80];
|
||||||
|
|
||||||
/* printf("out %ld %g\n", t, y); */
|
/* printf("out %ld %g\n", t, y); */
|
||||||
if (y != c->ylast) {
|
if (y != c->ylast || !c->exact) {
|
||||||
c->ylast = y;
|
c->ylast = y;
|
||||||
if (y == LOGGER_NAN) {
|
if (y == LOGGER_NAN) {
|
||||||
snprintf(line, sizeof line, "%ld\n", (long)(t - c->tlast));
|
snprintf(line, sizeof line, "%ld\n", (long)(t - c->tlast));
|
||||||
|
Reference in New Issue
Block a user