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0atJra0a;!h=f19^
zJQCHXp*bC0alpCe_RGgn_En!2N%^*ZBU4zEdwq~cx<_Z(IFl3VErJrg`Zet0Na@zf
z%X`XuaGG_966hN-o^9b1_)?mghpbaKyya`i5zWr0`$|(Q;I93sH6Gp!Bi78SFi6Dx52OWoE6y0%UaxRIcN#z(ez!H
z3NNDqjZRmCu($dQxy+ff*r3brT^bY*awBj8&7G1
zom(;kDMgQtK#V)@K)2pX9_>S>3U@)TI>Z(6tFxpF46jZ1IH{?G=qEL908|1)h~)fo(k{r&$iMoInK?v^R3^cc=6Dy?{%faQoTX3@=}*{
zcB^yug!7F}Iai1Cgx56WR?sGQ^!$e>1Y^N(f=Ww$&BGV$3?3y05Xs<|Qo{%nzcpKHcXM5c~2c5e7`ns5@_@v_TX
zGAq5L?C-rNhQDme#XnR9(nv^?)Xz8q1+&b}-zYvb-V;_J{0%x@ywxENUsZSN8B=mtamOY)!Va!b(x>^@Al0AF7K!^FLJMJQ#my=`)^f8+B=WiKpYCgTc_5ju_naCKJ+rKqY
zGQoYWpDfHK!sarYxhgOr^g{}gJd=s+u!Y=Zv_9#13^
literal 0
HcmV?d00001
diff --git a/resources-rectangle-240x240/jsonData.xml b/resources-rectangle-240x240/jsonData.xml
index c2f2c6a..b884d5d 100644
--- a/resources-rectangle-240x240/jsonData.xml
+++ b/resources-rectangle-240x240/jsonData.xml
@@ -1,7 +1,7 @@
- [109, 55, 97, 147, 73, 20, 200, 170, 172, 84, 184, 79, 30, 42, 139, 134, 112, 106, 111, 110, 154, 116, 170, 177]
+ [115, 55, 97, 147, 73, 20, 200, 170, 165, 84, 177, 79, 30, 42, 138, 133, 112, 106, 111, 110, 154, 116, 170, 178]
-
- [97, 59, 88, 133, 62, 29, 157, 136, 158, 74, 169, 76, 43, 54, 121, 124, 97.5, 100, 105, 105, 124, 107, 136, 144]
+
+ [100, 59, 88, 134, 65, 30, 156, 136, 155, 74, 167, 76, 43, 54, 121, 124, 97.5, 100, 105, 105, 124, 107, 136, 142]
- [109, 63, 97, 142, 73, 32, 173, 153, 172, 84, 185, 84, 47, 59, 136, 136, 110, 110, 116, 115, 136, 118, 153, 156]
+ [113, 63, 97, 144, 73, 32, 172, 153, 171, 84, 183, 84, 47, 59, 136, 136, 110, 110, 117, 116, 136, 118, 153, 156]
- [118, 69, 105, 154, 83, 36, 186, 170, 187, 92, 202, 93, 48, 63, 145.5, 147, 119, 120, 126, 124, 147, 128, 170, 169]
+ [122, 69, 105, 154, 81, 36, 186, 170, 183, 92, 198, 93, 48, 63, 145.5, 147, 119, 120, 126, 124, 147, 128, 170, 169]
- [128, 75, 113, 166, 93, 41, 205, 187, 202, 97, 217, 98, 50, 65, 161, 162, 129, 130, 135, 134, 162, 138, 187, 184]
+ [132, 75, 113, 166, 88, 38, 205, 187, 195, 97, 210, 98, 50, 65, 161, 161.9, 129, 130, 135, 134, 162, 138, 187, 184]
- [175, 100, 157, 231, 141, 54, 297, 260, 280, 129, 302, 133, 66, 88, 216, 221, 174, 177, 187, 185, 222, 191, 259, 257]
+ [177, 100, 157, 231, 141, 54, 297, 260, 280, 129, 298, 133, 66, 84, 216, 221, 174, 177, 187, 185, 222, 191, 259, 257]
- [189, 106, 168, 246, 154, 58, 317, 277, 298, 142, 322, 147, 63, 86, 232, 237, 186, 191, 201, 200, 237.5, 205, 276, 274]
+ [190, 105, 170, 244, 154, 58, 317, 277, 298, 142, 321, 147, 63, 86, 232, 237, 186, 191, 201, 200, 237.5, 205, 276, 274]
- [169, 92, 145, 213, 126, 50, 274, 240, 258, 119, 279, 123, 61, 81, 199.5, 204, 161, 165, 174, 173, 205, 177, 239 , 237]
+ ["0", "7", ";", "P", ".", "A", "S", "@", "6", "1", "Q", "3", "5", "R", "2", "B", "U", "T", "W", "V", "X", "X", ""]
+ ["0", "A", "S", "@", "6", "1", "Q", "3", "5", "R", "2", "B", "U", "T", "W", "V", "X", "X", ""]
+
+ [169, 91, 145, 213, 126, 50, 274, 240, 255, 119, 275, 123, 59, 79, 199.5, 204, 161, 165, 174, 173, 205, 177, 239, 237]
\ No newline at end of file
diff --git a/resources/resource/fonts/Checker.fnt b/resources/resource/fonts/Checker.fnt
new file mode 100644
index 0000000..c87e30b
--- /dev/null
+++ b/resources/resource/fonts/Checker.fnt
@@ -0,0 +1,5 @@
+info face="Checkerboard" size=-50 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
+common lineHeight=50 base=40 scaleW=50 scaleH=50 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0
+page id=0 file="Checker_0.png"
+chars count=1
+char id=64 x=0 y=0 width=49 height=49 xoffset=0 yoffset=0 xadvance=49 page=0 chnl=15
diff --git a/resources/resource/fonts/Checker_0.png b/resources/resource/fonts/Checker_0.png
new file mode 100644
index 0000000000000000000000000000000000000000..790598dbba25fc33133cae5620ab4e99c65c9c81
GIT binary patch
literal 1757
zcmbVNO^@3|7dO#hHuku-
zvq|<;^@hY92{`ZzxNw6*ubep|_y-__I3NT<%s7slqVzLTobk-_KJW8>%$rYo2RF7h
zFKud?w$<794>heOmo@F2d}{Mo|NK_|yqN5NkZIca3+h|bKL7HfrfvKZ_K)(T?t7Su
zs7{y|@cJxDl$CaEXO<9p%yWIfhhgj)zkPS#&_m`Kw;Em0P1<}E?w_Xo=IKG7o*q+|
z89Q(3*JfA}L_8<@EE>ldo_R*Wi{)BvTZUdh@?+1~RSxx|ZclHElZ=NyA^8{PgbULk1?Yc;Z7Ia-#
zaUf($gqh9boXpHPyS!xZc}CMP$wLwAijfS&B=-!dbP+<7RJ3tcrb#BunvukUb)Z5j
zfQ(kSWRi{x=Zso>%p)G>nZ&{hn~X#*vXOWMb#?rZ1DV=xxAL)8OB7WuvV8AEhEXPD
zEjsJZ6K);yOiWVB_fDkD%PN`#w^L4Xk@kfcFALRMO4bpo+xnGTVa&uddws=#`y}U{
zp{iyA$FxBoA#6ho;hO+r02a`$U|}#{3$-ys4?$(iFp`ref*Hku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jgcjN8;zrdOR=qrHnqn18;Y>7q*)49)NY2w=kFLsig3@bK<*9
z6)ahwPVZ6L8bJ?aKD{}RZn>Edr(Rql2|Vc!?62qsKJFG8lRbAb%AQy|y6k(=oeOv<-SMTT&9AypoQ)5
z<(yGQ{TnyAyB&vBs7a#?M&C*BLZD;&N2^uFxH&1tkTaZDLek)1jH>Nsyvfq=*Wy7>
za(Zcx{doCfCX)$0aVT=4=-C$aPMC>;uHr&0iE`tyrNLl#$Z?L3VvY-qJE{cgpD^bI
z7Hy=g%eDH@rL4(?_e-20gAY^i>3k-D{@AoZLV)hn)ZlvSuG-(3~km
zPj{R$;f=SIo0}mxrwu7#r~41cu|7A<94M>mySo0Q=80zP3s;Y??>PN$ie#PM)+a~*
zl$bK=IX~JEPI!M1%@t2BaH;o?g*d91mqBt>l~?4{7i~zI{E-;Q@WYWX&@pr$jR^e^AqiTA%d-Bmtf%4v+u;
h^?wb)48?byH|av!&GGjsZ5w~U!J1eb7wz+i`7atWL`?ty
literal 0
HcmV?d00001
diff --git a/resources/resource/resources.xml b/resources/resource/resources.xml
index ff10390..180b97f 100644
--- a/resources/resource/resources.xml
+++ b/resources/resource/resources.xml
@@ -1,11 +1,10 @@
-
+
-
\ No newline at end of file
diff --git a/resources/strings.xml b/resources/strings.xml
index 2f99037..d8f830a 100644
--- a/resources/strings.xml
+++ b/resources/strings.xml
@@ -1,6 +1,6 @@
MoveToBeActive
Settings
- Long press the menu\nbutton to start
Main Menu
+ Long press the menu\nbutton to start
\ No newline at end of file
diff --git a/source/AnalogApp.mc b/source/AnalogApp.mc
index e05dae3..6566774 100644
--- a/source/AnalogApp.mc
+++ b/source/AnalogApp.mc
@@ -4,9 +4,9 @@
// Application Developer Agreement.
//
-using Toybox.Application;
-using Toybox.Time;
-using Toybox.Communications;
+import Toybox.Application;
+import Toybox.Time;
+//using Toybox.Communications;
// This is the primary entry point of the application.
class AnalogWatch extends Application.AppBase
@@ -17,17 +17,20 @@ class AnalogWatch extends Application.AppBase
AppBase.initialize();
}
- function onStart(state) {
+ // onStart() is called on application start up
+ function onStart(state as Dictionary?) as Void {
}
- function onStop(state) {
+ // onStop() is called when your application is exiting
+ function onStop(state as Dictionary?) as Void {
}
+
// This method runs each time the main application starts.
- function getInitialView() {
+ function getInitialView() as Array? {
if( Toybox.WatchUi has :WatchFaceDelegate ) {
- return [new AnalogView(), new AnalogDelegate()];
+ return [new AnalogView(), new AnalogDelegate()] as Array;
} else {
- return [new AnalogView()];
+ return [new AnalogView()] as Array;
}
}
diff --git a/source/AnalogSettingsView.mc b/source/AnalogSettingsView.mc
index c26a965..6f01cd7 100644
--- a/source/AnalogSettingsView.mc
+++ b/source/AnalogSettingsView.mc
@@ -32,7 +32,9 @@ class AnalogSettingsViewTest extends WatchUi.Menu2 {
Menu2.addItem(new WatchUi.MenuItem("Layout", null, "design", null));
Menu2.addItem(new WatchUi.MenuItem("Data Fields", null, "datapoints", null));
-
+ if (Storage.getValue(21)[1] or System.getSystemStats() has :batteryInDays){
+ Menu2.addItem(new WatchUi.MenuItem("Base Units", null, "units", null));
+ }
//WatchUi.pushView(Menu2, new Menu2TestMenu2Delegate(), WatchUi.SLIDE_UP );
}
@@ -57,7 +59,7 @@ class AnalogSettingsViewTest extends WatchUi.Menu2 {
}
function onDone() {
- WatchUi.popView(WatchUi.SLIDE_DOWN);
+ WatchUi.popView(WatchUi.SLIDE_BLINK);
}
function onWrap(key as WatchUi.Key) {
@@ -111,8 +113,13 @@ class Menu2TestMenu2Delegate extends WatchUi.Menu2InputDelegate { // Sub-menu De
}
iconMenu.addItem(new WatchUi.ToggleMenuItem("Hour Labels", {:enabled=>"ON", :disabled=>"OFF"}, 5, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
}
- //if (width==240 and dc.getTextDimensions("100",0)[1]>=26){
- if (Toybox has :Weather){ // Doesn't show for Fenix 5 Plus
+ if (Storage.getValue(18) != null ){
+ boolean = Storage.getValue(18);
+ } else {
+ boolean = false;
+ }
+ iconMenu.addItem(new WatchUi.ToggleMenuItem("Tickmark Color", {:enabled=>"Accent", :disabled=>"Default"}, 18, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ if (Storage.getValue(21)[1]){ // has weather
if (Storage.getValue(7) != null ){
boolean = Storage.getValue(7);
} else {
@@ -121,24 +128,17 @@ class Menu2TestMenu2Delegate extends WatchUi.Menu2InputDelegate { // Sub-menu De
iconMenu.addItem(new WatchUi.ToggleMenuItem("Location Name", {:enabled=>"ON", :disabled=>"OFF"}, 7, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
}
// allow full colors in AOD for AMOLED devices
- if(System.getDeviceSettings().requiresBurnInProtection == true){
- if (Storage.getValue(18) != null ){
- boolean = Storage.getValue(18);
+ if(Storage.getValue(21)[0]){
+ if (Storage.getValue(22) != null ){
+ boolean = Storage.getValue(22);
} else {
- boolean = true;
+ boolean = false;
}
- iconMenu.addItem(new WatchUi.ToggleMenuItem("Mute AOD Colors", {:enabled=>"Mute Colors", :disabled=>"Full Color"}, 18, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ iconMenu.addItem(new WatchUi.ToggleMenuItem("AOD Colors", {:enabled=>"Accent", :disabled=>"Grayscale"}, 22, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
}
-
var drawableT = new CustomThickness();
-/* if (Storage.getValue(13) != null ){
- boolean = Storage.getValue(13);
- } else {
- boolean = false;
- }*/
iconMenu.addItem(new WatchUi.IconMenuItem("Hands Thickness", drawableT.getString(), 13, drawableT, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
-
- WatchUi.pushView(iconMenu, new AnalogSettingsViewTest(), WatchUi.SLIDE_UP );
+ WatchUi.pushView(iconMenu, new AnalogSettingsViewTest(), WatchUi.SLIDE_BLINK );
} else if( item.getId().equals("datapoints") ) {
var dataMenu = new WatchUi.Menu2({:title=>"Data"});
count=0;
@@ -153,34 +153,59 @@ class Menu2TestMenu2Delegate extends WatchUi.Menu2InputDelegate { // Sub-menu De
dataMenu.addItem(new WatchUi.IconMenuItem("Left Bottom", drawable4.getString(), 11, drawable4, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
dataMenu.addItem(new WatchUi.IconMenuItem("Right Top", drawable6.getString(), 17, drawable6, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
dataMenu.addItem(new WatchUi.IconMenuItem("Right Bottom", drawable5.getString(), 12, drawable5, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
- if (Toybox has :Weather){
- if (Storage.getValue(6) != null ){
- boolean = Storage.getValue(6);
- } else {
- boolean = true;
- }
- dataMenu.addItem(new WatchUi.ToggleMenuItem("Temp. Type", {:enabled=>"Real Temperature", :disabled=>"Feels Like"}, 6, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
- if (Storage.getValue(15) != null ){
- boolean = Storage.getValue(15);
- } else {
- boolean = true;
- }
- dataMenu.addItem(new WatchUi.ToggleMenuItem("Wind Speed Unit", {:enabled=>"km/h or mph", :disabled=>"m/s"}, 15, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
- if (Storage.getValue(16) != null ){
- boolean = Storage.getValue(16);
+ if (System.SCREEN_SHAPE_ROUND == System.getDeviceSettings().screenShape) { //check if rounded display
+ if (Storage.getValue(14) != null ){
+ boolean = Storage.getValue(14);
} else {
boolean = false;
}
- dataMenu.addItem(new WatchUi.ToggleMenuItem("Temperat. Unit", {:enabled=>"Always Celsius", :disabled=>"User Settings"}, 16, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ dataMenu.addItem(new WatchUi.ToggleMenuItem("Font Size", {:enabled=>"Bigger", :disabled=>"Standard"}, 14, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
}
-/* if (Storage.getValue(14) != null ){
- boolean = Storage.getValue(14);
- } else {
- boolean = false;
- }
- dataMenu.addItem(new WatchUi.ToggleMenuItem("Font Size", {:enabled=>"Bigger", :disabled=>"Standard"}, 14, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
-*/
- WatchUi.pushView(dataMenu, new AnalogSettingsViewTest(), WatchUi.SLIDE_UP );
+ WatchUi.pushView(dataMenu, new AnalogSettingsViewTest(), WatchUi.SLIDE_BLINK );
+ } else if( item.getId().equals("units") ) {
+ var checkWeather=Storage.getValue(21)[1]; // has :Weather
+ var unitsMenu = new WatchUi.Menu2({:title=>"Units"});
+ if (checkWeather or System.getSystemStats() has :batteryInDays){
+ if (System.getSystemStats() has :batteryInDays){
+ if (Storage.getValue(19) != null ){
+ boolean = Storage.getValue(19);
+ } else {
+ boolean = false;
+ }
+ unitsMenu.addItem(new WatchUi.ToggleMenuItem("Battery Estimate", {:enabled=>"ON", :disabled=>"OFF"}, 19, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ }
+ if (checkWeather){
+ if (Storage.getValue(6) != null ){
+ boolean = Storage.getValue(6);
+ } else {
+ boolean = true;
+ }
+ unitsMenu.addItem(new WatchUi.ToggleMenuItem("Temp. Type", {:enabled=>"Real Temperature", :disabled=>"Feels Like"}, 6, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ if (Storage.getValue(16) != null ){
+ boolean = Storage.getValue(16);
+ } else {
+ boolean = false;
+ }
+ unitsMenu.addItem(new WatchUi.ToggleMenuItem("Temp. Unit", {:enabled=>"Always Celsius", :disabled=>"User Settings"}, 16, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ if (Storage.getValue(15) != null ){
+ boolean = Storage.getValue(15);
+ } else {
+ boolean = true;
+ }
+ unitsMenu.addItem(new WatchUi.ToggleMenuItem("Wind Speed Unit", {:enabled=>"km/h or mph", :disabled=>"m/s"}, 15, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ if (Storage.getValue(21)[19]){
+ if (Storage.getValue(20) != null ){
+ boolean = Storage.getValue(20);
+ } else {
+ boolean = true;
+ }
+ unitsMenu.addItem(new WatchUi.ToggleMenuItem("Atm. Pres. Type", {:enabled=>"Mean Sea-Level", :disabled=>"Standard"}, 20, boolean, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ }
+ }
+ } else {
+ unitsMenu.addItem(new WatchUi.ToggleMenuItem("None available", {:enabled=>"None", :disabled=>"None"}, null, null, {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}));
+ }
+ WatchUi.pushView(unitsMenu, new AnalogSettingsViewTest(), WatchUi.SLIDE_BLINK );
} else {
WatchUi.requestUpdate();
}
@@ -215,7 +240,7 @@ class DrawableMenuTitle extends WatchUi.Drawable {
mIndex=Storage.getValue(2);
}
- System.println(dc.getWidth());
+ //System.println(dc.getWidth());
var appIcon = Application.loadResource(Rez.Drawables.LauncherIcon);
var bitmapWidth = appIcon.getWidth();
@@ -301,7 +326,6 @@ class CustomAccent extends WatchUi.Drawable {
}
-
// This is the custom Icon drawable. It fills the icon space with a color to
// to demonstrate its extents. It changes color each time the next state is
// triggered, which is done when the item is selected in this application.
@@ -314,21 +338,24 @@ class CustomLeftTopDataPoint extends WatchUi.Drawable {
function initialize() {
Drawable.initialize({});
- var mArray=[Storage.getValue(9) == null ? 14 : Storage.getValue(9), Storage.getValue(10) == null ? 14 : Storage.getValue(10)]; // if values are null, then "none"
+ var mArray=[Storage.getValue(9) == null ? 22 : Storage.getValue(9), Storage.getValue(10) == null ? 22 : Storage.getValue(10)]; // if values are null, then "none"
mIndex=mArray[count];
count++;
}
// Return the icon string for the menu to use as its label
function getString() {
- var mIconStrings = ["Steps", "Distance", "Elevation", (Toybox has :Weather)?"Wind Speed":"Not Available", (Toybox has :Weather)?"Humidity":"Not Available", (Toybox has :Weather)?"Precipitation":"Not Available", "Calories", (ActivityMonitor.getInfo() has :floorsClimbed)?"Floors Climbed":"Not Available", (Activity.getActivityInfo() has :currentOxygenSaturation)?"Pulse Ox":"Not available", "Heart Rate", "Notifications",(System.getSystemStats() has :solarIntensity and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", "None"];
+ //var checkWeather = (Toybox has :Weather);
+ var checkWeather = Storage.getValue(21)[1];
+ var mIconStrings = ["Steps", "Distance", "Elevation", (checkWeather)?"Wind Speed":"Not Available", (checkWeather)?"Min/Max Temp.":"Not Available", (checkWeather)?"Humidity":"Not Available", (checkWeather)?"Precipitation":"Not Available", (Storage.getValue(21)[19]) ? "Atm. Pressure" : "Not available", "Calories", (Storage.getValue(21)[12])?"Floors Climbed":"Not Available", (Storage.getValue(21)[11])?"Pulse Ox":"Not available", "Heart Rate", "Notifications",(Storage.getValue(21)[8] and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", (Storage.getValue(21)[15])?"Body Battery":"Not Available", (Storage.getValue(21)[13])?"Stress":"Not Available", (Storage.getValue(21)[14])?"Respiration Rate":"Not Available", (Storage.getValue(21)[17])?"Recovery Time":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Run":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Cycle":"Not Available", "None"];
return mIconStrings[mIndex];
}
// Advance to the next color state for the drawable
function nextState(id) {
- var mIconStrings = ["Steps", "Distance", "Elevation", (Toybox has :Weather)?"Wind Speed":"Not Available", (Toybox has :Weather)?"Humidity":"Not Available", (Toybox has :Weather)?"Precipitation":"Not Available", "Calories", (ActivityMonitor.getInfo() has :floorsClimbed)?"Floors Climbed":"Not Available", (Activity.getActivityInfo() has :currentOxygenSaturation)?"Pulse Ox":"Not available", "Heart Rate", "Notifications",(System.getSystemStats() has :solarIntensity and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", "None"];
+ var checkWeather = Storage.getValue(21)[1];
+ var mIconStrings = ["Steps", "Distance", "Elevation", (checkWeather)?"Wind Speed":"Not Available", (checkWeather)?"Min/Max Temp.":"Not Available", (checkWeather)?"Humidity":"Not Available", (checkWeather)?"Precipitation":"Not Available", (Storage.getValue(21)[19]) ? "Atm. Pressure" : "Not available", "Calories", (Storage.getValue(21)[12])?"Floors Climbed":"Not Available", (Storage.getValue(21)[11])?"Pulse Ox":"Not available", "Heart Rate", "Notifications",(Storage.getValue(21)[8] and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", (Storage.getValue(21)[15])?"Body Battery":"Not Available", (Storage.getValue(21)[13])?"Stress":"Not Available", (Storage.getValue(21)[14])?"Respiration Rate":"Not Available", (Storage.getValue(21)[17])?"Recovery Time":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Run":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Cycle":"Not Available", "None"];
mIndex++;
if(mIndex >= mIconStrings.size()) {
mIndex = 0;
@@ -350,13 +377,8 @@ class CustomLeftTopDataPoint extends WatchUi.Drawable {
dc.setColor(iColor, Graphics.COLOR_TRANSPARENT);
if (mIndex < mIcons.size()-1){
var iconsFont = Application.loadResource(Rez.Fonts.IconsFont);
- var humidityFont = Application.loadResource(Rez.Fonts.HumidityFont);
var icon = mIcons[mIndex];
- if (icon.find("R")!=null or icon.find("S")!=null or icon.find("P")!=null){
- dc.drawText( dc.getWidth()/2, dc.getHeight()/3, humidityFont, icon , Graphics.TEXT_JUSTIFY_CENTER);
- } else {
- dc.drawText( dc.getWidth()/2, dc.getHeight()/3, iconsFont, icon , Graphics.TEXT_JUSTIFY_CENTER);
- }
+ dc.drawText( dc.getWidth()/2, dc.getHeight()/3, iconsFont, icon , Graphics.TEXT_JUSTIFY_CENTER);
}
dc.clear();
}
@@ -375,20 +397,22 @@ class CustomLeftBottomDataPoint extends WatchUi.Drawable {
function initialize() {
Drawable.initialize({});
- var mArray=[Storage.getValue(11) == null ? 11 : Storage.getValue(11), Storage.getValue(12) == null ? 11 : Storage.getValue(12), Storage.getValue(17) == null ? 11 : Storage.getValue(17)]; // if null, then "none"
+ var mArray=[Storage.getValue(11) == null ? 18 : Storage.getValue(11), Storage.getValue(12) == null ? 18 : Storage.getValue(12), Storage.getValue(17) == null ? 18 : Storage.getValue(17)]; // if null, then "none"
mIndex=mArray[count];
count++;
}
// Return the icon string for the menu to use as its label
function getString() {
- var mIconStrings = ["Steps", (Toybox has :Weather)?"Humidity":"Not Available", (Toybox has :Weather)?"Precipitation":"Not Available", "Calories", (ActivityMonitor.getInfo() has :floorsClimbed)?"Floors Climbed":"Not Available", (Activity.getActivityInfo() has :currentOxygenSaturation)?"Pulse Ox":"Not available" , "Heart Rate", "Notifications", (System.getSystemStats() has :solarIntensity and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", "None"];
+ var checkWeather = Storage.getValue(21)[1];
+ var mIconStrings = ["Steps", (checkWeather)?"Humidity":"Not Available", (checkWeather)?"Precipitation":"Not Available", (Storage.getValue(21)[19]) ? "Atm. Pressure" : "Not available", "Calories", (Storage.getValue(21)[12])?"Floors Climbed":"Not Available", (Storage.getValue(21)[11])?"Pulse Ox":"Not available" , "Heart Rate", "Notifications", (Storage.getValue(21)[8] and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", (Storage.getValue(21)[15])?"Body Battery":"Not Available", (Storage.getValue(21)[13])?"Stress":"Not Available", (Storage.getValue(21)[14])?"Respiration Rate":"Not Available", (Storage.getValue(21)[17])?"Recovery Time":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Run":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Cycle":"Not Available", "None"];
return mIconStrings[mIndex];
}
// Advance to the next color state for the drawable
function nextState(id) {
- var mIconStrings = ["Steps", (Toybox has :Weather)?"Humidity":"Not Available", (Toybox has :Weather)?"Precipitation":"Not Available", "Calories", (ActivityMonitor.getInfo() has :floorsClimbed)?"Floors Climbed":"Not Available", (Activity.getActivityInfo() has :currentOxygenSaturation)?"Pulse Ox":"Not available" , "Heart Rate", "Notifications", (System.getSystemStats() has :solarIntensity and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", "None"];
+ var checkWeather = Storage.getValue(21)[1];
+ var mIconStrings = ["Steps", (checkWeather)?"Humidity":"Not Available", (checkWeather)?"Precipitation":"Not Available", (Storage.getValue(21)[19]) ? "Atm. Pressure" : "Not available", "Calories", (Storage.getValue(21)[12])?"Floors Climbed":"Not Available", (Storage.getValue(21)[11])?"Pulse Ox":"Not available" , "Heart Rate", "Notifications", (Storage.getValue(21)[8] and System.getSystemStats().solarIntensity != null) ? "Solar Intensity" : "Not available", "Seconds", "Intensity Min.", (Storage.getValue(21)[15])?"Body Battery":"Not Available", (Storage.getValue(21)[13])?"Stress":"Not Available", (Storage.getValue(21)[14])?"Respiration Rate":"Not Available", (Storage.getValue(21)[17])?"Recovery Time":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Run":"Not Available", (Storage.getValue(21)[3])?"VO2 Max Cycle":"Not Available", "None"];
mIndex++;
if(mIndex >= mIconStrings.size()) {
mIndex = 0;
@@ -410,13 +434,8 @@ class CustomLeftBottomDataPoint extends WatchUi.Drawable {
dc.setColor(iColor, Graphics.COLOR_TRANSPARENT);
if (mIndex < mIcons.size()-1){
var iconsFont = Application.loadResource(Rez.Fonts.IconsFont);
- var humidityFont = Application.loadResource(Rez.Fonts.HumidityFont);
var icon = mIcons[mIndex];
- if (icon.find("R")!=null or icon.find("S")!=null or icon.find("P")!=null){
- dc.drawText( dc.getWidth()/2, dc.getHeight()/3, humidityFont, icon , Graphics.TEXT_JUSTIFY_CENTER);
- } else {
- dc.drawText( dc.getWidth()/2, dc.getHeight()/3, iconsFont, icon , Graphics.TEXT_JUSTIFY_CENTER);
- }
+ dc.drawText( dc.getWidth()/2, dc.getHeight()/3, iconsFont, icon , Graphics.TEXT_JUSTIFY_CENTER);
}
dc.clear();
}
diff --git a/source/AnalogView.mc b/source/AnalogView.mc
index 3e4eb6b..e6ca874 100644
--- a/source/AnalogView.mc
+++ b/source/AnalogView.mc
@@ -4,7 +4,9 @@
// Application Developer Agreement.
//
+import Toybox.Activity;
import Toybox.Graphics;
+import Toybox.Weather;
import Toybox.System;
import Toybox.WatchUi;
import Toybox.Application.Storage;
@@ -17,22 +19,54 @@ class AnalogView extends WatchUi.WatchFace
{
var offscreenBuffer;
//var fullScreenRefresh;
- var accentColor;
- var MtbA = null;
+ //var accentColor;
+ //var MtbA = null;
var inLowPower=false;
- var canBurnIn=false;
+ //var canBurnIn=false;
var upTop=true;
// Initialize variables for this view
function initialize() {
+
WatchFace.initialize();
- //fullScreenRefresh = true;
- //partialUpdatesAllowed = ( Toybox.WatchUi.WatchFace has :onPartialUpdate );
- var sSettings=System.getDeviceSettings();
- //first check if the setting is availe on the current device
- if(sSettings has :requiresBurnInProtection) {
- //get the state of the setting
- canBurnIn=sSettings.requiresBurnInProtection;
+
+ //var checks as Array = Storage.getValue(21);
+ //if (checks==null or checks.size()<20) {
+ if (Storage.getValue(21)==null or Storage.getValue(21).size()<20) {
+ var checks as Array = Storage.getValue(21);
+ checks = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
+ if (System.getDeviceSettings() has :requiresBurnInProtection){
+ checks[0]=System.getDeviceSettings().requiresBurnInProtection;
+ }
+ if (System.getDeviceSettings() has :doNotDisturb) { checks[4]=true; }
+ if (System.getSystemStats() has :solarIntensity) { checks[8]=true; }
+ if (UserProfile.getProfile() has :vo2maxRunning and UserProfile.getProfile() has :vo2maxCycling) { checks[3]=true; }
+
+ if (Toybox has :Weather){
+ checks[1]=true;
+ if (Toybox.Weather has :getCurrentConditions){
+ checks[2]=true;
+ if (Toybox.Weather.getCurrentConditions() has :feelsLikeTemperature){ checks[5]=true; }
+ if (Toybox.Weather.getCurrentConditions() has :temperature){ checks[6]=true; }
+ if (Toybox.Weather.getCurrentConditions() has :observationLocationName){ checks[7]=true; }
+ }
+ }
+ if (Activity has :getActivityInfo) {
+ checks[9]=true;
+ if (Activity.getActivityInfo() has :currentOxygenSaturation){ checks[11]=true; }
+ if (Activity.getActivityInfo() has :altitude) { checks[16]=true; }
+ if (Activity.getActivityInfo() has :meanSeaLevelPressure) { checks[18]=true; }
+ if (Activity.getActivityInfo() has :ambientPressure) { checks[19]=true; }
+ }
+ if (ActivityMonitor has :getHeartRateHistory) { checks[10]=true; }
+ if ((Toybox has :SensorHistory) && (Toybox.SensorHistory has :getBodyBatteryHistory)) { checks[15]=true; }
+ if ((Toybox has :SensorHistory) && (Toybox.SensorHistory has :getStressHistory)) { checks[13]=true; }
+
+ if (ActivityMonitor.getInfo() has :floorsClimbed) { checks[12]=true; }
+ if (ActivityMonitor.getInfo() has :respirationRate) { checks[14]=true; }
+ if (ActivityMonitor.getInfo() has :timeToRecovery) { checks[17]=true; }
+
+ Storage.setValue(21,checks);
}
}
@@ -54,13 +88,16 @@ class AnalogView extends WatchUi.WatchFace
// Configure the layout of the watchface for this device
function onLayout(dc) {
- if (Storage.getValue(1) != null) {
- accentColor = Storage.getValue(1);
- } else {
- accentColor = 0x55FF00;
+ if (Storage.getValue(1) == null) {
+ if (dc.getWidth()>=360){
+ Storage.setValue(1, 0xAAFF00); // Vivomove Green
+ Storage.setValue(2, 1);
+ } else {
+ Storage.setValue(1, 0x55FF00); // Bright Green
+ Storage.setValue(2, 0);
+ }
}
-
- //System.println(accentColor);
+ var accentColor = Storage.getValue(1);
// If this device supports BufferedBitmap, allocate the buffers we use for drawing
if(Toybox.Graphics has :BufferedBitmap or :BufferedBitmapReference) {
@@ -78,16 +115,6 @@ class AnalogView extends WatchUi.WatchFace
Graphics.COLOR_BLACK,
Graphics.COLOR_WHITE
,accentColor
-/* ,Graphics.COLOR_BLUE
- ,Graphics.COLOR_TRANSPARENT
- ,0xAAFF00 //Vivomove Green
- ,0x55FF00 //Green
- ,0xFFFF00 //Yellow
- ,0x00FFFF //Cyan
- ,0xAA55FF //Violet
- ,0xFFAA00 //Orange
- ,0xFF0000 //Red
- ,0xFF55FF //Pink */
]
}) ;
@@ -105,12 +132,15 @@ class AnalogView extends WatchUi.WatchFace
// Handle the update event
function onUpdate(dc) {
+ var targetDc = null;
var width;
var height;
- var targetDc = null;
-
- MtbA = new MtbA_functions();
-
+ var MtbA = new MtbA_functions();
+ var check = Storage.getValue(21);
+ var canBurnIn=check[0];
+ //var canBurnIn=false;
+ var accentColor = Storage.getValue(1);
+
// We always want to refresh the full screen when we get a regular onUpdate call.
//fullScreenRefresh = true;
@@ -139,7 +169,7 @@ class AnalogView extends WatchUi.WatchFace
targetDc.fillRectangle(0, 0, dc.getWidth(), dc.getHeight()); //width & height?
// Draw the tick marks around the edges of the screen
- MtbA.drawHashMarks(targetDc, accentColor, Storage.getValue(5), width, height, inLowPower and canBurnIn); //dc
+ MtbA.drawHashMarks(targetDc, accentColor, Storage.getValue(5), width, height, inLowPower and canBurnIn, Storage.getValue(18)); //dc
dc.drawBitmap(0, 0, offscreenBuffer);
} else {
@@ -154,11 +184,9 @@ class AnalogView extends WatchUi.WatchFace
dc.drawBitmap(0, 0, offscreenBuffer);
}
- var position = Application.loadResource(Rez.JsonData.mPosition);
-
// Draw the tick marks around the edges of the screen
if(width>=360){ // No anti-alias for hashmarks on AMOLED screens
- MtbA.drawHashMarks(dc, accentColor, Storage.getValue(5), width, height, inLowPower and canBurnIn); //dc
+ MtbA.drawHashMarks(dc, accentColor, Storage.getValue(5), width, height, inLowPower and canBurnIn, Storage.getValue(18)); //dc
if (dc has :setAntiAlias) {
dc.setAntiAlias(true);
}
@@ -166,8 +194,10 @@ class AnalogView extends WatchUi.WatchFace
if (dc has :setAntiAlias) {
dc.setAntiAlias(true);
}
- MtbA.drawHashMarks(dc, accentColor, Storage.getValue(5), width, height, inLowPower and canBurnIn); //dc
+ MtbA.drawHashMarks(dc, accentColor, Storage.getValue(5), width, height, inLowPower and canBurnIn, Storage.getValue(18)); //dc
}
+
+ var position = Application.loadResource(Rez.JsonData.mPosition);
// Garmin Logo check
if (Storage.getValue(3) == null or Storage.getValue(3) == true) {
@@ -180,45 +210,99 @@ class AnalogView extends WatchUi.WatchFace
}
//Draw Weather Icon (dc, x, y, x2, width)
- if (Toybox has :Weather) {
- if (Storage.getValue(3)==false){ // Hide Garmin Logo
- MtbA.drawWeatherIcon(dc, position[18], position[22], position[19], width);
- //Draw Temperature Text
- MtbA.drawTemperature(dc, position[21], position[7], Storage.getValue(6), width);
- //Draw Location Name
- MtbA.drawLocation(dc, width/2, position[6], width*0.60, height*0.20, Storage.getValue(7));
- } else { // Show Garmin Logo
- MtbA.drawWeatherIcon(dc, position[18], position[20], position[19], width);
- //Draw Temperature Text
- MtbA.drawTemperature(dc, position[21], position[20], Storage.getValue(6), width);
- //Draw Location Name
- MtbA.drawLocation(dc, width/2, position[23], width*0.60, height*0.20, Storage.getValue(7));
+ //if (Toybox has :Weather and Weather has :getCurrentConditions) {
+ if (check[1] and check[2]) {
+ if(Toybox.Weather.getCurrentConditions() != null) {
+ var cond = Toybox.Weather.getCurrentConditions();
+ if (Storage.getValue(3)==false){ // Hide Garmin Logo
+ if (cond.condition!=null){
+ MtbA.drawWeatherIcon(dc, position[18], position[22], position[19], width, cond.condition);
+ }
+ //Draw Temperature Text
+ MtbA.drawTemperature(dc, position[21], position[7], Storage.getValue(6), width, cond);
+ if (check[7] and cond.observationLocationName!=null){
+ //Draw Location Name
+ MtbA.drawLocation(dc, width/2, position[6], width*0.60, dc.getFontHeight(Graphics.FONT_TINY), Storage.getValue(7), cond);
+ }
+ } else { // Show Garmin Logo
+ if (cond.condition!=null){
+ MtbA.drawWeatherIcon(dc, position[18], position[20], position[19], width, cond.condition);
+ }
+ //Draw Temperature Text
+ MtbA.drawTemperature(dc, position[21], (System.SCREEN_SHAPE_ROUND == System.getDeviceSettings().screenShape)?position[15]:position[20], Storage.getValue(6), width, cond);
+ if (check[7] and cond.observationLocationName!=null){
+ //Draw Location Name
+ MtbA.drawLocation(dc, width/2, position[23], width*0.60, dc.getFontHeight(Graphics.FONT_TINY), Storage.getValue(7), cond);
+ }
+ }
}
}
-
+ // Draw Battery
+ MtbA.drawBatteryIcon(dc, width*0.69, height / 2.11, width*0.82, height / 2.06+(width==218 ? 1 : 0), width, height, accentColor);
+ MtbA.drawBatteryText(dc, width*0.76, height / 2.14 - 1, width);
+
+System.println(width);
+System.println(dc.getFontHeight(Graphics.FONT_TINY)); //29-19 F6 / 27-19 VA4 /
+System.println(dc.getFontHeight(Graphics.FONT_XTINY));
+
//Data Points
+ var FontAdj= 0;
+ if (Storage.getValue(14)==true){
+ if (width==260 and dc.getFontHeight(Graphics.FONT_TINY)==29) { //Fenix 6
+ FontAdj=6;
+ } else if (width==260 and dc.getFontHeight(Graphics.FONT_TINY)==27) { // Vivoactive 4
+ FontAdj=5;
+ } else if (width==280){
+ FontAdj=7;
+ } else if (width>=400) {
+ FontAdj=5;
+ } else if (width==218) {
+ FontAdj=3;
+ } else if (width==240 and dc.getFontHeight(Graphics.FONT_TINY)==26) { // Fenix 5, 5S and 5X
+ FontAdj=0;
+ } else {
+ FontAdj=4;
+ }
+ }
+
// (dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset, dataPoint)
var dataPoint = Storage.getValue(12); //right bottom
- MtbA.drawRightPoints(dc, position[8], position[14], position[10], position[15], accentColor, width, 0, dataPoint);
+ MtbA.drawRightPoints(dc, position[8], position[14], position[10], position[15]-FontAdj, accentColor, width, 0, dataPoint);
+ //MtbA.drawRightPoints(dc, position[8], position[14], position[10], position[15], accentColor, width, 0, dataPoint);
+
dataPoint = Storage.getValue(17); //right top
- MtbA.drawRightPoints(dc, position[8], position[9], position[10], position[11], accentColor, width, 0, dataPoint);
+ MtbA.drawRightPoints(dc, position[8], position[9], position[10], position[11]-FontAdj, accentColor, width, 0, dataPoint);
//(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
dataPoint = Storage.getValue(9); // left top
- MtbA.drawLeftTop(dc, position[12], position[9], position[13], position[11], accentColor, width, dataPoint);
+ MtbA.drawLeftTop(dc, position[12], position[9], position[13], position[11]-FontAdj, accentColor, width, dataPoint);
+
dataPoint = Storage.getValue(10); // left middle
- MtbA.drawLeftTop(dc, position[12], position[16], position[13], position[17], accentColor, width, dataPoint);
+ MtbA.drawLeftTop(dc, position[12], position[16], position[13], position[17]-FontAdj, accentColor, width, dataPoint);
//MtbA.drawLeftMiddle(dc, position[12], position[16], position[13], position[17], accentColor, width, dataPoint);
+
dataPoint = Storage.getValue(11); // left bottom
- MtbA.drawLeftBottom(dc, position[12], position[14], position[13], position[15], accentColor, width, dataPoint);
-
- // Draw Battery
- MtbA.drawBatteryIcon(dc, width*0.69, height / 2.11, width*0.82, height / 2.06+(width==218 ? 1 : 0), width, height, accentColor);
- MtbA.drawBatteryText(dc, width*0.76, height / 2.14 - 1, width);
-
+ MtbA.drawLeftBottom(dc, position[12], position[14], position[13], position[15]-FontAdj, accentColor, width, dataPoint);
+
+ var iconSize = 0;
+
+ if (width==360){
+ iconSize = 12;
+ } else if (width==280){
+ iconSize = 13;
+ } else if (width==260){
+ iconSize = 14;
+ } else if (width==240){
+ iconSize = 12;
+ } else if (width==218){
+ iconSize = 15;
+ } else if (width>360){
+ iconSize = 20;
+ }
+
// Bluetooth, Alarm and Dnd Icons
- if (System.getDeviceSettings() has :doNotDisturb and System.getDeviceSettings().doNotDisturb) { // Dnd exists and is turned on
+ if (check[4] and System.getDeviceSettings().doNotDisturb) { // Dnd exists and is turned on
if ((Storage.getValue(8) == null or Storage.getValue(8) == true) and (Storage.getValue(4) == null or Storage.getValue(4) == true)){ // all 3 icons
// Draw the Do Not Disturb Icon in the middle
MtbA.drawDndIcon(dc, position[0], position[1], width);
@@ -243,7 +327,8 @@ class AnalogView extends WatchUi.WatchFace
} else { // Dnd does not exist or is turned off
if ((Storage.getValue(8) == null or Storage.getValue(8) == true) and (Storage.getValue(4) == null or Storage.getValue(4) == true)){ // all 2 icons
// Draw alarm icon on the right
- MtbA.drawAlarmIcon(dc, (position[3]+(position[3]+position[0])/2)/2, position[1], accentColor, width);
+ //MtbA.drawAlarmIcon(dc, (position[3]+(position[3]+position[0])/2)/2, position[1], accentColor, width);
+ MtbA.drawAlarmIcon(dc, ((position[3]+position[0])/2)+iconSize, position[1], accentColor, width);
//Draw bluetooth icon on the left
MtbA.drawBluetoothIcon(dc, (position[2]+position[0])/2, position[1]);
} else if(Storage.getValue(8) == false and (Storage.getValue(4) == null or Storage.getValue(4) == true)){ // alarm icon is hidden
@@ -373,8 +458,8 @@ class AnalogDelegate extends WatchUi.WatchFaceDelegate {
// partialUpdatesAllowed flag here to let the rendering methods know they
// should not be rendering a second hand.
function onPowerBudgetExceeded(powerInfo) {
- System.println( "Average execution time: " + powerInfo.executionTimeAverage );
- System.println( "Allowed execution time: " + powerInfo.executionTimeLimit );
+ //System.println( "Average execution time: " + powerInfo.executionTimeAverage );
+ //System.println( "Allowed execution time: " + powerInfo.executionTimeLimit );
//partialUpdatesAllowed = false;
}
}
\ No newline at end of file
diff --git a/source/MtbA_functions.mc b/source/MtbA_functions.mc
index 49cc086..203c714 100644
--- a/source/MtbA_functions.mc
+++ b/source/MtbA_functions.mc
@@ -16,6 +16,7 @@ class MtbA_functions {
const IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
const screenShape = System.getDeviceSettings().screenShape;
var fontSize = (Storage.getValue(14) == true ? 1 : 0);
+ var check=Storage.getValue(21);
// This function is used to generate the coordinates of the 4 corners of the polygon
// used to draw a watch hand. The coordinates are generated with specified length,
@@ -42,141 +43,180 @@ class MtbA_functions {
/* ------------------------ */
// Draws the clock tick marks around the outside edges of the screen.
- function drawHashMarks(dc, accentColor, showBoolean, width, height, aod) {
+(:round) function drawHashMarks(dc, accentColor, showBoolean, width, height, aod, colorFlag) {
var sX, sY;
var eX, eY;
var outerRad = width / 2;
var innerRad = outerRad - 10;
- // Draw hashmarks differently depending on screen geometry.
- if (System.SCREEN_SHAPE_ROUND == screenShape) { //check if round display
-
- var increment = (aod==true) ? 5 : 1;
- //increment = (aod==true) ? 5 : 1;
-
- // Loop through each minute and draw tick marks
- for (var i = 0; i <= 59; i += increment) {
- var angle = i * Math.PI / 30;
- if (aod==true) {
- if (i % 5 == 0){
- if (i == 15 or i == 45) {
- //dc.setColor(accentColor, Graphics.COLOR_BLACK);
- //dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_BLACK);
- dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- } else {
- //dc.setColor(Graphics.COLOR_DK_GRAY, Graphics.COLOR_TRANSPARENT);
- dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
- }
- }
- } else{
- if ((i == 15) or (i == 45)) {
- dc.setColor(accentColor, accentColor);
- } else {
- if ((showBoolean == false) and (i == 0 or i == 30)) {
- dc.setColor(accentColor, accentColor);
- } else {
- if (width < 360){
- dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_LT_GRAY); // Using lighter tone for MIP displays
- } else {
- dc.setColor(Graphics.COLOR_DK_GRAY, Graphics.COLOR_DK_GRAY); // Darker tone for AMOLED
- }
- }
- }
- }
- // thicker lines at 5 min intervals
- if( (i % 5) == 0) {
- dc.setPenWidth(3);
- } else {
- dc.setPenWidth(1);
- }
- if(aod==true) { // AOD for AMOLED is on, then only small hashmarks are going to be displayed at each 15 min
- sY = innerRad * Math.sin(angle);
- eY = outerRad * Math.sin(angle);
- sX = innerRad * Math.cos(angle);
- eX = outerRad * Math.cos(angle);
- } else if (showBoolean == false) { // if not showing hour labels, then all 5 minute marks will have same length
- // longer lines at intermediate 5 min marks
- if ((i % 5) == 0) {
- sY = (innerRad-10) * Math.sin(angle);
- eY = outerRad * Math.sin(angle);
- sX = (innerRad-10) * Math.cos(angle);
- eX = outerRad * Math.cos(angle);
- }
- else {
- sY = innerRad * Math.sin(angle);
- eY = outerRad * Math.sin(angle);
- sX = innerRad * Math.cos(angle);
- eX = outerRad * Math.cos(angle);
- }
- } else if( (i % 5) == 0 && !((i % 15) == 0)) { // when showing hour labels, the marks at each 15 min will be smaller to accomodate labels
- sY = (innerRad-10) * Math.sin(angle);
- eY = outerRad * Math.sin(angle);
- sX = (innerRad-10) * Math.cos(angle);
- eX = outerRad * Math.cos(angle);
- } else {
- sY = innerRad * Math.sin(angle);
- eY = outerRad * Math.sin(angle);
- sX = innerRad * Math.cos(angle);
- eX = outerRad * Math.cos(angle);
- }
-
- sX += outerRad; sY += outerRad;
- eX += outerRad; eY += outerRad;
- dc.drawLine(sX, sY, eX, eY);
- }
- } else { // rectangle display
- var coords = [0, width / 4, (3 * width) / 4, width];
- dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_LT_GRAY); //
- for (var i = 0; i < coords.size(); i += 1) {
- var dx = ((width / 2.0) - coords[i]) / (height / 2.0);
- var upperX = coords[i] + (dx * 10);
-
- // Draw the upper hash marks.
- //dc.fillPolygon([[coords[i] - 1, 2], [upperX - 1, 12], [upperX + 1, 12], [coords[i] + 1, 2]]);
- dc.fillPolygon([[coords[i] - 1, 1], [upperX - 1, 11], [upperX + 1, 11], [coords[i] + 1, 1]]);
-
- // Draw the lower hash marks.
- //dc.fillPolygon([[coords[i] - 1, height-2], [upperX - 1, height - 12], [upperX + 1, height - 12], [coords[i] + 1, height - 2]]);
- dc.fillPolygon([[coords[i] - 1, height-1], [upperX - 1, height - 11], [upperX + 1, height - 11], [coords[i] + 1, height - 1]]);
-
- if(coords[i] == width / 4){ // Draw the middle-upper hash marks.
- dc.fillPolygon([[1, coords[i] - 1], [11, upperX - 1], [11, upperX + 1], [1, coords[i] + 1]]);
- dc.fillPolygon([[height-1, coords[i] - 1], [height - 11, upperX - 1], [height - 11, upperX + 1], [height - 1, coords[i] + 1]]);
- //dc.fillPolygon([[2, 59], [12, 64], [12, 66], [2, 61]]);
- }
-
- if(coords[i] == (3 * width) / 4){ // Draw the middle-lower hash marks.
- dc.fillPolygon([[1, coords[i] - 1], [11, upperX - 1], [11, upperX + 1], [1, coords[i] + 1]]);
- dc.fillPolygon([[height-1, coords[i] - 1], [height - 11, upperX - 1], [height - 11, upperX + 1], [height - 1, coords[i] + 1]]);
- //dc.fillPolygon([[2, 59], [12, 64], [12, 66], [2, 61]]);
+ // Draw hashmarks differently depending on screen geometry.
+ if (System.SCREEN_SHAPE_ROUND == screenShape) { //check if round display
+ var increment = (aod==true) ? 5 : 1;
+
+ // Loop through each minute and draw tick marks
+ for (var i = 0; i <= 59; i += increment) {
+ var angle = i * Math.PI / 30;
+ if (aod==true) { // AOD mode is ON
+ if (i % 5 == 0){
+ if (colorFlag == true and Storage.getValue(22)==true){ // Tickmark color is ON and AOD Colors is ON
+ dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
+ } else if (i == 15 or i == 45) {
+ //dc.setColor(accentColor, Graphics.COLOR_BLACK);
+ //dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_BLACK);
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ } else {
+ //dc.setColor(Graphics.COLOR_DK_GRAY, Graphics.COLOR_TRANSPARENT);
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
}
}
- for (var i = 0; i <= 59; i += 15) { //draw the middle hashmarks (each 15 min)
- var angle = i * Math.PI / 30;
-
- if ((i == 15) or (i == 45)) {
- dc.setColor(accentColor, accentColor);
- } else {
+ } else{ // AOD mode is OFF
+ if ((i == 15) or (i == 45)) {
+ dc.setColor(accentColor, accentColor);
+ } else {
+ if (colorFlag == true and (i % 5 == 0)){
+ dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
+ } else{
if ((showBoolean == false) and (i == 0 or i == 30)) {
- dc.setColor(accentColor, accentColor);
+ dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
} else {
- dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_LT_GRAY); // Using lighter tone for MIP displays
+ if (width < 360){
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT); // Using lighter tone for MIP displays
+ } else {
+ dc.setColor(Graphics.COLOR_DK_GRAY, Graphics.COLOR_TRANSPARENT); // Darker tone for AMOLED
+ }
}
- }
-
- if( (i % 15) == 0) {
- dc.setPenWidth(3);
- sY = innerRad * Math.sin(angle);
- eY = outerRad * Math.sin(angle);
- sX = innerRad * Math.cos(angle);
- eX = outerRad * Math.cos(angle);
- sX += outerRad; sY += outerRad;
- eX += outerRad; eY += outerRad;
- dc.drawLine(sX, sY, eX, eY);
}
+ }
+ }
+
+ // thicker lines at 5 min intervals
+ if( (i % 5) == 0) {
+ dc.setPenWidth(3);
+ } else {
+ dc.setPenWidth(1);
+ }
+ if(aod==true) { // AOD for AMOLED is ON, so only small hashmarks are going to be displayed at each 15 min
+ sY = innerRad * Math.sin(angle);
+ eY = outerRad * Math.sin(angle);
+ sX = innerRad * Math.cos(angle);
+ eX = outerRad * Math.cos(angle);
+ } else if (showBoolean == false) { // AOD for AMOLED is OFF and NOT showing hour labels, then all 5 minute marks will have same length
+ // longer lines at intermediate 5 min marks
+ if ((i % 5) == 0) {
+ sY = (innerRad-10) * Math.sin(angle);
+ eY = outerRad * Math.sin(angle);
+ sX = (innerRad-10) * Math.cos(angle);
+ eX = outerRad * Math.cos(angle);
}
- }
+ else {
+ sY = innerRad * Math.sin(angle);
+ eY = outerRad * Math.sin(angle);
+ sX = innerRad * Math.cos(angle);
+ eX = outerRad * Math.cos(angle);
+ }
+ } else if( (i % 5) == 0 && !((i % 15) == 0)) { // AOD for AMOLED is OFF and showing hour labels, then marks at each 15 min will be smaller to accomodate labels
+ sY = (innerRad-10) * Math.sin(angle);
+ eY = outerRad * Math.sin(angle);
+ sX = (innerRad-10) * Math.cos(angle);
+ eX = outerRad * Math.cos(angle);
+ } else {
+ sY = innerRad * Math.sin(angle);
+ eY = outerRad * Math.sin(angle);
+ sX = innerRad * Math.cos(angle);
+ eX = outerRad * Math.cos(angle);
+ }
+
+ sX += outerRad; sY += outerRad;
+ eX += outerRad; eY += outerRad;
+ dc.drawLine(sX, sY, eX, eY);
+ }
+ return true;
+ } else { // rectangle display
+ return false;
+ }
+
}
+
+(:square) function drawHashMarks(dc, accentColor, showBoolean, width, height, aod, colorFlag) {
+ var sX, sY;
+ var eX, eY;
+ var outerRad = width / 2;
+ var innerRad = outerRad - 10;
+
+ // Draw hashmarks differently depending on screen geometry.
+ if (System.SCREEN_SHAPE_ROUND != screenShape) { //check if square display
+ var coords = [0, width / 4, (3 * width) / 4, width];
+ if(aod==true and Storage.getValue(22)!=true) { // AOD ON and AOD colors OFF
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ } else { // AOD OFF or (AOD ON and AOD colors ON)
+ if (colorFlag == true){
+ dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
+ } else{
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ }
+ }
+ for (var i = 0; i < coords.size(); i += 1) {
+ var dx = ((width / 2.0) - coords[i]) / (height / 2.0);
+ var upperX = coords[i] + (dx * 10);
+
+ // Draw the upper hash marks.
+ //dc.fillPolygon([[coords[i] - 1, 2], [upperX - 1, 12], [upperX + 1, 12], [coords[i] + 1, 2]]);
+ dc.fillPolygon([[coords[i] - 1, 1], [upperX - 1, 11], [upperX + 1, 11], [coords[i] + 1, 1]]);
+
+ // Draw the lower hash marks.
+ //dc.fillPolygon([[coords[i] - 1, height-2], [upperX - 1, height - 12], [upperX + 1, height - 12], [coords[i] + 1, height - 2]]);
+ dc.fillPolygon([[coords[i] - 1, height-1], [upperX - 1, height - 11], [upperX + 1, height - 11], [coords[i] + 1, height - 1]]);
+
+ if(coords[i] == width / 4){ // Draw the middle-upper hash marks.
+ dc.fillPolygon([[1, coords[i] - 1], [11, upperX - 1], [11, upperX + 1], [1, coords[i] + 1]]);
+ dc.fillPolygon([[height-1, coords[i] - 1], [height - 11, upperX - 1], [height - 11, upperX + 1], [height - 1, coords[i] + 1]]);
+ //dc.fillPolygon([[2, 59], [12, 64], [12, 66], [2, 61]]);
+ }
+
+ if(coords[i] == (3 * width) / 4){ // Draw the middle-lower hash marks.
+ dc.fillPolygon([[1, coords[i] - 1], [11, upperX - 1], [11, upperX + 1], [1, coords[i] + 1]]);
+ dc.fillPolygon([[height-1, coords[i] - 1], [height - 11, upperX - 1], [height - 11, upperX + 1], [height - 1, coords[i] + 1]]);
+ //dc.fillPolygon([[2, 59], [12, 64], [12, 66], [2, 61]]);
+ }
+ }
+ for (var i = 0; i <= 59; i += 15) { //draw the middle hashmarks (each 15 min)
+ var angle = i * Math.PI / 30;
+
+ if(aod==true and Storage.getValue(22)!=true) { // AOD ON and AOD colors OFF
+ if ((i == 15) or (i == 45)) {
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ } else {
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ }
+ } else { // AOD OFF or AOD ON and AOD colors ON
+ if ((i == 15) or (i == 45)) {
+ dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
+ } else {
+ if (colorFlag == true){
+ dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
+ } else{
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT); // Using lighter tone for MIP displays
+ }
+ }
+ }
+
+ if( (i % 15) == 0) {
+ dc.setPenWidth(3);
+ sY = innerRad * Math.sin(angle);
+ eY = outerRad * Math.sin(angle);
+ sX = innerRad * Math.cos(angle);
+ eX = outerRad * Math.cos(angle);
+ sX += outerRad; sY += outerRad;
+ eX += outerRad; eY += outerRad;
+ dc.drawLine(sX, sY, eX, eY);
+ }
+ }
+ return true;
+ }else { // round display
+ return false;
+ }
+ }
+
/* ------------------------ */
@@ -242,7 +282,7 @@ class MtbA_functions {
function drawHourLabels(dc, width, height) {
// Load the custom fonts: used for drawing the 3, 6, 9, and 12 on the watchface
var font = Application.loadResource(Rez.Fonts.id_font_black_diamond);
-
+
if (width < 360){ // Using lighter tone for MIP displays
dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
} else { // Darker tone for AMOLED
@@ -257,168 +297,180 @@ class MtbA_functions {
/* ------------------------ */
- function drawWeatherIcon(dc, x, y, x2, width) {
- var clockTime = System.getClockTime();
+ function drawWeatherIcon(dc, x, y, x2, width, weather) {
+ var clockTime = System.getClockTime().hour;
var WeatherFont = Application.loadResource(Rez.Fonts.WeatherFont);
-
- if(Toybox has :Weather and Weather has :getCurrentConditions) {
- if(Weather.getCurrentConditions() != null) {
- var weather = Weather.getCurrentConditions();
-
- // placeholder for SDK 5
- //var position = weather.observationLocationPosition;
- //var today = new Time.Moment(Time.today().value());
- //System.println(Weather.getSunset(position, today));
- //System.println(Weather.getSunrise(position, today));
-
- if (width<=280){
- y = y-2;
- if (width==218) {
- y = y-1;
- }
- }
-
- //weather icon test
- //weather.condition = 6;
+
+/* var weather2 = (Weather.getHourlyForecast());
+ System.println(weather2[0].condition);
+ System.println(weather2[1].condition);
+ System.println(weather2[2].condition);
+ System.println(weather2[3].condition);
+*/
+ // placeholder for SDK 5
+ //var position = weather.observationLocationPosition;
+ //var today = new Time.Moment(Time.today().value());
+ //System.println(Weather.getSunset(position, today));
+ //System.println(Weather.getSunrise(position, today));
- dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- if (weather.condition == 20) { // Cloudy
- dc.drawText(x2-1, y-1, WeatherFont, "I", Graphics.TEXT_JUSTIFY_RIGHT); // Cloudy
- } else if (weather.condition == 0 or weather.condition == 5) { // Clear or Windy
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2-2, y-1, WeatherFont, "f", Graphics.TEXT_JUSTIFY_RIGHT); // Clear Night
- } else {
- dc.drawText(x2, y-2, WeatherFont, "H", Graphics.TEXT_JUSTIFY_RIGHT); // Clear Day
- }
- } else if (weather.condition == 1 or weather.condition == 23 or weather.condition == 40 or weather.condition == 52) { // Partly Cloudy or Mostly Clear or fair or thin clouds
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2-1, y-2, WeatherFont, "g", Graphics.TEXT_JUSTIFY_RIGHT); // Partly Cloudy Night
- } else {
- dc.drawText(x2, y-2, WeatherFont, "G", Graphics.TEXT_JUSTIFY_RIGHT); // Partly Cloudy Day
- }
- } else if (weather.condition == 2 or weather.condition == 22) { // Mostly Cloudy or Partly Clear
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2, y, WeatherFont, "h", Graphics.TEXT_JUSTIFY_RIGHT); // Mostly Cloudy Night
- } else {
- dc.drawText(x, y, WeatherFont, "B", Graphics.TEXT_JUSTIFY_RIGHT); // Mostly Cloudy Day
- }
- } else if (weather.condition == 3 or weather.condition == 14 or weather.condition == 15 or weather.condition == 11 or weather.condition == 13 or weather.condition == 24 or weather.condition == 25 or weather.condition == 26 or weather.condition == 27 or weather.condition == 45) { // Rain or Light Rain or heavy rain or showers or unkown or chance
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2, y, WeatherFont, "c", Graphics.TEXT_JUSTIFY_RIGHT); // Rain Night
- } else {
- dc.drawText(x, y, WeatherFont, "D", Graphics.TEXT_JUSTIFY_RIGHT); // Rain Day
- }
- } else if (weather.condition == 4 or weather.condition == 10 or weather.condition == 16 or weather.condition == 17 or weather.condition == 34 or weather.condition == 43 or weather.condition == 46 or weather.condition == 48 or weather.condition == 51) { // Snow or Hail or light or heavy snow or ice or chance or cloudy chance or flurries or ice snow
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2, y, WeatherFont, "e", Graphics.TEXT_JUSTIFY_RIGHT); // Snow Night
- } else {
- dc.drawText(x, y, WeatherFont, "F", Graphics.TEXT_JUSTIFY_RIGHT); // Snow Day
- }
- } else if (weather.condition == 6 or weather.condition == 12 or weather.condition == 28 or weather.condition == 32 or weather.condition == 36 or weather.condition == 41 or weather.condition == 42) { // Thunder or scattered or chance or tornado or squall or hurricane or tropical storm
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2, y, WeatherFont, "b", Graphics.TEXT_JUSTIFY_RIGHT); // Thunder Night
- } else {
- dc.drawText(x, y, WeatherFont, "C", Graphics.TEXT_JUSTIFY_RIGHT); // Thunder Day
- }
- } else if (weather.condition == 7 or weather.condition == 18 or weather.condition == 19 or weather.condition == 21 or weather.condition == 44 or weather.condition == 47 or weather.condition == 49 or weather.condition == 50) { // Wintry Mix (Snow and Rain) or chance or cloudy chance or freezing rain or sleet
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2, y, WeatherFont, "d", Graphics.TEXT_JUSTIFY_RIGHT); // Snow+Rain Night
- } else {
- dc.drawText(x, y, WeatherFont, "E", Graphics.TEXT_JUSTIFY_RIGHT); // Snow+Rain Day
- }
- } else if (weather.condition == 8 or weather.condition == 9 or weather.condition == 29 or weather.condition == 30 or weather.condition == 31 or weather.condition == 33 or weather.condition == 35 or weather.condition == 37 or weather.condition == 38 or weather.condition == 39) { // Fog or Hazy or Mist or Dust or Drizzle or Smoke or Sand or sandstorm or ash or haze
- if (clockTime.hour >= 18 or clockTime.hour < 6) {
- dc.drawText(x2, y, WeatherFont, "a", Graphics.TEXT_JUSTIFY_RIGHT); // Fog Night
- } else {
- dc.drawText(x, y, WeatherFont, "A", Graphics.TEXT_JUSTIFY_RIGHT); // Fog Day
- }
- }
+ if (width<=280){
+ y = y-2;
+ if (width==218) {
+ y = y-1;
}
+ }
+
+ //weather icon test
+ //weather.condition = 6;
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ if (weather == 20) { // Cloudy
+ dc.drawText(x2-1, y-1, WeatherFont, "I", Graphics.TEXT_JUSTIFY_RIGHT); // Cloudy
+ } else if (weather == 0 or weather == 5) { // Clear or Windy
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2-2, y-1, WeatherFont, "f", Graphics.TEXT_JUSTIFY_RIGHT); // Clear Night
+ } else {
+ dc.drawText(x2, y-2, WeatherFont, "H", Graphics.TEXT_JUSTIFY_RIGHT); // Clear Day
+ }
+ } else if (weather == 1 or weather == 23 or weather == 40 or weather == 52) { // Partly Cloudy or Mostly Clear or fair or thin clouds
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2-1, y-2, WeatherFont, "g", Graphics.TEXT_JUSTIFY_RIGHT); // Partly Cloudy Night
+ } else {
+ dc.drawText(x2, y-2, WeatherFont, "G", Graphics.TEXT_JUSTIFY_RIGHT); // Partly Cloudy Day
+ }
+ } else if (weather == 2 or weather == 22) { // Mostly Cloudy or Partly Clear
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2, y, WeatherFont, "h", Graphics.TEXT_JUSTIFY_RIGHT); // Mostly Cloudy Night
+ } else {
+ dc.drawText(x, y, WeatherFont, "B", Graphics.TEXT_JUSTIFY_RIGHT); // Mostly Cloudy Day
+ }
+ } else if (weather == 3 or weather == 14 or weather == 15 or weather == 11 or weather == 13 or weather == 24 or weather == 25 or weather == 26 or weather == 27 or weather == 45) { // Rain or Light Rain or heavy rain or showers or unkown or chance
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2, y, WeatherFont, "c", Graphics.TEXT_JUSTIFY_RIGHT); // Rain Night
+ } else {
+ dc.drawText(x, y, WeatherFont, "D", Graphics.TEXT_JUSTIFY_RIGHT); // Rain Day
+ }
+ } else if (weather == 4 or weather == 10 or weather == 16 or weather == 17 or weather == 34 or weather == 43 or weather == 46 or weather == 48 or weather == 51) { // Snow or Hail or light or heavy snow or ice or chance or cloudy chance or flurries or ice snow
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2, y, WeatherFont, "e", Graphics.TEXT_JUSTIFY_RIGHT); // Snow Night
+ } else {
+ dc.drawText(x, y, WeatherFont, "F", Graphics.TEXT_JUSTIFY_RIGHT); // Snow Day
+ }
+ } else if (weather == 6 or weather == 12 or weather == 28 or weather == 32 or weather == 36 or weather == 41 or weather == 42) { // Thunder or scattered or chance or tornado or squall or hurricane or tropical storm
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2, y, WeatherFont, "b", Graphics.TEXT_JUSTIFY_RIGHT); // Thunder Night
+ } else {
+ dc.drawText(x, y, WeatherFont, "C", Graphics.TEXT_JUSTIFY_RIGHT); // Thunder Day
+ }
+ } else if (weather == 7 or weather == 18 or weather == 19 or weather == 21 or weather == 44 or weather == 47 or weather == 49 or weather == 50) { // Wintry Mix (Snow and Rain) or chance or cloudy chance or freezing rain or sleet
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2, y, WeatherFont, "d", Graphics.TEXT_JUSTIFY_RIGHT); // Snow+Rain Night
+ } else {
+ dc.drawText(x, y, WeatherFont, "E", Graphics.TEXT_JUSTIFY_RIGHT); // Snow+Rain Day
+ }
+ } else if (weather == 8 or weather == 9 or weather == 29 or weather == 30 or weather == 31 or weather == 33 or weather == 35 or weather == 37 or weather == 38 or weather == 39) { // Fog or Hazy or Mist or Dust or Drizzle or Smoke or Sand or sandstorm or ash or haze
+ if (clockTime >= 18 or clockTime < 6) {
+ dc.drawText(x2, y, WeatherFont, "a", Graphics.TEXT_JUSTIFY_RIGHT); // Fog Night
+ } else {
+ dc.drawText(x, y, WeatherFont, "A", Graphics.TEXT_JUSTIFY_RIGHT); // Fog Day
+ }
}
}
/* ------------------------ */
- function drawTemperature(dc, x, y, showBoolean, width) {
- if(Toybox has :Weather and Weather has :getCurrentConditions) {
- if(Weather.getCurrentConditions() != null) {
- var weather = Weather.getCurrentConditions();
- var TempMetric = System.getDeviceSettings().temperatureUnits;
- var fahrenheit;
- var temp = "";
- var units = "";
-
- var offset=0;
-
- if(width==390){ // venu
- offset=-1;
- }
-
- if (showBoolean == false and weather has :feelsLikeTemperature) { //feels like
- if (TempMetric == System.UNIT_METRIC or Storage.getValue(16)==true) { //Celsius
- units = "°C";
- temp = weather.feelsLikeTemperature;
- } else {
- temp = (weather.feelsLikeTemperature * 9/5) + 32;
- //temp = Lang.format("$1$", [temp.format("%d")] );
- units = "°F";
- }
- } else if(weather has :temperature) { // real temperature
- if (TempMetric == System.UNIT_METRIC or Storage.getValue(16)==true) { //Celsius
- units = "°C";
- temp = weather.temperature;
- } else {
- temp = (weather.temperature * 9/5) + 32;
- //temp = Lang.format("$1$", [temp.format("%d")] );
- units = "°F";
- }
- }
-
- if (temp != null and (temp instanceof Number)){
- dc.drawText(x, y+offset, Graphics.FONT_XTINY, temp + units, Graphics.TEXT_JUSTIFY_LEFT); // + units
+ function drawTemperature(dc, x, y, showBoolean, width, weather) {
+
+ var TempMetric = System.getDeviceSettings().temperatureUnits;
+ var fahrenheit;
+ var temp = "", units = "", minTemp=0, maxTemp=0;
+
+ if (weather.lowTemperature!=null and weather.highTemperature!=null){
+ minTemp = weather.lowTemperature;
+ maxTemp = weather.highTemperature;
+ }
+
+ var offset=0;
+
+ if(width==390){ // venu
+ offset=-1;
+ }
+
+ if (showBoolean == false and check[5] and weather.feelsLikeTemperature!=null) { //feels like
+ if (TempMetric == System.UNIT_METRIC or Storage.getValue(16)==true) { //Celsius
+ units = "°C";
+ temp = weather.feelsLikeTemperature;
+ } else {
+ temp = (weather.feelsLikeTemperature * 9/5) + 32;
+ minTemp = (minTemp* 9/5) + 32;
+ maxTemp = (maxTemp* 9/5) + 32;
+ //temp = Lang.format("$1$", [temp.format("%d")] );
+ units = "°F";
+ }
+ } else if(check[6] and weather.temperature!=null) { // real temperature
+ if (TempMetric == System.UNIT_METRIC or Storage.getValue(16)==true) { //Celsius
+ units = "°C";
+ temp = weather.temperature;
+ } else {
+ temp = (weather.temperature * 9/5) + 32;
+ minTemp = (minTemp* 9/5) + 32;
+ maxTemp = (maxTemp* 9/5) + 32;
+ //temp = Lang.format("$1$", [temp.format("%d")] );
+ units = "°F";
}
+ }
+
+ if (temp != null and (temp instanceof Number)){
+ if (temp<=minTemp){
+ dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT); // Light Blue 0x55AAFF
+ } else if (temp>=maxTemp){
+ dc.setColor(0xFFAA55, Graphics.COLOR_TRANSPARENT); // Light Orange
+ } else {
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
}
+ dc.drawText(x, y+offset, Graphics.FONT_XTINY, temp, Graphics.TEXT_JUSTIFY_LEFT); // + units
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ dc.drawText(x + dc.getTextWidthInPixels(temp.format("%d"),Graphics.FONT_XTINY), y+offset , Graphics.FONT_XTINY, units, Graphics.TEXT_JUSTIFY_LEFT); //Lang.format("$1$%",[precipitation])
}
}
/* ------------------------ */
// Weather Location Name
- function drawLocation(dc, x, y, wMax, hMax, showBoolean) {
- if(Toybox has :Weather and Weather has :getCurrentConditions) {
- if(Weather.getCurrentConditions() != null) {
- var weather = Weather.getCurrentConditions();
- if (showBoolean != false) { // Show Location Name
- if(weather has :observationLocationName) {
- var location = weather.observationLocationName;
- if (location.length()>15 and location.find(",")!=null){
- location = location.substring(0,location.find(","));
- }
- if (location.find("null")!=null and location.find(",")!=null) {
- var location2 = location.substring(0,location.find(","));
- if (location2.find("null")!=null) {
- location2 = location.substring(location.find(",")+2,location.length());
- if (location2.find("null")!=null){
- location2 = "";
- }
- }
- location = location2;
- }
- else if (location.find("null")!=null) {
- location = "";
- }
+ function drawLocation(dc, x, y, wMax, hMax, showBoolean, weather) {
- if(x*2==260 and Storage.getValue(3)==false){
- y = y+6;
+ if (showBoolean != false) { // Show Location Name
+ if(check[7] and weather.observationLocationName!=null) {
+ var location = weather.observationLocationName;
+ if (location.length()>15 and location.find(",")!=null){
+ location = location.substring(0,location.find(","));
+ }
+ if (location.find("ocation[")!=null){
+ location="null";
+ }
+ if (location.find("null")!=null and location.find(",")!=null) {
+ var location2 = location.substring(0,location.find(","));
+ if (location2.find("null")!=null) {
+ location2 = location.substring(location.find(",")+2,location.length());
+ if (location2.find("null")!=null){
+ location2 = "";
}
-
- dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
- //dc.fitTextToArea(text, font, width, height, truncate)
- dc.drawText(x, y, Graphics.FONT_XTINY, dc.fitTextToArea(location, Graphics.FONT_XTINY, wMax, hMax, true), Graphics.TEXT_JUSTIFY_CENTER);
- }
- }
- }
- }
+ }
+ location = location2;
+ }
+ else if (location.find("null")!=null) {
+ location = "";
+ }
+
+ if(x*2==260 and Storage.getValue(3)==false){
+ y = y+6;
+ }
+
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ //dc.fitTextToArea(text, font, width, height, truncate)
+ dc.drawText(x, y, Graphics.FONT_XTINY, dc.fitTextToArea(location, Graphics.FONT_XTINY, wMax, hMax, true), Graphics.TEXT_JUSTIFY_CENTER);
+ }
+ }
}
/* ------------------------ */
@@ -429,7 +481,7 @@ class MtbA_functions {
var formattedNotificationAmount = "";
var notificationAmount;
- if (System.getDeviceSettings() has :notificationCount) {
+ if (System.getDeviceSettings().notificationCount!=null) {
notificationAmount = System.getDeviceSettings().notificationCount;
if(notificationAmount > 99) {
formattedNotificationAmount = "99+";
@@ -453,12 +505,12 @@ class MtbA_functions {
}
// Icon
- if (formattedNotificationAmount.toNumber() == 0){
- if (width==360 or width==390 or width==416){ //AMOLED
+ if (formattedNotificationAmount.toNumber() == 0){ // when notification count is zero
+// if (width>=360){ //AMOLED (2021)
dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
- } else { // MIP, for better readability
- dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- }
+// } else { // MIP, for better readability
+// dc.setColor( (accentColor==Graphics.COLOR_WHITE ? Graphics.COLOR_LT_GRAY : Graphics.COLOR_WHITE), Graphics.COLOR_TRANSPARENT); // if accent color is white and notification is zero, then icon color is gray
+// }
} else {
dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
}
@@ -471,16 +523,16 @@ class MtbA_functions {
// Get heart rate
function drawHeartRate(dc, xIcon, hrIconY, xText, width, accentColor) {
var heartRate;
- if(Activity has :getActivityInfo) {
+ if(check[9]) {
heartRate = Activity.getActivityInfo().currentHeartRate;
if(heartRate==null) {
- if(ActivityMonitor has :getHeartRateHistory) {
+ if(check[10]) {
var HRH=ActivityMonitor.getHeartRateHistory(1, true);
- var HRS=HRH.next();
- if(HRS!=null && HRS.heartRate!= ActivityMonitor.INVALID_HR_SAMPLE){
- heartRate = HRS.heartRate;
+ var HRS=HRH.next();
+ if(HRS!=null && HRS.heartRate!= ActivityMonitor.INVALID_HR_SAMPLE){
+ heartRate = HRS.heartRate;
+ }
}
- }
}
if(heartRate==null) {
heartRate = 0;
@@ -567,7 +619,7 @@ class MtbA_functions {
} else if(width==260){ // Fenix 6
xText = xText-1.5;
hrIconY = hrIconY - 4;
- } else if(width==240){ // Fenix 6
+ } else if(width==240){ // Fenix 6s
xText = xText-0.5;
hrIconY = hrIconY - 5;
if (System.SCREEN_SHAPE_ROUND != screenShape){ //rectangle
@@ -582,12 +634,31 @@ class MtbA_functions {
xText = xText-1.5;
hrIconY = hrIconY - 2;
}
+
+ var FontAdj= 0;
+ if (Storage.getValue(14)==true){
+ if (width==260 and dc.getFontHeight(Graphics.FONT_TINY)==29) { //Fenix 6
+ FontAdj=6;
+ } else if (width==260 and dc.getFontHeight(Graphics.FONT_TINY)==27) { // Vivoactive 4
+ FontAdj=5;
+ } else if (width==280){
+ FontAdj=7;
+ } else if (width>=400) {
+ FontAdj=5;
+ } else if (width==218) {
+ FontAdj=3;
+ } else if (width==240 and dc.getFontHeight(Graphics.FONT_TINY)==26) { // Fenix 5, 5S and 5X
+ FontAdj=0;
+ } else {
+ FontAdj=4;
+ }
+ }
// Render heart rate icon and text
dc.setColor(heartRateIconColour, Graphics.COLOR_TRANSPARENT);
- dc.drawText( xIcon + offset/3 , hrIconY - 1, IconsFont, "3", Graphics.TEXT_JUSTIFY_CENTER); // Using Icon
+ dc.drawText( xIcon + offset/3 , hrIconY - 1, IconsFont, "3", Graphics.TEXT_JUSTIFY_CENTER); // Icon
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- dc.drawText( xText, hrIconY - offset , fontSize, heartRateText, Graphics.TEXT_JUSTIFY_LEFT);
+ dc.drawText( xText, hrIconY - offset - FontAdj , fontSize, heartRateText, Graphics.TEXT_JUSTIFY_LEFT); // Text
}
/* ------------------------ */
@@ -595,30 +666,19 @@ class MtbA_functions {
// Draw Battery Icon and Text
function drawBatteryIcon(dc, xBattery, yBattery, xContact, yContact, width, height, accentColor) {
- var battery = Math.ceil(System.getSystemStats().battery);
- var batteryState;
- var batteryIconColour;
-
- // Choose the colour of the battery based on it's state
- if (battery > 30) {
- batteryState=0;
- } else if (battery <= 15) {
- batteryState=1;
- } else if (battery <= 30) {
- batteryState=2;
- } else {
- batteryState=3;
- }
-
- if (batteryState == 0) {
+ var battery = Math.ceil(System.getSystemStats().battery);
+ var batteryIconColour;
+
+ // Choose the colour of the battery based on it's state
+ if (battery > 30) {
if (accentColor == 0x55FF00 or System.getDeviceSettings().requiresBurnInProtection == false) {
batteryIconColour = 0x55FF00; /* GREEN */
} else {
batteryIconColour = 0xAAFF00; /* Vivomove GREEN */
}
- } else if (batteryState == 1) {
+ } else if (battery <= 20) {
batteryIconColour = 0xFF5555 /* pastel red */;
- } else if (batteryState == 2) {
+ } else if (battery <= 40) {
batteryIconColour = 0xFFFF55 /* pastel yellow */;
} else {
batteryIconColour = Graphics.COLOR_LT_GRAY ; // Not detected
@@ -648,14 +708,22 @@ class MtbA_functions {
dc.setColor(batteryIconColour, Graphics.COLOR_TRANSPARENT);
//dc.fillRoundedRectangle(x, y, width, height, radius)
- dc.fillRoundedRectangle(xBattery, yBattery , width*0.135 + (System.SCREEN_SHAPE_ROUND != screenShape ? 14 : 0) + (width==240 and dc.getTextDimensions("100",0)[1]>=26 ? 12 : 0), height*0.0625 - offsetLED, 2);
+ dc.fillRoundedRectangle(xBattery, yBattery , width*0.135 + (System.SCREEN_SHAPE_ROUND != screenShape ? 14 : 0) + (width==240 and dc.getTextDimensions("100",0)[1]>=26 and System.SCREEN_SHAPE_ROUND == screenShape ? 12 : 0), height*0.0625 - offsetLED, 2);
dc.fillRoundedRectangle(xContact, yContact , width*0.018, height*0.039 - offset, 2);
}
// Draw Battery Text (separate because of "too many arguments" error)
function drawBatteryText(dc, xText, yText, width) {
- var battery = Math.ceil(System.getSystemStats().battery);
+ var estimateFlag = Storage.getValue(19);
+ var battery;
+
+ if (estimateFlag == true and System.getSystemStats().batteryInDays!=null){
+ battery = Math.ceil(System.getSystemStats().batteryInDays);
+ } else {
+ battery = Math.ceil(System.getSystemStats().battery);
+ }
+
var offset = 0, offsetLED = 0;
if (width==390) { // Venu & D2 Air
@@ -679,10 +747,10 @@ class MtbA_functions {
offsetLED = -1;
}
- System.println(width);
+ //System.println(width);
dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_TRANSPARENT);
- dc.drawText(xText + offsetLED, yText + offset , 0 /* batteryFont */,battery.format("%d") + "%", Graphics.TEXT_JUSTIFY_CENTER ); // Correct battery text on Fenix 5 series (except 5s)
+ dc.drawText(xText + offsetLED, yText + offset , 0 /* batteryFont */,battery.format("%d") + (estimateFlag == true ? "d" : "%"), Graphics.TEXT_JUSTIFY_CENTER ); // Correct battery text on Fenix 5 series (except 5s)
}
/* ------------------------ */
@@ -692,29 +760,33 @@ class MtbA_functions {
// If this device supports the Do Not Disturb feature,
// load the associated Icon into memory.
- var dndIcon;
+ //var dndIcon;
- if (System.getDeviceSettings() has :doNotDisturb) {
- dndIcon = Application.loadResource(Rez.Drawables.DoNotDisturbIcon);
- } else {
- //dndIcon = null;
- return false;
- }
+ if (check[4] and System.getDeviceSettings().doNotDisturb!=null) {
+ //dndIcon = Application.loadResource(Rez.Drawables.DoNotDisturbIcon);
+
+ // Draw the do-not-disturb icon if we support it and the setting is enabled
+ var offsetX = 0, offsetY = 0;
+ if (width>=390) { // Venu & D2 Air
+ offsetX = 7;
+ offsetY = 2;
+ } else if (width==280 or width==260 or width==240){ // Fenix 6X & Enduro & Fenix 6
+ offsetX = -1;
+ } else if (width==218){ // VA4s
+ offsetY = -2;
+ } else if (width==360){ // Venu 2s
+ offsetY = 2;
+ offsetX = 2;
+ }
- // Draw the do-not-disturb icon if we support it and the setting is enabled
- var offsetX = 0, offsetY = 0;
- if (width>=390) { // Venu & D2 Air
- offsetX = 7;
- } else if (width==280 or width==260 or width==240){ // Fenix 6X & Enduro & Fenix 6
- offsetY = -4;
- } else if (width==218){ // VA4s
- offsetY = -3;
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ dc.drawText( x + offsetX, y + offsetY , IconsFont, "Y", Graphics.TEXT_JUSTIFY_LEFT);
+ return true;
+ } else {
+ //dndIcon = null;
+ return false;
}
- if (null != dndIcon && System.getDeviceSettings().doNotDisturb) {
- dc.drawBitmap( x + offsetX, y + offsetY , dndIcon);
- }
- return true;
}
/* ------------------------ */
@@ -722,20 +794,20 @@ class MtbA_functions {
// Draw Pulse Ox Icon and Text
function drawPulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor) {
- var pulseOx = null;
- if (Activity.getActivityInfo() has :currentOxygenSaturation) {
- pulseOx = Activity.getActivityInfo().currentOxygenSaturation ;
- }
-
- var offset = 0;
- if (width>=360) { // Venu & D2 Air
- offset = 7;
- } else if (System.SCREEN_SHAPE_ROUND != screenShape){ // Venu sq
- offset = -2;
- }
-
- if (pulseOx!= null) {
- // Change the colour of the pulse Ox icon based on current value
+ var pulseOx = null;
+ if (check[11]) {
+ pulseOx = Activity.getActivityInfo().currentOxygenSaturation ;
+ }
+
+ var offset = 0;
+ if (width>=360) { // Venu & D2 Air
+ offset = 7;
+ } else if (System.SCREEN_SHAPE_ROUND != screenShape){ // Venu sq
+ offset = -2;
+ }
+
+ if (pulseOx!= null) {
+ // Change the colour of the pulse Ox icon based on current value
if (pulseOx >= 95) { // Normal
if (accentColor == 0xAAFF00) {
dc.setColor(0xAAFF00, Graphics.COLOR_TRANSPARENT); /* Vivomove GREEN */
@@ -751,13 +823,15 @@ class MtbA_functions {
} else { // Cyanosis
dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT); /* red */
}
- dc.drawText( xIcon, yIcon + offset , IconsFont, "@", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
- dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- dc.drawText( xText, yText , fontSize, Lang.format("$1$%", [pulseOx.format("%.0f")] ), Graphics.TEXT_JUSTIFY_LEFT);
- return true;
- } else {
- return false;
- }
+
+ dc.drawText( xIcon, yIcon + offset , IconsFont, "Q", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ //dc.drawText( xText, yText , fontSize, Lang.format("$1$%", [pulseOx.format("%.0f")] ), Graphics.TEXT_JUSTIFY_LEFT);
+ dc.drawText( xText, yText, fontSize, pulseOx.format("%.0f") + "%", Graphics.TEXT_JUSTIFY_LEFT);
+ return true;
+ } else {
+ return false;
+ }
}
/* ------------------------ */
@@ -768,13 +842,16 @@ class MtbA_functions {
//var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
var floorsCount=0;
- if (ActivityMonitor.getInfo() has :floorsClimbed) {
+ if (check[12]) {
floorsCount = ActivityMonitor.getInfo().floorsClimbed;//.toString();
} else {
return false;
}
- if (floorsCount>=ActivityMonitor.getInfo().floorsClimbedGoal) {
+ var goal = ActivityMonitor.getInfo().floorsClimbedGoal;
+ if (goal == null) { goal = 0; }
+
+ if (floorsCount>=goal) {
dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
} else {
if (width==360 or width==390 or width==416){ //AMOLED
@@ -806,13 +883,8 @@ class MtbA_functions {
//var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
var stepDistance=null;
- var distStr = "0";
var unit = "";
- if (ActivityMonitor.getInfo() has :steps) {
- distStr = ActivityMonitor.getInfo().steps;
- }
-
var offsetY = 0;
if (width>=360) { // Venu & D2 Air
offsetY = 7;
@@ -823,8 +895,14 @@ class MtbA_functions {
yIcon = yIcon-1.5;
xIcon = xIcon+1;
}
+
+ var distStr = ActivityMonitor.getInfo().steps;
+ if (distStr == null) { distStr = 0; }
+
+ var goal = ActivityMonitor.getInfo().stepGoal;
+ if (goal == null) { goal = 0; }
- if (ActivityMonitor.getInfo().steps>=ActivityMonitor.getInfo().stepGoal) {
+ if (distStr>=goal) {
dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
} else {
if (width==360 or width==390 or width==416){ //AMOLED
@@ -848,30 +926,28 @@ class MtbA_functions {
//var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
var DistanceMetric = System.getDeviceSettings().distanceUnits;
- var stepDistance=null;
+ var stepDistance = ActivityMonitor.getInfo().distance;//.toString();
var distStr = "0";
var unit = "";
- if (ActivityMonitor.getInfo() has :distance) {
- stepDistance = ActivityMonitor.getInfo().distance;//.toString();
- if (stepDistance != null) {
- if (DistanceMetric == System.UNIT_METRIC) {
- unit = " km";
- stepDistance = stepDistance * 0.00001;
- } else{
- unit = " mi";
- stepDistance = stepDistance * 0.00001 * 0.621371;
- }
- } else {
- unit = "?";
- }
-
- if (stepDistance >= 10) {
- distStr = Lang.format("$1$", [stepDistance.format("%.0f")] );
- } else { //(stepDistance <10)
- distStr = Lang.format("$1$", [stepDistance.format("%.1f")] );
- }
- }
+ if (stepDistance != null) {
+ if (DistanceMetric == System.UNIT_METRIC) {
+ unit = " km";
+ stepDistance = stepDistance * 0.00001;
+ } else{
+ unit = " mi";
+ stepDistance = stepDistance * 0.00001 * 0.621371;
+ }
+ } else {
+ stepDistance=0;
+ unit = "?";
+ }
+
+ if (stepDistance >= 10) {
+ distStr = stepDistance.format("%.0f");
+ } else { //(stepDistance <10)
+ distStr = stepDistance.format("%.1f");
+ }
var offsetY = 0;
if (width>=360) { // Venu & D2 Air
@@ -882,7 +958,10 @@ class MtbA_functions {
offsetY = -1;
}
- if (ActivityMonitor.getInfo().steps>=ActivityMonitor.getInfo().stepGoal) {
+ var goal = ActivityMonitor.getInfo().stepGoal;
+ if (goal == null) { goal = 0; }
+
+ if (ActivityMonitor.getInfo().steps!=null and ActivityMonitor.getInfo().steps>=goal) {
dc.setColor(accentColor, Graphics.COLOR_TRANSPARENT);
} else {
if (width==360 or width==390 or width==416){ //AMOLED
@@ -895,7 +974,6 @@ class MtbA_functions {
// Distance Text
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- //dc.drawText(xText , yText, Graphics.FONT_XTINY, distStr + unit, Graphics.TEXT_JUSTIFY_LEFT); // Step Distance
dc.drawText(xText , yText, fontSize, distStr + unit, Graphics.TEXT_JUSTIFY_LEFT); // Step Distance
}
@@ -984,49 +1062,37 @@ class MtbA_functions {
}
}
- var borderColor = Graphics.COLOR_BLACK;
- var arborColor=Graphics.COLOR_LT_GRAY;
- var minuteHandColor = Graphics.COLOR_WHITE;
- var BurnIn = System.getDeviceSettings().requiresBurnInProtection;
- if (aod==true and BurnIn==true) {
- if(Storage.getValue(18) == true){
- // mute AOD colors
- accentColor = Graphics.COLOR_LT_GRAY;
- arborColor = Graphics.COLOR_LT_GRAY;
- minuteHandColor = Graphics.COLOR_LT_GRAY;
- }
-
- //borderColor=Graphics.COLOR_LT_GRAY;
- //accentColor=Graphics.COLOR_BLACK;
- //arborColor=Graphics.COLOR_BLACK;
- //borderColor=Graphics.COLOR_DK_GRAY;
- //width=(upTop) ? width-width*.1 : width+width*.1;
+ var borderColor=Graphics.COLOR_BLACK, arborColor=Graphics.COLOR_LT_GRAY; // colors for not AOD mode
+ var BurnIn = check[0];
+ if (aod==true and BurnIn==true and Storage.getValue(22) != true) { //AOD mode ON
+ accentColor=Graphics.COLOR_LT_GRAY;
+ //arborColor=Graphics.COLOR_LT_GRAY;
+ //borderColor=Graphics.COLOR_BLACK;
}
- //Use white to draw the hour hand, with a dark grey background
- dc.setColor(borderColor, Graphics.COLOR_TRANSPARENT); //(centerPoint, angle, handLength, tailLength, width, triangle)
- dc.fillPolygon(generateHandCoordinates(screenCenterPoint, hourHandAngle, width / 3.485, 0, Math.ceil(handWidth+(width*0.01)), triangle)); // (width*0.01)
- //dc.fillPolygon(generateHandCoordinates(screenCenterPoint, hourHandAngle, width / 3.45, 0, handWidth*0.045)); // standard
- dc.setColor(minuteHandColor, Graphics.COLOR_TRANSPARENT);
- dc.fillPolygon(generateHandCoordinates(screenCenterPoint, hourHandAngle, width / 3.54 , 0, handWidth, triangle-0.01)); // thick
-
- // Draw the minute hand.
- //var minuteHandAngle = (clockTime.min / 60.0) * Math.PI * 2;
- var minuteHandAngle = (clockTime.min / 30.0) * Math.PI;
-
- //generateHandCoordinates(centerPoint, angle, handLength, tailLength, width) -- width / (higher means smaller)
- dc.setColor(borderColor, Graphics.COLOR_TRANSPARENT);
- dc.fillPolygon(generateHandCoordinates(screenCenterPoint, minuteHandAngle, width / 2.225, 0, Math.ceil(handWidth+(width*0.01)), triangle)); // 2.5
- //dc.fillPolygon(generateHandCoordinates(screenCenterPoint, minuteHandAngle, width / 2.22, 0, handWidth*0.045)); // standard
- dc.setColor(accentColor, Graphics.COLOR_WHITE);
- dc.fillPolygon(generateHandCoordinates(screenCenterPoint, minuteHandAngle, width / 2.25 , 0, handWidth, triangle-0.01)); // thick
-
-
- // Draw the arbor in the center of the screen.
- dc.setColor(borderColor,Graphics.COLOR_BLACK);
- dc.fillCircle(width / 2, height / 2, handWidth*0.65-offsetOuterCircle); // *0.65
- dc.setColor(arborColor, Graphics.COLOR_WHITE);
- dc.fillCircle(width / 2, height / 2, handWidth*0.65-offsetInnerCircle); // -4
+ //Use white to draw the hour hand, with a dark grey background
+ dc.setColor(borderColor, Graphics.COLOR_TRANSPARENT); //(centerPoint, angle, handLength, tailLength, width, triangle)
+ dc.fillPolygon(generateHandCoordinates(screenCenterPoint, hourHandAngle, width / 3.485, 0, Math.ceil(handWidth+(width*0.01)), triangle)); // hour hand border
+
+ dc.setColor((aod==true and BurnIn==true and Storage.getValue(22) != true) ? Graphics.COLOR_LT_GRAY : Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT); // Light gray if AOD mode ON, White if not (or MIP display)
+ dc.fillPolygon(generateHandCoordinates(screenCenterPoint, hourHandAngle, width / 3.54 , 0, handWidth, triangle-0.01)); // hour hand
+
+ // Draw the minute hand.
+ //var minuteHandAngle = (clockTime.min / 60.0) * Math.PI * 2;
+ var minuteHandAngle = (clockTime.min / 30.0) * Math.PI;
+
+ //generateHandCoordinates(centerPoint, angle, handLength, tailLength, width) -- width / (higher means smaller)
+ dc.setColor(borderColor, Graphics.COLOR_TRANSPARENT);
+ dc.fillPolygon(generateHandCoordinates(screenCenterPoint, minuteHandAngle, width / 2.225, 0, Math.ceil(handWidth+(width*0.01)), triangle)); // minute hand border
+ dc.setColor(accentColor, Graphics.COLOR_WHITE);
+ dc.fillPolygon(generateHandCoordinates(screenCenterPoint, minuteHandAngle, width / 2.25 , 0, handWidth, triangle-0.01)); // minute hand
+
+
+ // Draw the arbor in the center of the screen.
+ dc.setColor(borderColor,Graphics.COLOR_BLACK);
+ dc.fillCircle(width / 2, height / 2, handWidth*0.65-offsetOuterCircle); // *0.65
+ dc.setColor(arborColor, Graphics.COLOR_WHITE);
+ dc.fillCircle(width / 2, height / 2, handWidth*0.65-offsetInnerCircle); // -4
if (aod==true and BurnIn==true) {
var checkerboard = Application.loadResource(Rez.Fonts.Checkerboard);
@@ -1057,11 +1123,7 @@ class MtbA_functions {
//var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
var calories=0;
- if (ActivityMonitor.getInfo() has :calories) {
- calories = ActivityMonitor.getInfo().calories;//.toString();
- } else {
- return false;
- }
+ calories = ActivityMonitor.getInfo().calories;//.toString();
var offset = 0;
if (width>=360) { // Venu & D2 Air
@@ -1083,7 +1145,7 @@ class MtbA_functions {
// Text
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
dc.drawText( xText , yText , fontSize, calories, Graphics.TEXT_JUSTIFY_LEFT);
- return true;
+
}
/* ------------------------ */
@@ -1092,26 +1154,23 @@ class MtbA_functions {
function drawElevation(dc, xIcon, yIcon, xText, yText, width) {
//var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
- var elevationMetric = null;
+ var elevationMetric = System.getDeviceSettings().elevationUnits;
var elevation=null;
var elevationStr;
var unit;
- if (Activity.getActivityInfo() has :altitude) {
+ if (check[16]) {
//elevation = Activity.getActivityInfo().altitude;
if(Activity.getActivityInfo().altitude!=null){
elevation = Activity.getActivityInfo().altitude.toFloat();
}
}
- if (System.getDeviceSettings() has :elevationUnits){
- elevationMetric = System.getDeviceSettings().elevationUnits;
- }
var offsetY = 0;
if (width>=360) { // Venu & D2 Air
offsetY = 7;
- } else if (System.SCREEN_SHAPE_ROUND != screenShape){ // Venu sq
- offsetY = -1;
+// } else if (System.SCREEN_SHAPE_ROUND != screenShape){ // Venu sq
+// offsetY = -1;
} else if (width==240 and dc.getTextDimensions("100",0)[1]>=26){ // Fenix 5 Plus
offsetY = -1;
}
@@ -1154,25 +1213,77 @@ class MtbA_functions {
dc.drawText(xText, yText, fontSize, elevationStr + unit, Graphics.TEXT_JUSTIFY_LEFT); // Elevation in m or mi
}
+/* ------------------------ */
+
+ // Draw Atmospheric Pressure
+ function drawPressure(dc, xIcon, yIcon, xText, yText, width) {
+
+ //var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
+ var pressure=null;
+ //var unit= "";
+
+ if (Storage.getValue(20)==true){ //Athmospheric Pressure Type
+ if (check[18]) {
+ if(Activity.getActivityInfo().meanSeaLevelPressure!=null){
+ pressure = Activity.getActivityInfo().meanSeaLevelPressure;
+ }
+ }
+ } else {
+ if (check[19]) {
+ //elevation = Activity.getActivityInfo().altitude;
+ if(Activity.getActivityInfo().ambientPressure!=null){
+ //System.println(Activity.getActivityInfo().ambientPressure);
+ //System.println(Activity.getActivityInfo().meanSeaLevelPressure );
+ pressure = Activity.getActivityInfo().ambientPressure;
+ }
+ }
+ }
+
+ var offset = 0;
+ if (width>=360) { // Venu & D2 Air
+ offset = 7;
+ } else if (System.SCREEN_SHAPE_ROUND != screenShape){ // Venu sq
+ offset = -2;
+ }
+
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ if (pressure!=null){
+ if(pressure<100914.4) {
+ dc.setColor(0xFFAA55, Graphics.COLOR_TRANSPARENT); // Violet 0xAA55FF
+ } else if (pressure>102268.9){
+ dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT); // Light blue 0x00FFFF 0x55AAFF
+ }
+ }
+ dc.drawText( xIcon, yIcon + offset , IconsFont, "@", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
+
+ // Pressure Text
+ if (pressure != null) {
+ pressure = pressure / 100;
+ pressure = pressure.format("%.0f");
+ //unit = " hPa";
+ } else{
+ pressure = "";
+ }
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ dc.drawText(xText, yText, fontSize, pressure /*+ unit*/, Graphics.TEXT_JUSTIFY_LEFT); // pressure in hPa
+ }
+
+
/* ------------------------ */
// Draw Precipitation Percentage
function drawPrecipitation(dc, xIcon, yIcon, xText, yText, width) {
- //var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
- var IconsFont = Application.loadResource(Rez.Fonts.HumidityFont);
+ //var IconsFont = Application.loadResource(Rez.Fonts.HumidityFont);
var precipitation=0;
- if (Toybox has :Weather and Weather has :getCurrentConditions) {
- if (Weather.getCurrentConditions()!=null){
+ if (check[1] and check[2]) {
if (Weather.getCurrentConditions().precipitationChance!=null){
precipitation = Weather.getCurrentConditions().precipitationChance;//.toString();
} else {
return false;
}
- } else {
- return false;
- }
} else {
return false;
}
@@ -1192,38 +1303,87 @@ class MtbA_functions {
offset = 7;
}
- var precipitationZone = null;
+ var precipitationIconColour;
if (precipitation >= 90) { // Very High
- precipitationZone = 4;
+ precipitationIconColour = 0xAA55FF; // Violet
} else if (precipitation >= 60) { // High
- precipitationZone = 3;
+ precipitationIconColour = 0x0055FF; // Dark Blue
} else if (precipitation >= 30) { // Moderate
- precipitationZone = 2;
+ precipitationIconColour = Graphics.COLOR_BLUE; // Blue
} else if (precipitation > 0) { // Low
- precipitationZone = 1;
+ precipitationIconColour = 0x00FFFF; // Light blue
} else { // Not existent
- precipitationZone = 0;
- }
-
- var precipitationIconColour = Graphics.COLOR_BLACK;
-
- if (precipitationZone == 0) { // Not existent
precipitationIconColour = Graphics.COLOR_LT_GRAY;
- } else if (precipitationZone == 1) { // Low
- precipitationIconColour = 0x00FFFF; // Light blue
- } else if (precipitationZone == 2) { // Moderate
- precipitationIconColour = Graphics.COLOR_BLUE; // Blue
- } else if (precipitationZone == 3) { // High
- precipitationIconColour = 0x0055FF; // Dark Blue
- } else if (precipitationZone == 4) { // Very High
- precipitationIconColour = 0xAA55FF; // Violet
- }
+ }
dc.setColor(precipitationIconColour, Graphics.COLOR_TRANSPARENT);
dc.drawText( xIcon, yIcon + offset , IconsFont, "S", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- dc.drawText( xText - offset , yText , fontSize, Lang.format("$1$%",[precipitation]), Graphics.TEXT_JUSTIFY_LEFT);
+ dc.drawText( xText - offset , yText , fontSize, precipitation + "%", Graphics.TEXT_JUSTIFY_LEFT);
+
+ return true;
+ }
+
+/* ------------------------ */
+
+ // Draw Min and Max Temperatures
+ function drawMinMaxTemp(dc, xIcon, yIcon, xText, yText, width) {
+
+ //var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
+ var minTemp as Number, maxTemp as Number;
+ var TempMetric = System.getDeviceSettings().temperatureUnits;
+ var fahrenheit;
+ var units = "";
+
+ if (check[1] and check[2]) {
+ if (Weather.getCurrentConditions()!=null){
+ if (Weather.getCurrentConditions().lowTemperature!=null and Weather.getCurrentConditions().highTemperature!=null){
+ minTemp = Weather.getCurrentConditions().lowTemperature.toString();
+ maxTemp = Weather.getCurrentConditions().highTemperature.toString();
+ } else { return false; }
+ } else { return false; }
+ } else {
+ return false;
+ }
+
+ if (TempMetric == System.UNIT_METRIC or Storage.getValue(16)==true) { //Celsius
+ units = "°C";
+ } else {
+ minTemp = (minTemp * 9/5) + 32;
+ maxTemp = (maxTemp * 9/5) + 32;
+ //temp = Lang.format("$1$", [temp.format("%d")] );
+ units = "°F";
+ }
+
+ var offset = 0;
+ if (width>=360) { // Venu & D2 Air
+ offset = 7;
+ } else if (System.SCREEN_SHAPE_ROUND != screenShape) { // Venu sq
+ offset = -2;
+ } else if (width==240 and dc.getTextDimensions("100",0)[1]>=26){ //Fenix 5 Plus
+ offset = -1;
+ }
+
+ //precipitationIconColour = 0x00FFFF; // Light blue
+ //precipitationIconColour = 0xAA55FF; // Violet
+
+ if (width>=360){ //AMOLED
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ } else { // MIP, for better readability
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ }
+ dc.drawText( xIcon, yIcon + offset , IconsFont, ".", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
+
+ dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT); // Light Blue 0x00FFFF / 0x55AAFF
+ dc.drawText( xText, yText , fontSize, minTemp, Graphics.TEXT_JUSTIFY_LEFT); //Lang.format("$1$%",[precipitation])
+
+ dc.setColor(0xFFAA55, Graphics.COLOR_TRANSPARENT); // Purple 0xAA55FF
+ dc.drawText( xText + dc.getTextWidthInPixels(minTemp+"/",fontSize) , yText , fontSize, maxTemp, Graphics.TEXT_JUSTIFY_LEFT); //Lang.format("$1$%",[precipitation])
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ dc.drawText( xText + dc.getTextWidthInPixels(minTemp,fontSize), yText , fontSize, "/", Graphics.TEXT_JUSTIFY_LEFT); //Lang.format("$1$%",[precipitation])
+ dc.drawText( xText + dc.getTextWidthInPixels(minTemp+"/"+maxTemp,fontSize), yText , fontSize, units, Graphics.TEXT_JUSTIFY_LEFT); //Lang.format("$1$%",[precipitation])
return true;
}
@@ -1236,19 +1396,15 @@ class MtbA_functions {
//var IconsFont = Application.loadResource(Rez.Fonts.IconsFont);
var humidity=0;
- if (Toybox has :Weather and Weather has :getCurrentConditions) {
- if (Weather.getCurrentConditions() != null){
- if (Weather.getCurrentConditions().relativeHumidity != null){
- humidity = Weather.getCurrentConditions().relativeHumidity;//.toString();
- } else {
- return false;
- }
- } else {
- return false;
- }
+ if (check[1] and check[2]) {
+ if (Weather.getCurrentConditions().relativeHumidity != null){
+ humidity = Weather.getCurrentConditions().relativeHumidity;//.toString();
} else {
return false;
- }
+ }
+ } else {
+ return false;
+ }
var offsetY = 0;
if (width>=360) { // Venu & D2 Air
@@ -1274,7 +1430,7 @@ class MtbA_functions {
dc.setColor(0xFFFF55, Graphics.COLOR_TRANSPARENT); // Yellow
} else { // Healthy
if (accentColor == 0xAAFF00) {
- dc.setColor(0xAAFF00, Graphics.COLOR_TRANSPARENT); /* Vivomove GREEN */
+ dc.setColor(0xAAFF00, Graphics.COLOR_TRANSPARENT); /* Vivomove GREEN */
} else {
dc.setColor(0x55FF00, Graphics.COLOR_TRANSPARENT); // Green
}
@@ -1282,9 +1438,9 @@ class MtbA_functions {
dc.drawText( xIcon, yIcon + offsetY , IconsFont, "A", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- dc.drawText( xText , yText , fontSize, Lang.format("$1$%",[humidity]), Graphics.TEXT_JUSTIFY_LEFT);
+ dc.drawText( xText , yText , fontSize, humidity + "%", Graphics.TEXT_JUSTIFY_LEFT);
return true;
- }
+ }
/* ------------------------ */
@@ -1299,115 +1455,66 @@ class MtbA_functions {
var unit;
var windIconColour = Graphics.COLOR_DK_GRAY;
- if (Toybox has :Weather and Weather has :getCurrentConditions) {
- if (Weather.getCurrentConditions() != null){
- if (Weather.getCurrentConditions().windSpeed != null and Weather.getCurrentConditions().windBearing != null){
- windSpeed = Weather.getCurrentConditions().windSpeed;//.toString();
- windBearing = Weather.getCurrentConditions().windBearing;//.toString();
-
- var beaufortZone = null;
-
- if (windSpeed >= 32.7) { // Hurricane Force
- beaufortZone = 12;
- } else if (windSpeed >= 28.5) { // Violent Storm
- beaufortZone = 11;
- } else if (windSpeed >= 24.5) { // Storm
- beaufortZone = 10;
- } else if (windSpeed >= 20.8) { // Strong Gale
- beaufortZone = 9;
- } else if (windSpeed >= 17.2) { // Gale
- beaufortZone = 8;
- } else if (windSpeed >= 13.9) { // Near Gale
- beaufortZone = 7;
- } else if (windSpeed >= 10.8) { // Strong Breeze
- beaufortZone = 6;
- } else if (windSpeed >= 8) { // Fresh Breeze
- beaufortZone = 5;
- } else if (windSpeed >= 5.5) { // Moderate Breeze
- beaufortZone = 4;
- } else if (windSpeed >= 3.4) { // Gentle Breeze
- beaufortZone = 3;
- } else if (windSpeed >= 1.6) { // Light Breeze
- beaufortZone = 2;
- } else if (windSpeed >= 0.5) { // Light Air
- beaufortZone = 1;
- } else { // Calm
- beaufortZone = 0;
- }
-
- if (beaufortZone == 0) { // Calm
- //windIconColour = 0x55AAAA;
- windIconColour = 0xFFFFFF;
- } else if (beaufortZone == 1) { // Light Air
- //windIconColour = 0x55FFFF;
- windIconColour = 0xAAFFFF;
- } else if (beaufortZone == 2) { // Light Breeze
- //windIconColour = 0x00AAFF;
- windIconColour = 0x55FFFF;
- } else if (beaufortZone == 3) { // Gentle Breeze
- //windIconColour = 0x55AA00;
- windIconColour = 0xAAFFAA;
- } else if (beaufortZone == 4) { // Moderate Breeze
- //windIconColour = 0x55FF00;
- windIconColour = 0x55FFAA;
- } else if (beaufortZone == 5){ // Fresh Breeze
- //windIconColour = 0xAAFF00;
- windIconColour = 0x00FF55;
- } else if (beaufortZone == 6){ // Strong Breeze
- //windIconColour = 0xAAFFAA;
- windIconColour = 0x55FF00;
- } else if (beaufortZone == 7){ // Near Gale
- //windIconColour = 0xFFFFAA;
- windIconColour = 0xAAFF00;
- } else if (beaufortZone == 8){ // Gale
- //windIconColour = 0xFFFF00;
- windIconColour = 0xFFAA55;
- } else if (beaufortZone == 9){ // Strong Gale
- windIconColour = 0xFFAA00;
- } else if (beaufortZone == 10){ // Storm
- //windIconColour = 0xFFAAAA;
- windIconColour = 0xFF5500;
- } else if (beaufortZone == 11){ // Violent Storm
- //windIconColour = 0xFF5500;
- windIconColour = 0xFF0000;
- } else if (beaufortZone == 12){ // Hurricane Force
- //windIconColour = 0xFF0000;
- windIconColour = 0xAA0000;
- }
-
- if (windBearing >= 335 or windBearing < 25) {
- letter = "N";
- } else if (windBearing >= 25 and windBearing < 65) {
- letter = "NE";
- } else if (windBearing >= 65 and windBearing < 115) {
- letter = "E";
- } else if (windBearing >= 115 and windBearing < 155) {
- letter = "SE";
- } else if (windBearing >= 155 and windBearing < 205) {
- letter = "S";
- } else if (windBearing >= 205 and windBearing < 245) {
- letter = "SW";
- } else if (windBearing >= 245 and windBearing < 295) {
- letter = "W";
- } else if (windBearing >= 295 and windBearing < 335) {
- letter = "NW";
- } else {
- IconsFont = Application.loadResource(Rez.Fonts.HumidityFont);
- letter = "P";
- }
- if (letter.length()==2 and (width>260 or System.SCREEN_SHAPE_ROUND != screenShape)) {
- xIcon = xIcon - 2;
- }
- }
- }
+ if (check[1] and check[2] and Weather.getCurrentConditions() != null and Weather.getCurrentConditions().windSpeed != null and Weather.getCurrentConditions().windBearing != null) {
+ windSpeed = Weather.getCurrentConditions().windSpeed;//.toString();
+ windBearing = Weather.getCurrentConditions().windBearing;//.toString();
+
+ if (windSpeed >= 32.7) { // Hurricane Force
+ windIconColour = 0xAA0000;
+ } else if (windSpeed >= 28.5) { // Violent Storm
+ windIconColour = 0xFF0000;
+ } else if (windSpeed >= 24.5) { // Storm
+ windIconColour = 0xFF5500;
+ } else if (windSpeed >= 20.8) { // Strong Gale
+ windIconColour = 0xFFAA00;
+ } else if (windSpeed >= 17.2) { // Gale
+ windIconColour = 0xFFAA55;
+ } else if (windSpeed >= 13.9) { // Near Gale
+ windIconColour = 0xAAFF00;
+ } else if (windSpeed >= 10.8) { // Strong Breeze
+ windIconColour = 0x55FF00;
+ } else if (windSpeed >= 8) { // Fresh Breeze
+ windIconColour = 0x00FF55;
+ } else if (windSpeed >= 5.5) { // Moderate Breeze
+ windIconColour = 0x55FFAA;
+ } else if (windSpeed >= 3.4) { // Gentle Breeze
+ windIconColour = 0xAAFFAA;
+ } else if (windSpeed >= 1.6) { // Light Breeze
+ windIconColour = 0x55FFFF;
+ } else if (windSpeed >= 0.5) { // Light Air
+ windIconColour = 0xAAFFFF;
+ } else { // Calm
+ windIconColour = 0xFFFFFF;
+ }
+
+ if (windBearing >= 335 or windBearing < 25) {
+ letter = "N";
+ } else if (windBearing >= 25 and windBearing < 65) {
+ letter = "NE";
+ } else if (windBearing >= 65 and windBearing < 115) {
+ letter = "E";
+ } else if (windBearing >= 115 and windBearing < 155) {
+ letter = "SE";
+ } else if (windBearing >= 155 and windBearing < 205) {
+ letter = "S";
+ } else if (windBearing >= 205 and windBearing < 245) {
+ letter = "SW";
+ } else if (windBearing >= 245 and windBearing < 295) {
+ letter = "W";
+ } else if (windBearing >= 295 and windBearing < 335) {
+ letter = "NW";
+ } else {
+ letter = "P";
+ }
+ if (letter.length()==2 and (width>260 or System.SCREEN_SHAPE_ROUND != screenShape)) {
+ xIcon = xIcon - 2;
+ }
}
dc.setColor(windIconColour, Graphics.COLOR_TRANSPARENT);
//System.println(windBearing);
//dc.drawText( xIcon, yIcon + offset, IconsFont, "P", Graphics.TEXT_JUSTIFY_CENTER); // Icon Using Font
- IconsFont = Graphics.FONT_TINY;
-
if (width==360) { // Venu 2s
xIcon = xIcon -1;
} else if (width==280) { // Fenix 6X & Enduro
@@ -1421,7 +1528,7 @@ class MtbA_functions {
}
if (letter != null){
- dc.drawText( xIcon , yIcon, IconsFont, letter, Graphics.TEXT_JUSTIFY_CENTER); // Icon Using Font
+ dc.drawText( xIcon , yIcon, Graphics.FONT_TINY, letter, Graphics.TEXT_JUSTIFY_CENTER); // Icon Using Font
}
// Wind Speed Text
@@ -1444,11 +1551,10 @@ class MtbA_functions {
}
if (windSpeed != null){
- var windStr = Lang.format("$1$", [Math.round(windSpeed).format("%.0f")] );
+ var windStr = Math.round(windSpeed).format("%.0f");
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
dc.drawText(xText , yText, fontSize, windStr + unit, Graphics.TEXT_JUSTIFY_LEFT); // Wind Speed in km/h or mph
- }
-
+ }
}
/* ------------------------ */
@@ -1456,55 +1562,34 @@ class MtbA_functions {
// Draw Solar Intensity
function drawSolarIntensity(dc, xIcon, yIcon, xText, yText, width, accentColor) {
- var IconsFont = Application.loadResource(Rez.Fonts.HumidityFont);
var solarIntensity=0;
- if (System.getSystemStats() has :solarIntensity) {
- if (System.getSystemStats().solarIntensity != null) {
- solarIntensity = System.getSystemStats().solarIntensity;//.toString();
- } else {
- return false;
- }
+ if (check[8] and System.getSystemStats().solarIntensity != null) {
+ solarIntensity = System.getSystemStats().solarIntensity;//.toString();
} else {
return false;
}
- var solarZone = null;
+ var solarIconColour = null;
if (solarIntensity >= 80) { // Extreme
- solarZone = 5;
+ solarIconColour = 0xAA55FF;
} else if (solarIntensity >= 60) { // Very High
- solarZone = 4;
+ solarIconColour = Graphics.COLOR_RED;
} else if (solarIntensity >= 40) { // High
- solarZone = 3;
+ solarIconColour = 0xFFAA00;
} else if (solarIntensity >= 20) { // Moderate
- solarZone = 2;
+ solarIconColour = 0xFFFF55;
} else if (solarIntensity > 0) { // Low
- solarZone = 1;
- } else { // Not existent
- solarZone = 0;
- }
-
- var solarIconColour = Graphics.COLOR_DK_GRAY;
-
- if (solarZone == 0) { // Not existent
- solarIconColour = Graphics.COLOR_LT_GRAY;
- } else if (solarZone == 1) { // Low
if (accentColor == 0xAAFF00) {
solarIconColour = 0xAAFF00; /* Vivomove GREEN */
} else {
solarIconColour = 0x55FF00; /* GREEN */
}
- } else if (solarZone == 2) { // Moderate
- solarIconColour = 0xFFFF55;
- } else if (solarZone == 3) { // High
- solarIconColour = 0xFFAA00;
- } else if (solarZone == 4) { // Very High
- solarIconColour = Graphics.COLOR_RED;
- } else if (solarZone == 5){ // Extreme
- solarIconColour = 0xAA55FF;
- }
-
+ } else { // Not existent
+ solarIconColour = Graphics.COLOR_LT_GRAY;
+ }
+
var offsetY = 0;
if (width==280 or width==240) { // Fenix 6X & Enduro
offsetY = -2;
@@ -1515,9 +1600,9 @@ class MtbA_functions {
dc.setColor(solarIconColour, Graphics.COLOR_TRANSPARENT);
dc.drawText( xIcon, yIcon + offsetY , IconsFont, "R", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
- dc.drawText( xText , yText , fontSize, Lang.format("$1$%",[solarIntensity]), Graphics.TEXT_JUSTIFY_LEFT);
+ dc.drawText( xText , yText , fontSize, solarIntensity + "%", Graphics.TEXT_JUSTIFY_LEFT);
return true;
- }
+ }
/* ------------------------ */
@@ -1565,7 +1650,7 @@ class MtbA_functions {
function drawIntensityMin(dc, xIcon, yIcon, xText, yText, width, accentColor) {
var intensity=0;
- if (ActivityMonitor.getInfo() has :activeMinutesWeek) {
+ if (ActivityMonitor.getInfo().activeMinutesWeek.total != null and ActivityMonitor.getInfo().activeMinutesWeekGoal!=null) {
intensity = ActivityMonitor.getInfo().activeMinutesWeek.total;//.toString();
} else {
return false;
@@ -1584,10 +1669,11 @@ class MtbA_functions {
if (width==240 and System.SCREEN_SHAPE_ROUND == screenShape){
yIcon = yIcon - 1;
+ if (dc.getTextDimensions("100",0)[1]>=26){
+ yIcon = yIcon - 1;
+ }
} else if (width==218){
yIcon = yIcon + 1;
- } else if (width==240 and dc.getTextDimensions("100",0)[1]>=26){
- yIcon = yIcon - 1;
}
dc.drawText( xIcon, yIcon, IconsFont, "B", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
@@ -1598,10 +1684,208 @@ class MtbA_functions {
return true;
}
+/* ------------------------ */
+
+ function drawBodyBattery(dc, xIcon, yIcon, xText, yText, width) {
+
+ var offset = 0;
+ if (width>=360) { // Venu & D2 Air
+ offset = 7;
+ } else if (System.SCREEN_SHAPE_ROUND != screenShape) { // Venu sq
+ offset = -2;
+ } else if (width==240 and dc.getTextDimensions("100",0)[1]>=26){ //Fenix 5 Plus
+ offset = -1;
+ }
+
+ // Body Battery
+ if (check[15]){ //check[15]
+ var bbIterator = Toybox.SensorHistory.getBodyBatteryHistory({:period=>1});
+ var sample = bbIterator.next();
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ if (sample != null) {
+ dc.drawText(xText, yText, fontSize, sample.data.format("%d"), Graphics.TEXT_JUSTIFY_LEFT);
+ //dc.drawText(xText, yText, fontSize, Lang.format("$1$",[sample.data.format("%02d")]), Graphics.TEXT_JUSTIFY_LEFT);
+ dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT);
+ } else{
+ dc.drawText(xText, yText, fontSize, "---", Graphics.TEXT_JUSTIFY_LEFT);
+ if (width==360 or width==390 or width==416){ //AMOLED
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ } else { // MIP displays, for better readability
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ }
+ }
+ } else { return false; }
+
+ dc.drawText( xIcon, yIcon + offset , IconsFont, "U", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
+ return true;
+
+ }
+
+/* ------------------------ */
+
+ function drawStress(dc, xIcon, yIcon, xText, yText, width) {
+
+ var offsetY = 0;
+ if (width>=360) { // Fenix 6X & Enduro
+ offsetY = 1;
+ } else if (width==260){
+ offsetY = -0.5;
+ }
+
+ // Stress
+ if (check[13]){ //if (check[13]){
+ var stressIterator = Toybox.SensorHistory.getStressHistory({:period=>1});
+ var sample = stressIterator.next();
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ if (sample != null) {
+ dc.drawText(xText, yText, fontSize, sample.data.format("%d"), Graphics.TEXT_JUSTIFY_LEFT);
+ if (sample.data<=25) {
+ dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT);
+ } else if (sample.data<=50){
+ dc.setColor(0xFFFF55, Graphics.COLOR_TRANSPARENT);
+ } else if (sample.data<=75){
+ dc.setColor(Graphics.COLOR_ORANGE, Graphics.COLOR_TRANSPARENT);
+ } else { //between 76 and 100
+ dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
+ }
+ } else{
+ dc.drawText(xText, yText, fontSize, "---", Graphics.TEXT_JUSTIFY_LEFT);
+ if (width==360 or width==390 or width==416){ //AMOLED
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ } else { // MIP displays, for better readability
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ }
+ }
+ } else { return false; }
+
+ dc.drawText( xIcon, yIcon + offsetY , IconsFont, "T", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
+ return true;
+ }
+
+/* ------------------------ */
+ // Add Vo2 Max - vo2maxRunning and vo2maxCycling from UserProfile.getProfile()
+
+ function drawVO2Max(dc, xIcon, yIcon, xText, yText, width, cycle) {
+
+ var text = null;
+
+ if (check[3]) {
+ if (UserProfile.getProfile().vo2maxRunning!=null) {
+ text = UserProfile.getProfile().vo2maxRunning;
+ } else if (UserProfile.getProfile().vo2maxCycling!=null) {
+ text = UserProfile.getProfile().vo2maxCycling;
+ }
+ } else { return false; }
+
+ if(width==280 or width==240){ //Fenix 6X & Enduro
+ yIcon=yIcon-5;
+ } else if (width==260){
+ yIcon=yIcon-4;
+ } else if (width==218){
+ yIcon=yIcon-3;
+ } else if (width==360){
+ yIcon=yIcon-1;
+ }
+
+ if (text<=30){ // Very Poor
+ dc.setColor(Graphics.COLOR_RED, Graphics.COLOR_TRANSPARENT);
+ } else if (text<=34){ // Poor
+ dc.setColor(Graphics.COLOR_ORANGE, Graphics.COLOR_TRANSPARENT);
+ } else if (text<=39){ // Fair
+ dc.setColor(0xAAFF00, Graphics.COLOR_TRANSPARENT);
+ } else if (text<=44){ // Good
+ if (width>=360) {
+ dc.setColor(0xAAFF00, Graphics.COLOR_TRANSPARENT); /* Vivomove GREEN */
+ } else {
+ dc.setColor(0x55FF00, Graphics.COLOR_TRANSPARENT); /* GREEN */
+ }
+ } else if (text<=48){ // Excellent
+ dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_TRANSPARENT); // Blue or Graphics.COLOR_BLUE
+ } else { // Superior
+ dc.setColor(0xAA55FF, Graphics.COLOR_TRANSPARENT); // Purple or 0xAA55FF
+ }
+ dc.drawText( xIcon, yIcon, IconsFont, "X", Graphics.TEXT_JUSTIFY_CENTER);
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ dc.drawText( xText, yText, fontSize, text.format("%d"), Graphics.TEXT_JUSTIFY_LEFT);
+
+ return true;
+ }
+
+/* ------------------------ */
+ // Add respiration Rate (breaths per minute) - respirationRate from ActivityMonitor.getInfo()
+ function drawRespiration(dc, xIcon, yIcon, xText, yText, accentColor, width) {
+
+ var text=null;
+
+ if (check[14]) {// if (check[14]) {
+ text = ActivityMonitor.getInfo().respirationRate;
+ } else { return false; }
+
+ // Text
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ dc.drawText( xText, yText, fontSize, text, Graphics.TEXT_JUSTIFY_LEFT);
+
+ if(width==280 or width==240){ //Fenix 6X & Enduro
+ yIcon=yIcon-5;
+ } else if (width==260){
+ yIcon=yIcon-4;
+ } else if (width==218){
+ yIcon=yIcon-3;
+ }
+
+ // Icon
+ if (width==360 or width==390 or width==416){ //AMOLED
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ } else { // MIP displays, for better readability
+ dc.setColor( (accentColor==Graphics.COLOR_WHITE ? Graphics.COLOR_LT_GRAY : Graphics.COLOR_WHITE), Graphics.COLOR_TRANSPARENT); // if accent color is white and notification is zero, then icon color is gray
+ }
+ dc.drawText( xIcon, yIcon, IconsFont, "W", Graphics.TEXT_JUSTIFY_CENTER);
+ return true;
+
+ }
+
+/* ------------------------ */
+
+ // Add Recovery Time (hours) - timeToRecovery from ActivityMonitor.getInfo()
+ function drawRecoveryTime(dc, xIcon, yIcon, xText, yText, width) {
+
+ var recovery = null;
+ if (check[17]){
+ recovery = ActivityMonitor.getInfo().timeToRecovery ;
+ }
+
+ var offset = 0;
+ if (width>=360) { // Venu & D2 Air
+ offset = 6;
+ } else if (System.SCREEN_SHAPE_ROUND != screenShape) { //check if rectangle display
+ offset = -2;
+ }
+
+ if (recovery == null) {
+ return false;
+ } else {
+ if (width==360 or width==390 or width==416){ //AMOLED
+ dc.setColor(Graphics.COLOR_LT_GRAY, Graphics.COLOR_TRANSPARENT);
+ } else { // MIP displays, for better readability
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ }
+
+ dc.drawText( xIcon, yIcon + offset , IconsFont, "V", Graphics.TEXT_JUSTIFY_CENTER); // Using Font
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_TRANSPARENT);
+ dc.drawText( xText, yText , fontSize, (recovery>=10 ? recovery.format("%.0f") : recovery.format("%.1f")) + " hs", Graphics.TEXT_JUSTIFY_LEFT); //Lang.format("$1$", [recovery.format("%.1f")] )
+ return true;
+ }
+
+ }
+
/* ------------------------ */
// Draw Right Data Points
- function drawRightPoints(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset, dataPoint) { // 0=humidityIcon, 1=precipitationIcon, 2=caloriesIcon, 3=floorsClimbIcon, 4=pulseOxIcon, 5=heartRateIcon, 6=notificationIcon, 7=solarIcon, 8=none
+ function drawRightPoints(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset, dataPoint) {
var offset390=0;
@@ -1617,23 +1901,38 @@ class MtbA_functions {
drawHumidity(dc, xIcon+(xIcon*0.005), yIcon, xText-(xText*0.002), yText, width, accentColor);
} else if (dataPoint == 2) { // Precipitation(dc, xIcon, yIcon, xText, yText, width)
drawPrecipitation(dc, xIcon+(xIcon*0.0125)+offset390, yIcon-(xIcon*0.001)+(offset390*2), xText+(xText*0.025)-(offset390*2), yText, width);
- } else if (dataPoint == 3) { // Calories(dc, xIcon, yIcon, xText, yText, width)
+ } else if (dataPoint == 3) { // elevationIcon(dc, xIcon, yIcon, xText, yText, width)
+ drawPressure(dc, xIcon, yIcon, xText+(xText*0.01)-offset390, yText, width);
+ } else if (dataPoint == 4) { // Calories(dc, xIcon, yIcon, xText, yText, width)
drawCalories(dc, xIcon+(offset390*2), yIcon, xText, yText, width);
- } else if (dataPoint == 4) { // FloorsClimbed(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ } else if (dataPoint == 5) { // FloorsClimbed(dc, xIcon, yIcon, xText, yText, width, accentColor)
drawFloorsClimbed(dc, xIcon-(xIcon*0.002), yIcon-(xIcon*0.001), xText, yText, width, accentColor);
- } else if (dataPoint == 5) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
- drawPulseOx(dc, xIcon, yIcon+(xIcon*0.002), xText-offset390, yText, width, accentColor);
- } else if (dataPoint == 6) { // HeartRate(dc, xIcon, hrIconY, xText, width, Xoffset, accentColor)
+ } else if (dataPoint == 6) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawPulseOx(dc, xIcon, yIcon, xText-offset390, yText, width, accentColor);
+ } else if (dataPoint == 7) { // HeartRate(dc, xIcon, hrIconY, xText, width, Xoffset, accentColor)
drawHeartRate(dc, xIcon-(xIcon*0.005), yIcon+(xIcon*0.03)-offset390, xText, width, accentColor);
- } else if (dataPoint == 7) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ } else if (dataPoint == 8) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
drawNotification(dc, xIcon-(xIcon*0.002), yIcon+(xIcon*0.03)-offset390, xText, yText, accentColor, width);
- } else if (dataPoint == 8) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
+ } else if (dataPoint == 9) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
drawSolarIntensity(dc, xIcon, yIcon, xText, yText, width, accentColor);
- } else if (dataPoint == 9) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
- drawSeconds(dc, xIcon, yIcon+(xIcon*0.025)-(offset390*2), xText, yText, width);
} else if (dataPoint == 10) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
+ drawSeconds(dc, xIcon, yIcon+(xIcon*0.025)-(offset390*2), xText, yText, width);
+ } else if (dataPoint == 11) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
drawIntensityMin(dc, xIcon-(xIcon*0.002), yIcon+(xIcon*0.025)-(offset390*2), xText, yText, width, accentColor);
+ } else if (dataPoint == 12) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawBodyBattery(dc, xIcon+2, yIcon-1, xText+(xText*0.01), yText, width);
+ } else if (dataPoint == 13) { // Calories(dc, xIcon, yIcon, xText, yText, width)
+ drawStress(dc, xIcon-(xIcon*0.002), yIcon+4, xText, yText, width);
+ } else if (dataPoint == 14) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawRespiration(dc, xIcon-(xIcon*0.002), yIcon+(xIcon*0.03)-offset390, xText, yText, accentColor, width);
+ } else if (dataPoint == 15) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawRecoveryTime(dc, xIcon, yIcon+(xIcon*0.002), xText-offset390, yText, width);
+ } else if (dataPoint == 16) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawVO2Max(dc, xIcon-(xIcon*0.002), yIcon+(xIcon*0.03)-offset390, xText, yText, width, false); // run
+ } else if (dataPoint == 17) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawVO2Max(dc, xIcon-(xIcon*0.002), yIcon+(xIcon*0.03)-offset390, xText, yText, width, true); //cycling
}
+
}
/* ------------------------ */
@@ -1653,22 +1952,36 @@ class MtbA_functions {
drawHumidity(dc, xIcon+(xIcon*0.02), yIcon, xText-offset390, yText, width, accentColor);
} else if (dataPoint == 2) { // Precipitation(dc, xIcon, yIcon, xText, yText, width)
drawPrecipitation(dc, xIcon+(xIcon*0.05)+offset390, yIcon+offset390, xText+(xText*0.09)-offset390, yText, width);
- } else if (dataPoint == 3) { // Calories(dc, xIcon, yIcon, xText, yText, width)
+ } else if (dataPoint == 3) { // elevationIcon(dc, xIcon, yIcon, xText, yText, width)
+ drawPressure(dc, xIcon, yIcon, xText+(xText*0.01)-offset390, yText, width);
+ } else if (dataPoint == 4) { // Calories(dc, xIcon, yIcon, xText, yText, width)
drawCalories(dc, xIcon+(offset390*2), yIcon+(xIcon*0.01), xText, yText, width);
- } else if (dataPoint == 4) { // FloorsClimbed(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ } else if (dataPoint == 5) { // FloorsClimbed(dc, xIcon, yIcon, xText, yText, width, accentColor)
drawFloorsClimbed(dc, xIcon-(xIcon*0.015), yIcon-offset390, xText+(xText*0.015)-offset390, yText, width, accentColor);
- } else if (dataPoint == 5) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
- drawPulseOx(dc, xIcon, yIcon+(xIcon*0.015), xText+(xText*0.01)-offset390, yText, width, accentColor);
- } else if (dataPoint == 6) { // HeartRate(dc, xIcon, hrIconY, xText, width, Xoffset, accentColor)
+ } else if (dataPoint == 6) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawPulseOx(dc, xIcon+(xIcon*0.015), yIcon, xText+(xText*0.01)-offset390, yText, width, accentColor);
+ } else if (dataPoint == 7) { // HeartRate(dc, xIcon, hrIconY, xText, width, Xoffset, accentColor)
drawHeartRate(dc, xIcon-(xIcon*0.02), yIcon+(xIcon*0.125), xText+(xText*0.01), width, accentColor);
- } else if (dataPoint == 7) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ } else if (dataPoint == 8) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
drawNotification(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, accentColor, width);
- } else if (dataPoint == 8) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
+ } else if (dataPoint == 9) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
drawSolarIntensity(dc, xIcon, yIcon, xText, yText, width, accentColor);
- } else if (dataPoint == 9) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
- drawSeconds(dc, xIcon, yIcon+(xIcon*0.1)-offset390, xText, yText, width);
} else if (dataPoint == 10) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
+ drawSeconds(dc, xIcon, yIcon+(xIcon*0.1)-offset390, xText, yText, width);
+ } else if (dataPoint == 11) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
drawIntensityMin(dc, xIcon-(xIcon*0.005), yIcon+(xIcon*0.1)-offset390, xText, yText, width, accentColor);
+ } else if (dataPoint == 12) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawBodyBattery(dc, xIcon+2, yIcon-1, xText+(xText*0.01), yText, width);
+ } else if (dataPoint == 13) { // Calories(dc, xIcon, yIcon, xText, yText, width)
+ drawStress(dc, xIcon-(xIcon*0.002), yIcon+4, xText, yText, width);
+ } else if (dataPoint == 14) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawRespiration(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, accentColor, width);
+ } else if (dataPoint == 15) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawRecoveryTime(dc, xIcon, yIcon+(xIcon*0.015), xText+(xText*0.01)-offset390, yText, width);
+ } else if (dataPoint == 16) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawVO2Max(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, width, false); // run
+ } else if (dataPoint == 17) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawVO2Max(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, width, true); // cycling
}
}
@@ -1692,30 +2005,43 @@ class MtbA_functions {
drawElevation(dc, xIcon-(xIcon*0.015), yIcon-(xIcon*0.01), xText+(xText*0.015)-offset390, yText, width);
} else if (dataPoint == 3) { // windIcon(dc, xIcon, yIcon, xText, yText, width)
drawWindSpeed(dc, xIcon-offset390, yIcon+(xIcon*0.01)-offset390, xText, yText, width);
- } else if (dataPoint == 4) { // Humidity(dc, xIcon, yIcon, xText, yText, width)
+ } else if (dataPoint == 4) { // Calories(dc, xIcon, yIcon, xText, yText, width)
+ drawMinMaxTemp(dc, xIcon+(offset390*2), yIcon, xText+(xText*0.01), yText, width);
+ } else if (dataPoint == 5) { // Humidity(dc, xIcon, yIcon, xText, yText, width)
drawHumidity(dc, xIcon+(xIcon*0.02), yIcon-(xIcon*0.01), xText-offset390, yText, width, accentColor);
- } else if (dataPoint == 5) { // Precipitation(dc, xIcon, yIcon, xText, yText, width)
+ } else if (dataPoint == 6) { // Precipitation(dc, xIcon, yIcon, xText, yText, width)
drawPrecipitation(dc, xIcon+(xIcon*0.05)+offset390, yIcon-(xIcon*0.01)+(offset390*2), xText+(xText*0.09)-offset390, yText, width);
- } else if (dataPoint == 6) { // Calories(dc, xIcon, yIcon, xText, yText, width)
+ } else if (dataPoint == 7) { // elevationIcon(dc, xIcon, yIcon, xText, yText, width)
+ drawPressure(dc, xIcon, yIcon, xText+(xText*0.01)-offset390, yText, width);
+ } else if (dataPoint == 8) { // Calories(dc, xIcon, yIcon, xText, yText, width)
drawCalories(dc, xIcon+(offset390*2), yIcon, xText+(xText*0.01), yText, width);
- } else if (dataPoint == 7) { // FloorsClimbed(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ } else if (dataPoint == 9) { // FloorsClimbed(dc, xIcon, yIcon, xText, yText, width, accentColor)
drawFloorsClimbed(dc, xIcon-(xIcon*0.015), yIcon-(xIcon*0.015), xText+(xText*0.015)-offset390, yText, width, accentColor);
- } else if (dataPoint == 8) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ } else if (dataPoint == 10) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
drawPulseOx(dc, xIcon, yIcon, xText+(xText*0.01)-offset390, yText, width, accentColor);
- } else if (dataPoint == 9) { // HeartRate(dc, xIcon, hrIconY, xText, width, accentColor)
+ } else if (dataPoint == 11) { // HeartRate(dc, xIcon, hrIconY, xText, width, accentColor)
drawHeartRate(dc, xIcon-(xIcon*0.02), yIcon+(xIcon*0.115), xText+(xText*0.02), width, accentColor);
- } else if (dataPoint == 10) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ } else if (dataPoint == 12) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
drawNotification(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, accentColor, width);
- } else if (dataPoint == 11) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
+ } else if (dataPoint == 13) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
drawSolarIntensity(dc, xIcon, yIcon, xText, yText, width, accentColor);
- } else if (dataPoint == 12) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
+ } else if (dataPoint == 14) { // Seconds (dc, xIcon, yIcon, xText, yText, width)
drawSeconds(dc, xIcon, yIcon+(xIcon*0.085), xText, yText, width);
- } else if (dataPoint == 13) { // Intensity (dc, xIcon, yIcon, xText, yText, width)
+ } else if (dataPoint == 15) { // Intensity (dc, xIcon, yIcon, xText, yText, width)
drawIntensityMin(dc, xIcon-(xIcon*0.005), yIcon+(xIcon*0.085), xText, yText, width, accentColor);
- }
-
+ } else if (dataPoint == 16) { // Calories(dc, xIcon, yIcon, xText, yText, width)
+ drawBodyBattery(dc, xIcon+2, yIcon-1, xText+(xText*0.01), yText, width);
+ } else if (dataPoint == 17) { // SolarIntensity (dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawStress(dc, xIcon-(xIcon*0.002), yIcon+4, xText, yText, width);
+ } else if (dataPoint == 18) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawRespiration(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, accentColor, width);
+ } else if (dataPoint == 19) { // PulseOx(dc, xIcon, yIcon, xText, yText, width, accentColor)
+ drawRecoveryTime(dc, xIcon, yIcon, xText+(xText*0.01)-offset390, yText, width);
+ } else if (dataPoint == 20) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawVO2Max(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, width, false); //run
+ } else if (dataPoint == 21) { // Notification(dc, xIcon, yIcon, xText, yText, accentColor, width, Xoffset)
+ drawVO2Max(dc, xIcon-(xIcon*0.01), yIcon+(xIcon*0.12), xText, yText, width, true); // cycling
+ }
}
-
-
}
\ No newline at end of file