Skip to content

Commit 1daa8cd

Browse files
committed
Added support for new Edge, Forerunner and MARQ devices
1 parent 6d6ab8d commit 1daa8cd

File tree

8 files changed

+60
-23
lines changed

8 files changed

+60
-23
lines changed

Source/manifest.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
<iq:product id="edge1040"/>
1919
<iq:product id="edge520plus"/>
2020
<iq:product id="edge530"/>
21+
<iq:product id="edge540"/>
2122
<iq:product id="edge820"/>
2223
<iq:product id="edge830"/>
24+
<iq:product id="edge840"/>
2325
<iq:product id="edge_1000"/>
2426
<iq:product id="edge_520"/>
2527
<iq:product id="edgeexplore"/>
@@ -47,6 +49,8 @@
4749
<iq:product id="fr255m"/>
4850
<iq:product id="fr255s"/>
4951
<iq:product id="fr255sm"/>
52+
<iq:product id="fr265"/>
53+
<iq:product id="fr265s"/>
5054
<iq:product id="fr645"/>
5155
<iq:product id="fr645m"/>
5256
<iq:product id="fr735xt"/>
@@ -55,10 +59,13 @@
5559
<iq:product id="fr945"/>
5660
<iq:product id="fr945lte"/>
5761
<iq:product id="fr955"/>
62+
<iq:product id="fr965"/>
5863
<iq:product id="legacyherocaptainmarvel"/>
5964
<iq:product id="legacyherofirstavenger"/>
6065
<iq:product id="legacysagadarthvader"/>
6166
<iq:product id="legacysagarey"/>
67+
<iq:product id="marq2"/>
68+
<iq:product id="marq2aviator"/>
6269
<iq:product id="marqadventurer"/>
6370
<iq:product id="marqathlete"/>
6471
<iq:product id="marqaviator"/>

Source/monkey.jungle

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
project.manifest = manifest.xml
22
excludeBase=lowMemory;dataField;monochromeScreen
33

4+
project.optimization = 2
5+
project.typecheck = 0
6+
47
base.sourcePath = source;SmartBikeLights/Source/SmartBikeLights/source-common;source-generated
58

69
nonTouchScreen = $(excludeBase);touchScreen;noLightButtons
7-
rectangleNonTouchScreen = $(nonTouchScreen);round;hasGlance;highResolution
10+
rectangleNonTouchScreen = $(nonTouchScreen);round;highResolution
811
roundNonTouchScreen = $(nonTouchScreen);rectangle;highResolution
912
roundHighResolution = $(nonTouchScreen);rectangle;mediumResolution
1013
rectangleTouchScreen = $(excludeBase);nonTouchScreen;noLightButtons;round;settings;highResolution
@@ -15,12 +18,12 @@ round.excludeAnnotations = $(roundNonTouchScreen);hasGlance
1518
semiround.excludeAnnotations = $(roundNonTouchScreen);hasGlance
1619
base.excludeAnnotations = $(rectangle.excludeAnnotations)
1720

18-
# Rectangle non touch screen devices
19-
edge_520.excludeAnnotations = $(rectangleNonTouchScreen)
20-
edge520plus.excludeAnnotations = $(rectangleNonTouchScreen)
21-
edge530.excludeAnnotations = $(rectangleNonTouchScreen)
22-
venusq.excludeAnnotations = $(rectangleNonTouchScreen)
23-
venusqm.excludeAnnotations = $(rectangleNonTouchScreen)
21+
# Rectangle non touch screen devices without glance
22+
edge_520.excludeAnnotations = $(rectangleNonTouchScreen);hasGlance
23+
edge520plus.excludeAnnotations = $(rectangleNonTouchScreen);hasGlance
24+
edge530.excludeAnnotations = $(rectangleNonTouchScreen);hasGlance
25+
venusq.excludeAnnotations = $(rectangleNonTouchScreen);hasGlance
26+
venusqm.excludeAnnotations = $(rectangleNonTouchScreen);hasGlance
2427

