mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 08:32:32 +00:00
checking nan sample rate in ST Click detector
This commit is contained in:
parent
57bae3c39c
commit
73282b9a71
@ -2078,6 +2078,9 @@ public class PamDataBlock<Tunit extends PamDataUnit> 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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -88,6 +88,12 @@ public class STAcquisitionProcess extends AcquisitionProcess {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getSampleRate() {
|
||||
float fs = super.getSampleRate();
|
||||
return fs;
|
||||
}
|
||||
|
||||
@Override
|
||||
/**
|
||||
* Override the AcquisitionProcess version of this, because it sets the
|
||||
@ -156,4 +162,5 @@ public class STAcquisitionProcess extends AcquisitionProcess {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user