Skip to content

Commit

Permalink
Added app settings editor (only for Edge touchscreen devices and devi…
Browse files Browse the repository at this point in the history
…ces with CIQ 3.2 and more than 32KB memory) (#32)
  • Loading branch information
maca88 authored Jun 18, 2022
1 parent f0a84a3 commit 42a3019
Show file tree
Hide file tree
Showing 34 changed files with 1,076 additions and 83 deletions.
Binary file added Images/TouchSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/TouchSettingsColor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/WatchSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ Smart Bike Lights is a [data field](https://developer.garmin.com/connect-iq/conn
- Configurable full screen light panel for fast switching modes (only for Edge devices with touch screen)
- Support up to one headlight and one taillight that can be displayed on the smallest data field
- Switching light mode by tapping on the light icon (only for Edge devices with touch screen)
- Switching modes by holding the up/menu button (only for devices without touch screen that have CIQ 3.2 and with more than 32KB memory)
- Switching modes by holding the up/menu button (only for devices without touch screen that have CIQ 3.2+ and with more than 32KB memory)
- Has an alternative light network implementation that can be used for lights with partial ANT+ support (only for devices with more than 32KB memory)
- Support multiple light configurations (only for devices with more than 32KB memory)
- Support controlling multiple headlights/taillights at once (only for devices with more than 32KB memory)
- Has a built-in app settings editor (only for Edge touchscreen devices or devices that have CIQ 3.2+ and more than 32KB memory)

## How to use

Expand Down Expand Up @@ -45,12 +46,12 @@ For Edge touch screen devices (Edge 1030/1000/Explore/820/830):
For Edge 530:
1. Make sure that the lights are paired and connected with your Garmin device
2. On the data screen where you have the data field press the Menu button to open the menu
3. Navigate to "Data Fields" -> "Connect IQ data fields" -> "Smart Bike Lights" -> "Control mode" and change to the desired mode
3. Navigate to `Data Fields` -> `Connect IQ data fields` -> `Smart Bike Lights` -> `Control mode` and change to the desired mode

For watches with CIQ 3.2 and more than 32KB memory (Fenix 5 Plus/5S Plus/5X Plus, Fenix 6 Pro/6X Pro/6S Pro, Forerunner 245 Music/645 Music/745/945, MARQ, Descent Mk2):
1. Make sure that the lights are paired and connected with your Garmin device
2. On the data screen where you have the data field hold the Up button until a menu shows up (make sure that you have a recent firmware installed)
3. Navigate to "Smart Bike Lights" -> "Control mode" and change to the desired mode
2. On the data screen where you have the data field hold the `Up` button until a menu shows up (make sure that you have a recent firmware installed)
3. Navigate to `ConnectIQ Fields` -> `Smart Bike Lights` -> `Control mode` and change to the desired mode

For other devices:

Expand All @@ -77,9 +78,9 @@ The initial control mode will be determined based on the configuration from the

- **Activity color:** Used to define the color of the separator line in case two lights are connected and the color of the light panel buttons
- **Record lights mode:** Whether to record connected lights modes that will be displayed in Garmin Connect
- **Lights Configuration:** The configuration value generated by the [Lights Configurator](https://maca88.github.io/SmartBikeLights/)
- **Lights Configuration:** The configuration value generated by the [Lights Configurator](https://maca88.github.io/SmartBikeLights/). Devices with more than 32KB memory have two additional configuration inputs, where the current active is determined by **Current configuration** setting
- **Invert lights:** Whether lights icons and their positions should be inverted
- **Control mode only:** Whether only control mode can be changed when tapping on the light icon (only for Edge devices with touch screen)
- **Current configuration:** Used to select which `Lights Configuration` to use (only for devices with more than 32KB memory)

## Currently registered ANT+ lights:

Expand Down Expand Up @@ -118,6 +119,28 @@ Known limitations:
- It will not turn off the lights when the device goes to sleep
- It uses one ANT channel per light

## Built-in app settings editor

In order to avoid using Garmin Express or Garmin Connect Mobile for changing app settings, a built-in editor was added that is able to edit the following settings:
- Invert lights
- Activity color
- Current configuration

### Edge touchscreen devices

The app settings editor can be opened only when the data field is set to a `1 Field layout`. To open the app settings editor it is required to tap three times the "Off" button or in case the light network is not formed or an error is dispayed, tap once anywhere on the screen to open the editor.

<img src="/Images/TouchSettings.png?raw=true"> <img src="/Images/TouchSettingsColor.png?raw=true">

Because within a data field application it is not possible to swipe up/down, a bottom bar is added with up/down arrows to navigate through menu items in case they don't fit the screen.

### Other devices

For devices that support CIQ 3.2+ and have more than 32KB memory, the app setting editor can be reached by using the data field on-device settings view. To reach the app settings menu, hold the `Up` or `Back/Menu` button (depends on the device, e.g. `Back/Menu` for Venu 2, `Up` for fenix 6) and the navigate to `ConnectIQ Fields` -> `Smart Bike Lights` -> `Settings`.

<img src="/Images/WatchSettings.png?raw=true">


## Control multiple lights of the same type

There are two ways to control more than one light of the same type (e.g. two headlights):
Expand Down
122 changes: 122 additions & 0 deletions Source/SmartBikeLights/assets/MenuArrows.sfd
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
SplineFontDB: 3.2
FontName: MenuArrows
FullName: MenuArrows
FamilyName: MenuArrows
Weight: Regular
Copyright: Copyright (c) 2022, Maca
UComments: "2022-6-12: Created with FontForge (http://fontforge.org)"
Version: 001.000
ItalicAngle: 0
UnderlinePosition: -102.4
UnderlineWidth: 51.2
Ascent: 819
Descent: 205
InvalidEm: 0
LayerCount: 2
Layer: 0 0 "Back" 1
Layer: 1 0 "Fore" 0
XUID: [1021 213 -1312993357 22264]
OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1655024099
ModificationTime: 1655024259
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
OS2TypoDOffset: 1
OS2TypoLinegap: 0
OS2WinAscent: 0
OS2WinAOffset: 1
OS2WinDescent: 0
OS2WinDOffset: 1
HheadAscent: 0
HheadAOffset: 1
HheadDescent: 0
HheadDOffset: 1
OS2Vendor: 'PfEd'
MarkAttachClasses: 1
DEI: 91125
Encoding: ISO8859-1
UnicodeInterp: none
NameList: AGL For New Fonts
DisplaySize: -48
AntiAlias: 1
FitToEm: 0
WinInfo: 0 38 16
BeginPrivate: 0
EndPrivate
BeginChars: 256 4

StartChar: B
Encoding: 66 66 0
Width: 1024
Flags: H
LayerCount: 2
Fore
SplineSet
866 248 m 1
373 248 l 1
575 32 l 1
489 -48 l 1
378 70 266 189 155 307 c 1
266 425 378 544 489 662 c 1
575 582 l 1
373 366 l 1
866 366 l 1
866 248 l 1
EndSplineSet
EndChar

StartChar: D
Encoding: 68 68 1
Width: 1024
Flags: H
LayerCount: 2
Fore
SplineSet
237 498 m 1
512 240 l 1
787 498 l 1
867 412 l 1
749 301 630 189 512 78 c 1
394 189 275 301 157 412 c 1
237 498 l 1
EndSplineSet
EndChar

StartChar: U
Encoding: 85 85 2
Width: 1024
Flags: H
LayerCount: 2
Fore
SplineSet
787 116 m 1
512 374 l 1
237 116 l 1
157 202 l 1
275 313 394 425 512 536 c 1
630 425 749 313 867 202 c 1
787 116 l 1
EndSplineSet
EndChar

StartChar: R
Encoding: 82 82 3
Width: 1024
Flags: H
LayerCount: 2
Fore
SplineSet
321 32 m 1
579 307 l 1
321 582 l 1
407 662 l 1
518 544 630 425 741 307 c 1
630 189 518 70 407 -48 c 1
321 32 l 1
EndSplineSet
EndChar
EndChars
EndSplineFont
Binary file added Source/SmartBikeLights/assets/MenuArrows.ttf
Binary file not shown.
135 changes: 135 additions & 0 deletions Source/SmartBikeLights/assets/MenuIcons.sfd
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
SplineFontDB: 3.2
FontName: MenuIcons
FullName: MenuIcons
FamilyName: MenuIcons
Weight: Regular
Copyright: Copyright (c) 2022, Maca
UComments: "2022-6-12: Created with FontForge (http://fontforge.org)"
Version: 001.000
ItalicAngle: 0
UnderlinePosition: -102
UnderlineWidth: 51
Ascent: 819
Descent: 205
InvalidEm: 0
LayerCount: 2
Layer: 0 0 "Back" 1
Layer: 1 0 "Fore" 0
XUID: [1021 213 -1312993357 8071]
StyleMap: 0x0000
FSType: 0
OS2Version: 0
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1655029786
ModificationTime: 1655029927
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
OS2TypoDOffset: 1
OS2TypoLinegap: 92
OS2WinAscent: 0
OS2WinAOffset: 1
OS2WinDescent: 0
OS2WinDOffset: 1
HheadAscent: 0
HheadAOffset: 1
HheadDescent: 0
HheadDOffset: 1
MarkAttachClasses: 1
DEI: 91125
Encoding: ISO8859-1
UnicodeInterp: none
NameList: AGL For New Fonts
DisplaySize: -48
AntiAlias: 1
FitToEm: 0
WinInfo: 0 38 16
BeginPrivate: 0
EndPrivate
BeginChars: 256 3

StartChar: T
Encoding: 84 84 0
Width: 1024
Flags: H
LayerCount: 2
Fore
SplineSet
960 435 m 0
960 545 885 665 717 665 c 2
307 665 l 2
215 665 151 630 112 579 c 0
10 448 69 205 307 205 c 2
717 205 l 2
885 205 960 325 960 435 c 0
1011 435 m 0
1011 290 907 153 717 153 c 2
307 153 l 2
200 153 120 196 71 260 c 0
-58 426 28 717 307 717 c 2
717 717 l 2
907 717 1011 580 1011 435 c 0
EndSplineSet
Validated: 33
EndChar

StartChar: zero
Encoding: 48 48 1
Width: 1024
Flags: H
LayerCount: 2
Fore
SplineSet
270 626 m 0
294 628 333 625 356 619 c 0
375 614 387 607 402 597 c 0
418 586 434 574 447 557 c 0
462 538 476 511 483 486 c 0
490 461 491 433 488 408 c 0
485 383 475 356 463 335 c 0
452 315 436 297 418 283 c 0
400 268 378 256 354 249 c 0
328 242 293 239 267 242 c 0
243 245 221 254 201 265 c 0
180 277 160 293 145 312 c 0
130 330 118 352 111 376 c 0
104 402 101 436 104 463 c 0
107 488 117 514 129 534 c 0
140 553 155 570 171 583 c 0
186 596 202 606 219 613 c 0
235 620 250 624 270 626 c 0
EndSplineSet
Validated: 33
EndChar

StartChar: one
Encoding: 49 49 2
Width: 1024
Flags: H
LayerCount: 2
Fore
SplineSet
701 626 m 0
725 628 764 625 787 619 c 0
806 614 818 607 833 597 c 0
849 586 865 574 878 557 c 0
893 538 907 511 914 486 c 0
921 461 922 433 919 408 c 0
916 383 906 356 894 335 c 0
883 315 867 297 849 283 c 0
831 268 809 256 785 249 c 0
759 242 724 239 698 242 c 0
674 245 652 254 632 265 c 0
611 277 591 293 576 312 c 0
561 330 549 352 542 376 c 0
535 402 532 436 535 463 c 0
538 488 548 514 560 534 c 0
571 553 586 570 602 583 c 0
617 596 633 606 650 613 c 0
666 620 681 624 701 626 c 0
EndSplineSet
Validated: 33
EndChar
EndChars
EndSplineFont
Binary file added Source/SmartBikeLights/assets/MenuIcons.ttf
Binary file not shown.
4 changes: 4 additions & 0 deletions Source/SmartBikeLights/assets/arrow_back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Source/SmartBikeLights/assets/arrow_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Source/SmartBikeLights/assets/arrow_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Source/SmartBikeLights/assets/arrow_up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Source/SmartBikeLights/assets/icon_toggle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Source/SmartBikeLights/assets/icon_toggle_off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Source/SmartBikeLights/assets/icon_toggle_on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Source/SmartBikeLights/assets/icon_toggle_shell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 42a3019

Please sign in to comment.