Skip to content

Commit 69d3021

Browse files
committed
bugfix para filtertimer
1 parent 01293a0 commit 69d3021

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/utils/filtertime_s.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ int main(int argc, char *argv[]) {
104104
double /*start_time, end_time = 0, */current_time = 0;
105105

106106
int skip_midnight = 0;
107+
int salir = 0;
107108

108109
struct tm start_date_tm;
109110
struct tm end_date_tm;
@@ -221,10 +222,21 @@ int main(int argc, char *argv[]) {
221222

222223
rcount += pre_bytes + db_bytes + post_bytes;
223224

225+
if ( 1 == salir )
226+
continue;
227+
228+
// si la hora del plot está entre las 23:00 y las 23:30, no hacemos el skip
229+
// de seguridad en la medianoche, se entiene que la grabación viene de antes
230+
if ( 0 == skip_midnight && current_time > 82800 && current_time < 84600 ) {
231+
skip_midnight = 1;
232+
}
233+
234+
// si la grabación empieza más allá de las 23:53, omitimos hasta que sean las 00:00
224235
if ( 0 == skip_midnight && current_time > 86000) {
225236
if ( DEBUG ) printf("skipping 0\n");
226237
continue;
227238
}
239+
// una vez pasado este momento, nunca más vamos a omitir
228240
skip_midnight = 1;
229241

230242
// printf("%3.3f %3.3f %3.3f\n", start_time, current_time, end_time);
@@ -235,6 +247,7 @@ int main(int argc, char *argv[]) {
235247

236248
if ( current_time > end_date_timet ) {
237249
if ( DEBUG ) printf("skipping 2\n");
250+
salir = 1;
238251
continue;
239252
}
240253

0 commit comments

Comments
 (0)