From 88b034207a64c052c891a2507c045492206695ec Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Mon, 8 May 2023 15:44:26 +0100 Subject: [PATCH 1/3] Merge pull request #42 from PAMGuard/main (#106) From bf5f0daca547f33acc228596168bb87ac25639fe Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Fri, 12 May 2023 10:03:30 +0100 Subject: [PATCH 2/3] NI Playback bug Fix bug in NI playback which threw an exception if no devices were present and configured in NI-MAX --- src/nidaqdev/NIFilePlayback.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nidaqdev/NIFilePlayback.java b/src/nidaqdev/NIFilePlayback.java index f87a35ef..3b8b42ed 100644 --- a/src/nidaqdev/NIFilePlayback.java +++ b/src/nidaqdev/NIFilePlayback.java @@ -127,7 +127,8 @@ public class NIFilePlayback implements FilePlaybackDevice, PamSettings { @Override public boolean preparePlayback(PlaybackParameters playbackParameters) { - if (niDeviceLUT == null || niDeviceLUT.length <= playbackParameters.deviceNumber) { + if (niDeviceLUT == null || niDeviceLUT.length <= playbackParameters.deviceNumber + || playbackParameters.deviceNumber < 0) { return false; } int bn = niDeviceLUT[playbackParameters.deviceNumber]; From db037c6d2936148e0b4fcbba79e1d9f79a3ad51f Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Fri, 12 May 2023 15:37:21 +0100 Subject: [PATCH 3/3] Fixing SUD order --- src/Acquisition/FolderInputSystem.java | 12 ++++++++++++ src/PamController/InputStoreInfo.java | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/Acquisition/FolderInputSystem.java b/src/Acquisition/FolderInputSystem.java index 731c3439..3eed96ec 100644 --- a/src/Acquisition/FolderInputSystem.java +++ b/src/Acquisition/FolderInputSystem.java @@ -861,7 +861,19 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D long[] allFileStarts = new long[allFiles.size()]; for (int i = 0; i < allFiles.size(); i++) { allFileStarts[i] = getFileStartTime(allFiles.get(i).getAbsoluteFile()); + if (allFileStarts[i] < firstFileStart) { +// System.out.printf("Swap first file from %s to %s\n", firstFile.getName(), allFiles.get(i).getName()); + firstFile = allFiles.get(i); + firstFileStart = allFileStarts[i]; + } + if (allFileStarts[i] > lastFileEnd) { +// System.out.printf("Swap last file from %s to %s\n", lastFile.getName(), allFiles.get(i).getName()); + lastFile = allFiles.get(i); + lastFileEnd = allFileStarts[i] + (long) (lastFile.getDurationInSeconds()*1000.); + } } + storeInfo.setFirstFileStart(firstFileStart); // just incase changed. + storeInfo.setLastFileEnd(lastFileEnd); // just incase changed storeInfo.setFileStartTimes(allFileStarts); } return storeInfo; diff --git a/src/PamController/InputStoreInfo.java b/src/PamController/InputStoreInfo.java index 265ed9d2..cde04c8c 100644 --- a/src/PamController/InputStoreInfo.java +++ b/src/PamController/InputStoreInfo.java @@ -75,6 +75,27 @@ public class InputStoreInfo { public long[] getFileStartTimes() { return fileStartTimes; } + + /** + * @param firstFileStart the firstFileStart to set + */ + public void setFirstFileStart(long firstFileStart) { + this.firstFileStart = firstFileStart; + } + + /** + * @param lastFileStart the lastFileStart to set + */ + public void setLastFileStart(long lastFileStart) { + this.lastFileStart = lastFileStart; + } + + /** + * @param lastFileEnd the lastFileEnd to set + */ + public void setLastFileEnd(long lastFileEnd) { + this.lastFileEnd = lastFileEnd; + }