Skip to content

Commit

Permalink
Added color for Lap Pace
Browse files Browse the repository at this point in the history
  • Loading branch information
GCorm authored and GCorm committed Dec 18, 2018
1 parent b9d1043 commit c4487b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Configurable Garmin Watch datafield
![GRun Cover Image](/doc/GRunWatch.png)

## Release Notes
### Version 1.15
- Added color for Lap Pace

### Version 1.14
- Added the following fields: Lap Time, Lap Distance, Lap Pace

Expand Down
2 changes: 1 addition & 1 deletion resources/settings/properties.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<properties>
<property id="AppVersion" type="string">1.14</property>
<property id="AppVersion" type="string">1.15</property>
<property id="HeaderPosition" type="number">1</property>
<property id="MinPace" type="number">315</property>
<property id="MaxPace" type="number">345</property>
Expand Down
7 changes: 4 additions & 3 deletions source/GRunView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ class GRunView extends WatchUi.DataField
if (info.timerTime != null)
{
// Convert in second
timer = info.timerTime / 1000;
timer = info.timerTime / 1000.0;
}

// Elapsed of the current activity in meters (m)
Expand Down Expand Up @@ -835,7 +835,7 @@ class GRunView extends WatchUi.DataField
var lapDistance = distance - startDistanceCurrentLap;

if (lapDistance <= 0) { return 0; }
return lapTimer.toFloat() / lapDistance;
return lapTimer / lapDistance;
}

// Current altitude in meters (m)
Expand Down Expand Up @@ -890,7 +890,7 @@ class GRunView extends WatchUi.DataField
if ( (value == OPTION_AVERAGE_PACE_MANUAL_CALC) && (info.elapsedDistance != null) )
{
if (distance <= 0) { return 0; }
return timer.toFloat() / distance;
return timer / distance;
}

// Average speed during the current activity in meters per second (mps)
Expand Down Expand Up @@ -1709,6 +1709,7 @@ class GRunView extends WatchUi.DataField
case OPTION_CURRENT_PACE:
case OPTION_AVERAGE_PACE:
case OPTION_AVERAGE_PACE_MANUAL_CALC:
case OPTION_CURRENT_LAP_PACE:
if (value <= 0) { return ((id >= 8) && (id <= 10)) ? foregroundColor2 : foregroundColor1; }
else if (value < minPace) { return Graphics.COLOR_BLUE; }
else if (value > maxPace) { return Graphics.COLOR_RED; }
Expand Down

0 comments on commit c4487b5

Please sign in to comment.