Skip to content

Commit

Permalink
Add 1.11.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pcprince committed Jun 4, 2024
1 parent 31200ae commit 6d618b7
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ An Electron-based application capable of configuring the functionality of the Au
For more details on the device itself, visit [www.openacousticdevices.info](http://www.openacousticdevices.info).

### Usage ###
Once the repository has been cloned, install all required dependencies with:
Once the repository has been cloned, you must either have electron-builder installed globally, or get it for the app specifically by running:
```
npm install
```

From then onwards, start the application with:
From then onwards, or if you already had electron-builder installed, start the application with:
```
npm run start
```
Expand Down
1 change: 1 addition & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const iconLocation = (process.platform === 'linux') ? '/build/icon.png' : '/buil
const standardWindowSettings = {
resizable: false,
fullscreenable: false,
minimizable: false,
autoHideMenuBar: true,
icon: path.join(__dirname, iconLocation),
useContentSize: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AudioMoth-Config",
"version": "1.11.0",
"version": "1.11.1",
"description": "The configuration app for the AudioMoth acoustic monitoring device.",
"main": "main.js",
"author": "openacousticdevices.info",
Expand Down
106 changes: 96 additions & 10 deletions uiIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ configureButton.addEventListener('click', () => {

let message = 'The ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunrise and sunset' : 'dawn and dusk';
message += ' recording periods have zero duration. This means the AudioMoth will not record when in CUSTOM mode.';
message += ' recording periods have zero duration. Extend both intervals to configure.';

dialog.showMessageBoxSync({
type: 'error',
Expand All @@ -1552,11 +1552,13 @@ configureButton.addEventListener('click', () => {

}

if ((sunMode === constants.MODE_BEFORE_SUNRISE_AFTER_SUNRISE || sunMode === constants.MODE_BEFORE_BOTH_AFTER_BOTH) && noSunrise) {
if (sunMode === constants.MODE_BEFORE_SUNRISE_AFTER_SUNRISE && noSunrise) {

let message = 'The ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunrise' : 'dawn';
message += ' recording period has zero duration. This means the AudioMoth will not record around sunrise when in CUSTOM mode.';
message += ' recording period has zero duration. Extend the ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunrise' : 'dawn';
message += ' interval to configure.';

dialog.showMessageBoxSync({
type: 'error',
Expand All @@ -1570,11 +1572,95 @@ configureButton.addEventListener('click', () => {

}

if ((sunMode === constants.MODE_BEFORE_SUNSET_AFTER_SUNSET || sunMode === constants.MODE_BEFORE_BOTH_AFTER_BOTH) && noSunset) {
if (sunMode === constants.MODE_BEFORE_SUNSET_AFTER_SUNSET && noSunset) {

let message = 'The ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunset' : 'dusk';
message += ' recording period has zero duration. This means the AudioMoth will not record around sunrise when in CUSTOM mode.';
message += ' recording period has zero duration. Extend the ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunset' : 'dusk';
message += ' interval to configure.';

dialog.showMessageBoxSync({
type: 'error',
title: 'No recording periods',
message
});

console.log('Configuration cancelled');

return;

}

if (sunMode === constants.MODE_BEFORE_BOTH_AFTER_BOTH && noSunrise) {

let message = 'The ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunrise' : 'dawn';
message += ' recording period has zero duration. Switch to "';
switch (sunDefinitionIndex) {

case constants.SUNRISE_AND_SUNSET:
message += 'Sunset';
break;

case constants.CIVIL_DAWN_AND_DUSK:
message += 'Civil Dusk';
break;

case constants.NAUTICAL_DAWN_AND_DUSK:
message += 'Nautical Dusk';
break;

case constants.ASTRONOMICAL_DAWN_AND_DUSK:
message += 'Astro Dusk';
break;

}

message += '" recording mode or extend the ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunrise' : 'dawn';
message += ' interval to configure.';

dialog.showMessageBoxSync({
type: 'error',
title: 'No recording periods',
message
});

console.log('Configuration cancelled');

return;

}

if (sunMode === constants.MODE_BEFORE_BOTH_AFTER_BOTH && noSunset) {

let message = 'The ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunset' : 'dusk';
message += ' recording period has zero duration. Switch to "';
switch (sunDefinitionIndex) {

case constants.SUNRISE_AND_SUNSET:
message += 'Sunrise';
break;

case constants.CIVIL_DAWN_AND_DUSK:
message += 'Civil Dawn';
break;

case constants.NAUTICAL_DAWN_AND_DUSK:
message += 'Nautical Dawn';
break;

case constants.ASTRONOMICAL_DAWN_AND_DUSK:
message += 'Astro Dawn';
break;

}

message += '" recording mode or extend the ';
message += sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'sunset' : 'dusk';
message += ' interval to configure.';

dialog.showMessageBoxSync({
type: 'error',
Expand All @@ -1590,16 +1676,16 @@ configureButton.addEventListener('click', () => {

if (sunRecordingPeriods.length === 0) {

let messageText = sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'Sunrise and sunset ' : 'Dawn and dusk';
messageText += 'calculation shows no recording periods for the ';
messageText += firstRecordingDateCheckbox.checked ? 'selected first recording date. ' : 'current date. ';
messageText += 'This means the AudioMoth may not record when in CUSTOM mode. Are you sure you wish to apply this configuration?';
let message = sunDefinitionIndex === constants.SUNRISE_AND_SUNSET ? 'Sunrise and sunset' : 'Dawn and dusk';
message += ' calculation shows no recording periods for the ';
message += firstRecordingDateCheckbox.checked ? 'selected first recording date' : 'current date';
message += '. This means the AudioMoth may not record when in CUSTOM mode. Are you sure you wish to apply this configuration?';

const buttonIndex = dialog.showMessageBoxSync({
type: 'warning',
buttons: ['Yes', 'No'],
title: 'No recording periods',
message: messageText
message
});

if (buttonIndex === 1) {
Expand Down

0 comments on commit 6d618b7

Please sign in to comment.