2528
# High resolution watches without glance
2629
d2air.excludeAnnotations = $(roundHighResolution);hasGlance
@@ -32,30 +35,37 @@ d2airx10.excludeAnnotations = $(roundHighResolution);staticGlance
3235
descentmk2.excludeAnnotations = $(roundNonTouchScreen);staticGlance
3336
descentmk2s.excludeAnnotations = $(roundNonTouchScreen);staticGlance
3437
edge1040.excludeAnnotations = $(rectangleTouchScreen);staticGlance
38+
edge540.excludeAnnotations = $(rectangleNonTouchScreen);staticGlance
39+
edge840.excludeAnnotations = $(rectangleTouchScreen);staticGlance
3540
enduro.excludeAnnotations = $(roundNonTouchScreen);staticGlance
3641
epix2.excludeAnnotations = $(roundHighResolution);staticGlance
3742
fenix6pro.excludeAnnotations = $(roundNonTouchScreen);staticGlance
3843
fenix6spro.excludeAnnotations = $(roundNonTouchScreen);staticGlance
3944
fenix6xpro.excludeAnnotations = $(roundNonTouchScreen);staticGlance
45+
fenix7.excludeAnnotations = $(roundNonTouchScreen);staticGlance
46+
fenix7s.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4047
fenix7x.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4148
fr245m.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4249
fr255.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4350
fr255m.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4451
fr255s.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4552
fr255sm.excludeAnnotations = $(roundNonTouchScreen);staticGlance
53+
fr265.excludeAnnotations = $(roundHighResolution);staticGlance
54+
fr265s.excludeAnnotations = $(roundHighResolution);staticGlance
4655
fr745.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4756
fr945.excludeAnnotations = $(roundNonTouchScreen);staticGlance
48-
fr955.excludeAnnotations = $(roundNonTouchScreen);staticGlance
4957
fr945lte.excludeAnnotations = $(roundNonTouchScreen);staticGlance
58+
fr955.excludeAnnotations = $(roundNonTouchScreen);staticGlance
59+
fr965.excludeAnnotations = $(roundHighResolution);staticGlance
60+
marq2.excludeAnnotations = $(roundHighResolution);staticGlance
61+
marq2aviator.excludeAnnotations = $(roundHighResolution);staticGlance
5062
venu2.excludeAnnotations = $(roundHighResolution);staticGlance
5163
venu2plus.excludeAnnotations = $(roundHighResolution);staticGlance
5264
venu2s.excludeAnnotations = $(roundHighResolution);staticGlance
5365

5466
# Static glance
5567
fenix6.excludeAnnotations = $(roundNonTouchScreen);liveGlance
5668
fenix6s.excludeAnnotations = $(roundNonTouchScreen);liveGlance
57-
fenix7.excludeAnnotations = $(roundNonTouchScreen);liveGlance
58-
fenix7s.excludeAnnotations = $(roundNonTouchScreen);liveGlance
5969
fr245.excludeAnnotations = $(roundNonTouchScreen);liveGlance
6070
marqadventurer.excludeAnnotations = $(roundNonTouchScreen);liveGlance
6171
marqathlete.excludeAnnotations = $(roundNonTouchScreen);liveGlance
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<resources>
2+
<!-- Format [[:separatorWidth:, :titleFont:, :titleFontTopPadding:, :displayOffsetX:]
3+
:separatorWidth: = Number
4+
:titleFont: = 0-8
5+
:titleFontTopPadding: = Number
6+
:displayOffsetX: = Number
7+
-->
8+
<jsonData id="Settings">[2, 1, 0, 18]</jsonData>
9+
</resources>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
<font id="lightsFont" scope="glance" filename="../SmartBikeLights/Source/SmartBikeLights/resources/fonts/Lights48.fnt" antialias="true" />
3+
<font id="batteryFont" scope="glance" filename="../SmartBikeLights/Source/SmartBikeLights/resources/fonts/Battery24.fnt" antialias="false" />
4+
<font id="controlModeFont" filename="../SmartBikeLights/Source/SmartBikeLights/resources/fonts/ControlMode18.fnt" antialias="true" />
5+
</resources>

Source/source-generated/BikeLightsGlanceView.HighResolution.mc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
101101
dc.setColor(fgColor, bgColor);
102102
dc.clear();
103103
if (_initializedLights == 0) {
104-
dc.drawText(width / 2, height / 2, 2, "No network", 1 /* TEXT_JUSTIFY_CENTER */ | 4 /* TEXT_JUSTIFY_VCENTER */);
104+
var text = _individualNetwork ? "Bike Lights" : "No network";
105+
dc.drawText(width / 2, height / 2, 2, text, 1 /* TEXT_JUSTIFY_CENTER */ | 4 /* TEXT_JUSTIFY_VCENTER */);
105106
return;
106107
}
107108

@@ -153,8 +154,9 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
153154
}
154155

