Skip to content

Commit

Permalink
Publishing 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamml committed Jan 22, 2020
1 parent c7a9165 commit 9aca470
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 26 deletions.
17 changes: 0 additions & 17 deletions .project

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ X _ _ _

## Managing Settings
Settings should be managed through Garmin Connect Mobile or Garmin Express.

### On view only settings
Starting with release 1.2.0, Tempo Trainer has an option to operate in an always on mode (default) or in an on view only mode. See [here](https://github.com/adamml/tempo-trainer/blob/master/doc/on-view-only-settings.md) for more details.

### Rate Settings
Rate settings are described [here](https://github.com/adamml/tempo-trainer/blob/master/doc/rate-settings.md)
5 changes: 5 additions & 0 deletions doc/on-view-only-settings.mdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#On View Only

If you choose "yes", then the Tempo Trainer data field will only provide audible and vibration alerts when it is visible on the watch face.

Choose "no" to have these alerts always happen when the Tempo Trainer data field is enabled for an activity.
2 changes: 2 additions & 0 deletions doc/rate-settings.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#Rate Settings

The editing of the rate settings is limited by Connect IQ.

It is not possible to switch the contextualisation of the rate settings when switching between the two modes of the app (timed intervals and beats per minute).
Expand Down
2 changes: 1 addition & 1 deletion manifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. --><iq:manifest xmlns:iq="http://www.garmin.com/xml/connectiq" version="3">
<iq:application entry="TempoTrainerApp" id="7e3c23358cda46fc92ba2d7a14e43629" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="1.4.0" name="@Strings.AppName" type="datafield" version="1.1.0">
<iq:application entry="TempoTrainerApp" id="7e3c23358cda46fc92ba2d7a14e43629" launcherIcon="@Drawables.LauncherIcon" minSdkVersion="1.4.0" name="@Strings.AppName" type="datafield" version="1.3.0">
<iq:products>
<iq:product id="approachs60"/>
<iq:product id="d2bravo"/>
Expand Down
8 changes: 8 additions & 0 deletions resources/properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<property id="mode" type="number">0</property>
<property id="notify" type="number">0</property>
<property id="rate" type="number">1</property>
<property id="onViewOnly" type="number">0</property>
</properties>

<settings>
Expand All @@ -23,6 +24,13 @@
</settingConfig>
</setting>

<setting propertyKey="@Properties.onViewOnly" title="@Strings.onViewOnlyTitle" prompt="@Strings.onViewOnlyPrompt" helpUrl="https://github.com/adamml/tempo-trainer/blob/master/doc/on-view-only-settings.md">
<settingConfig type="list" readonly="false" required="true">
<listEntry value="0">@Strings.onViewOnlyFalse</listEntry>
<listEntry value="1">@Strings.onViewOnlyTrue</listEntry>
</settingConfig>
</setting>

<setting propertyKey="@Properties.notify" title="@Strings.notifyTitle">
<settingConfig type="list" readonly="false" required="true">
<listEntry value="0">@Strings.notifyVibrate</listEntry>
Expand Down
4 changes: 4 additions & 0 deletions resources/strings/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<string id="notifyVibrateTone">Vibrate, Tone + Visual</string>
<string id="notifyTone">Tone + Visual</string>
<string id="notifyVisual">Visual Only</string>
<string id="onViewOnlyFalse">No</string>
<string id="onViewOnlyPrompt">Select "no" to have the data field use vibration and/or tone alerts at all times when the data field is enabled for an activity (default); select "yes" to only have alerts active when the data field is in view on the watch screen.</string>
<string id="onViewOnlyTitle">Use vibration and/or tone alerts only when the data field is visible</string>
<string id="onViewOnlyTrue">Yes</string>
</strings>
33 changes: 25 additions & 8 deletions source/TempoTrainerView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class TempoTrainerView extends WatchUi.SimpleDataField {
hidden var _nextRate;

hidden var _timerState = NOT_RUNNING;

hidden var _isHidden = false;
hidden var _noShowMode;

function initialize() {
SimpleDataField.initialize();
Expand All @@ -39,12 +42,14 @@ class TempoTrainerView extends WatchUi.SimpleDataField {
_dataFieldMode = App.Properties.getValue("mode");
_attentionMode = App.Properties.getValue("notify");
_rate = App.Properties.getValue("rate");
_noShowMode = App.Properties.getValue("onViewOnly");
}
else
{
_dataFieldMode = Application.getApp().getProperty("mode");
_attentionMode = Application.getApp().getProperty("notify");
_rate = Application.getApp().getProperty("rate");
_noShowMode = Application.getApp().getProperty("onViewOnly");
}
} catch (e instanceof Lang.Exception) {

Expand All @@ -61,15 +66,17 @@ class TempoTrainerView extends WatchUi.SimpleDataField {
function compute(info) {
if(_timerState == RUNNING){
if(_nextRate <= info.timerTime){
if (_attentionMode < 3){
if (_attentionMode > 0){
if (Attention has :playTone) {
Attention.playTone(_toneProfile[_metronome]);
if (_attentionMode < 3){
if(!_isHidden){
if (_attentionMode > 0){
if (Attention has :playTone) {
Attention.playTone(_toneProfile[_metronome]);
}
}
}
if (_attentionMode < 2){
if(Attention has :vibrate) {
Attention.vibrate(_vibeProfile);
if (_attentionMode < 2){
if(Attention has :vibrate) {
Attention.vibrate(_vibeProfile);
}
}
}
if(_metronome == 0){
Expand Down Expand Up @@ -110,6 +117,16 @@ class TempoTrainerView extends WatchUi.SimpleDataField {
_nextRate = 0 + _rate;
}

function onHide() {
if(_noShowMode == 1){
_isHidden = true;
}
}

function onShow() {
_isHidden = false;
}

function updateSettings() {
try{
if(App has :Properties)
Expand Down

0 comments on commit 9aca470

Please sign in to comment.