From 370505258fe2dd2a27c9f835d31f98e6e98a9ab7 Mon Sep 17 00:00:00 2001 From: kyledo Date: Mon, 19 Jan 2026 23:21:29 +1100 Subject: [PATCH 1/4] minor conflict fixes --- source/GarminApp.mc | 369 +++++++++++++++++------------------ source/Views/AdvancedView.mc | 5 +- 2 files changed, 182 insertions(+), 192 deletions(-) diff --git a/source/GarminApp.mc b/source/GarminApp.mc index f8ea2d8..2c76633 100644 --- a/source/GarminApp.mc +++ b/source/GarminApp.mc @@ -100,64 +100,52 @@ class GarminApp extends Application.AppBase { function startRecording() as Void { - if (isRecording) { - return; - } + if (isRecording) {return;} - System.println("[INFO] Starting cadence monitoring"); + System.println("[INFO] Starting cadence monitoring"); - _finalCQ = null; - _finalCQConfidence = null; - _finalCQTrend = null; - _cqHistory = []; - _cadenceCount = 0; - _missingCadenceCount = 0; + _finalCQ = null; + _finalCQConfidence = null; + _finalCQTrend = null; + _cqHistory = []; + _cadenceCount = 0; + _missingCadenceCount = 0; - isRecording = true; - -} + isRecording = true; + } function stopRecording() as Void { - if (!isRecording) { - return; - } - - System.println("[INFO] Stopping cadence monitoring"); + if (!isRecording) {return;} - var cq = computeCadenceQualityScore(); + System.println("[INFO] Stopping cadence monitoring"); - if (cq >= 0) { - _finalCQ = cq; - _finalCQConfidence = computeCQConfidence(); - _finalCQTrend = computeCQTrend(); + var cq = computeCadenceQualityScore(); - System.println( - "[CADENCE QUALITY] Final CQ frozen at " + - cq.format("%d") + "% (" + - _finalCQTrend + ", " + - _finalCQConfidence + " confidence)" - ); + if (cq >= 0) { + _finalCQ = cq; + _finalCQConfidence = computeCQConfidence(); + _finalCQTrend = computeCQTrend(); - writeDiagnosticLog(); - } + System.println( + "[CADENCE QUALITY] Final CQ frozen at " + + cq.format("%d") + "% (" + + _finalCQTrend + ", " + + _finalCQConfidence + " confidence)" + ); - isRecording = false; -} + writeDiagnosticLog(); + } - function isActivityRecording() as Boolean { - return isRecording; + isRecording = false; } function updateCadenceBarAvg() as Void { - if (!isRecording) { - return; // ignore samples when not actively monitoring - } + //if (!isRecording) { return;} // ignore samples when not actively monitoring var info = Activity.getActivityInfo(); - - //var zoneState = null; + if (info != null && info.currentCadence != null) { var newCadence = info.currentCadence; _cadenceBarAvg[_cadenceAvgIndex] = newCadence.toFloat(); @@ -185,79 +173,79 @@ class GarminApp extends Application.AppBase { _cadenceIndex = (_cadenceIndex + 1) % MAX_BARS; if (_cadenceCount < MAX_BARS) { _cadenceCount++; } - if (DEBUG_MODE) { - System.println("[CADENCE] " + newCadence); -} - } else { - // Track missing cadence samples (sensor dropouts) - _missingCadenceCount++; - } - - // ----- Cadence Quality computation ----- - var cq = computeCadenceQualityScore(); - - if (cq < 0) { - System.println( - "[CADENCE QUALITY] Warming up (" + - _cadenceCount.toString() + "/" + - MIN_CQ_SAMPLES.toString() + " samples)" - ); - } else { if (DEBUG_MODE) { - System.println("[CADENCE QUALITY] CQ = " + cq.format("%d") + "%"); -} + System.println("[CADENCE] " + newCadence); + } + else { + // Track missing cadence samples (sensor dropouts) + _missingCadenceCount++; + } - // Record CQ history for trend analysis - _cqHistory.add(cq); + // ----- Cadence Quality computation ----- + var cq = computeCadenceQualityScore(); + + if (cq < 0) { + System.println( + "[CADENCE QUALITY] Warming up (" + + _cadenceCount.toString() + "/" + + MIN_CQ_SAMPLES.toString() + " samples)" + ); + } else { + if (DEBUG_MODE) { + System.println("[CADENCE QUALITY] CQ = " + cq.format("%d") + "%"); + } + + // Record CQ history for trend analysis + _cqHistory.add(cq); - // Keep sliding window small and recent - if (_cqHistory.size() > 10) { - _cqHistory.remove(0); + // Keep sliding window small and recent + if (_cqHistory.size() > 10) { + _cqHistory.remove(0); + } } - } - // ----- Memory logging (approx once per minute) ----- - if (_cadenceIndex % 60 == 0 && _cadenceIndex > 0) { - Logger.logMemoryStats("Runtime"); - } + // ----- Memory logging (approx once per minute) ----- + if (_cadenceIndex % 60 == 0 && _cadenceIndex > 0) { + Logger.logMemoryStats("Runtime"); + } } -// Cadence Quality -function computeTimeInZoneScore() as Number { + // Cadence Quality + function computeTimeInZoneScore() as Number { - // Not enough data yet - if (_cadenceCount < MIN_CQ_SAMPLES) { - return -1; // sentinel value meaning "not ready" - } + // Not enough data yet + if (_cadenceCount < MIN_CQ_SAMPLES) { + return -1; // sentinel value meaning "not ready" + } - var minZone = _idealMinCadence; - var maxZone = _idealMaxCadence; + var minZone = _idealMinCadence; + var maxZone = _idealMaxCadence; - var inZoneCount = 0; - var validSamples = 0; + var inZoneCount = 0; + var validSamples = 0; - for (var i = 0; i < MAX_BARS; i++) { - var c = _cadenceHistory[i]; + for (var i = 0; i < MAX_BARS; i++) { + var c = _cadenceHistory[i]; - if (c != null) { - validSamples++; + if (c != null) { + validSamples++; - if (c >= minZone && c <= maxZone) { - inZoneCount++; + if (c >= minZone && c <= maxZone) { + inZoneCount++; + } } } - } - if (validSamples == 0) { - return -1; - } + if (validSamples == 0) { + return -1; + } - var ratio = inZoneCount.toFloat() / validSamples.toFloat(); - return (ratio * 100).toNumber(); -} + var ratio = inZoneCount.toFloat() / validSamples.toFloat(); + return (ratio * 100).toNumber(); + } @@ -293,142 +281,145 @@ function computeTimeInZoneScore() as Number { function computeSmoothnessScore() as Number { - // Not enough data yet - if (_cadenceCount < MIN_CQ_SAMPLES) { - return -1; // not ready - } - - var totalDiff = 0.0; - var diffCount = 0; - - for (var i = 1; i < MAX_BARS; i++) { - var prev = _cadenceHistory[i - 1]; - var curr = _cadenceHistory[i]; - - if (prev != null && curr != null) { - totalDiff += abs(curr - prev); - diffCount++; + // Not enough data yet + if (_cadenceCount < MIN_CQ_SAMPLES) { + return -1; // not ready } - } - if (diffCount == 0) { - return -1; - } + var totalDiff = 0.0; + var diffCount = 0; - var avgDiff = totalDiff / diffCount; + for (var i = 1; i < MAX_BARS; i++) { + var prev = _cadenceHistory[i - 1]; + var curr = _cadenceHistory[i]; - /* - Interpret avgDiff: - - ~0–1 → very smooth - - ~2–3 → normal - - >5 → erratic - */ + if (prev != null && curr != null) { + totalDiff += abs(curr - prev); + diffCount++; + } + } - var rawScore = 100 - (avgDiff * 10); + if (diffCount == 0) { + return -1; + } - // Clamp to 0–100 - if (rawScore < 0) { rawScore = 0; } - if (rawScore > 100) { rawScore = 100; } + var avgDiff = totalDiff / diffCount; - return rawScore; -} + /* + Interpret avgDiff: + - ~0–1 → very smooth + - ~2–3 → normal + - >5 → erratic + */ -function computeCadenceQualityScore() as Number { + var rawScore = 100 - (avgDiff * 10); - var timeInZone = computeTimeInZoneScore(); - var smoothness = computeSmoothnessScore(); + // Clamp to 0–100 + if (rawScore < 0) { rawScore = 0; } + if (rawScore > 100) { rawScore = 100; } - // Not ready yet - if (timeInZone < 0 || smoothness < 0) { - return -1; + return rawScore; } - // Weighted combination - var cq = - (timeInZone * 0.7) + - (smoothness * 0.3); + function computeCadenceQualityScore() as Number { - return cq.toNumber(); -} + var timeInZone = computeTimeInZoneScore(); + var smoothness = computeSmoothnessScore(); + // Not ready yet + if (timeInZone < 0 || smoothness < 0) { + return -1; + } -function computeCQConfidence() as String { + // Weighted combination + var cq = + (timeInZone * 0.7) + + (smoothness * 0.3); - // Not enough data → low confidence - if (_cadenceCount < MIN_CQ_SAMPLES) { - return "Low"; + return cq.toNumber(); } - var missingRatio = _missingCadenceCount.toFloat() / - (_cadenceCount + _missingCadenceCount).toFloat(); - if (missingRatio > 0.2) { - return "Low"; - } else if (missingRatio > 0.1) { - return "Medium"; - } else { - return "High"; - } -} + function computeCQConfidence() as String { -function computeCQTrend() as String { + // Not enough data → low confidence + if (_cadenceCount < MIN_CQ_SAMPLES) { + return "Low"; + } + + var missingRatio = _missingCadenceCount.toFloat() / + (_cadenceCount + _missingCadenceCount).toFloat(); - if (_cqHistory.size() < 5) { - return "Stable"; + if (missingRatio > 0.2) { + return "Low"; + } else if (missingRatio > 0.1) { + return "Medium"; + } else { + return "High"; + } } - var first = _cqHistory[0]; - var last = _cqHistory[_cqHistory.size() - 1]; + function computeCQTrend() as String { - var delta = last - first; + if (_cqHistory.size() < 5) { + return "Stable"; + } - if (delta < -5) { - return "Declining"; - } else if (delta > 5) { - return "Improving"; - } else { - return "Stable"; - } -} + var first = _cqHistory[0]; + var last = _cqHistory[_cqHistory.size() - 1]; -function writeDiagnosticLog() as Void { + var delta = last - first; - if (!DEBUG_MODE) { - return; + if (delta < -5) { + return "Declining"; + } else if (delta > 5) { + return "Improving"; + } else { + return "Stable"; + } } - System.println("===== DIAGNOSTIC RUN SUMMARY ====="); + function writeDiagnosticLog() as Void { + + if (!DEBUG_MODE) { + return; + } - System.println("Final CQ: " + - (_finalCQ != null ? _finalCQ.format("%d") + "%" : "N/A")); + System.println("===== DIAGNOSTIC RUN SUMMARY ====="); - System.println("CQ Confidence: " + - (_finalCQConfidence != null ? _finalCQConfidence : "N/A")); + System.println("Final CQ: " + + (_finalCQ != null ? _finalCQ.format("%d") + "%" : "N/A")); - System.println("CQ Trend: " + - (_finalCQTrend != null ? _finalCQTrend : "N/A")); + System.println("CQ Confidence: " + + (_finalCQConfidence != null ? _finalCQConfidence : "N/A")); - System.println("Cadence samples collected: " + _cadenceCount.toString()); - System.println("Missing cadence samples: " + _missingCadenceCount.toString()); + System.println("CQ Trend: " + + (_finalCQTrend != null ? _finalCQTrend : "N/A")); - var totalSamples = _cadenceCount + _missingCadenceCount; - if (totalSamples > 0) { - var validRatio = - (_cadenceCount.toFloat() / totalSamples.toFloat()) * 100; + System.println("Cadence samples collected: " + _cadenceCount.toString()); + System.println("Missing cadence samples: " + _missingCadenceCount.toString()); - System.println("Valid data ratio: " + - validRatio.format("%d") + "%"); - } + var totalSamples = _cadenceCount + _missingCadenceCount; + if (totalSamples > 0) { + var validRatio = + (_cadenceCount.toFloat() / totalSamples.toFloat()) * 100; - System.println("Ideal cadence range: " + - _idealMinCadence.toString() + "-" + - _idealMaxCadence.toString()); + System.println("Valid data ratio: " + + validRatio.format("%d") + "%"); + } - System.println("===== END DIAGNOSTIC SUMMARY ====="); -} + System.println("Ideal cadence range: " + + _idealMinCadence.toString() + "-" + + _idealMaxCadence.toString()); + System.println("===== END DIAGNOSTIC SUMMARY ====="); + } + //set and get functions + function isActivityRecording() as Boolean { + return isRecording; + } function getMinCadence() as Number { return _idealMinCadence; diff --git a/source/Views/AdvancedView.mc b/source/Views/AdvancedView.mc index cb5e03b..1540843 100644 --- a/source/Views/AdvancedView.mc +++ b/source/Views/AdvancedView.mc @@ -90,8 +90,7 @@ class AdvancedView extends WatchUi.View { var idealMaxCadence = app.getMaxCadence(); /* var idealCadenceY = height * 0.37; - - + if(idealMinCadence != null && idealMaxCadence != null){ var displayString = (idealMinCadence + " - " + idealMaxCadence).toString(); dc.setColor(0xAAAAAA, Graphics.COLOR_TRANSPARENT); @@ -99,7 +98,7 @@ class AdvancedView extends WatchUi.View { }*/ var cadenceY = height * 0.37; - var chartDurationDisplay = null; + //var chartDurationDisplay = null; var chartDurationY = height * 0.85; if (info != null && info.currentCadence != null) { From 1e6c318d36a1bef3b6137cff4578e20461540727 Mon Sep 17 00:00:00 2001 From: kyledo Date: Tue, 20 Jan 2026 02:48:17 +1100 Subject: [PATCH 2/4] improve code indentation --- source/GarminApp.mc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/GarminApp.mc b/source/GarminApp.mc index 2c76633..f9f3037 100644 --- a/source/GarminApp.mc +++ b/source/GarminApp.mc @@ -209,7 +209,7 @@ class GarminApp extends Application.AppBase { Logger.logMemoryStats("Runtime"); } -} + } From a565a862b606ed0841a9b5cc7d7ae619f35b9607 Mon Sep 17 00:00:00 2001 From: kyledo Date: Tue, 20 Jan 2026 04:19:24 +1100 Subject: [PATCH 3/4] fixe null Chart duration --- source/Delegates/AdvancedViewDelegate.mc | 2 +- .../SelectBarChartDelegate.mc | 14 +++---- .../ProfileDelegates/ProfilePickerDelegate.mc | 2 + .../SelectExperienceDelegate.mc | 14 ++++--- .../ProfileDelegates/SelectGenderDelegate.mc | 8 ++-- .../ProfileDelegates/SelectProfileDelegate.mc | 6 +-- source/GarminApp.mc | 37 ++++++++----------- 7 files changed, 39 insertions(+), 44 deletions(-) diff --git a/source/Delegates/AdvancedViewDelegate.mc b/source/Delegates/AdvancedViewDelegate.mc index 9b302c8..edf4782 100644 --- a/source/Delegates/AdvancedViewDelegate.mc +++ b/source/Delegates/AdvancedViewDelegate.mc @@ -8,7 +8,7 @@ class AdvancedViewDelegate extends WatchUi.BehaviorDelegate { //private var _view as AdvancedView; function initialize(view as AdvancedView) { - InputDelegate.initialize(); + BehaviorDelegate.initialize(); //_view = view; } diff --git a/source/Delegates/SettingsDelegates/CustomizableDelegates/SelectBarChartDelegate.mc b/source/Delegates/SettingsDelegates/CustomizableDelegates/SelectBarChartDelegate.mc index 196f907..d26d760 100644 --- a/source/Delegates/SettingsDelegates/CustomizableDelegates/SelectBarChartDelegate.mc +++ b/source/Delegates/SettingsDelegates/CustomizableDelegates/SelectBarChartDelegate.mc @@ -6,7 +6,7 @@ import Toybox.Application; class SelectBarChartDelegate extends WatchUi.Menu2InputDelegate { private var _menu as WatchUi.Menu2; - var app = Application.getApp() as GarminApp; + var app = getApp(); var chartDuration = app.getChartDuration(); function initialize(menu as WatchUi.Menu2) { @@ -24,20 +24,16 @@ class SelectBarChartDelegate extends WatchUi.Menu2InputDelegate { //Try to change cadence range based off menu selection if (id == :chart_15m){ - app.setChartDuration("FifteenminChart"); - System.println("Chart Duration: Fifteenmin"); + app.setChartDuration(GarminApp.FifteenminChart); } else if (id == :chart_30m){ - app.setChartDuration("ThirtyminChart"); - System.println("Chart Duration: Thirtymin"); + app.setChartDuration(GarminApp.ThirtyminChart); } else if (id == :chart_1h){ - app.setChartDuration("OneHourChart"); - System.println("Chart Duration: OneHour"); + app.setChartDuration(GarminApp.OneHourChart); } else if (id == :chart_2h){ - app.setChartDuration("TwoHourChart"); - System.println("Chart Duration: TwoHour"); + app.setChartDuration(GarminApp.TwoHourChart); } else {System.println("ERROR");} diff --git a/source/Delegates/SettingsDelegates/ProfileDelegates/ProfilePickerDelegate.mc b/source/Delegates/SettingsDelegates/ProfileDelegates/ProfilePickerDelegate.mc index 61d7218..5cf3f9f 100644 --- a/source/Delegates/SettingsDelegates/ProfileDelegates/ProfilePickerDelegate.mc +++ b/source/Delegates/SettingsDelegates/ProfileDelegates/ProfilePickerDelegate.mc @@ -26,6 +26,8 @@ class ProfilePickerDelegate extends WatchUi.PickerDelegate { app.setUserSpeed(pickedValue); } + app.idealCadenceCalculator(); + WatchUi.popView(WatchUi.SLIDE_RIGHT); return true; } diff --git a/source/Delegates/SettingsDelegates/ProfileDelegates/SelectExperienceDelegate.mc b/source/Delegates/SettingsDelegates/ProfileDelegates/SelectExperienceDelegate.mc index 6e1a254..c33bb92 100644 --- a/source/Delegates/SettingsDelegates/ProfileDelegates/SelectExperienceDelegate.mc +++ b/source/Delegates/SettingsDelegates/ProfileDelegates/SelectExperienceDelegate.mc @@ -14,11 +14,11 @@ class SelectExperienceDelegate extends WatchUi.Menu2InputDelegate { Menu2InputDelegate.initialize(); _menu = menu; - if (experienceLvl == 1.06){ + if (experienceLvl == GarminApp.Beginner){ experienceLvlString = "Beginner"; - } else if (experienceLvl == 1.04){ + } else if (experienceLvl == GarminApp.Intermediate){ experienceLvlString = "Intermediate"; - } else if (experienceLvl == 1.02){ + } else if (experienceLvl == GarminApp.Advanced){ experienceLvlString = "Advanced"; } var newTitle = Lang.format("Experience: $1$", [experienceLvlString]); @@ -34,17 +34,19 @@ class SelectExperienceDelegate extends WatchUi.Menu2InputDelegate { //Try to change user experience lvl based off menu selection if (id == :exp_beginner){ System.println("User ExperienceLvl: Beginner"); - app.setExperienceLvl(1.06); + app.setExperienceLvl(GarminApp.Beginner); } else if (id == :exp_intermediate){ System.println("User ExperienceLvl: Intermediate"); - app.setExperienceLvl(1.04); + app.setExperienceLvl(GarminApp.Intermediate); } else if (id == :exp_advanced){ System.println("User ExperienceLvl: Advanced"); - app.setExperienceLvl(1.02); + app.setExperienceLvl(GarminApp.Advanced); } else {System.println("ERROR");} + app.idealCadenceCalculator(); + WatchUi.popView(WatchUi.SLIDE_RIGHT); } diff --git a/source/Delegates/SettingsDelegates/ProfileDelegates/SelectGenderDelegate.mc b/source/Delegates/SettingsDelegates/ProfileDelegates/SelectGenderDelegate.mc index 8f2179b..260fcf2 100644 --- a/source/Delegates/SettingsDelegates/ProfileDelegates/SelectGenderDelegate.mc +++ b/source/Delegates/SettingsDelegates/ProfileDelegates/SelectGenderDelegate.mc @@ -26,18 +26,20 @@ class SelectGenderDelegate extends WatchUi.Menu2InputDelegate { //Try to change user gender based off menu selection if (id == :user_male){ - app.setUserGender("Male"); + app.setUserGender(GarminApp.Male); System.println("User Gender: Male"); } else if (id == :user_female){ - app.setUserGender("Female"); + app.setUserGender(GarminApp.Female); System.println("User Gender: Female"); } else if (id == :user_other){ - app.setUserGender("Other"); + app.setUserGender(GarminApp.Other); System.println("User Gender: Other"); } else {System.println("ERROR");} + app.idealCadenceCalculator(); + WatchUi.popView(WatchUi.SLIDE_RIGHT); } diff --git a/source/Delegates/SettingsDelegates/ProfileDelegates/SelectProfileDelegate.mc b/source/Delegates/SettingsDelegates/ProfileDelegates/SelectProfileDelegate.mc index 2e55f3e..f9e8551 100644 --- a/source/Delegates/SettingsDelegates/ProfileDelegates/SelectProfileDelegate.mc +++ b/source/Delegates/SettingsDelegates/ProfileDelegates/SelectProfileDelegate.mc @@ -60,16 +60,16 @@ class SelectProfileDelegate extends WatchUi.Menu2InputDelegate { function speedPicker() as Void { //uses number not float var currentSpeed = app.getUserSpeed().toNumber(); - if (currentSpeed == null) { currentSpeed = 10; } // Default 10 km/h + if (currentSpeed == null) { currentSpeed = 3; } // Default 3 km/h - var factory = new ProfilePickerFactory(5, 30, 1, {:label=>" km/h"}); + var factory = new ProfilePickerFactory(3, 30, 1, {:label=>" km/h"}); var picker = new WatchUi.Picker({ :title => new WatchUi.Text({:text=>"Set Speed", :locX=>WatchUi.LAYOUT_HALIGN_CENTER, :locY=>WatchUi.LAYOUT_VALIGN_BOTTOM, :color=>Graphics.COLOR_WHITE}), :pattern => [factory], :defaults => [factory.getIndex(currentSpeed)] }); - + WatchUi.pushView(picker, new ProfilePickerDelegate(:prof_speed), WatchUi.SLIDE_LEFT); } diff --git a/source/GarminApp.mc b/source/GarminApp.mc index 9054961..cd68575 100644 --- a/source/GarminApp.mc +++ b/source/GarminApp.mc @@ -16,7 +16,7 @@ class GarminApp extends Application.AppBase { var globalTimer; var isRecording as Boolean = false; - + enum { //each chart corresponds to a difference bar duration average (in seconds) FifteenminChart = 3, ThirtyminChart = 6, @@ -45,10 +45,10 @@ class GarminApp extends Application.AppBase { //default value (can change in settings) private var _userHeight = 170;//>>cm - private var _userSpeed = 3.8;//>>m/s + private var _userSpeed = 10;//>>km/h private var _experienceLvl = Beginner; private var _userGender = Male; - private var _chartDuration = ThirtyminChart; + private var _chartDuration = ThirtyminChart as Number; private var _idealMinCadence = 80; private var _idealMaxCadence = 100; @@ -253,17 +253,18 @@ class GarminApp extends Application.AppBase { var referenceCadence = 0; var finalCadence = 0; var userLegLength = _userHeight * 0.53; + var userSpeedms = _userSpeed / 3.6;//km/h --> m/s //reference cadence switch (_userGender) { case Male: - referenceCadence = (-1.268 * userLegLength) + (3.471 * _userSpeed) + 261.378; + referenceCadence = (-1.268 * userLegLength) + (3.471 * userSpeedms) + 261.378; break; case Female: - referenceCadence = (-1.190 * userLegLength) + (3.705 * _userSpeed) + 249.688; + referenceCadence = (-1.190 * userLegLength) + (3.705 * userSpeedms) + 249.688; break; default: - referenceCadence = (-1.251 * userLegLength) + (3.665 * _userSpeed) + 254.858; + referenceCadence = (-1.251 * userLegLength) + (3.665 * userSpeedms) + 254.858; break; } @@ -449,29 +450,21 @@ class GarminApp extends Application.AppBase { return _cadenceCount; } + function setChartDuration(value as Number) as Void { + _chartDuration = value; + + System.println(CHART_ENUM_NAMES[_chartDuration] + " selected."); + } + function getChartDuration() as String{ return CHART_ENUM_NAMES[_chartDuration]; } - - function setChartDuration(value as String) as Void { - if (value == "FifteenminChart"){ - _chartDuration = FifteenminChart; - } else if (value == "ThirtyminChart"){ - _chartDuration = ThirtyminChart; - } else if (value == "OneHourChart"){ - _chartDuration = OneHourChart; - } else if (value == "TwoHourChart"){ - _chartDuration = TwoHourChart; - } else {System.println("ERROR");} - - System.println(_chartDuration); - } function getUserGender() as String { return _userGender; } - function setUserGender(value as String) as Void { + function setUserGender(value as Number) as Void { _userGender = value; } @@ -499,7 +492,7 @@ class GarminApp extends Application.AppBase { return _experienceLvl; } - function setExperienceLvl(value as Number) as Void { + function setExperienceLvl(value as Float) as Void { _experienceLvl = value; } From cb4fc3707351367f02951293f827dfe920880e5f Mon Sep 17 00:00:00 2001 From: kyledo Date: Tue, 20 Jan 2026 14:03:31 +1100 Subject: [PATCH 4/4] minor pixel threshold change for each bar --- source/Views/AdvancedView.mc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Views/AdvancedView.mc b/source/Views/AdvancedView.mc index 1540843..6effcd8 100644 --- a/source/Views/AdvancedView.mc +++ b/source/Views/AdvancedView.mc @@ -180,7 +180,7 @@ class AdvancedView extends WatchUi.View { if(cadenceCount == 0) {return;} var numBars = cadenceCount; - var barWidth = (barZoneWidth / MAX_BARS).toNumber(); + var barWidth = app.max(1, (barZoneWidth / MAX_BARS).toNumber()); var startIndex = (cadenceIndex - numBars + MAX_BARS) % MAX_BARS;