Merge branch 'espruino:master' into master

pull/3448/head
slynchDev 2024-06-09 13:44:28 -07:00 committed by GitHub
commit 116789cdfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 17 deletions

View File

@ -6,3 +6,4 @@
0.06: Fix azimuth (bug #2651), only show degrees
0.07: Minor code improvements
0.08: Minor code improvements
0.09: Fix: Handle when the moon rise/set do not occur on the current day

View File

@ -180,8 +180,8 @@ function drawMoonTimesPage(gps, title) {
const moonColor = g.theme.dark ? {r: 1, g: 1, b: 1} : {r: 0, g: 0, b: 0};
const pageData = {
Rise: dateToTimeString(times.rise),
Set: dateToTimeString(times.set),
Rise: times.rise ? dateToTimeString(times.rise) : "Not today",
Set: times.set ? dateToTimeString(times.set) : "Not today",
};
drawData(title, pageData, null, g.getHeight()/2 - Object.keys(pageData).length/2*20 + 5);
@ -240,7 +240,7 @@ function sunIndexPageMenu(gps) {
"title": "-- Sun --",
},
"Current Pos": () => {
m = E.showMenu();
E.showMenu();
drawSunShowPage(gps, "Current Pos", new Date());
},
};
@ -248,13 +248,13 @@ function sunIndexPageMenu(gps) {
Object.keys(sunTimes).sort().reduce((menu, key) => {
const title = titlizeKey(key);
menu[title] = () => {
m = E.showMenu();
E.showMenu();
drawSunShowPage(gps, key, sunTimes[key]);
};
return menu;
}, sunMenu);
sunMenu["< Back"] = () => m = indexPageMenu(gps);
sunMenu["< Back"] = () => indexPageMenu(gps);
return E.showMenu(sunMenu);
}
@ -266,18 +266,18 @@ function moonIndexPageMenu(gps) {
"title": "-- Moon --",
},
"Times": () => {
m = E.showMenu();
E.showMenu();
drawMoonTimesPage(gps, /*LANG*/"Times");
},
"Position": () => {
m = E.showMenu();
E.showMenu();
drawMoonPositionPage(gps, /*LANG*/"Position");
},
"Illumination": () => {
m = E.showMenu();
E.showMenu();
drawMoonIlluminationPage(gps, /*LANG*/"Illumination");
},
"< Back": () => m = indexPageMenu(gps),
"< Back": () => indexPageMenu(gps),
};
return E.showMenu(moonMenu);
@ -289,10 +289,10 @@ function indexPageMenu(gps) {
"title": /*LANG*/"Select",
},
/*LANG*/"Sun": () => {
m = sunIndexPageMenu(gps);
sunIndexPageMenu(gps);
},
/*LANG*/"Moon": () => {
m = moonIndexPageMenu(gps);
moonIndexPageMenu(gps);
},
"< Back": () => { load(); }
};
@ -300,9 +300,9 @@ function indexPageMenu(gps) {
return E.showMenu(menu);
}
function getCenterStringX(str) {
return (g.getWidth() - g.stringWidth(str)) / 2;
}
//function getCenterStringX(str) {
// return (g.getWidth() - g.stringWidth(str)) / 2;
//}
function init() {
let location = require("Storage").readJSON("mylocation.json",1)||{"lat":51.5072,"lon":0.1276,"location":"London"};
@ -311,5 +311,4 @@ function init() {
Bangle.drawWidgets();
}
let m;
init();

View File

@ -1,7 +1,7 @@
{
"id": "astrocalc",
"name": "Astrocalc",
"version": "0.08",
"version": "0.09",
"description": "Calculates interesting information on the sun like sunset and sunrise and moon cycles for the current day based on your location from MyLocation app",
"icon": "astrocalc.png",
"tags": "app,sun,moon,cycles,tool,outdoors",

View File

@ -6,6 +6,8 @@ shows distance, time, steps, cadence, pace and more.
To use it, start the app and press the middle button so that
the red `STOP` in the bottom right turns to a green `RUN`.
The separate **Run+** app for Bangle.js 2 provides additional features.
## Display
* `DIST` - the distance travelled based on the GPS (if you have a GPS lock).

View File

@ -1,7 +1,7 @@
{ "id": "run",
"name": "Run",
"version": "0.19",
"description": "Displays distance, time, steps, cadence, pace and more for runners.",
"description": "Displays distance, time, steps, cadence, pace and more for runners. The **Run+** app for Bangle.js 2 provides additional features.",
"icon": "app.png",
"tags": "run,running,fitness,outdoors,gps",
"supports" : ["BANGLEJS","BANGLEJS2"],