diff --git a/src/PamguardMVC/PamDataBlock.java b/src/PamguardMVC/PamDataBlock.java index 2b987ffa..2ad1d09e 100644 --- a/src/PamguardMVC/PamDataBlock.java +++ b/src/PamguardMVC/PamDataBlock.java @@ -2078,6 +2078,9 @@ public class PamDataBlock extends PamObservable { /* * Doesnt notify it's own parent to avoid an infinite loop */ + if (Float.isNaN(sampleRate)) { + System.out.println("NaN sample rate being set in " + getLongDataName()); + } if (notify) { for (int i = 0; i < countObservers(); i++) { if (getPamObserver(i).getObserverObject() != parentProcess) { diff --git a/src/soundtrap/STAcquisitionControl.java b/src/soundtrap/STAcquisitionControl.java index 09eebc77..bfad1da2 100644 --- a/src/soundtrap/STAcquisitionControl.java +++ b/src/soundtrap/STAcquisitionControl.java @@ -28,6 +28,7 @@ import java.awt.Component; import Acquisition.AcquisitionControl; import Acquisition.DaqSystem; +import PamController.PamControlledUnitSettings; /** * @author SCANS @@ -102,6 +103,18 @@ public class STAcquisitionControl extends AcquisitionControl { return stDaqSystem; } + @Override + public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) { + // TODO Auto-generated method stub + boolean ok = super.restoreSettings(pamControlledUnitSettings); + if (Float.isNaN(this.getAcquisitionParameters().sampleRate)) { + System.out.println("Nan sample rate read back in sound trap data control. "); + this.getAcquisitionParameters().sampleRate = 384000.f; + } + + return ok; + } + } diff --git a/src/soundtrap/STAcquisitionProcess.java b/src/soundtrap/STAcquisitionProcess.java index caf2583a..1b99ef31 100644 --- a/src/soundtrap/STAcquisitionProcess.java +++ b/src/soundtrap/STAcquisitionProcess.java @@ -87,6 +87,12 @@ public class STAcquisitionProcess extends AcquisitionProcess { } } } + + @Override + public float getSampleRate() { + float fs = super.getSampleRate(); + return fs; + } @Override /** @@ -150,6 +156,7 @@ public class STAcquisitionProcess extends AcquisitionProcess { public boolean isStalled() { return false; } +