From 6efc127917b03d6aa530ec2e1cea5f5b3e1ee4dd Mon Sep 17 00:00:00 2001 From: Peter Prince Date: Mon, 13 Nov 2023 13:39:13 +0000 Subject: [PATCH] Add 1.10.0 changes --- about.html | 2 +- about.js | 9 +- ariaSpeak.js | 32 ++ builder.js | 7 +- constants.js | 19 + index.css | 25 +- index.html | 800 ++++++++++++++++++++++++++++++++--- lifeDisplay.js | 47 +- main.js | 788 ++++++++++++++++++++++++---------- nightMode.js | 8 +- package.json | 43 +- packetReader.js | 33 +- processing/downsampling.html | 232 ++++++---- processing/expansion.html | 447 +++++++++++-------- processing/split.html | 270 +++++++----- processing/summarise.html | 92 ++++ processing/uiDownsampling.js | 19 +- processing/uiExpansion.js | 21 +- processing/uiInput.js | 171 ++++++++ processing/uiOutput.js | 89 +--- processing/uiSplit.js | 19 +- processing/uiSummarise.js | 232 ++++++++++ saveLoad.js | 207 +++++---- schedule/dateInput.js | 59 +-- schedule/schedule.js | 44 +- schedule/scheduleEditor.js | 181 +++++--- schedule/timeInput.js | 38 +- schedule/uiSchedule.js | 50 +-- schedule/uiScheduleEditor.js | 78 ++-- scheduleBar.js | 102 ++--- settings/durationInput.js | 34 +- settings/sliderControl.js | 2 +- settings/uiAdvanced.js | 5 +- settings/uiFiltering.js | 49 ++- settings/uiSettings.js | 11 +- timeHandler.js | 269 ++++-------- timeZoneSelection.html | 60 +++ ubuntu.mono.ttf | Bin 0 -> 205748 bytes ui.css | 6 + ui.js | 125 +++--- uiIndex.js | 299 +++++++------ uiNight.css | 19 +- uiTimeZoneSelection.js | 479 +++++++++++++++++++++ versionChecker.js | 35 +- 44 files changed, 3965 insertions(+), 1592 deletions(-) create mode 100644 ariaSpeak.js create mode 100644 processing/summarise.html create mode 100644 processing/uiInput.js create mode 100644 processing/uiSummarise.js create mode 100644 timeZoneSelection.html create mode 100644 ubuntu.mono.ttf create mode 100644 uiTimeZoneSelection.js diff --git a/about.html b/about.html index fc6bedb..8253987 100644 --- a/about.html +++ b/about.html @@ -29,7 +29,7 @@
diff --git a/about.js b/about.js index 94c1f64..6a31267 100644 --- a/about.js +++ b/about.js @@ -9,17 +9,18 @@ /* global document */ const electron = require('electron'); +const {app, process} = require('@electron/remote'); const audiomoth = require('audiomoth-hid'); const nightMode = require('./nightMode.js'); const versionDisplay = document.getElementById('version-display'); const electronVersionDisplay = document.getElementById('electron-version-display'); -const audiomothHidVersionDisplay = document.getElementById('audiomoth-hid-version-display'); const websiteLink = document.getElementById('website-link'); +const audiomothHidVersionDisplay = document.getElementById('audiomoth-hid-version-display'); -versionDisplay.textContent = 'Version ' + electron.remote.app.getVersion(); -electronVersionDisplay.textContent = 'Running on Electron version ' + electron.remote.process.versions.electron; +versionDisplay.textContent = 'Version ' + app.getVersion(); +electronVersionDisplay.textContent = 'Running on Electron version ' + process.versions.electron; audiomothHidVersionDisplay.textContent = 'AudioMoth-HID module ' + audiomoth.version; electron.ipcRenderer.on('night-mode', (e, nm) => { @@ -36,7 +37,7 @@ electron.ipcRenderer.on('night-mode', (e, nm) => { }); -websiteLink.addEventListener('click', function () { +websiteLink.addEventListener('click', () => { electron.shell.openExternal('https://openacousticdevices.info'); diff --git a/ariaSpeak.js b/ariaSpeak.js new file mode 100644 index 0000000..646442a --- /dev/null +++ b/ariaSpeak.js @@ -0,0 +1,32 @@ +/**************************************************************************** + * ariaSpeak.js + * openacousticdevices.info + * May 2023 + *****************************************************************************/ + +/** + * Say something if user is using a screen reader + * @param {string} text Text which should be said if viewed on a screen reader + */ +exports.speak = (text) => { + + const element = document.createElement('div'); + const id = 'speak-' + Date.now(); + element.setAttribute('id', id); + element.setAttribute('aria-live', 'polite'); + element.classList.add('visually-hidden'); + document.body.appendChild(element); + + window.setTimeout(() => { + + document.getElementById(id).innerHTML = text; + + }, 100); + + window.setTimeout(() => { + + document.body.removeChild(document.getElementById(id)); + + }, 1000); + +}; diff --git a/builder.js b/builder.js index d5b7d09..9e0b7d4 100755 --- a/builder.js +++ b/builder.js @@ -1,12 +1,11 @@ - 'use strict'; const builder = require('electron-builder'); const Platform = builder.Platform; -var config, target, argTarget; +let config, target; -argTarget = process.argv[2]; +const argTarget = process.argv[2]; switch (argTarget) { @@ -55,7 +54,7 @@ default: builder.build({ targets: target, - config: config + config }).then(function (m) { console.log('Generated files:'); diff --git a/constants.js b/constants.js index 7e6b1fc..fc613c1 100644 --- a/constants.js +++ b/constants.js @@ -198,3 +198,22 @@ exports.getFirmwareClassification = (desc) => { exports.latestFirmwareVersionArray = [1, 8, 0]; exports.latestFirmwareVersionString = '1.8.0'; + +/* Time zone modes */ + +exports.TIME_ZONE_MODE_UTC = 0; +exports.TIME_ZONE_MODE_LOCAL = 1; +exports.TIME_ZONE_MODE_CUSTOM = 2; +exports.TIME_ZONE_MODE_STRINGS = ['UTC', 'LOCAL', 'CUSTOM']; + +/* Calculation values */ + +exports.UINT32_MAX = 0xFFFFFFFF; +exports.UINT16_MAX = 0xFFFF; + +exports.MILLISECONDS_IN_SECOND = 1000; + +exports.SECONDS_IN_MINUTE = 60; +exports.SECONDS_IN_DAY = 86400; + +exports.MINUTES_IN_HOUR = 60; \ No newline at end of file diff --git a/index.css b/index.css index c9183c5..7308ace 100644 --- a/index.css +++ b/index.css @@ -1,3 +1,8 @@ +@font-face { + font-family: 'Ubuntu'; + src: url('./ubuntu.mono.ttf'); +} + input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; @@ -13,6 +18,7 @@ input[type=number]::-webkit-outer-spin-button { .table>tbody>tr>td, .table>tbody>tr>th { + border-color: transparent; border-top: none; } @@ -21,11 +27,12 @@ input[type=number]::-webkit-outer-spin-button { } .grey { - color:#808080; + color: #D3D3D3; } .mono-text { - font-variant-numeric: tabular-nums; + font-family: 'Ubuntu'; + font-size: 27px; } input { @@ -35,3 +42,17 @@ input { span { font-variant-numeric: tabular-nums; } + +.groupBorder { + border: #cdcdcd thin solid; + padding: 5px; +} + +.leftElement { + margin-left: 16px; +} + +.rightElement { + margin-right: 16px; + text-align: right; +} diff --git a/index.html b/index.html index 544932f..7d152f5 100644 --- a/index.html +++ b/index.html @@ -9,105 +9,794 @@ -
+
-
-
-
- -
-
-
-
+
+
+ +
--:--:-- --/--/----
+
UTC
+
-
-
-
-
- Device ID: -
-
- - -
-
-
-
- Firmware description: -
-
- - -
-
-
-
- Firmware version: +
+ +
+ +
+ +
+
+ Device ID: +
+
+ - +
-
- - + +
+
+ Firmware description: +
+
+ - +
-
-
-
- Battery: + +
+
+ Firmware version: +
+
+ - +
-
- - + +
+
+ Battery: +
+
+ - +
+
+
+
-
-