2024-02-23 16:17:45 +00:00
|
|
|
/**
|
|
|
|
* Regatta Timer
|
|
|
|
*/
|
|
|
|
const Layout = require("Layout");
|
2024-03-01 14:31:42 +00:00
|
|
|
const locale = require("locale").name == "system" ? "en" : require("locale").name.substring(0, 2);
|
2024-02-23 16:17:45 +00:00
|
|
|
|
|
|
|
// "Anton" bold font
|
|
|
|
Graphics.prototype.setFontAnton = function(scale) {
|
|
|
|
// Actual height 69 (68 - 0)
|
|
|
|
g.setFontCustom(atob("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAA/gAAAAAAAAAAP/gAAAAAAAAAH//gAAAAAAAAB///gAAAAAAAAf///gAAAAAAAP////gAAAAAAD/////gAAAAAA//////gAAAAAP//////gAAAAH///////gAAAB////////gAAAf////////gAAP/////////gAD//////////AA//////////gAA/////////4AAA////////+AAAA////////gAAAA///////wAAAAA//////8AAAAAA//////AAAAAAA/////gAAAAAAA////4AAAAAAAA///+AAAAAAAAA///gAAAAAAAAA//wAAAAAAAAAA/8AAAAAAAAAAA/AAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////AAAAAB///////8AAAAH////////AAAAf////////wAAA/////////4AAB/////////8AAD/////////+AAH//////////AAP//////////gAP//////////gAP//////////gAf//////////wAf//////////wAf//////////wAf//////////wA//8AAAAAB//4A//wAAAAAAf/4A//gAAAAAAP/4A//gAAAAAAP/4A//gAAAAAAP/4A//wAAAAAAf/4A///////////4Af//////////wAf//////////wAf//////////wAf//////////wAP//////////gAP//////////gAH//////////AAH//////////AAD/////////+AAB/////////8AAA/////////4AAAP////////gAAAD///////+AAAAAf//////4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/gAAAAAAAAAAP/gAAAAAAAAAAf/gAAAAAAAAAAf/gAAAAAAAAAAf/AAAAAAAAAAA//AAAAAAAAAAA/+AAAAAAAAAAB/8AAAAAAAAAAD//////////gAH//////////gAP//////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/4AAAAB/gAAD//4AAAAf/gAAP//4AAAB//gAA///4AAAH//gAB///4AAAf//gAD///4AAA///gAH///4AAD///gAP///4AAH///gAP///4AAP///gAf///4AAf///gAf///4AB////gAf///4AD////gA////4AH////gA////4Af////gA////4A/////gA//wAAB/////gA//gAAH/////gA//gAAP/////gA//gAA///8//gA//gAD///w//gA//wA////g//gA////////A//gA///////8A//gA///////4A//gAf//////wA//gAf//////gA//gAf/////+AA//gAP/////8AA//gAP/////4AA//gAH/////gAA//gAD/////AAA//gAB////8AAA//gAA////wAAA//gAAP///AAAA//gAAD//8AAAA//gAAAP+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB/+AAAAAD/wAAB//8AAAAP/wAAB///AAAA//wAAB///wAAB//wAAB///4AAD//wAAB///8AAH//wAAB///+AAP//wAAB///+AAP//wAAB////AAf//wAAB////AAf//wAAB////gAf//wAAB////gA///wAAB////gA///wAAB////gA///w//AAf//wA//4A//AAA//wA//gA//AAAf/wA//gB//gAAf/wA//gB//gAAf/wA//gD//wAA//wA//wH//8AB//wA///////////gA///////////gA///////////gA///////////gAf//////////AAf//////////AAP//////////AAP/////////+AAH/////////8AAH///+/////4AAD///+f////wAAA///8P////gAAAf//4H///+AAAAH//gB///wAAAAAP4AAH/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/wAAAAAAAAAA//wAAAAAAAAAP//wAAAAAAAAB///wAAAAAAAAf///wAAAAAAAH////wAAAAAAA/////wAAAAAAP/////wAAAAAB//////wAAAAAf//////wAAAAH///////wAAAA////////wAAAP////////wAAA///////H/wAAA//////wH/wAAA/////8AH/wAAA/////AAH/wAAA////gAAH/wAAA///4AAAH/wAAA//+AAAAH/wAAA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gA///////////gAAAAAAAAH/4AAAAAAAAAAH/wAAAAAAAAAAH/wAAAAAAAAAAH/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB//8AAA/////+B///AAA/////+B///wAA/////+B///4AA/////+B///8AA/////+B///8AA/////+B///+AA/////+B////AA/////+B////AA/////+B////AA/////+B////gA/////+B////gA/////+B////gA/////+A////gA//gP/gAAB//wA//gf/AAAA//wA//gf/AAAAf/wA//g//AAAAf/wA//g//AAAA//wA//g//gAAA//wA//g//+AAP//wA//g////////gA//g////////gA//g////////gA//g////////gA//g////////AA//gf///////AA//gf//////+AA//gP//////+AA//gH//////8AA//gD//////4AA//gB//////wAA//gA//////AAAAAAAH////8AAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////gAAAAB///////+AAAAH////////gAAAf////////4AAB/////////8AAD/////////+AAH//////////AAH//////////gAP//////////gAP//////////gAf//////////wAf//////////wAf//////////wAf//////////wAf//////////4A//wAD/4AAf/4A//gAH/wAAP/4A//gAH/wAAP/4A//gAP/wAAP/4A//gAP/4AAf/4A//wAP/+AD//4A///wP//////4Af//4P//////wAf//4P//////wAf//4P//////wAf//4P//////wAP//4P//////gAP//4H//////gAH//4H//////AAH//4D/////+AAD//4D/////8AAB//4B/////4AAA//4A/////wAAAP/4AP////AAAAB/4AD///4AAAAAAAAAH/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//AAAAAAAAAAA//
|
|
|
|
};
|
|
|
|
|
2024-03-01 14:31:42 +00:00
|
|
|
function Regattatimer() {
|
2024-02-23 16:17:45 +00:00
|
|
|
return {
|
2024-03-01 14:31:42 +00:00
|
|
|
layout: undefined,
|
|
|
|
/*
|
|
|
|
layouts: {
|
|
|
|
idle: function() {
|
|
|
|
switch(settings.dial) {
|
|
|
|
case "Discs":
|
|
|
|
break;
|
|
|
|
case "Numeric":
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
start: function(phase) {
|
|
|
|
switch(settings.dial) {
|
|
|
|
case "Discs":
|
|
|
|
break;
|
|
|
|
case "Numeric":
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
|
|
|
race: function() {
|
|
|
|
}
|
2024-03-01 14:31:42 +00:00
|
|
|
},
|
|
|
|
*/
|
2024-02-23 16:17:45 +00:00
|
|
|
mode: "idle", // idle, start, race"
|
2024-02-24 20:07:32 +00:00
|
|
|
countdown: 300, // 5 minutes
|
2024-02-23 16:17:45 +00:00
|
|
|
counter: undefined,
|
|
|
|
interval: undefined,
|
2024-03-02 18:22:33 +00:00
|
|
|
theme: null,
|
|
|
|
themes: {
|
|
|
|
"Light": {
|
|
|
|
"fgColor": "#000000",
|
|
|
|
"bgColor": "#FFFF00",
|
|
|
|
},
|
|
|
|
"Dark": {
|
|
|
|
"fgColor": "#FFFF00",
|
|
|
|
"bgColor": "#000000",
|
|
|
|
}
|
|
|
|
},
|
2024-03-07 20:20:39 +00:00
|
|
|
icons: {
|
|
|
|
"battery": function() {
|
|
|
|
return Graphics.createImage(`
|
|
|
|
XXXX
|
|
|
|
X X
|
|
|
|
X XX X
|
|
|
|
X X
|
|
|
|
X XX X
|
|
|
|
X X
|
|
|
|
X XX X
|
|
|
|
X X
|
|
|
|
X XX X
|
|
|
|
X X
|
|
|
|
XXXXXX`);
|
|
|
|
},
|
|
|
|
"satellites": function() {
|
|
|
|
return Graphics.createImage(`
|
|
|
|
X
|
|
|
|
XoX
|
|
|
|
XoX
|
|
|
|
XoX
|
|
|
|
XoX o X
|
|
|
|
XoX o o XoX
|
|
|
|
XoX o o XoX
|
|
|
|
X o XoX
|
|
|
|
XoX
|
|
|
|
XoX
|
|
|
|
XoX
|
|
|
|
X`);
|
|
|
|
},
|
|
|
|
},
|
2024-02-23 16:17:45 +00:00
|
|
|
settings: Object.assign({
|
2024-02-24 20:07:32 +00:00
|
|
|
"debug": false,
|
2024-03-01 14:31:42 +00:00
|
|
|
"buzzer": true,
|
|
|
|
"dial": "Numeric",
|
2024-03-01 20:38:19 +00:00
|
|
|
"gps": true,
|
2024-03-01 14:31:42 +00:00
|
|
|
"record": false,
|
|
|
|
"theme": "Dark",
|
2024-02-23 16:17:45 +00:00
|
|
|
}, require('Storage').readJSON("regattatimer.json", true) || {}),
|
|
|
|
|
|
|
|
translations: Object.assign({
|
|
|
|
"de": {
|
2024-03-01 14:31:42 +00:00
|
|
|
"speed": "FüG", // Fahrt über Grund
|
2024-02-23 16:17:45 +00:00
|
|
|
"speed_unit": "kn"
|
|
|
|
},
|
|
|
|
"en": {
|
2024-03-01 14:31:42 +00:00
|
|
|
"speed": "SOA", // SOA speed of advance
|
2024-02-23 16:17:45 +00:00
|
|
|
"speed_unit": "kn"
|
|
|
|
}
|
|
|
|
}, require('Storage').readJSON("translations.json", true) || {}),
|
|
|
|
|
2024-03-01 14:31:42 +00:00
|
|
|
init: function() {
|
|
|
|
|
|
|
|
if(this.settings.debug) {
|
|
|
|
this.countdown = 1;
|
|
|
|
}
|
|
|
|
|
2024-03-02 18:22:33 +00:00
|
|
|
this.theme = this.themes[this.settings.theme];
|
2024-03-01 14:31:42 +00:00
|
|
|
|
|
|
|
Bangle.setLCDPower(1);
|
|
|
|
Bangle.setLCDTimeout(0);
|
2024-03-01 20:32:08 +00:00
|
|
|
|
2024-03-01 14:31:42 +00:00
|
|
|
// in "idle", "start" or "stoped" mode, a button click (re)starts the countdown
|
|
|
|
// in "race" mode, a button click stops the counter
|
|
|
|
var onButtonClick = (function(ev) {
|
|
|
|
switch(this.mode) {
|
|
|
|
case "idle":
|
|
|
|
this.resetCounter();
|
|
|
|
this.mode = "start";
|
|
|
|
this.setLayoutStartMinSec();
|
|
|
|
this.startCounter();
|
|
|
|
this.interval = setInterval((function() {
|
|
|
|
this.startCounter();
|
|
|
|
}).bind(this), 1000);
|
|
|
|
break;
|
|
|
|
case "stoped":
|
|
|
|
case "start":
|
|
|
|
this.resetCounter();
|
|
|
|
this.setLayoutIdle();
|
|
|
|
break;
|
|
|
|
case "race":
|
|
|
|
this.raceCounterStop();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}).bind(this);
|
|
|
|
|
|
|
|
setWatch(onButtonClick, BTN1, true);
|
|
|
|
|
|
|
|
this.setLayoutIdle();
|
|
|
|
},
|
|
|
|
|
|
|
|
onGPS: function(fix) {
|
|
|
|
if(this.mode == "race") {
|
|
|
|
if(fix.fix && isFinite(fix.speed)) {
|
|
|
|
this.layout.clear(layout.speed);
|
|
|
|
this.layout.speed.label = fix.speed.toFixed(2);
|
|
|
|
this.layout.render(this.layout.speed);
|
|
|
|
}
|
|
|
|
this.layout.satellites.label = fix.satellites;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2024-02-23 16:17:45 +00:00
|
|
|
translate: function(slug) {
|
2024-02-24 20:07:32 +00:00
|
|
|
return this.translations[locale][slug];
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
2024-03-01 14:31:42 +00:00
|
|
|
// during the start phase, the clock counts down 5 4 1 0 minutes
|
|
|
|
// a button click restarts the countdown
|
2024-02-23 16:17:45 +00:00
|
|
|
startCounter: function() {
|
|
|
|
|
|
|
|
this.counter --;
|
|
|
|
|
|
|
|
if(this.counter >= 0) {
|
|
|
|
var counterMinutes = parseInt(this.counter / 60);
|
|
|
|
|
|
|
|
if(counterMinutes > 0) {
|
|
|
|
this.layout.minutes.label = counterMinutes;
|
2024-03-01 14:31:42 +00:00
|
|
|
// this.layout.seconds.label = "0".concat(this.counter - counterMinutes * 60).toString().slice(-2);
|
|
|
|
this.layout.seconds.label = this.padZeroLeft(this.counter - counterMinutes * 60);
|
2024-02-23 16:17:45 +00:00
|
|
|
this.layout.render();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.setLayoutStartSec();
|
|
|
|
this.layout.seconds.label = this.counter.toString();
|
|
|
|
this.layout.render();
|
|
|
|
}
|
|
|
|
// this keeps the watch LCD lit up
|
|
|
|
g.flip();
|
|
|
|
}
|
|
|
|
// time is up
|
|
|
|
else {
|
|
|
|
this.raceCounterStart();
|
|
|
|
}
|
|
|
|
},
|
2024-03-01 14:31:42 +00:00
|
|
|
padZeroLeft: function(str) {
|
|
|
|
return str.toString().padStart(2, "0");
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
|
|
|
formatTime: function(time) {
|
2024-03-01 14:31:42 +00:00
|
|
|
var
|
|
|
|
minutes = parseInt(time / 60),
|
|
|
|
seconds = time - (minutes * 60);
|
|
|
|
|
|
|
|
return this.padZeroLeft(parseInt(time / 3600)) + ":" + this.padZeroLeft(minutes) + ":" + this.padZeroLeft(seconds);
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
|
|
|
raceCounter: function() {
|
2024-03-01 14:31:42 +00:00
|
|
|
|
|
|
|
if(this.counter % 60 == 0) {
|
|
|
|
this.layout.clear(this.layout.battery);
|
|
|
|
this.layout.battery.label = E.getBattery() + "%";
|
|
|
|
this.layout.render(this.layout.battery);
|
|
|
|
}
|
2024-02-23 16:17:45 +00:00
|
|
|
|
|
|
|
this.counter ++;
|
|
|
|
|
|
|
|
this.layout.racetime.label = this.formatTime(this.counter);
|
|
|
|
this.layout.daytime.label = require("locale").time(new Date(), 1);
|
|
|
|
this.layout.render();
|
|
|
|
|
|
|
|
// keeps the watch screen lit up
|
|
|
|
g.flip();
|
|
|
|
},
|
|
|
|
raceCounterStop: function() {
|
|
|
|
if(this.interval) {
|
|
|
|
clearInterval(this.interval);
|
|
|
|
this.interval = undefined;
|
|
|
|
}
|
|
|
|
this.mode = "stoped";
|
|
|
|
},
|
|
|
|
raceCounterStart: function() {
|
|
|
|
if(this.interval) {
|
|
|
|
clearInterval(this.interval);
|
|
|
|
this.interval = undefined;
|
|
|
|
}
|
|
|
|
|
2024-03-02 18:22:33 +00:00
|
|
|
if(this.settings.buzzer) {
|
2024-03-01 14:31:42 +00:00
|
|
|
Bangle.buzz();
|
|
|
|
}
|
2024-02-23 16:17:45 +00:00
|
|
|
|
|
|
|
this.counter = 0;
|
|
|
|
// switch to race mode
|
|
|
|
this.mode = "race";
|
|
|
|
this.setLayoutRace();
|
|
|
|
this.raceCounter();
|
2024-03-01 14:31:42 +00:00
|
|
|
this.interval = setInterval((function() {
|
2024-02-23 16:17:45 +00:00
|
|
|
this.raceCounter();
|
|
|
|
}).bind(this), 1000);
|
|
|
|
},
|
|
|
|
|
2024-03-01 14:31:42 +00:00
|
|
|
resetCounter: function() {
|
|
|
|
if(this.interval) {
|
|
|
|
clearInterval(this.interval);
|
|
|
|
this.interval = undefined;
|
|
|
|
}
|
|
|
|
this.counter = this.countdown;
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setLayoutIdle: function() {
|
|
|
|
|
|
|
|
g.clear();
|
|
|
|
|
|
|
|
this.mode = "idle";
|
|
|
|
|
2024-03-01 14:31:42 +00:00
|
|
|
this.layout = new Layout({
|
2024-02-23 16:17:45 +00:00
|
|
|
type: "v",
|
2024-03-02 18:22:33 +00:00
|
|
|
bgCol: this.theme.bgColor,
|
2024-02-23 16:17:45 +00:00
|
|
|
c: [
|
|
|
|
{
|
2024-03-01 14:31:42 +00:00
|
|
|
type: "v",
|
2024-02-23 16:17:45 +00:00
|
|
|
c: [
|
2024-03-02 18:22:33 +00:00
|
|
|
{type: "txt", font: "Anton", label: "5", col: this.theme.fgColor, id: "minutes", fillx: 1, filly: 1},
|
|
|
|
{type: "txt", font: "20%", label: "--:--", col: this.theme.fgColor, id: "daytime", fillx: 1, filly: 1}
|
2024-02-23 16:17:45 +00:00
|
|
|
]
|
|
|
|
}
|
2024-03-01 14:31:42 +00:00
|
|
|
]}, {lazy: true});
|
|
|
|
|
|
|
|
this.interval = setInterval((function() {
|
|
|
|
this.layout.daytime.label = require("locale").time(new Date(), 1);
|
|
|
|
this.layout.render();
|
|
|
|
|
|
|
|
// keeps the watch screen lit up
|
|
|
|
g.flip();
|
|
|
|
}).bind(this), 1000);
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
|
|
|
setLayoutStartMinSec: function() {
|
|
|
|
g.clear();
|
|
|
|
|
|
|
|
this.layout = new Layout({
|
|
|
|
type: "v",
|
2024-03-02 18:22:33 +00:00
|
|
|
bgCol: this.theme.bgColor,
|
2024-02-23 16:17:45 +00:00
|
|
|
c: [
|
|
|
|
{
|
|
|
|
type: "h",
|
|
|
|
c: [
|
2024-03-02 18:22:33 +00:00
|
|
|
{type: "txt", font: "Anton", label: "4", col: this.theme.fgColor, id: "minutes", fillx: 1, filly: 1},
|
|
|
|
{type: "txt", font: "Anton", label: "59", col: this.theme.fgColor, id: "seconds", fillx: 1, filly: 1},
|
2024-02-23 16:17:45 +00:00
|
|
|
]
|
|
|
|
}
|
2024-03-01 14:31:42 +00:00
|
|
|
]}, {lazy: true}
|
|
|
|
);
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
|
|
|
setLayoutStartSec: function() {
|
|
|
|
g.clear();
|
|
|
|
|
|
|
|
this.layout = new Layout({
|
|
|
|
type: "v",
|
2024-03-02 18:22:33 +00:00
|
|
|
bgCol: this.theme.bgColor,
|
2024-02-23 16:17:45 +00:00
|
|
|
c:[
|
2024-03-02 18:22:33 +00:00
|
|
|
{type: "txt", font: "Anton", label: "", fillx: true, filly: true, col: this.theme.fgColor, id: "seconds"},
|
2024-03-01 14:31:42 +00:00
|
|
|
]}, {lazy: true});
|
2024-02-23 16:17:45 +00:00
|
|
|
},
|
|
|
|
setLayoutRace: function() {
|
|
|
|
g.clear();
|
|
|
|
|
|
|
|
this.layout = new Layout({
|
|
|
|
type: "v",
|
2024-03-02 18:22:33 +00:00
|
|
|
bgCol: this.theme.bgColor,
|
2024-02-23 16:17:45 +00:00
|
|
|
c: [
|
2024-03-02 18:22:33 +00:00
|
|
|
{type: "txt", font: "20%", label: "00:00:00", col: this.theme.fgColor, pad: 4, filly: 1, fillx: 1, id: "racetime"},
|
|
|
|
{type: "txt", font: "15%", label: "-", col: this.theme.fgColor, pad: 4, filly:1, fillx:1, id: "daytime"},
|
2024-02-23 16:17:45 +00:00
|
|
|
// horizontal
|
|
|
|
{type: "h", c: [
|
2024-03-02 18:22:33 +00:00
|
|
|
{type: "txt", font: "10%", label: this.translate("speed"), col: this.theme.fgColor, pad:4, fillx:1, filly:1},
|
|
|
|
{type: "txt", font: "20%", label: "0", col: this.theme.fgColor, pad:4, fillx:1, filly:1, id: "speed"},
|
|
|
|
{type: "txt", font: "10%", label: this.translate("speed_unit"), col: this.theme.fgColor, pad:4, fillx:1, filly:1},
|
2024-02-23 16:17:45 +00:00
|
|
|
]},
|
|
|
|
{type: "h", c: [
|
2024-03-07 20:20:39 +00:00
|
|
|
{type:"img", pad: 2, col: this.theme.fgColor, bgCol: this.theme.bgColor, src: this.icons.satellites()},
|
2024-03-02 18:22:33 +00:00
|
|
|
{type: "txt", font: "10%", label: "0", col: this.theme.fgColor, pad: 2, filly:1, id: "satellites"},
|
2024-03-01 14:31:42 +00:00
|
|
|
// hacky, use empty element with fillx to push the other elments to the left an right side
|
|
|
|
{type: undefined, pad: 2, fillx: 1},
|
2024-03-07 20:20:39 +00:00
|
|
|
{type:"img", pad: 2, col: this.theme.fgColor, bgCol: this.theme.bgColor, src: this.icons.battery()},
|
2024-03-02 18:22:33 +00:00
|
|
|
{type: "txt", font: "10%", label: "-", col: this.theme.fgColor, pad: 2, filly: 1, id: "battery"},
|
2024-02-23 16:17:45 +00:00
|
|
|
]}
|
2024-03-01 14:31:42 +00:00
|
|
|
]}, {lazy: true});
|
2024-02-23 16:17:45 +00:00
|
|
|
}
|
2024-03-01 14:31:42 +00:00
|
|
|
};
|
2024-02-23 16:17:45 +00:00
|
|
|
}
|
|
|
|
|
2024-03-01 14:31:42 +00:00
|
|
|
var regattatimer = Regattatimer();
|
2024-02-23 16:17:45 +00:00
|
|
|
regattatimer.init();
|
|
|
|
|
2024-02-24 20:07:32 +00:00
|
|
|
if(regattatimer.settings.gps) {
|
2024-02-23 16:17:45 +00:00
|
|
|
Bangle.setGPSPower(1);
|
|
|
|
Bangle.on('GPS', regattatimer.onGPS.bind(regattatimer));
|
|
|
|
}
|
|
|
|
|
2024-03-01 14:31:42 +00:00
|
|
|
Bangle.on('kill', function() {
|
|
|
|
Bangle.setLCDPower(0);
|
|
|
|
Bangle.setLCDTimeout(10);
|
2024-03-06 10:43:50 +00:00
|
|
|
/*
|
2024-02-24 20:07:32 +00:00
|
|
|
if(regattatimer.settings.gps) {
|
2024-02-23 16:17:45 +00:00
|
|
|
Bangle.setGPSPower(0);
|
|
|
|
}
|
2024-03-06 10:43:50 +00:00
|
|
|
*/
|
2024-02-23 16:17:45 +00:00
|
|
|
});
|