Begin statistics creation
This commit is contained in:
26
CHDataManagement/Workouts/File/RouteData.swift
Normal file
26
CHDataManagement/Workouts/File/RouteData.swift
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user