Skip to content

Commit

Permalink
Add 400kHz sample rate
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenAcousticDevices committed Sep 18, 2017
1 parent 4ad1553 commit e1d8ebb
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 15 deletions.
9 changes: 8 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ var configurations = [{
acquisitionCycles: 2,
oversampleRate: 2,
current: 24.0
}, {
sampleRate: 400000,
clockBand: AM_HFXO,
clockDivider: 4,
acquisitionCycles: 2,
oversampleRate: 2,
current: 26.0
}];


Expand Down Expand Up @@ -283,4 +290,4 @@ setTimeout(getAudioMothPacket, 1000);

configureButton.addEventListener('click', function () {
ui.checkInputs(configureDevice);
});
});
10 changes: 7 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@
<td align="center" style='padding: 2px'>48</td>
<td align="center" style='padding: 2px'>96</td>
<td align="center" style='padding: 2px'>192</td>
<td id='sampling-240-label' align="center" style='padding: 2px; color: lightgray'>240</td>
<td id='sampling-320-label' align="center" style='padding: 2px; color: lightgray'>320</td>
<td id='sample-rate-240-label' align="center" style='padding: 2px; color: lightgray'>240</td>
<td id='sample-rate-320-label' align="center" style='padding: 2px; color: lightgray'>320</td>
<td id='sample-rate-400-label' align="center" style='padding: 2px; color: lightgray'>400</td>
</tr>
<tr>
<td align="left" style='padding-top: 0px'>Sample rate (kHz):</td>
Expand All @@ -110,8 +111,10 @@
<td align="center" style='padding-top: 0px'><input type="radio" id="sample-rate-radio5" value=5 name="sample-rate-radio"></td>
<td align="center" style='padding-top: 0px'><input type="radio" id="sample-rate-radio6" value=6 name="sample-rate-radio" disabled></td>
<td align="center" style='padding-top: 0px'><input type="radio" id="sample-rate-radio7" value=7 name="sample-rate-radio" disabled></td>
<td align="center" style='padding-top: 0px'><input type="radio" id="sample-rate-radio8" value=8 name="sample-rate-radio" disabled></td>
</tr>
<tr style='font-size: 11px;'>
<td align="center" style='padding: 2px'></td>
<td align="center" style='padding: 2px'></td>
<td align="center" style='padding: 2px'></td>
<td align="center" style='padding: 2px'></td>
Expand All @@ -125,6 +128,7 @@
<tr>
<td align="left" style='padding-top: 0px'>Gain:</td>
<td align="center" style='padding-top: 0px'></td>
<td align="center" style='padding-top: 0px'></td>
<td align="center" style='padding-top: 0px'></td>
<td align="center" style='padding-top: 0px'></td>
<td align="center" style='padding-top: 0px'><input type="radio" id="gain-radio0" value=0 name="gain-radio"></td>
Expand Down Expand Up @@ -180,4 +184,4 @@
</div>
<script src="app.js" charset="utf-8"></script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function openAboutWindow() {

var aboutWindow = new BrowserWindow({
width: 400,
height: 300,
height: 325,
resizable: false,
fullscreenable: false,
icon: path.join(__dirname, "/build/icon.ico")
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",
"version": "1.0.2",
"version": "1.0.3",
"description": "The configuration app for the AudioMoth acoustic monitoring device.",
"main": "main.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions saveLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ function useLoadedConfiguration(err, data) {

sampleRateRadios = document.getElementsByName("sample-rate-radio");
sampleRateRadios[jsonObj.sampleRateIndex].checked = true;
if(jsonObj.sampleRateIndex > 6){
ui.enableHighSamplingRate();
}
gainRadios = document.getElementsByName("gain-radio");
gainRadios[jsonObj.gainIndex].checked = true;

Expand Down
22 changes: 13 additions & 9 deletions ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ var endTimeInput = document.getElementById('end-time-input');
var recordingDurationInput = document.getElementById('recording-duration-input');
var sleepDurationInput = document.getElementById('sleep-duration-input');

var sampling240Label = document.getElementById('sampling-240-label');
var sampling320Label = document.getElementById('sampling-320-label');
var sampleRate240Label = document.getElementById('sample-rate-240-label');
var sampleRate320Label = document.getElementById('sample-rate-320-label');
var sampleRate400Label = document.getElementById('sample-rate-400-label');

var sampling240RadioButton = document.getElementById('sample-rate-radio6');
var sampling320RadioButton = document.getElementById('sample-rate-radio7');
var sampleRate240RadioButton = document.getElementById('sample-rate-radio6');
var sampleRate320RadioButton = document.getElementById('sample-rate-radio7');
var sampleRate400RadioButton = document.getElementById('sample-rate-radio8');

var configureButton = document.getElementById('configure-button');

Expand Down Expand Up @@ -200,11 +202,13 @@ exports.enableDisplayAndShowTime = function (date) {

exports.enableHighSamplingRate = function () {

sampling240Label.style.color = 'black';
sampling320Label.style.color = 'black';
sampleRate240Label.style.color = 'black';
sampleRate320Label.style.color = 'black';
sampleRate400Label.style.color = 'black';

sampling240RadioButton.removeAttribute("disabled");
sampling320RadioButton.removeAttribute("disabled");
sampleRate240RadioButton.removeAttribute("disabled");
sampleRate320RadioButton.removeAttribute("disabled");
sampleRate400RadioButton.removeAttribute("disabled");

};

Expand Down Expand Up @@ -443,4 +447,4 @@ sleepDurationInput.addEventListener('change', function () {

recordingDurationInput.addEventListener('change', function () {
checkInputs(lifeDisplay.updateLifeDisplay);
});
});

0 comments on commit e1d8ebb

Please sign in to comment.