From 13e3ae96a01b895f0233c48d662fa4356571bc05 Mon Sep 17 00:00:00 2001 From: kyledo Date: Sat, 31 Jan 2026 17:44:08 +1100 Subject: [PATCH 1/2] minor bug fix T1 newcomer can continue implementing the feature --- source/GarminApp.mc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/GarminApp.mc b/source/GarminApp.mc index ef16858..48ce05b 100644 --- a/source/GarminApp.mc +++ b/source/GarminApp.mc @@ -105,7 +105,7 @@ class GarminApp extends Application.AppBase { Logger.logMemoryStats("Startup"); // Load saved settings from persistent storage - loadSettings(); + //loadSettings(); globalTimer = new Timer.Timer(); globalTimer.start(method(:updateCadenceBarAvg),1000,true); @@ -468,7 +468,7 @@ class GarminApp extends Application.AppBase { _idealMinCadence = finalCadence - 5; // Save the calculated cadence zones - saveSettings(); + //saveSettings(); System.println("[CADENCE] Calculated ideal range: " + _idealMinCadence.toString() + "-" + _idealMaxCadence.toString() + " spm"); } @@ -613,12 +613,12 @@ class GarminApp extends Application.AppBase { function setMinCadence(value as Number) as Void { _idealMinCadence = value; - saveSettings(); + //saveSettings(); } function setMaxCadence(value as Number) as Void { _idealMaxCadence = value; - saveSettings(); + //saveSettings(); } function getCadenceHistory() as Array { @@ -648,7 +648,7 @@ class GarminApp extends Application.AppBase { function setUserGender(value as Number) as Void { _userGender = value; - saveSettings(); + //saveSettings(); } function getUserLegLength() as Float { @@ -657,7 +657,7 @@ class GarminApp extends Application.AppBase { function setUserHeight(value as Number) as Void { _userHeight = value; - saveSettings(); + //saveSettings(); } function getUserHeight() as Number { @@ -670,7 +670,7 @@ class GarminApp extends Application.AppBase { function setUserSpeed(value as Float) as Void { _userSpeed = value; - saveSettings(); + //saveSettings(); } function getExperienceLvl() as Number { @@ -679,7 +679,7 @@ class GarminApp extends Application.AppBase { function setExperienceLvl(value as Float) as Void { _experienceLvl = value; - saveSettings(); + //saveSettings(); } function min(a,b){ @@ -791,9 +791,10 @@ class GarminApp extends Application.AppBase { } // Activity metrics getters + /* function getSessionDuration() { return _sessionDuration; - } + }*/ function getSessionDistance() { return _sessionDistance; From 380fe4976a9748cfbd2139fca421723b998fe160 Mon Sep 17 00:00:00 2001 From: kyledo Date: Sun, 1 Feb 2026 21:02:03 +1100 Subject: [PATCH 2/2] minor fix adjust spacing of text on advanced view. Added chart duration indication --- source/Views/AdvancedView.mc | 44 +++++++++++------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/source/Views/AdvancedView.mc b/source/Views/AdvancedView.mc index f942ab4..74107a6 100644 --- a/source/Views/AdvancedView.mc +++ b/source/Views/AdvancedView.mc @@ -213,24 +213,29 @@ class AdvancedView extends WatchUi.View { var idealMaxCadence = app.getMaxCadence(); var cadenceY = height * 0.37; + var cadenceRangeY = height * 0.43; var chartDurationY = height * 0.85; if (info != null && info.currentCadence != null) { // Draw cadence value in green (RGB: 0,255,0 = 0x00FF00) correctColor(info.currentCadence, idealMinCadence, idealMaxCadence, dc); - dc.drawText(width / 2, cadenceY + 20, Graphics.FONT_XTINY, info.currentCadence.toString() + " spm", Graphics.TEXT_JUSTIFY_CENTER); + dc.drawText(width / 2, cadenceY, Graphics.FONT_XTINY, info.currentCadence.toString() + " spm", Graphics.TEXT_JUSTIFY_CENTER); } - drawChart(dc); - - // Display cadence zone range instead of time duration + // Display cadence zone range var minZone = app.getMinCadence(); var maxZone = app.getMaxCadence(); - var zoneText = "Zone: " + minZone.toString() + "-" + maxZone.toString() + " spm"; + var zoneText = "Target: " + minZone.toString() + "-" + maxZone.toString() + " spm"; dc.setColor(0x969696, Graphics.COLOR_TRANSPARENT); - dc.drawText(width / 2, chartDurationY, Graphics.FONT_XTINY, zoneText, Graphics.TEXT_JUSTIFY_CENTER); + dc.drawText(width / 2, cadenceRangeY, Graphics.FONT_XTINY, zoneText, Graphics.TEXT_JUSTIFY_CENTER); + + drawChart(dc); + var string = app.getChartDuration(); + + dc.setColor(0x969696, Graphics.COLOR_TRANSPARENT); + dc.drawText(width / 2, chartDurationY, Graphics.FONT_XTINY, "Last " + string, Graphics.TEXT_JUSTIFY_CENTER); } @@ -300,8 +305,6 @@ class AdvancedView extends WatchUi.View { var barWidth = (barZoneWidth / MAX_BARS).toNumber(); var startIndex = (cadenceIndex - numBars + MAX_BARS) % MAX_BARS; - var colorThreshold = 20; - // FIXED SCALE - bars have fixed height based on absolute cadence // Colors change dynamically based on your zone for (var i = 0; i < numBars; i++) { @@ -313,29 +316,8 @@ class AdvancedView extends WatchUi.View { var barHeight = ((cadence / MAX_CADENCE_DISPLAY) * chartHeight).toNumber(); var x = barZoneLeft + i * barWidth; var y = barZoneBottom - barHeight; - - // Dynamic color based on YOUR current zone - //FML - if (cadence < idealMinCadence - colorThreshold) { - // Way below zone - Grey - dc.setColor(0x969696, Graphics.COLOR_TRANSPARENT); - } - else if (cadence >= idealMinCadence - colorThreshold && cadence < idealMinCadence) { - // Below zone - Blue - dc.setColor(0x0cc0df, Graphics.COLOR_TRANSPARENT); - } - else if (cadence >= idealMinCadence && cadence <= idealMaxCadence) { - // In zone - Green (YOUR ZONE!) - dc.setColor(0x00bf63, Graphics.COLOR_TRANSPARENT); - } - else if (cadence > idealMaxCadence && cadence <= idealMaxCadence + colorThreshold) { - // Above zone - Orange - dc.setColor(0xff751f, Graphics.COLOR_TRANSPARENT); - } - else if (cadence > idealMaxCadence + colorThreshold) { - // Way above zone - Red - dc.setColor(0xFF0000, Graphics.COLOR_TRANSPARENT); - } + + correctColor(cadence, idealMinCadence, idealMaxCadence, dc); dc.fillRectangle(x, y, barWidth, barHeight); }