-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTraining.h
46 lines (40 loc) · 1.2 KB
/
Training.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include <Defines.h>
#include <wx/datetime.h>
/**
* @brief A training/activity
*/
struct Training {
/**
* @brief Return human readable string
* @param includeDate Include date in returned string
* @param unit Unit (km|miles)
* @return human readable string
*/
wxString ToString(bool includeDate, PTUnit const &unit);
/**
* @brief Get min, max and average time for this activity
* @param minTime Min
* @param maxTime Max
* @param avgSpan Average
*/
void GetTime(wxTimeSpan &minTime, wxTimeSpan &maxTime, wxTimeSpan &avgSpan );
/**
* @brief Get min, max and average distance for this activity
* @param minDist Min
* @param maxDist Max
* @param avgDist Average
* @param unit km|miles
*/
void GetDistance( double &minDist, double &maxDist, double &avgDist, PTUnit const &unit );
/**
* @brief Helper for sorting activities by date
* @param a First
* @param b Second
* @return First is before second
*/
static bool compareDate(const Training& a, const Training& b);
PTTrainingType type;
int intensity;
wxDateTime date;
};