remove unused fields

This commit is contained in:
vcoppe committed 2026-10-08 21:19:53 +02:00
1 parent 83b76bb838
commit 3bb553d6b5
5 files changed
+2 -114

No files matched your search

-12
View File
@@ -167,14 +167,6 @@ pub(crate) fn statistics_object(stats: &engine::GlobalStatistics) -> GlobalStati
}
};
let seconds = |ms: Option<i64>| ms.map(|ms| ms as f64 / 1000.0);
let average = |key: &str, average: &engine::Average| {
if let Some(avg) = average.avg() {
let value = Object::new();
set(&value, "avg", avg);
set(&value, "count", f64::from(average.count));
set(&object, key, value);
}
};
set(&object, "totalDistance", stats.total_distance);
optional("movingDistance", stats.moving_distance);
optional("totalTime", seconds(stats.total_time));
@@ -185,10 +177,6 @@ pub(crate) fn statistics_object(stats: &engine::GlobalStatistics) -> GlobalStati
optional("endTime", stats.end_time.map(|t| t as f64));
optional("totalSpeed", stats.total_speed());
optional("movingSpeed", stats.moving_speed());
average("hr", &stats.hr);
average("cad", &stats.cad);
average("atemp", &stats.atemp);
average("power", &stats.power);
let (sw, ne) = (&stats.bounds.sw, &stats.bounds.ne);
if sw.lng <= ne.lng && sw.lat <= ne.lat {
let bounds = Object::new();
+1 -6
View File
@@ -113,7 +113,7 @@ export interface FileStructure {
}
/**
* Global statistics of a file, of the selection, or of a part of it. The optional fields are
* absent when there is no data for them (no timestamps, no heart rate...).
* absent when there is no data for them (no timestamps...).
*/
export interface GlobalStatistics {
/** km */
@@ -130,11 +130,6 @@ export interface GlobalStatistics {
/** km/h */
totalSpeed?: number;
movingSpeed?: number;
/** Average and number of trackpoints having the measure. */
hr?: { avg: number; count: number };
cad?: { avg: number; count: number };
atemp?: { avg: number; count: number };
power?: { avg: number; count: number };
/** Absent when there are no trackpoints. */
bounds?: { west: number; south: number; east: number; north: number };
}