Merge branch 'espruino:master' into master

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

View File

@ -1,7 +1,7 @@
{ {
"id": "astrocalc", "id": "astrocalc",
"name": "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", "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", "icon": "astrocalc.png",
"tags": "app,sun,moon,cycles,tool,outdoors", "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 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 red `STOP` in the bottom right turns to a green `RUN`.
The separate **Run+** app for Bangle.js 2 provides additional features.
## Display ## Display
* `DIST` - the distance travelled based on the GPS (if you have a GPS lock). * `DIST` - the distance travelled based on the GPS (if you have a GPS lock).

View File

@ -1,7 +1,7 @@
{ "id": "run", { "id": "run",
"name": "Run", "name": "Run",
"version": "0.19", "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", "icon": "app.png",
"tags": "run,running,fitness,outdoors,gps", "tags": "run,running,fitness,outdoors,gps",
"supports" : ["BANGLEJS","BANGLEJS2"], "supports" : ["BANGLEJS","BANGLEJS2"],