Skip to content

Commit

Permalink
Comment troubleshooting code
Browse files Browse the repository at this point in the history
  • Loading branch information
gcormier9 committed Mar 7, 2022
1 parent be74c6c commit f86b0d5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 24 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,28 @@ Calculate the vertical speed in meter/min or feet/min depending on the watch set


## Release Notes
### Version 1.33
- Version 1.32 was invalid as I forgot to remove troubleshooting code.

| Memory Usage on va3 (28.6 KB) | Current | Peak |
| --------------------------------- |:-------:|:-------:|
| At startup | 25.5 kB | 27.1 kB |
| 10 sec running | 25.5 kB | 27.5 kB |
| After setting change | 25.5 kB | 28.4 kB |

| Memory Usage on fenix5 (28.6 KB) | Current | Peak |
| --------------------------------- |:-------:|:-------:|
| At startup | 25.4 kB | 27.4 kB |
| 10 sec running | 25.4 kB | 27.7 kB |
| After setting change | 25.4 kB | 28.4 kB |


| Memory Usage on fr945 (124.6 KB) | Current | Peak |
| --------------------------------- |:-------:|:-------:|
| At startup | 30.5 kB | 32.6 kB |
| 10 sec running | 30.5 kB | 33.0 kB |
| After setting change | 30.5 kB | 33.7 kB |

### Version 1.32
- Added support for D2 Air X10

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.32</property>
<property id="AppVersion" type="string">1.33</property>
<property id="HeaderHeight" type="number">30</property>
<property id="SingleBackgroundColor" type="boolean">false</property>
<property id="LapDistance" type="number">0</property>
Expand Down
46 changes: 23 additions & 23 deletions source/GRunView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -995,19 +995,19 @@ class GRunView extends WatchUi.DataField

// Validate font size (testing)
///////////////////////////////////////////////////////////////////////////////////////////////////
dc.clearClip();
if (id == 4) {
if (timer.toNumber() % 2 == 1) { lapCount = (lapCount + 1) % 9; }
font = 8 - lapCount;

var textDimensions = GRunApp.getTextDimensions(dc, formattedValue, font);
if (font == 8) {
System.println("font: " + font + ", width: " + areaWidth + "|" + textDimensions[0] + ", height: " + areaHeight + "|" + textDimensions[1]);
} else {
var textDimensions2 = GRunApp.getTextDimensions(dc, formattedValue, font+1);
System.println("font: " + font + ", width: " + areaWidth + "|" + textDimensions[0] + "|" + textDimensions2[0] + "(" + (areaWidth-textDimensions2[0]) + "), height: " + areaHeight + "|" + textDimensions[1] + "|" + textDimensions2[1] + "(" + (areaHeight-textDimensions2[1]) + ")");
}
}
//dc.clearClip();
//if (id == 4) {
// if (timer.toNumber() % 2 == 1) { lapCount = (lapCount + 1) % 9; }
// font = 8 - lapCount;
//
// var textDimensions = GRunApp.getTextDimensions(dc, formattedValue, font);
// if (font == 8) {
// System.println("font: " + font + ", width: " + areaWidth + "|" + textDimensions[0] + ", height: " + areaHeight + "|" + textDimensions[1]);
// } else {
// var textDimensions2 = GRunApp.getTextDimensions(dc, formattedValue, font+1);
// System.println("font: " + font + ", width: " + areaWidth + "|" + textDimensions[0] + "|" + textDimensions2[0] + "(" + (areaWidth-textDimensions2[0]) + "), height: " + areaHeight + "|" + textDimensions[1] + "|" + textDimensions2[1] + "(" + (areaHeight-textDimensions2[1]) + ")");
// }
//}
///////////////////////////////////////////////////////////////////////////////////////////////////

// Realign text
Expand Down Expand Up @@ -1040,16 +1040,16 @@ class GRunView extends WatchUi.DataField

// Validate font size (testing)
///////////////////////////////////////////////////////////////////////////////////////////////////
if (displayIcon) { areaX += 30; } // 24 (iconWidth) + 6 (padding)
var textDimensions = GRunApp.getTextDimensions(dc, formattedValue, font);
var x2 = areaX + ((areaWidth - textDimensions[0]) / 2);
var y2 = areaY + ((areaHeight - textDimensions[1]) / 2);
dc.setPenWidth(1);
dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
dc.drawRectangle(x2, y2, textDimensions[0], textDimensions[1]);
dc.setPenWidth(2);
dc.setColor(Graphics.COLOR_PINK, Graphics.COLOR_TRANSPARENT);
dc.drawRectangle(areaX, areaY, areaWidth, areaHeight);
//if (displayIcon) { areaX += 30; } // 24 (iconWidth) + 6 (padding)
//var textDimensions = GRunApp.getTextDimensions(dc, formattedValue, font);
//var x2 = areaX + ((areaWidth - textDimensions[0]) / 2);
//var y2 = areaY + ((areaHeight - textDimensions[1]) / 2);
//dc.setPenWidth(1);
//dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
//dc.drawRectangle(x2, y2, textDimensions[0], textDimensions[1]);
//dc.setPenWidth(2);
//dc.setColor(Graphics.COLOR_PINK, Graphics.COLOR_TRANSPARENT);
//dc.drawRectangle(areaX, areaY, areaWidth, areaHeight);
///////////////////////////////////////////////////////////////////////////////////////////////////
}

Expand Down

0 comments on commit f86b0d5

Please sign in to comment.