155156
_individualNetwork = configuration[6];
156-
if (_individualNetwork != null /* Is enabled */ || _lightNetwork instanceof AntLightNetwork.IndividualLightNetwork) {
157-
recreateLightNetwork();
157+
if (_individualNetwork != null) {
158+
release();
159+
return;
158160
}
159161

160162
initializeLights();
@@ -348,7 +350,7 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
348350
private function recreateLightNetwork() {
349351
release();
350352
_lightNetwork = _individualNetwork != null
351-
? new AntLightNetwork.IndividualLightNetwork(_individualNetwork[0], _individualNetwork[1], _lightNetworkListener)
353+
? null
352354
: new AntPlus.LightNetwork(_lightNetworkListener);
353355
}
354356

Source/source-generated/BikeLightsGlanceView.MediumResolution.mc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
101101
dc.setColor(fgColor, bgColor);
102102
dc.clear();
103103
if (_initializedLights == 0) {
104-
dc.drawText(width / 2, height / 2, 2, "No network", 1 /* TEXT_JUSTIFY_CENTER */ | 4 /* TEXT_JUSTIFY_VCENTER */);
104+
var text = _individualNetwork ? "Bike Lights" : "No network";
105+
dc.drawText(width / 2, height / 2, 2, text, 1 /* TEXT_JUSTIFY_CENTER */ | 4 /* TEXT_JUSTIFY_VCENTER */);
105106
return;
106107
}
107108

@@ -153,8 +154,9 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
153154
}
154155

155156
_individualNetwork = configuration[6];
156-
if (_individualNetwork != null /* Is enabled */ || _lightNetwork instanceof AntLightNetwork.IndividualLightNetwork) {
157-
recreateLightNetwork();
157+
if (_individualNetwork != null) {
158+
release();
159+
return;
158160
}
159161

160162
initializeLights();
@@ -348,7 +350,7 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
348350
private function recreateLightNetwork() {
349351
release();
350352
_lightNetwork = _individualNetwork != null
351-
? new AntLightNetwork.IndividualLightNetwork(_individualNetwork[0], _individualNetwork[1], _lightNetworkListener)
353+
? null
352354
: new AntPlus.LightNetwork(_lightNetworkListener);
353355
}
354356

Source/source-preprocess/BikeLightsGlanceView.mc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
101101
dc.setColor(fgColor, bgColor);
102102
dc.clear();
103103
if (_initializedLights == 0) {
104-
dc.drawText(width / 2, height / 2, 2, "No network", 1 /* TEXT_JUSTIFY_CENTER */ | 4 /* TEXT_JUSTIFY_VCENTER */);
104+
var text = _individualNetwork ? "Bike Lights" : "No network";
105+
dc.drawText(width / 2, height / 2, 2, text, 1 /* TEXT_JUSTIFY_CENTER */ | 4 /* TEXT_JUSTIFY_VCENTER */);
105106
return;
106107
}
107108

@@ -153,8 +154,9 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
153154
}
154155

155156
_individualNetwork = configuration[6];
156-
if (_individualNetwork != null /* Is enabled */ || _lightNetwork instanceof AntLightNetwork.IndividualLightNetwork) {
157-
recreateLightNetwork();
157+
if (_individualNetwork != null) {
158+
release();
159+
return;
158160
}
159161

160162
initializeLights();
@@ -348,7 +350,7 @@ class BikeLightsGlanceView extends WatchUi.GlanceView {
348350
private function recreateLightNetwork() {
349351
release();
350352
_lightNetwork = _individualNetwork != null
351-
? new AntLightNetwork.IndividualLightNetwork(_individualNetwork[0], _individualNetwork[1], _lightNetworkListener)
353+
? null
352354
: new /* #include ANT_NETWORK */(_lightNetworkListener);
353355
}
354356

0 commit comments

Comments
 (0)