diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0f478d0..1c18954 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -9,6 +9,9 @@ on: release: types: [published] +env: + CIQ_VERSION: 4.0.9 + jobs: install-connect-iq: name: "Install ConnectIQ" @@ -24,18 +27,18 @@ jobs: id: ciq with: path: /opt/ciq - key: ciq-${{ hashFiles('manifest.xml') }} + key: ciq-${{ env.CIQ_VERSION }}-${{ hashFiles('manifest.xml') }} - uses: actions/cache@v2 id: devices with: path: ~/.Garmin/ConnectIQ - key: devices-${{ hashFiles('manifest.xml') }} + key: devices-${{ env.CIQ_VERSION }}-${{ hashFiles('manifest.xml') }} - run: | sudo apt-get install --reinstall unzip wget git ssh tar gzip ca-certificates cd /opt; - wget -q https://developer.garmin.com/downloads/connect-iq/sdks/connectiq-sdk-lin-4.0.3-2021-06-01-b7cc78017.zip -O ciq.zip; + wget -q https://developer.garmin.com/downloads/connect-iq/sdks/connectiq-sdk-lin-${{ env.CIQ_VERSION }}-2022-01-24-2154651d3.zip -O ciq.zip; unzip ciq.zip -d ciq; rm -f ciq.zip; if: steps.ciq.outputs.cache-hit != 'true' @@ -59,7 +62,7 @@ jobs: - uses: actions/setup-java@v2 with: distribution: "adopt" # See 'Supported distributions' for available options - java-version: "8" + java-version: "16" - uses: actions/setup-python@v2 with: python-version: "3.x" @@ -68,13 +71,13 @@ jobs: id: ciq with: path: /opt/ciq - key: ciq-${{ hashFiles('manifest.xml') }} + key: ciq-${{ env.CIQ_VERSION }}-${{ hashFiles('manifest.xml') }} - uses: actions/cache@v2 id: devices with: path: ~/.Garmin/ConnectIQ - key: devices-${{ hashFiles('manifest.xml') }} + key: devices-${{ env.CIQ_VERSION }}-${{ hashFiles('manifest.xml') }} - run: | sed -i "s/0.0.0/${{ github.event.release.tag_name }}/g" manifest.xml @@ -97,8 +100,9 @@ jobs: - run: | echo /opt/ciq/bin >> $GITHUB_PATH echo "$CIQ_DEV_KEY" | base64 -d > /tmp/dev.key + java -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /opt/ciq/bin/monkeybrains.jar -v for i in $(grep "product id=" manifest.xml | cut -d \" -f2); do - if [[ "$i" =~ ^(venu2|venu2s)$ ]]; then + if [[ "$i" =~ ^(venu2|venu2s|venu2plus|fenix7|fenix7s|fenix7x|epix2)$ ]]; then export SDK=4.0.0 elif [[ "$i" =~ ^(approachs60)$ ]]; then export SDK=2.4.0 @@ -109,9 +113,10 @@ jobs: else export SDK=3.2.0 fi - java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /opt/ciq/bin/monkeybrains.jar -o /tmp/RunPowerWorkout-$i.prg -w -y /tmp/dev.key -d $i -c $SDK -f monkey.jungle + echo "BUILDING $i with sdk $SDK" + java -jar /opt/ciq/bin/monkeybrains.jar -o /tmp/RunPowerWorkout-$i.prg -w -y /tmp/dev.key -d $i -c $SDK -f monkey.jungle || true done - java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /opt/ciq/bin/monkeybrains.jar -o /tmp/RunPowerWorkout.iq -e -w -y /tmp/dev.key -r -f monkey.jungle; + java -jar /opt/ciq/bin/monkeybrains.jar -o /tmp/RunPowerWorkout.iq -e -w -y /tmp/dev.key -r -f monkey.jungle name: Build IQ file env: CIQ_DEV_KEY: ${{ secrets.CIQ_DEVELOPER_KEY }} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index e2ca64a..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "monkeyc", - "request": "runApp", - "name": "Run App", - "device": "${command:GetTargetDevice}" - }, - { - "type": "monkeyc", - "request": "runTests", - "name": "Run Tests", - "device": "${command:GetTargetDevice}" - } - ] -} \ No newline at end of file diff --git a/manifest.xml b/manifest.xml index 950739f..abe1cde 100644 --- a/manifest.xml +++ b/manifest.xml @@ -3,68 +3,73 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + eng - + \ No newline at end of file diff --git a/monkey.jungle b/monkey.jungle index 57b7261..a18d0ee 100644 --- a/monkey.jungle +++ b/monkey.jungle @@ -20,6 +20,7 @@ legacysagarey.sourcePath = source;source-ant venu.sourcePath = source;source-ant venud.sourcePath = source;source-ant venu2.sourcePath = source;source-ant +venu2plus.sourcePath = source;source-ant venu2s.sourcePath = source;source-ant vivoactive3.sourcePath = source;source-ant vivoactive3d.sourcePath = source;source-ant @@ -40,6 +41,7 @@ descentmk1.resourcePath = resources-highmem;resources-hm-240;resources;resources descentmk2.resourcePath = resources-highmem;resources-hm-280;resources descentmk2s.resourcePath = resources-highmem;resources-hm-240;resources enduro.resourcePath = resources;resources-lowmem +epix2.resourcePath = resources;resources-60x60;resources-highmem;resources-hm-416 fenix5.resourcePath = resources-lowmem;resources-noworkout;resources fenix5plus.resourcePath = resources-highmem;resources-hm-240;resources fenix5s.resourcePath = resources;resources-lowmem;resources-36x36;resources-noworkout @@ -51,6 +53,9 @@ fenix6pro.resourcePath = resources-highmem;resources-hm-260;resources fenix6s.resourcePath = resources;resources-lowmem fenix6spro.resourcePath = resources-highmem;resources-hm-240;resources fenix6xpro.resourcePath = resources-highmem;resources-hm-280;resources +fenix7.resourcePath = resources-highmem;resources-hm-260;resources +fenix7s.resourcePath = resources-highmem;resources-hm-240;resources +fenix7x.resourcePath = resources-highmem;resources-hm-280;resources fr245.resourcePath = resources-lowmem;resources-ant;resources fr245m.resourcePath = resources-ant;resources-highmem;resources-hm-240;resources fr55.resourcePath = resources-lowmem;resources-35x35;resources @@ -75,6 +80,7 @@ marqgolfer.resourcePath = resources-highmem;resources-hm-240;resources venu.resourcePath = resources;resources-60x60;resources-lowmem;resources-ant venud.resourcePath = resources;resources-60x60;resources-lowmem;resources-ant venu2.resourcePath = resources;resources-70x70;resources-highmem;resources-hm-416 +venu2plus.resourcePath = resources;resources-70x70;resources-highmem;resources-hm-360 venu2s.resourcePath = resources;resources-61x61;resources-highmem;resources-hm-360 vivoactive3.resourcePath = resources;resources-40x33;resources-ant;resources-noworkout;resources-lowmem vivoactive3d.resourcePath = resources;resources-40x33;resources-ant;resources-noworkout;resources-lowmem @@ -117,6 +123,7 @@ descentmk1.excludeAnnotations = $(descentmk1.excludeAnnotations);$(high_mem_excl descentmk2.excludeAnnotations = $(descentmk2.excludeAnnotations);$(high_mem_excludes);ant;noworkout descentmk2s.excludeAnnotations = $(descentmk2s.excludeAnnotations);$(high_mem_excludes);ant;noworkout enduro.excludeAnnotations = $(enduro.excludeAnnotations);$(low_mem_excludes);ant;noworkout +epix2.excludeAnnotations = $(epix2.excludeAnnotations);$(high_mem_excludes);ant;noworkout fenix5.excludeAnnotations = $(fenix5.excludeAnnotations);$(low_mem_excludes);ant;workout fenix5plus.excludeAnnotations = $(fenix5plus.excludeAnnotations);$(high_mem_excludes);ant;noworkout fenix5s.excludeAnnotations = $(fenix5s.excludeAnnotations);$(low_mem_excludes);ant;workout @@ -128,6 +135,9 @@ fenix6pro.excludeAnnotations = $(fenix6pro.excludeAnnotations);$(high_mem_exclud fenix6s.excludeAnnotations = $(fenix6s.excludeAnnotations);$(low_mem_excludes);ant;noworkout fenix6spro.excludeAnnotations = $(fenix6spro.excludeAnnotations);$(high_mem_excludes);ant;noworkout fenix6xpro.excludeAnnotations = $(fenix6xpro.excludeAnnotations);$(high_mem_excludes);ant;noworkout +fenix7.excludeAnnotations = $(fenix7.excludeAnnotations);$(high_mem_excludes);ant;noworkout +fenix7s.excludeAnnotations = $(fenix7s.excludeAnnotations);$(high_mem_excludes);ant;noworkout +fenix7x.excludeAnnotations = $(fenix7x.excludeAnnotations);$(high_mem_excludes);ant;noworkout fr245.excludeAnnotations = $(fr245.excludeAnnotations);$(low_mem_excludes);noant;noworkout fr245m.excludeAnnotations = $(fr245m.excludeAnnotations);$(high_mem_excludes);noant;noworkout fr55.excludeAnnotations = $(fr55.excludeAnnotations);$(low_mem_low_excludes);noant;noworkout @@ -152,6 +162,7 @@ marqgolfer.excludeAnnotations = $(marqgolfer.excludeAnnotations);$(high_mem_excl venu.excludeAnnotations = $(venu.excludeAnnotations);$(low_mem_large_excludes);noant;noworkout venud.excludeAnnotations = $(venud.excludeAnnotations);$(low_mem_large_excludes);noant;noworkout venu2.excludeAnnotations = $(venu2.excludeAnnotations);$(high_mem_excludes);noant;noworkout +venu2plus.excludeAnnotations = $(venu2plus.excludeAnnotations);$(high_mem_excludes);noant;noworkout venu2s.excludeAnnotations = $(venu2s.excludeAnnotations);$(high_mem_excludes);noant;noworkout vivoactive3.excludeAnnotations = $(vivoactive3.excludeAnnotations);$(low_mem_excludes);noant;workout vivoactive3d.excludeAnnotations = $(vivoactive3d.excludeAnnotations);$(low_mem_excludes);noant;workout diff --git a/source/RunPowerWorkoutView.mc b/source/RunPowerWorkoutView.mc index 2ed6c76..213c9aa 100644 --- a/source/RunPowerWorkoutView.mc +++ b/source/RunPowerWorkoutView.mc @@ -596,7 +596,7 @@ class RunPowerWorkoutView extends WatchUi.DataField { workout.step.durationType == 1) { stepType = (targetHigh > 0 && targetLow > 0) ? 1 : 98; - if (workout.step.durationValue != null && remainingDistance >= 0) { + if (workout.step.durationValue != null && elapsedDistance != null && remainingDistance >= 0) { remainingDistance = workout.step.durationValue - (elapsedDistance.toNumber() - stepStartDistance); @@ -673,7 +673,7 @@ class RunPowerWorkoutView extends WatchUi.DataField { if (avgPower == 0) { avgPower = currentPower; - } else if (lapTime != 0) { + } else if (timer != 0) { avgPower = (((avgPower * (timer - 1)) + currentPower) / (timer * 1.0)); } diff --git a/source/Utils.mc b/source/Utils.mc index 8b435ac..0689b82 100644 --- a/source/Utils.mc +++ b/source/Utils.mc @@ -21,7 +21,7 @@ class Utils { smallunit = "YD"; } - if ((distance / factor) >= 1) { + if ((distance / factor) >= 1 || !useMetric) { var formatted = ((distance * 1.0) / (factor * 1.0)).format("%.2f"); var index = formatted.find("."); if (index != null && showSmallDecimals) {