diff --git a/README.md b/README.md index 2d70308..05e4413 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Package the application into an installer for your current platform with: npm run dist [win64/win32/mac/linux] ``` -This will place a packaged version of the app and an installer for the platform this command was run on into the `/dist` folder. Note that to sign the binary in macOS you will need to run the command above as 'sudo'. The codesign application will retrieve the appropriate certificate from Keychain Access. +This will place a packaged version of the app and an installer for the platform this command was run on into the `/dist` folder. Note that to sign the binary in macOS you will need to run the command above as 'sudo'. The codesign application will retreive the appropriate certificate from Keychain Access. For detailed usage instructions of the app itself and to download prebuilt installers of the latest stable version for all platforms, visit the app support site [here](http://www.openacousticdevices.info/config). diff --git a/about.html b/about.html index 494bda6..fc6bedb 100644 --- a/about.html +++ b/about.html @@ -3,6 +3,7 @@ + About AudioMoth Configuration App diff --git a/index.css b/index.css new file mode 100644 index 0000000..c9183c5 --- /dev/null +++ b/index.css @@ -0,0 +1,37 @@ +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +*, *::after, *::before { + -webkit-user-select: none; + -webkit-user-drag: none; + -webkit-app-region: no-drag; + cursor: default; +} + +.table>tbody>tr>td, +.table>tbody>tr>th { + border-top: none; +} + +#disabled-filter-slider .slider-handle { + display: none; +} + +.grey { + color:#808080; +} + +.mono-text { + font-variant-numeric: tabular-nums; +} + +input { + font-variant-numeric: tabular-nums; +} + +span { + font-variant-numeric: tabular-nums; +} diff --git a/index.html b/index.html index bf7fd5b..544932f 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ + @@ -15,7 +16,7 @@
- +
diff --git a/main.js b/main.js index 7ef34c9..cf194ac 100644 --- a/main.js +++ b/main.js @@ -272,21 +272,27 @@ function toggleNightMode () { mainWindow.webContents.send('night-mode'); + if (splitWindow) { + + splitWindow.webContents.send('night-mode'); + + } + if (expansionWindow) { expansionWindow.webContents.send('night-mode'); } - if (aboutWindow) { + if (downsampleWindow) { - aboutWindow.webContents.send('night-mode'); + downsampleWindow.webContents.send('night-mode'); } - if (splitWindow) { + if (aboutWindow) { - splitWindow.webContents.send('night-mode'); + aboutWindow.webContents.send('night-mode'); } @@ -442,25 +448,6 @@ app.on('ready', function () { } }] - }, { - label: 'Edit', - submenu: [{ - label: 'Cut', - accelerator: 'CommandOrControl+X', - selector: 'cut:' - }, { - label: 'Copy', - accelerator: 'CommandOrControl+C', - selector: 'copy:' - }, { - label: 'Paste', - accelerator: 'CommandOrControl+V', - selector: 'paste:' - }, { - label: 'Select All', - accelerator: 'CommandOrControl+A', - selector: 'selectAll:' - }] }, { label: 'Help', submenu: [{ diff --git a/package.json b/package.json index b055af3..a98b608 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "AudioMoth-Config", - "version": "1.9.1", + "version": "1.9.2", "description": "The configuration app for the AudioMoth acoustic monitoring device.", "main": "main.js", "author": "openacousticdevices.info", diff --git a/processing/downsampling.html b/processing/downsampling.html index 1567e9c..12001bc 100644 --- a/processing/downsampling.html +++ b/processing/downsampling.html @@ -3,6 +3,7 @@ + Downsample AudioMoth WAV Files diff --git a/processing/expansion.html b/processing/expansion.html index ce7c1b7..474f784 100644 --- a/processing/expansion.html +++ b/processing/expansion.html @@ -3,6 +3,7 @@ + Expand AudioMoth T.WAV Files diff --git a/processing/split.html b/processing/split.html index e2b818a..b1bfd31 100644 --- a/processing/split.html +++ b/processing/split.html @@ -3,6 +3,7 @@ + Split AudioMoth WAV Files diff --git a/processing/uiDownsampling.js b/processing/uiDownsampling.js index 0ec3748..6e38922 100644 --- a/processing/uiDownsampling.js +++ b/processing/uiDownsampling.js @@ -291,7 +291,7 @@ function downsampleFiles () { } -/* When the progress bar is complete and the summary window at the end has been displayed for a fixed amount of ttime, it will close and this re-enables the UI */ +/* When the progress bar is complete and the summary window at the end has been displayed for a fixed amount of time, it will close and this re-enables the UI */ electron.ipcRenderer.on('downsample-summary-closed', enableUI); diff --git a/processing/uiExpansion.js b/processing/uiExpansion.js index 74be30b..b5cb75f 100644 --- a/processing/uiExpansion.js +++ b/processing/uiExpansion.js @@ -393,7 +393,7 @@ function expandFiles () { } -/* When the progress bar is complete and the summary window at the end has been displayed for a fixed amount of ttime, it will close and this re-enables the UI */ +/* When the progress bar is complete and the summary window at the end has been displayed for a fixed amount of time, it will close and this re-enables the UI */ electron.ipcRenderer.on('expansion-summary-closed', enableUI); @@ -611,7 +611,7 @@ expandButton.addEventListener('click', () => { dialog.showMessageBox(currentWindow, { type: 'error', - title: 'Cannot downsample with current settings', + title: 'Cannot expand with current settings', message: 'Output destination is the same as input destination and no prefix is selected.' }); @@ -625,7 +625,7 @@ expandButton.addEventListener('click', () => { dialog.showMessageBox(currentWindow, { type: 'error', - title: 'Cannot downsample with current settings', + title: 'Cannot expand with current settings', message: 'Output destination is the same as input destination and no prefix is selected.' }); diff --git a/processing/uiSplit.js b/processing/uiSplit.js index 74aad04..4abd5e5 100644 --- a/processing/uiSplit.js +++ b/processing/uiSplit.js @@ -295,7 +295,7 @@ function splitFiles () { } -/* When the progress bar is complete and the summary window at the end has been displayed for a fixed amount of ttime, it will close and this re-enables the UI */ +/* When the progress bar is complete and the summary window at the end has been displayed for a fixed amount of time, it will close and this re-enables the UI */ electron.ipcRenderer.on('split-summary-closed', enableUI); @@ -389,7 +389,7 @@ splitButton.addEventListener('click', () => { dialog.showMessageBox(currentWindow, { type: 'error', - title: 'Cannot downsample with current settings', + title: 'Cannot split with current settings', message: 'Output destination is the same as input destination and no prefix is selected.' }); @@ -403,7 +403,7 @@ splitButton.addEventListener('click', () => { dialog.showMessageBox(currentWindow, { type: 'error', - title: 'Cannot downsample with current settings', + title: 'Cannot split with current settings', message: 'Output destination is the same as input destination and no prefix is selected.' }); diff --git a/settings/durationInput.js b/settings/durationInput.js index 93d2a78..cdcad12 100644 --- a/settings/durationInput.js +++ b/settings/durationInput.js @@ -327,7 +327,7 @@ class DurationInput extends HTMLElement { const holderNode = document.createElement('div'); holderNode.className = 'duration-holder'; - holderNode.style = 'position: absolute; top: 0px; margin-left: 5%; margin-top: 2px; width: 90%;'; + holderNode.style = 'position: absolute; top: 0px; margin-left: 5%; margin-top: 3px; width: 90%;'; const spanNode = document.createElement('span'); spanNode.className = 'duration-span'; diff --git a/settings/uiAdvanced.js b/settings/uiAdvanced.js index ecaf08e..5d78faf 100644 --- a/settings/uiAdvanced.js +++ b/settings/uiAdvanced.js @@ -54,13 +54,13 @@ exports.is48DCFilterDisabled = () => { }; -exports.istimeSettingFromGPSEnabled = () => { +exports.isTimeSettingFromGPSEnabled = () => { return gpsTimeCheckbox.checked; }; -exports.ismagneticSwitchEnabled = () => { +exports.isMagneticSwitchEnabled = () => { return magneticDelayCheckbox.checked; diff --git a/settings/uiSettings.js b/settings/uiSettings.js index 7df1038..9ebcea5 100644 --- a/settings/uiSettings.js +++ b/settings/uiSettings.js @@ -191,8 +191,8 @@ exports.getSettings = () => { energySaverModeEnabled: uiAdvanced.isEnergySaverModeEnabled(), lowGainRangeEnabled: uiAdvanced.isLowGainRangeEnabled(), disable48DCFilter: uiAdvanced.is48DCFilterDisabled(), - timeSettingFromGPSEnabled: uiAdvanced.istimeSettingFromGPSEnabled(), - magneticSwitchEnabled: uiAdvanced.ismagneticSwitchEnabled() + timeSettingFromGPSEnabled: uiAdvanced.isTimeSettingFromGPSEnabled(), + magneticSwitchEnabled: uiAdvanced.isMagneticSwitchEnabled() }; return settings; diff --git a/ui.css b/ui.css index 79335f0..6351a67 100644 --- a/ui.css +++ b/ui.css @@ -1,21 +1,3 @@ -input[type=number]::-webkit-inner-spin-button, -input[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} - -*, *::after, *::before { - -webkit-user-select: none; - -webkit-user-drag: none; - -webkit-app-region: no-drag; - cursor: default; -} - -.table>tbody>tr>td, -.table>tbody>tr>th { - border-top: none; -} - body { background: #FFFFFF; } @@ -24,10 +6,6 @@ body { background: rgb(173, 189, 241); } -#disabled-filter-slider .slider-handle { - display: none; -} - -.grey { - color: #D3D3D3; +input { + border: thin solid #cfcfcf; } diff --git a/uiIndex.js b/uiIndex.js index dee4a1a..b019142 100644 --- a/uiIndex.js +++ b/uiIndex.js @@ -34,6 +34,7 @@ const versionChecker = require('./versionChecker.js'); const UINT32_MAX = 0xFFFFFFFF; const UINT16_MAX = 0xFFFF; const SECONDS_IN_DAY = 86400; +const MILLISECONDS_IN_SECOND = 1000; const THRESHOLD_SCALE_PERCENTAGE = 0; const THRESHOLD_SCALE_16BIT = 1; @@ -114,6 +115,8 @@ function requestBatteryState () { audiomoth.getBatteryState(function (err, battery) { + if (communicating) return; + if (err) { console.error(err); @@ -153,6 +156,8 @@ function requestFirmwareVersion () { audiomoth.getFirmwareVersion(function (err, versionArr) { + if (communicating) return; + if (err) { console.error(err); @@ -180,6 +185,8 @@ function requestFirmwareDescription () { audiomoth.getFirmwareDescription(function (err, description) { + if (communicating) return; + if (err || description === null || description === '') { if (err) { @@ -208,6 +215,8 @@ function requestID () { audiomoth.getID(function (err, deviceId) { + if (communicating) return; + if (err || deviceId === null) { if (err) { @@ -244,14 +253,12 @@ function requestID () { function getAudioMothPacket () { - if (communicating) { - - return; - - } + if (communicating) return; audiomoth.getTime(function (err, currentDate) { + if (communicating) return; + if (err || currentDate === null) { date = null; @@ -264,15 +271,21 @@ function getAudioMothPacket () { requestID(); - setTimeout(getAudioMothPacket, 200); - }); + const milliseconds = Date.now() % MILLISECONDS_IN_SECOND; + + var delay = MILLISECONDS_IN_SECOND / 2 - milliseconds; + + if (delay < 0) delay += MILLISECONDS_IN_SECOND; + + setTimeout(getAudioMothPacket, delay); + } /* Check the version and description to see if the firmware is compatible or equivalent to an equivalent version of firmware */ -function checkVersionCompatibilty () { +function checkVersionCompatibility () { /* This version array may be replaced if the firmware is custom with an equivalent official version */ @@ -344,12 +357,6 @@ function checkVersionCompatibilty () { function usePacketValues () { - if (communicating) { - - return; - - } - if (date === null) { disableDisplay(); @@ -368,7 +375,7 @@ function usePacketValues () { updateBatteryDisplay(batteryState); - setTimeout(checkVersionCompatibilty, 100); + setTimeout(checkVersionCompatibility, 100); } diff --git a/uiNight.css b/uiNight.css index 761eae7..037f8d3 100644 --- a/uiNight.css +++ b/uiNight.css @@ -1,19 +1,5 @@ -input[type=number]::-webkit-inner-spin-button, -input[type=number]::-webkit-outer-spin-button { - -webkit-appearance: none; - margin: 0; -} - -*, *::after, *::before { - -webkit-user-select: none; - -webkit-user-drag: none; - -webkit-app-region: no-drag; - cursor: default; -} - .table>tbody>tr>td, .table>tbody>tr>th { - border-top: none; color: #FFFFFF; } @@ -25,6 +11,7 @@ body { input { background: #000000; color: #FFFFFF; + border: thin solid #FFFFFF; } select { @@ -59,7 +46,3 @@ select { #goertzel-threshold-slider .slider-track { background: rgb(64, 100, 216); } - -.grey { - color:#808080; -} \ No newline at end of file