Begin statistics creation

This commit is contained in:
Christoph Hagen
2025-08-31 16:27:32 +02:00
parent f972a2c020
commit 96bd07bdb7
33 changed files with 1406 additions and 187 deletions

View File

@@ -0,0 +1,26 @@
import Foundation
/**
All data needed to create statistic displays
*/
struct RouteData {
let series: RouteSeries
let ranges: DataRanges
let samples: [RouteSample]
}
extension RouteData: Codable {
func encoded(prettyPrinted: Bool = false) -> Data {
let encoder = JSONEncoder()
encoder.outputFormatting = .sortedKeys
if prettyPrinted {
encoder.outputFormatting.insert(.prettyPrinted)
}
return try! encoder.encode(self)
}
}