Skip to content

Commit 84a7111

Browse files
authored
Sky maps and alarms (#68)
* Added optional sky maps, allowing the clock face to be replaced with a map of the planets, stars, and constellations as they appear in your local sky. * Added alarm clock feature, with daily and one-time alarms. * Fixed bug in recognizing GPS clock sync when using updated `ntpq`. * Improved software update notifications. * Improved weather alert formatting. * Improved installation reliability. * Improved user settings dialog. * Updated FTP leap second retrieval.
1 parent c140769 commit 84a7111

60 files changed

Lines changed: 8854 additions & 8934 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 3.0.0
2+
3+
* Added optional sky maps, allowing the clock face to be replaced with a map of the planets, stars, and constellations as they appear in your local sky.
4+
* Added alarm clock feature, with daily and one-time alarms.
5+
* Fixed bug in recognizing GPS clock sync when using updated `ntpq`.
6+
* Improved software update notifications.
7+
* Improved weather alert formatting.
8+
* Improved installation reliability.
9+
* Improved user settings dialog.
10+
* Updated FTP leap second retrieval.
11+
12+
## 2.12.3
13+
14+
* Get default forecast if automatic location check fails.
15+
116
## 2.12.2
217

318
* Fix for Visual Crossing and Weatherbit.io snowfall amounts.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Astronomy/Weather Clock
22

3-
Copyright © 2018-2021 Kerry Shetline, kerry@shetline.com
3+
Copyright © 2018-2022 Kerry Shetline, kerry@shetline.com
44

55
### MIT
66

README.md

Lines changed: 125 additions & 36 deletions
Large diffs are not rendered by default.

build.js

Lines changed: 72 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.ts

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,21 @@ async function checkForGps(): Promise<void> {
550550
let gpsTimeIsWorking = false;
551551

552552
if (hasGpsTools) {
553-
const gpsInfo = await monitorProcessLines(spawn('gpspipe', ['-w', '-n', '12']), null, ErrorMode.NO_ERRORS);
553+
const gpsInfo = await new Promise<string[]>((resolve, reject) => {
554+
const proc = spawn('gpspipe', ['-w', '-n', '12']);
555+
let finished = false;
556+
557+
monitorProcessLines(proc, null, ErrorMode.NO_ERRORS)
558+
.then(lines => { finished = true; resolve(lines); })
559+
.catch(err => { finished = true; reject(err); });
560+
setTimeout(() => {
561+
if (!finished) {
562+
proc.kill();
563+
console.warn(chalk.yellow('Warning: gpspipe timed out.'));
564+
resolve([]);
565+
}
566+
}, 10000);
567+
});
554568

555569
for (const line of gpsInfo) {
556570
try {
@@ -566,10 +580,24 @@ async function checkForGps(): Promise<void> {
566580
}
567581

568582
if (hasNtpTools) {
569-
const ntpInfo = await monitorProcessLines(spawn('ntpq', ['-p']), null, ErrorMode.NO_ERRORS);
583+
const ntpInfo = await new Promise<string[]>((resolve, reject) => {
584+
const proc = spawn('ntpq', ['-p']);
585+
let finished = false;
586+
587+
monitorProcessLines(proc, null, ErrorMode.NO_ERRORS)
588+
.then(lines => { finished = true; resolve(lines); })
589+
.catch(err => { finished = true; reject(err); });
590+
setTimeout(() => {
591+
if (!finished) {
592+
proc.kill();
593+
console.warn(chalk.yellow('Warning: ntpq timed out.'));
594+
resolve([]);
595+
}
596+
}, 10000);
597+
});
570598

571599
for (const line of ntpInfo) {
572-
if (/^\*SHM\b.+\.PPS\.\s+0\s+l\s+.+?\s-?[.\d]+\s+[.\d]+\s*$/.test(line)) {
600+
if (/^\*SHM\b.+\.PPS\.\s+0\s+l\s+.+?\s[-+]?[.\d]+\s+[.\d]+\s*$/.test(line)) {
573601
gpsTimeIsWorking = true;
574602
break;
575603
}
@@ -993,7 +1021,7 @@ async function doServiceDeployment(): Promise<void> {
9931021
spin, ErrorMode.ANY_ERROR);
9941022

9951023
if (doKiosk)
996-
launchChromium = launchChromium.replace(/\s+/, ' --kiosk ');
1024+
launchChromium = launchChromium.replace(/\s+/, ' --kiosk --autoplay-policy=no-user-gesture-required ');
9971025

9981026
const autostartPath = autostartDir + '/autostart';
9991027
const autostartLine1 = autostartDir + '/autostart_extra.sh';

custom-types/custom-types.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// noinspection JSUnusedGlobalSymbols
2+
interface String {
3+
/**
4+
* Gets a substring beginning at the specified location and having the specified length.
5+
* (deprecation removed)
6+
* @param from The starting position of the desired substring. The index of the first character in the string is zero.
7+
* @param length The number of characters to include in the returned substring.
8+
*/
9+
substr(from: number, length?: number): string;
10+
}

img/awc-dlog-alarms.jpg

46.9 KB
Loading

img/awc-dlog-locations.jpg

65.8 KB
Loading

img/awc-dlog-options.jpg

49.8 KB
Loading

img/awc_dlog.png

-117 KB
Binary file not shown.

0 commit comments

Comments
 (0)