Skip to content

Commit

Permalink
Merge pull request ryanbinns#120 from scubajorgen/master
Browse files Browse the repository at this point in the history
New activities added for Adventurer
  • Loading branch information
ryanbinns authored Mar 10, 2017
2 parents 294b895 + 8e2632a commit f19ff7a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 22 deletions.
19 changes: 12 additions & 7 deletions include/libttwatch.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ typedef enum

/*****************************************************************************/
typedef enum
{
TTWATCH_Running,
TTWATCH_Cycling,
TTWATCH_Swimming,
TTWATCH_Treadmill = 7,
TTWATCH_Freestyle,
TTWATCH_Gym
{
TTWATCH_Running = 0,
TTWATCH_Cycling = 1,
TTWATCH_Swimming = 2,
TTWATCH_Treadmill = 7,
TTWATCH_Freestyle = 8,
TTWATCH_Gym = 9,
TTWATCH_Hiking = 10, // Adventurer
TTWATCH_IndoorCycling = 11, // Adventurer
TTWATCH_TrailRunning =14, // Adventurer
TTWATCH_Skiing = 15, // Adventurer
TTWATCH_Snowboarding =16 // Adventurer
} TTWATCH_ACTIVITY;

/*****************************************************************************/
Expand Down
20 changes: 12 additions & 8 deletions include/ttbin.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@
#define TAG_INDOOR_CYCLING (0x40)
#define TAG_GYM (0x41)

#define ACTIVITY_RUNNING (0)
#define ACTIVITY_CYCLING (1)
#define ACTIVITY_SWIMMING (2)
#define ACTIVITY_STOPWATCH (6) /* doesn't actually log any data */
#define ACTIVITY_TREADMILL (7)
#define ACTIVITY_FREESTYLE (8)
#define ACTIVITY_GYM (9)
#define ACTIVITY_INDOOR (11)
#define ACTIVITY_RUNNING (0)
#define ACTIVITY_CYCLING (1)
#define ACTIVITY_SWIMMING (2)
#define ACTIVITY_STOPWATCH (6) /* doesn't actually log any data */
#define ACTIVITY_TREADMILL (7)
#define ACTIVITY_FREESTYLE (8)
#define ACTIVITY_GYM (9)
#define ACTIVITY_HIKING (10)
#define ACTIVITY_INDOOR (11)
#define ACTIVITY_TRAILRUNNING (14)
#define ACTIVITY_SKIING (15)
#define ACTIVITY_SNOWBOARDING (16)

typedef struct
{
Expand Down
22 changes: 15 additions & 7 deletions src/ttbin.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -856,13 +856,17 @@ const char *create_filename(TTBIN_FILE *ttbin, const char *ext)

switch (ttbin->activity)
{
case ACTIVITY_RUNNING: type = "Running"; break;
case ACTIVITY_CYCLING: type = "Cycling"; break;
case ACTIVITY_SWIMMING: type = "Pool_swim"; break;
case ACTIVITY_TREADMILL: type = "Treadmill"; break;
case ACTIVITY_FREESTYLE: type = "Freestyle"; break;
case ACTIVITY_GYM: type = "Gym"; break;
case ACTIVITY_INDOOR: type = "Indoor"; break;
case ACTIVITY_RUNNING: type = "Running"; break;
case ACTIVITY_CYCLING: type = "Cycling"; break;
case ACTIVITY_SWIMMING: type = "Pool_swim"; break;
case ACTIVITY_TREADMILL: type = "Treadmill"; break;
case ACTIVITY_FREESTYLE: type = "Freestyle"; break;
case ACTIVITY_GYM: type = "Gym"; break;
case ACTIVITY_INDOOR: type = "Indoor"; break;
case ACTIVITY_HIKING: type = "Hiking"; break;
case ACTIVITY_TRAILRUNNING: type = "Trailrunning"; break;
case ACTIVITY_SKIING: type = "Skiing"; break;
case ACTIVITY_SNOWBOARDING: type = "Snowboarding"; break;
}
sprintf(filename, "%s_%02d-%02d-%02d.%s", type, time->tm_hour, time->tm_min, time->tm_sec, ext);

Expand Down Expand Up @@ -1120,6 +1124,10 @@ static void update_summary_information(TTBIN_FILE *ttbin)
case ACTIVITY_RUNNING:
case ACTIVITY_CYCLING:
case ACTIVITY_FREESTYLE:
case ACTIVITY_HIKING:
case ACTIVITY_TRAILRUNNING:
case ACTIVITY_SKIING:
case ACTIVITY_SNOWBOARDING:
i = ttbin->gps_records.count;
while (i > 0)
{
Expand Down
5 changes: 5 additions & 0 deletions src/ttwatch.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,11 @@ static void do_list_history_callback(TTWATCH_ACTIVITY activity, int index, const
case TTWATCH_Treadmill: write_log(0, "Treadmill:\n"); break;
case TTWATCH_Freestyle: write_log(0, "Freestyle:\n"); break;
case TTWATCH_Gym: write_log(0, "Gym:\n"); break;
case TTWATCH_Hiking: write_log(0, "Hiking:\n"); break;
case TTWATCH_IndoorCycling: write_log(0, "IndoorCycling:\n"); break;
case TTWATCH_TrailRunning: write_log(0, "Trailrunning:\n"); break;
case TTWATCH_Skiing: write_log(0, "Skiing:\n"); break;
case TTWATCH_Snowboarding: write_log(0, "Snowboarding:\n"); break;
}
d->activity = activity;
}
Expand Down

0 comments on commit f19ff7a

Please sign in to comment.