Merge pull request #38 from PAMGuard/main

Merge in from main
This commit is contained in:
Douglas Gillespie 2023-04-05 19:33:16 +01:00 committed by GitHub
commit ed77670458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 325 additions and 167 deletions

View File

@ -6,7 +6,7 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java 17">
<attributes> <attributes>
<attribute name="module" value="true"/> <attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>

1
.gitignore vendored
View File

@ -40,3 +40,4 @@ settings.xml
.classpath .classpath
.classpath .classpath
.classpath .classpath
.classpath

View File

@ -4,7 +4,7 @@
<groupId>org.pamguard</groupId> <groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId> <artifactId>Pamguard</artifactId>
<name>Pamguard Java12+</name> <name>Pamguard Java12+</name>
<version>2.02.07b</version> <version>2.02.07f</version>
<description>Pamguard for Java 12+, using Maven to control dependcies</description> <description>Pamguard for Java 12+, using Maven to control dependcies</description>
<url>www.pamguard.org</url> <url>www.pamguard.org</url>
<organization> <organization>

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.pamguard</groupId> <groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId> <artifactId>Pamguard</artifactId>
<version>2.02.07b</version> <version>2.02.07f</version>
<name>Pamguard Java12+</name> <name>Pamguard Java12+</name>
<description>Pamguard for Java 12+, using Maven to control dependcies</description> <description>Pamguard for Java 12+, using Maven to control dependcies</description>
<url>www.pamguard.org</url> <url>www.pamguard.org</url>

View File

@ -50,6 +50,7 @@ import PamView.dialog.PamGridBagContraints;
import PamView.dialog.PamLabel; import PamView.dialog.PamLabel;
import PamView.panel.PamPanel; import PamView.panel.PamPanel;
import PamView.panel.PamProgressBar; import PamView.panel.PamProgressBar;
import PamguardMVC.debug.Debug;
/** /**
* Read multiple files in sequence. Options exist to either pause and * Read multiple files in sequence. Options exist to either pause and
@ -118,7 +119,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
if (folderInputParameters == null) if (folderInputParameters == null)
setFolderInputParameters(new FolderInputParameters(getSystemType())); setFolderInputParameters(new FolderInputParameters(getSystemType()));
// PamSettingManager.getInstance().registerSettings(this); //calling super already registers this in the FileInputSystem constructor // PamSettingManager.getInstance().registerSettings(this); //calling super already registers this in the FileInputSystem constructor
checkComandLine(); // checkComandLine();
makeSelFileList(); makeSelFileList();
newFileTimer = new Timer(1000, new RestartTimer()); newFileTimer = new Timer(1000, new RestartTimer());
newFileTimer.setRepeats(false); newFileTimer.setRepeats(false);
@ -128,21 +129,24 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
/** /**
* Check to see if acquisition source folder was set in the command line. * Check to see if acquisition source folder was set in the command line.
*/ */
private void checkComandLine() { private String[] checkComandLineFolder() {
String globalFolder = GlobalArguments.getParam(GlobalWavFolderArg); String globalFolder = GlobalArguments.getParam(GlobalWavFolderArg);
Debug.out.println("Checking -wavfilefolder option: is " + globalFolder);
if (globalFolder == null) { if (globalFolder == null) {
return; return null;
} }
// see if it at least exists, though will we want to do this for Network folders ? // see if it at least exists, though will we want to do this for Network folders ?
File aFile = new File(globalFolder); File aFile = new File(globalFolder);
if (aFile.exists() == false) { if (aFile.exists() == false) {
System.err.println("Command line folder does not exist: " + globalFolder); System.err.printf("Command line wav folder \"%s\" does not exist", globalFolder);
// return null;
} }
String[] selList = {globalFolder}; String[] selList = {globalFolder};
folderInputParameters.setSelectedFiles(selList); // folderInputParameters.setSelectedFiles(selList);
// need to immediately make the allfiles list since it's about to get used by the reprocess manager // need to immediately make the allfiles list since it's about to get used by the reprocess manager
// need to worry about how to wait for this since it's starting in a different thread. // need to worry about how to wait for this since it's starting in a different thread.
makeSelFileList(); //makeSelFileList();
return selList;
} }
/** /**
@ -295,15 +299,24 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
} }
/** /**
* Make a list of wav files within a folder. * Make a list of wav files within a folder. In some circumstances this can be a list
* of actual files in a folder. Also needs to handle the possibility of it using
* a globally set folder name.
* @return flag to indicate...nothing? * @return flag to indicate...nothing?
*/ */
public int makeSelFileList() { public int makeSelFileList() {
if (fileInputParameters.recentFiles == null || fileInputParameters.recentFiles.size() < 1) { String[] selection = checkComandLineFolder();
return 0;
if (selection == null) {
if (fileInputParameters.recentFiles == null || fileInputParameters.recentFiles.size() < 1) {
return 0;
}
selection = folderInputParameters.getSelectedFiles();
}
if (selection.length > 0) {
System.out.println("FolderInputSystem.makeSelFileList(): Searching for sound files in " + selection[0]);
} }
String[] selection = folderInputParameters.getSelectedFiles();
return makeSelFileList(selection); return makeSelFileList(selection);
} }

View File

@ -284,9 +284,12 @@ public class StandardFileDate implements FileDate, PamSettings {
} catch (ParseException e) { } catch (ParseException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
// e.printStackTrace(); // e.printStackTrace();
System.out.println(e.getMessage()); System.out.println("StandardfileDate.forcedDataFormat:" + e.getMessage());
} //throws ParseException if no match } //throws ParseException if no match
setLastFormat(forcedDateFormat); setLastFormat(forcedDateFormat);
if (d == null) {
return 0;
}
return d.getTime(); return d.getTime();
} }

View File

@ -368,7 +368,7 @@ abstract public class IshLocProcess extends PamProcess implements SpectrogramMar
selectionSams = daqBlock.getSamples(startSam, (int)durationSam, channelMap); selectionSams = daqBlock.getSamples(startSam, (int)durationSam, channelMap);
} }
catch (RawDataUnavailableException e) { catch (RawDataUnavailableException e) {
System.out.println(e.getMessage()); System.out.println("RawDataUnavailableException in IshLocProcess:" + e.getMessage());
// if the raw data has already been discarded, adjust the natural lifetime to try and avoid this in the future // if the raw data has already been discarded, adjust the natural lifetime to try and avoid this in the future
int newTime; int newTime;

View File

@ -287,7 +287,7 @@ public final class SSHSession implements UserInfo {
out.write(k); out.write(k);
out.flush(); out.flush();
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("IOException in SSHSession.write: " + e.getMessage());
} }
} }
@ -349,7 +349,7 @@ public final class SSHSession implements UserInfo {
} }
} }
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("Error in SSHSession.pump: " + e.getMessage());
} finally { } finally {
closeQuietly(in); closeQuietly(in);
closeQuietly(out); closeQuietly(out);

View File

@ -203,7 +203,7 @@ public class AcquireNmeaData extends PamProcess implements ActionListener, Modul
try { try {
pjSerialComm = PJSerialComm.openSerialPort(params.serialPortName, params.serialPortBitsPerSecond); pjSerialComm = PJSerialComm.openSerialPort(params.serialPortName, params.serialPortBitsPerSecond);
} catch (PJSerialException e) { } catch (PJSerialException e) {
System.out.println(e.getMessage()); System.out.println("PJSerialException in AcquireNMEAData" + e.getMessage());
// WarnOnce.sho // WarnOnce.sho
return; return;
} }

View File

@ -1314,7 +1314,12 @@ public class PamController implements PamControllerInterface, PamSettings {
@Override @Override
public void run() { public void run() {
long t1 = System.currentTimeMillis();
while (checkRunStatus()) { while (checkRunStatus()) {
long t2 = System.currentTimeMillis();
if (t2 - t1 > 5000) {
System.out.printf("Stopping, but stuck in loop for CheckRunStatus for %3.1fs\n", (double) (t2-t1)/1000.);
}
try { try {
Thread.sleep(10); Thread.sleep(10);
} catch (InterruptedException e) { } catch (InterruptedException e) {

View File

@ -1752,10 +1752,10 @@ public class PamSettingManager {
fIs.close(); fIs.close();
fOs.close(); fOs.close();
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
System.out.println(e.getMessage()); System.out.println("FileNotFound exception in PamSettingsManager: " + e.getMessage());
return false; return false;
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("IO exception in PamSettingsManager: " + e.getMessage());
return false; return false;
} }
return true; return true;

View File

@ -31,12 +31,12 @@ public class PamguardVersionInfo {
* Version number, major version.minorversion.sub-release. * Version number, major version.minorversion.sub-release.
* Note: can't go higher than sub-release 'f' * Note: can't go higher than sub-release 'f'
*/ */
static public final String version = "2.02.07b"; static public final String version = "2.02.07f";
/** /**
* Release date * Release date
*/ */
static public final String date = "19 January 2023"; static public final String date = "4 April 2023";
// /** // /**
// * Release type - Beta or Core // * Release type - Beta or Core

View File

@ -46,7 +46,7 @@ public class ExternalCapture extends ExternalController {
} }
} }
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("IOError in ExternalCapture.readInputStream: " + e.getMessage());
} }
} }

View File

@ -662,7 +662,7 @@ public class PamguardXMLWriter implements PamSettings {
} }
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Error in PamguardXMLWriter.writeArray: " + e.getMessage());
} }
return null; return null;
} }
@ -704,7 +704,7 @@ public class PamguardXMLWriter implements PamSettings {
return e; return e;
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Error in PamguardXMLWriter.writeObjectArray: " + e.getMessage());
} }
return null; return null;
} }
@ -729,7 +729,7 @@ public class PamguardXMLWriter implements PamSettings {
// el.appendChild(e); // el.appendChild(e);
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Error in PamguardXMLWriter.writePrimativeArray: " + e.getMessage());
} }
return null; return null;
} }

View File

@ -108,7 +108,7 @@ public class FileFunctions {
return attrib; return attrib;
} }
catch (Error e) { catch (Error e) {
System.out.println(e.getMessage()); System.out.println("Error in FileFunctions.getAttributes: " + e.getMessage());
return 0; return 0;
} }
} }

View File

@ -8,6 +8,7 @@ import PamUtils.PamFileFilter;
import PamUtils.worker.PamWorkProgressMessage; import PamUtils.worker.PamWorkProgressMessage;
import PamUtils.worker.PamWorkWrapper; import PamUtils.worker.PamWorkWrapper;
import PamUtils.worker.PamWorker; import PamUtils.worker.PamWorker;
import PamguardMVC.debug.Debug;
/** /**
* Class to list files in one or more directories. * Class to list files in one or more directories.
@ -64,6 +65,9 @@ public abstract class FileListWorker<T extends File> implements PamWorkWrapper<F
this.fileList = rootList; this.fileList = rootList;
this.subFolders = subFolders; this.subFolders = subFolders;
this.useOldIfPossible = useOldIfPossible; this.useOldIfPossible = useOldIfPossible;
for (int i = 0; i < rootList.length; i++) {
Debug.out.println(">>>>>>>>Starting file search in " + rootList[i]);
}
if (noChange(rootList, subFolders, useOldIfPossible)) { if (noChange(rootList, subFolders, useOldIfPossible)) {
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
@ -162,6 +166,7 @@ public abstract class FileListWorker<T extends File> implements PamWorkWrapper<F
private void addFiles(PamWorker<FileListData<T>> pamWorker, FileListData<T> newFileList, File folder) { private void addFiles(PamWorker<FileListData<T>> pamWorker, FileListData<T> newFileList, File folder) {
newFileList.addFolder(); newFileList.addFolder();
pamWorker.update(new PamWorkProgressMessage(-1, "Searching folder " + folder.getAbsolutePath())); pamWorker.update(new PamWorkProgressMessage(-1, "Searching folder " + folder.getAbsolutePath()));
Debug.out.println(">>>> Searching for files in abs path " + folder.getAbsolutePath());
// System.out.println(folder.getAbsolutePath()); // System.out.println(folder.getAbsolutePath());
File[] moreFiles = folder.listFiles(fileFilter); File[] moreFiles = folder.listFiles(fileFilter);
if (moreFiles == null) { if (moreFiles == null) {

View File

@ -3699,7 +3699,7 @@ Text {
#label-title1 { #label-title1 {
-fx-font: bold 16pt -fx-font-family; -fx-font: bold 14pt -fx-font-family;
} }
#label-title2 { #label-title2 {

View File

@ -225,6 +225,11 @@ public class AlarmProcess extends PamProcess {
} }
@Override
public void updateData(PamObservable o, PamDataUnit arg) {
newData(o, arg);
}
public boolean setupAlarm() { public boolean setupAlarm() {
dataSource = PamController.getInstance().getDataBlock(PamDataUnit.class, alarmControl.alarmParameters.dataSourceName); dataSource = PamController.getInstance().getDataBlock(PamDataUnit.class, alarmControl.alarmParameters.dataSourceName);
if (dataSource == null) { if (dataSource == null) {

View File

@ -94,7 +94,7 @@ public class PlaySound extends AlarmAction implements PamSettings {
double secs = fl/sr*1000; double secs = fl/sr*1000;
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Error in PlaySound.playSound:" + e.getMessage());
return false; return false;
} }
return true; return true;
@ -114,10 +114,10 @@ public class PlaySound extends AlarmAction implements PamSettings {
System.out.println(f.getMessage()); System.out.println(f.getMessage());
return currentClip = null; return currentClip = null;
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("IOError in PlaySound.prepareClip: " + e.getMessage());
return currentClip = null; return currentClip = null;
} catch (LineUnavailableException e) { } catch (LineUnavailableException e) {
System.out.println(e.getMessage()); System.out.println("LineUnavailableException in PlaySound.prepareClip: " + e.getMessage());
return currentClip = null; return currentClip = null;
} }
currentFile = soundFile; currentFile = soundFile;

View File

@ -118,7 +118,7 @@ public abstract class BackupStream implements PamSettings, BackupFunction {
try { try {
ok = doAction(backupManager, action, item); ok = doAction(backupManager, action, item);
} catch (BackupException e) { } catch (BackupException e) {
System.out.println(e.getMessage()); System.out.println("Error in BackupStream.runAction:" + e.getMessage());
backupManager.updateProgress(new BackupProgress(this, action, STATE.PROBLEM, toDoList.size(), backupManager.updateProgress(new BackupProgress(this, action, STATE.PROBLEM, toDoList.size(),
iDone, "Error " + e.getMessage())); iDone, "Error " + e.getMessage()));
ok = false; //otherwise, OK stays true! This will leave a true null entry in the database, so file will be selected next time around ok = false; //otherwise, OK stays true! This will leave a true null entry in the database, so file will be selected next time around

View File

@ -41,6 +41,8 @@ public abstract class BinaryDataSource {
private boolean saveUpdates = false; private boolean saveUpdates = false;
private BackgroundBinaryWriter backgroundBinaryWriter; private BackgroundBinaryWriter backgroundBinaryWriter;
public static final Object packSynchObject = new Object();
/** /**
* Create a binary data source. These are used both to store data in binary * Create a binary data source. These are used both to store data in binary
@ -224,11 +226,13 @@ public abstract class BinaryDataSource {
* Then pack the data * Then pack the data
*/ */
BinaryObjectData data; BinaryObjectData data;
if (pamDataUnit instanceof BackgroundDataUnit) { synchronized (packSynchObject) {
data = getBackgroundBinaryWriter().packBackgroundData((BackgroundDataUnit) pamDataUnit); if (pamDataUnit instanceof BackgroundDataUnit) {
} data = getBackgroundBinaryWriter().packBackgroundData((BackgroundDataUnit) pamDataUnit);
else { }
data = getPackedData(pamDataUnit); else {
data = getPackedData(pamDataUnit);
}
} }
/* /*
* Then put it back to how it was a moment ago. * Then put it back to how it was a moment ago.

View File

@ -1809,7 +1809,7 @@ public class ClickDetector extends PamProcess {
newClick.setStartSample(newClick.getStartSample() - firstFilterDelay - secondFilterDelay); newClick.setStartSample(newClick.getStartSample() - firstFilterDelay - secondFilterDelay);
waveDataError = false; waveDataError = false;
} catch (RawDataUnavailableException e) { } catch (RawDataUnavailableException e) {
System.out.println("RawDataUnavailableException"); System.out.println(" Click Detector RawDataUnavailableException");
System.out.println(e.getMessage()); System.out.println(e.getMessage());
} }
for (int k = 0; k < nChannels; k++) { for (int k = 0; k < nChannels; k++) {

View File

@ -51,11 +51,18 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTextField; import javax.swing.JTextField;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JPanel;
import PamController.SettingsPane; import PamController.SettingsPane;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import PamView.PamSymbol; import PamView.PamSymbol;
import PamView.dialog.PamGridBagContraints; import PamView.dialog.PamGridBagContraints;
import PamView.symbol.SymbolData; import PamView.symbol.SymbolData;
import clickDetector.ClickControl;
import clickDetector.ClickClassifiers.basicSweep.CodeHost; import clickDetector.ClickClassifiers.basicSweep.CodeHost;
import clickDetector.ClickClassifiers.basicSweep.SweepClassifier; import clickDetector.ClickClassifiers.basicSweep.SweepClassifier;
import clickDetector.ClickClassifiers.basicSweep.SweepClassifierSet; import clickDetector.ClickClassifiers.basicSweep.SweepClassifierSet;
@ -237,11 +244,10 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
//create holder pane //create holder pane
borderPane=new PamBorderPane(); borderPane=new PamBorderPane();
this.setCenter(borderPane); this.setCenter(borderPane);
PamHBox hBox = new PamHBox(); PamHBox hBox = new PamHBox();
hBox.setSpacing(5); hBox.setSpacing(5);
if (borderTitle != null) { if (borderTitle != null) {
label=new Label(borderTitle); label=new Label(borderTitle);
@ -764,6 +770,8 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
*/ */
PamSpinner<Double> threshold; PamSpinner<Double> threshold;
private PamVBox vboxholder;
ClickLengthBox() { ClickLengthBox() {
super("Click Length", true); super("Click Length", true);
@ -882,10 +890,11 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
@Override @Override
protected void disbleControls(boolean disable) { protected void disbleControls(boolean disable) {
smoothing.setDisable(disable); vboxholder.setDisable(disable);
minLengthms.setDisable(disable); // smoothing.setDisable(disable);
maxLengthms.setDisable(disable); // minLengthms.setDisable(disable);
threshold.setDisable(disable); // maxLengthms.setDisable(disable);
// threshold.setDisable(disable);
} }
} }
@ -929,13 +938,13 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
pamGridPane.setVgap(5); pamGridPane.setVgap(5);
Label freqLabel=new Label("Frequency (Hz)"); Label freqLabel=new Label("Frequency (Hz)");
pamGridPane.add(freqLabel, 0, 0); //// gridPaneHolder.add(freqLabel, 0, 0);
pamGridPane.add(new Label("Threshold (dB)"), 2, 0); //// gridPaneHolder.add(new Label("Threshold (dB)"), 2, 0);
PamGridPane.setHalignment(freqLabel, HPos.CENTER); // PamGridPane.setHalignment(freqLabel, HPos.CENTER);
PamGridPane.setColumnSpan(pamGridPane, 2); // PamGridPane.setColumnSpan(gridPaneHolder, 2);
//
//test band // //test band
pamGridPane.add(new Label("Test Band"), 0, 1); // gridPaneHolder.add(new Label("Test Band"), 0, 1);
testBandFreqPane=new FreqBandPane(Orientation.HORIZONTAL); testBandFreqPane=new FreqBandPane(Orientation.HORIZONTAL);
testBandFreqPane.setBandText(""); testBandFreqPane.setBandText("");
@ -1094,6 +1103,9 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
private PamSpinner<Double> threshold; private PamSpinner<Double> threshold;
private FreqBandPane searchRange; private FreqBandPane searchRange;
private FreqBandPane meanFreq; private FreqBandPane meanFreq;
//the main holder pane.
private PamGridPane gridPaneHolder;
FrequencySearchBlock() { FrequencySearchBlock() {
super("Peak and Mean Frequency", true); super("Peak and Mean Frequency", true);
@ -1176,14 +1188,12 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
addValidatorFreqCheck(getValidator(), peakWidthPane, "peak width ", "peak_width"); addValidatorFreqCheck(getValidator(), peakWidthPane, "peak width ", "peak_width");
gridy++; gridy++;
pamGridPane.add(new Label(""), 1,gridy); pamGridPane.add(new Label(""), 1,gridy);
threshold=new PamSpinner<Double>(1., 300., 6.,1.); threshold=new PamSpinner<Double>(1., 300., 6.,1.);
threshold.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL); threshold.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);
threshold.setPrefWidth(100); threshold.setPrefWidth(100);
GridPane.setMargin(threshold, new Insets(0,0,0,5)); //bit of a hack to make sure everything lines up nicely with the frequency pane. GridPane.setMargin(threshold, new Insets(0,0,0,5)); //bit of a hack to make sure everything lines up nicely with the frequency pane.
pamGridPane.add(threshold,2,gridy); pamGridPane.add(threshold,2,gridy);
pamGridPane.add(new Label("dB"), 3,gridy); pamGridPane.add(new Label("dB"), 3,gridy);
@ -1216,8 +1226,6 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
@Override @Override
protected void setParams() { protected void setParams() {
setEnableBox(sweepClassifierSet.enableEnergyBands); setEnableBox(sweepClassifierSet.enableEnergyBands);
} }
@Override @Override
@ -1227,6 +1235,22 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
} }
@Override @Override
// protected void disbleControls(boolean disable) {
// this.gridPaneHolder.setDisable(disable);
// peakFreqCheckBox.setDisable(enable);
// peakWidthCheckBox.setDisable(enable);
// meanFreqCheckBox.setDisable(enable);
//
//
// /**
// * Pane to set frequency band range */
// peakFreqPane.setDisable(enable);
// smoothing.setDisable(enable);
// peakWidthPane.setDisable(enable);
// threshold.setDisable(enable);
// searchRange.setDisable(enable);
// meanFreq.setDisable(enable);
protected void disbleControls(boolean enable) { protected void disbleControls(boolean enable) {
peakFreqCheckBox.setDisable(enable); peakFreqCheckBox.setDisable(enable);
peakWidthCheckBox.setDisable(enable); peakWidthCheckBox.setDisable(enable);
@ -1274,6 +1298,11 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
*/ */
private PamSpinner<Double> freqZeroMax; private PamSpinner<Double> freqZeroMax;
/**
* The main holder
*/
private PamGridPane gridPaneHolder;
ZeroCrossingsBox() { ZeroCrossingsBox() {
super("Zero Crossings", true); super("Zero Crossings", true);
this.getHolderPane().setCenter(createZeroCrossPane()); this.getHolderPane().setCenter(createZeroCrossPane());
@ -1600,6 +1629,7 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
p.setLayout(new GridBagLayout()); p.setLayout(new GridBagLayout());
GridBagConstraints c = new PamGridBagContraints(); GridBagConstraints c = new PamGridBagContraints();
// c.gridx = 0; // c.gridx = 0;
// addComponent(p, enableBearings, c); // addComponent(p, enableBearings, c);
// c.gridx += c.gridwidth; // c.gridx += c.gridwidth;
@ -1832,12 +1862,19 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
} }
private boolean showWarning(String string, String string2) { private boolean showWarning(String string, String string2) {
//PamController.getInstance(); //PamController.getInstance();
PamDialogFX.showWarning(null, string, string2); PamDialogFX.showWarning(null, string, string2);
return false; return false;
} }
/**
* Get the click control associated with the classifier.
* @return the click control.
*/
public ClickControl getClickControl() {
return this.sweepClassifier.getClickDetector().getClickControl();
}
/** /**
@ -1862,4 +1899,4 @@ public class SweepClassifierSetPaneFX extends SettingsPane<ClickTypeProperty> {
private boolean isPaneShowing() { private boolean isPaneShowing() {
return sweepClassifier.getClassifierPane().getFlipPane().isBackVisible(); return sweepClassifier.getClassifierPane().getFlipPane().isBackVisible();
} }
} }

View File

@ -291,7 +291,7 @@ public class ClipProcess extends SpectrogramMarkProcess {
try { try {
rawData = rawDataBlock.getSamples(startSample, numSamples, channelMap); rawData = rawDataBlock.getSamples(startSample, numSamples, channelMap);
} catch (RawDataUnavailableException e) { } catch (RawDataUnavailableException e) {
System.out.println(e.getMessage()); System.out.println("RawDataUnavailableException in ClipProcess.spectrogramNotification :" + e.getMessage());
return false; return false;
} }
if (rawData == null) { if (rawData == null) {

View File

@ -199,7 +199,7 @@ public class DbHtDialog extends PamDialog {
params.calculateFilterThings(currentSampleRate); params.calculateFilterThings(currentSampleRate);
} }
catch (DbHtException e) { catch (DbHtException e) {
System.out.println(e.getMessage()); System.out.println("Error in DbHtDialog.updateEverything: " + e.getMessage());
return; return;
} }
double[] f = params.getFilterFrequencies(currentSampleRate); double[] f = params.getFilterFrequencies(currentSampleRate);

View File

@ -1110,7 +1110,7 @@ public class DifarProcess extends PamProcess {
rawData[0] = rawDataAll[0]; // is fine since getSamples was fed a channel map. rawData[0] = rawDataAll[0]; // is fine since getSamples was fed a channel map.
} }
} catch (RawDataUnavailableException e) { } catch (RawDataUnavailableException e) {
System.out.println(e.getMessage()); System.out.println("Error in DifarProcess.difarTrigger" + e.getMessage());
return; return;
} }
if (rawData[0] == null) { if (rawData[0] == null) {

View File

@ -98,7 +98,7 @@ public class NativeDemux extends GreenridgeDemux {
return true; return true;
} }
catch (UnsatisfiedLinkError e) { catch (UnsatisfiedLinkError e) {
System.out.println(e.getMessage()); System.out.println("Error in NativeDemux.loadLibrary" + e.getMessage());
return false; return false;
} }
} }

View File

@ -190,7 +190,7 @@ public class DBSpeedTest {
dropStmt.execute(); dropStmt.execute();
} catch (SQLException e) { } catch (SQLException e) {
// e.printStackTrace(); // e.printStackTrace();
System.out.println(e.getMessage()); System.out.println("Error in DBSpeedTest testSpeed2:" + e.getMessage());
} }
} }
try { try {

View File

@ -261,7 +261,13 @@ public class ContourFinder {
* Note that binData is padded, whiteData isn't. * Note that binData is padded, whiteData isn't.
*/ */
GPLContour newContour = new GPLContour(iT-1, iF-1+gplProcess.binLo, whiteData[iT-1][iF-1], energyData[iT-1][iF-1]); GPLContour newContour = new GPLContour(iT-1, iF-1+gplProcess.binLo, whiteData[iT-1][iF-1], energyData[iT-1][iF-1]);
findAdjacentPoints(newContour, iT, iF, binData, whiteData, energyData, con); try {
findAdjacentPoints(newContour, iT, iF, binData, whiteData, energyData, con);
}
catch (StackOverflowError e) {
System.out.println("Stack overflow in GPLContour.findRegion for bloated contour size " + newContour.getArea());
System.out.println("The contour is incomplete, but has not been discarded");
}
return newContour; return newContour;
} }
@ -282,6 +288,10 @@ public class ContourFinder {
* Separate loops to get above and to sides, NOT diagonal matches. * Separate loops to get above and to sides, NOT diagonal matches.
* could also easily change to connect 8 instead of connect 4. * could also easily change to connect 8 instead of connect 4.
*/ */
if (newContour.getArea() >= 500) {
System.out.println("GPL Contour size exceeds maximum value of 500 points so ceasing to grow it");
return;
}
binData[currT][currF] = 0; // set current point to 0 so it doesn't get found again binData[currT][currF] = 0; // set current point to 0 so it doesn't get found again
int nX = binData.length-1; int nX = binData.length-1;
int nY = binData[0].length-1; int nY = binData[0].length-1;

View File

@ -217,7 +217,7 @@ public class HyperbolicLocaliser extends TOADBaseAlgorithm {
// answer2 = rightMatrix.times(leftInverse.transpose()); // answer2 = rightMatrix.times(leftInverse.transpose());
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Error in HyperbolicLocaliser.processTOADsPlane: " + e.getMessage());
// Matrix m = leftMatrix.transpose(); // Matrix m = leftMatrix.transpose();
// m = m.inverse(); // m = m.inverse();
return null; return null;
@ -254,7 +254,7 @@ public class HyperbolicLocaliser extends TOADBaseAlgorithm {
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Error2 in HyperbolicLocaliser.processTOADsPlane: " + e.getMessage());
} }
// now need to rotate back from the plane that we're in to get back to the original position. // now need to rotate back from the plane that we're in to get back to the original position.
@ -736,7 +736,7 @@ public class HyperbolicLocaliser extends TOADBaseAlgorithm {
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Error in HyperbolicLocaliser.processTOADs3D: " + e.getMessage());
} }
LatLong pos = geometry.getReferenceGPS().addDistanceMeters(centre.getCoordinate(0)+answer.get(0,0), LatLong pos = geometry.getReferenceGPS().addDistanceMeters(centre.getCoordinate(0)+answer.get(0,0),

View File

@ -146,7 +146,7 @@ public class ToadSimplexLocaliser extends TOADBaseAlgorithm {
try { try {
result = optimiser.optimize(chiFunc, goal, start); result = optimiser.optimize(chiFunc, goal, start);
} catch (OptimizationException | FunctionEvaluationException | IllegalArgumentException e) { } catch (OptimizationException | FunctionEvaluationException | IllegalArgumentException e) {
System.out.println(e.getMessage()); System.out.println("Error in TOADSimplexLocaliser.processTOADs: " + e.getMessage());
nFails++; nFails++;
System.out.printf("%d fails out of %d = %3.2f%%\n", nFails, nCalls, (double) nFails * 100. / nCalls); System.out.printf("%d fails out of %d = %3.2f%%\n", nFails, nCalls, (double) nFails * 100. / nCalls);
resultChiData[iStart] = null; resultChiData[iStart] = null;

View File

@ -129,7 +129,7 @@ public class EmulatorStream {
try { try {
emSocket.getOutputStream().write(data); emSocket.getOutputStream().write(data);
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("Error in EmulatorStream.sendPamCommand: " + e.getMessage());
} }
} }
private boolean openSocket() { private boolean openSocket() {
@ -137,9 +137,9 @@ public class EmulatorStream {
try { try {
emSocket = new Socket(sktParams.ipAddress, sktParams.portNumber); emSocket = new Socket(sktParams.ipAddress, sktParams.portNumber);
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
System.out.println(e.getMessage()); System.out.println("UnknownHostException in EmulatorStream.sendPamCommand: " + e.getMessage());
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("IOException in EmulatorStream.sendPamCommand: " + e.getMessage());
} }
if (emSocket != null) { if (emSocket != null) {
status.socketStatus = emSocket.isConnected(); status.socketStatus = emSocket.isConnected();

View File

@ -458,7 +458,7 @@ public class NetworkReceiver extends PamControlledUnit implements PamSettings, N
// checkExistingThreads(clientSocket, rxThread); // checkExistingThreads(clientSocket, rxThread);
} }
} catch (IOException e) { } catch (IOException e) {
System.out.println(e.getMessage()); System.out.println("IOException in NeetworkReceiver" + e.getMessage());
} }
} }

View File

@ -75,7 +75,10 @@ public class NetworkObjectPacker {
BinaryDataSource binarySource = dataBlock.getBinaryDataSource(); BinaryDataSource binarySource = dataBlock.getBinaryDataSource();
int dataType2 = dataBlock.getQuickId(); int dataType2 = dataBlock.getQuickId();
BinaryObjectData packedObject = binarySource.getPackedData(dataUnit); BinaryObjectData packedObject = null;
synchronized (BinaryDataSource.packSynchObject) {
packedObject = binarySource.getPackedData(dataUnit);
}
byte[] data = packedObject.getData(); byte[] data = packedObject.getData();
int duDataLength = data.length + 12; int duDataLength = data.length + 12;
DataUnitBaseData baseData = dataUnit.getBasicData(); DataUnitBaseData baseData = dataUnit.getBasicData();

View File

@ -23,10 +23,12 @@ import javax.swing.SwingWorker;
import networkTransfer.emulator.NetworkEmulator; import networkTransfer.emulator.NetworkEmulator;
import networkTransfer.receive.NetworkReceiver; import networkTransfer.receive.NetworkReceiver;
import pamguard.GlobalArguments;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import Acquisition.FolderInputSystem;
import PamController.PamControlledUnit; import PamController.PamControlledUnit;
import PamController.PamControlledUnitSettings; import PamController.PamControlledUnitSettings;
import PamController.PamController; import PamController.PamController;
@ -44,6 +46,11 @@ import PamguardMVC.PamDataBlock;
* *
*/ */
public class NetworkSender extends PamControlledUnit implements PamSettings { public class NetworkSender extends PamControlledUnit implements PamSettings {
public static final String ADDRESS = "-netSend.address";
public static final String PORT = "-netSend.port";
public static final String ID1 = "-netSend.id1";
public static final String ID2 = "-netSend.id2";
protected NetworkSendParams networkSendParams = new NetworkSendParams(); protected NetworkSendParams networkSendParams = new NetworkSendParams();
private NetworkEmulator networkEmulator; private NetworkEmulator networkEmulator;
@ -169,6 +176,28 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
public boolean restoreSettings( public boolean restoreSettings(
PamControlledUnitSettings pamControlledUnitSettings) { PamControlledUnitSettings pamControlledUnitSettings) {
networkSendParams = ((NetworkSendParams) pamControlledUnitSettings.getSettings()).clone(); networkSendParams = ((NetworkSendParams) pamControlledUnitSettings.getSettings()).clone();
String address = GlobalArguments.getParam(ADDRESS);
String portString = GlobalArguments.getParam(PORT);
String id1String = GlobalArguments.getParam(ID1);
String id2String = GlobalArguments.getParam(ID2);
if (address != null) {
networkSendParams.ipAddress = address; // remember it.
}
if(portString != null) {
networkSendParams.portNumber = Integer.valueOf(portString);
}
if(id1String!=null) {
networkSendParams.stationId1 = Integer.valueOf(id1String);
}
if(id2String!=null) {
networkSendParams.stationId1 = Integer.valueOf(id2String);
}
return (networkSendParams != null); return (networkSendParams != null);
} }
@ -452,7 +481,7 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
return true; return true;
} catch (IOException e) { } catch (IOException e) {
// e.printStackTrace(); // e.printStackTrace();
System.out.println(e.getMessage()); System.out.println("IOException in NeetworkSender.writeByteData: " + e.getMessage());
currStatus = "Socket Closed"; currStatus = "Socket Closed";
return false; return false;
} }
@ -465,7 +494,7 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
return true; return true;
} catch (IOException e) { } catch (IOException e) {
// e.printStackTrace(); // e.printStackTrace();
System.out.println(e.getMessage()); System.out.println("IOException in NeetworkSender.writeStringData" + e.getMessage());
currStatus = "Socket Closed"; currStatus = "Socket Closed";
return false; return false;
} }
@ -513,7 +542,7 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
tcpWriter.close(); tcpWriter.close();
} catch (IOException e) { } catch (IOException e) {
// e.printStackTrace(); // e.printStackTrace();
System.out.println(e.getMessage()); System.out.println("IOException in NeetworkSender.closeconnection" + e.getMessage());
} }
tcpSocket = null; tcpSocket = null;
tcpWriter = null; tcpWriter = null;

View File

@ -68,7 +68,7 @@ public class SerialOutput {
SerialPort.NO_PARITY, SerialPort.NO_PARITY,
SerialPort.FLOW_CONTROL_DISABLED); // disable flow control, since this is the RXTX default and it's not specified above SerialPort.FLOW_CONTROL_DISABLED); // disable flow control, since this is the RXTX default and it's not specified above
} catch (PJSerialException e) { } catch (PJSerialException e) {
System.out.println(e.getMessage()); System.out.println("PJSerialException in SerialOutput: " + e.getMessage());
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }

View File

@ -21,8 +21,6 @@ import dataMap.OfflineDataMapPoint;
* @param <T> * @param <T>
*/ */
public class DataCopyTask<T extends PamDataUnit> extends OfflineTask<T> { public class DataCopyTask<T extends PamDataUnit> extends OfflineTask<T> {
private PamDataBlock<T> pamDataBlock;
private SQLLogging sqlLogging; private SQLLogging sqlLogging;
@ -40,7 +38,6 @@ public class DataCopyTask<T extends PamDataUnit> extends OfflineTask<T> {
*/ */
public DataCopyTask(PamDataBlock<T> pamDataBlock) { public DataCopyTask(PamDataBlock<T> pamDataBlock) {
super(pamDataBlock); super(pamDataBlock);
this.pamDataBlock = pamDataBlock;
this.sqlLogging = pamDataBlock.getLogging(); this.sqlLogging = pamDataBlock.getLogging();
this.binaryDataSource = pamDataBlock.getBinaryDataSource(); this.binaryDataSource = pamDataBlock.getBinaryDataSource();
setParentDataBlock(pamDataBlock); setParentDataBlock(pamDataBlock);
@ -77,7 +74,7 @@ public class DataCopyTask<T extends PamDataUnit> extends OfflineTask<T> {
@Override @Override
public String getName() { public String getName() {
return "Copy " + pamDataBlock.getDataName() + " To database"; return "Copy " + getDataBlock().getDataName() + " To database";
} }
@Override @Override

View File

@ -458,5 +458,4 @@ public abstract class OfflineTask<T extends PamDataUnit> {
} }
} }

View File

@ -250,7 +250,7 @@ public class PamAxisPane2 extends StackPane {
// } // }
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Exception in PamAxisPanel2.ScaledNumberFormatter: " + e.getMessage());
e.printStackTrace(); e.printStackTrace();
return "Err"; return "Err";
} }

View File

@ -109,7 +109,7 @@ public class GroupedSourcePaneFX extends SourcePaneFX {
channelPanel.setSpacing(5); channelPanel.setSpacing(5);
Label channelLabel = new Label("Channels"); Label channelLabel = new Label("Channels");
// channelLabel.setFont(PamGuiManagerFXAWT.titleFontSize2); PamGuiManagerFX.titleFont2style(channelLabel);
sourcePane.add(channelLabel,0,2); sourcePane.add(channelLabel,0,2);
//create radio buttons to allow user to quickly select type of grouping. //create radio buttons to allow user to quickly select type of grouping.

View File

@ -238,11 +238,13 @@ public class SimpleFilterPaneFX extends DynamicSettingsPane<FFTFilterParams>{
* @param disable - true to disable the pane * @param disable - true to disable the pane
*/ */
public void setDisableFilterPane(boolean disable){ public void setDisableFilterPane(boolean disable){
highPass.setDisable(disable); mainPane.setDisable(disable);
lowPass.setDisable(disable);
bandPass.setDisable(disable); // highPass.setDisable(disable);
bandStop.setDisable(disable); // lowPass.setDisable(disable);
freqPane.setDisableFreqPane(disable); // bandPass.setDisable(disable);
// bandStop.setDisable(disable);
// freqPane.setDisableFreqPane(disable);
} }
public double getSampleRate() { public double getSampleRate() {

View File

@ -43,6 +43,7 @@ import PamguardMVC.debug.Debug;
import binaryFileStorage.BinaryStore; import binaryFileStorage.BinaryStore;
import dataPlotsFX.JamieDev; import dataPlotsFX.JamieDev;
import generalDatabase.DBControl; import generalDatabase.DBControl;
import networkTransfer.send.NetworkSender;
import rocca.RoccaDev; import rocca.RoccaDev;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -122,6 +123,7 @@ public class Pamguard {
int runMode = PamController.RUN_NORMAL; int runMode = PamController.RUN_NORMAL;
String InputPsf = "NULL"; String InputPsf = "NULL";
// set up the system to output to both a log file and the console window. Also // set up the system to output to both a log file and the console window. Also
@ -137,6 +139,14 @@ public class Pamguard {
// TimeZone.setDefault(PamCalendar.defaultTimeZone); // TimeZone.setDefault(PamCalendar.defaultTimeZone);
System.out.println("**********************************************************"); System.out.println("**********************************************************");
// print out the entire command line
if (args != null && args.length > 0) {
System.out.printf("Command line options: ");
for (int i = 0; i < args.length; i++) {
System.out.printf("\"%s\" ", args[i]);
}
System.out.printf("\n");
}
try { try {
// get the java runnable file name. // get the java runnable file name.
// http://stackoverflow.com/questions/4294522/jar-file-name-form-java-code // http://stackoverflow.com/questions/4294522/jar-file-name-form-java-code
@ -210,6 +220,7 @@ public class Pamguard {
} }
else if (anArg.equalsIgnoreCase("-nogui")) { else if (anArg.equalsIgnoreCase("-nogui")) {
PamGUIManager.setType(PamGUIManager.NOGUI); PamGUIManager.setType(PamGUIManager.NOGUI);
System.out.println("no gui operation.");
} }
/////////////// ///////////////
else if (anArg.equalsIgnoreCase("-psf")) { else if (anArg.equalsIgnoreCase("-psf")) {
@ -219,13 +230,16 @@ public class Pamguard {
} }
else if (anArg.equalsIgnoreCase("-port")) { else if (anArg.equalsIgnoreCase("-port")) {
// port id to open a udp port to receive commands // port id to open a udp port to receive commands
pamBuoyGlobals.setNetworkControlPort(Integer.parseInt(args[iArg++])); String port = args[iArg++];
pamBuoyGlobals.setNetworkControlPort(Integer.parseInt(port));
System.out.println("Setting UDP control port " + port);
} }
else if (anArg.equalsIgnoreCase("-mport")) { else if (anArg.equalsIgnoreCase("-mport")) {
// multicast control (for multiple PAMGuards) // multicast control (for multiple PAMGuards)
String mAddr = args[iArg++]; String mAddr = args[iArg++];
int mPort = Integer.parseInt(args[iArg++]); int mPort = Integer.parseInt(args[iArg++]);
pamBuoyGlobals.setMultiportConfig(mAddr, mPort); pamBuoyGlobals.setMultiportConfig(mAddr, mPort);
System.out.printf("Setting multiport control addr %s port %d\n", mAddr, mPort);
} }
else if (anArg.equalsIgnoreCase("-nolog")) { else if (anArg.equalsIgnoreCase("-nolog")) {
System.out.println("Disabling log file from command line switch..."); System.out.println("Disabling log file from command line switch...");
@ -233,23 +247,47 @@ public class Pamguard {
} }
else if (anArg.equalsIgnoreCase(BinaryStore.GlobalFolderArg)) { else if (anArg.equalsIgnoreCase(BinaryStore.GlobalFolderArg)) {
// output folder for binary files. // output folder for binary files.
GlobalArguments.setParam(BinaryStore.GlobalFolderArg, args[iArg++]); String binFolder = args[iArg++];
GlobalArguments.setParam(BinaryStore.GlobalFolderArg, binFolder);
System.out.println("Setting output folder for binary files to " + binFolder);
} }
else if (anArg.equalsIgnoreCase(DBControl.GlobalDatabaseNameArg)) { else if (anArg.equalsIgnoreCase(DBControl.GlobalDatabaseNameArg)) {
// database file name // database file name
GlobalArguments.setParam(DBControl.GlobalDatabaseNameArg, args[iArg++]); String dbName = args[iArg++];
GlobalArguments.setParam(DBControl.GlobalDatabaseNameArg, dbName);
System.out.println("Setting output database file to " + dbName);
} }
else if (anArg.equalsIgnoreCase(FolderInputSystem.GlobalWavFolderArg)) { else if (anArg.equalsIgnoreCase(FolderInputSystem.GlobalWavFolderArg)) {
// source folder for wav files (or other supported sound files) // source folder for wav files (or other supported sound files)
GlobalArguments.setParam(FolderInputSystem.GlobalWavFolderArg, args[iArg++]); String wavFolder = args[iArg++];
GlobalArguments.setParam(FolderInputSystem.GlobalWavFolderArg, wavFolder);
System.out.println("Setting input wav file folder to " + wavFolder);
} }
else if (anArg.equalsIgnoreCase(PamController.AUTOSTART)) { else if (anArg.equalsIgnoreCase(PamController.AUTOSTART)) {
// auto start processing. // auto start processing.
GlobalArguments.setParam(PamController.AUTOSTART, PamController.AUTOSTART); GlobalArguments.setParam(PamController.AUTOSTART, PamController.AUTOSTART);
System.out.println("Setting autostart ON");
} }
else if (anArg.equalsIgnoreCase(PamController.AUTOEXIT)) { else if (anArg.equalsIgnoreCase(PamController.AUTOEXIT)) {
// auto exit at end of processing. // auto exit at end of processing.
GlobalArguments.setParam(PamController.AUTOEXIT, PamController.AUTOEXIT); GlobalArguments.setParam(PamController.AUTOEXIT, PamController.AUTOEXIT);
System.out.println("Setting autoexit ON");
}
else if (anArg.equalsIgnoreCase(NetworkSender.ADDRESS)) {
// auto exit at end of processing.
GlobalArguments.setParam(NetworkSender.ADDRESS, args[iArg++]);
}
else if (anArg.equalsIgnoreCase(NetworkSender.ID1)) {
// auto exit at end of processing.
GlobalArguments.setParam(NetworkSender.ID1, args[iArg++]);
}
else if (anArg.equalsIgnoreCase(NetworkSender.ID2)) {
// auto exit at end of processing.
GlobalArguments.setParam(NetworkSender.ID2, args[iArg++]);
}
else if (anArg.equalsIgnoreCase(NetworkSender.PORT)) {
// auto exit at end of processing.
GlobalArguments.setParam(NetworkSender.PORT, args[iArg++]);
} }
else if (anArg.equalsIgnoreCase(ReprocessStoreChoice.paramName)) { else if (anArg.equalsIgnoreCase(ReprocessStoreChoice.paramName)) {
String arg = args[iArg++]; String arg = args[iArg++];

View File

@ -317,10 +317,12 @@ public class DLPredictionPlotInfoFX extends GenericLinePlotInfo {
@Override @Override
public double[][] getDetData(PamDataUnit pamDataUnit) { public double[][] getDetData(PamDataUnit pamDataUnit) {
double[] data = PamArrayUtils.float2Double(((DLDataUnit) pamDataUnit).getPredicitionResult().getPrediction());
double[] data = PamArrayUtils.float2Double(((DLDataUnit) pamDataUnit).getPredicitionResult().getPrediction());
double[][] dataD = new double[data.length][]; double[][] dataD = new double[data.length][];
for (int i=0; i<data.length; i++) { for (int i=0; i<data.length; i++) {
dataD[i] = new double[] {data[i]}; dataD[i] = new double[] {data[i]};
} }

View File

@ -375,7 +375,7 @@ public class DLClassifyProcess extends PamInstantProcess {
//Need to go by the parent data unit for merging data not the segments. Note that we may still add multiple //Need to go by the parent data unit for merging data not the segments. Note that we may still add multiple
//predicitions to a single data unit depending on how many segments it contains. //predicitions to a single data unit depending on how many segments it contains.
System.out.println("New model data " + pamRawData.getParentDataUnit().getUID() + " " + groupDataBuffer[i].size() + " " + modelResultDataBuffer[i].size()); //System.out.println("New model data " + pamRawData.getParentDataUnit().getUID() + " " + groupDataBuffer[i].size() + " " + modelResultDataBuffer[i].size());
if (pamRawData.getParentDataUnit()!=lastParentDataUnit[i]) { if (pamRawData.getParentDataUnit()!=lastParentDataUnit[i]) {
//save any data //save any data

View File

@ -75,79 +75,81 @@ public class DLImageTransformPane extends PamBorderPane {
if (getDLTransforms()==null) return; if (getDLTransforms()==null) return;
//System.out.println("Set transforms: " + sampleRate); //System.out.println("Set transforms: " + sampleRate);
/****This was way too much hassle in bugs than it was worth****/
//OK so when we change samplerates massively e.g. from bat to right whale we could technically use the //OK so when we change samplerates massively e.g. from bat to right whale we could technically use the
//same transforms but this can cause weird issues - for example upsampling a 2s right whale call to 256000 Hz is //same transforms but this can cause weird issues - for example upsampling a 2s right whale call to 256000 Hz is
//not pretty. So just be nice to the user and set a few default //not pretty. So just be nice to the user and set a few default
ArrayList<DLTransform> transforms = getDLTransforms(); // ArrayList<DLTransform> transforms = getDLTransforms();
WaveTransform waveTransForm ; // WaveTransform waveTransForm ;
FreqTransform freqTranform ; // FreqTransform freqTranform ;
//extra things that may need changed... // //extra things that may need changed...
for (DLTransform dlTransfrom: transforms) { // for (DLTransform dlTransfrom: transforms) {
switch (dlTransfrom.getDLTransformType()) { // switch (dlTransfrom.getDLTransformType()) {
case DECIMATE: // case DECIMATE:
waveTransForm = ((WaveTransform) dlTransfrom); // waveTransForm = ((WaveTransform) dlTransfrom);
//
//change if the example sample rate is higher to if there is a large differenc in sample rates and decimation. // //change if the example sample rate is higher to if there is a large differenc in sample rates and decimation.
if (exampleSound.getSampleRate()<waveTransForm.getParams()[0].floatValue() // if (exampleSound.getSampleRate()<waveTransForm.getParams()[0].floatValue()
|| exampleSound.getSampleRate()/waveTransForm.getParams()[0].floatValue()>4) { // || exampleSound.getSampleRate()/waveTransForm.getParams()[0].floatValue()>4) {
waveTransForm.setParams(new Number[] {exampleSound.getSampleRate()}); //set the correct samplerate // waveTransForm.setParams(new Number[] {exampleSound.getSampleRate()}); //set the correct samplerate
dlTransformPane.getDLTransformPanes().get(transforms.indexOf(dlTransfrom)).setParams(waveTransForm); // dlTransformPane.getDLTransformPanes().get(transforms.indexOf(dlTransfrom)).setParams(waveTransForm);
} // }
break; // break;
case PREEMPHSIS: // case PREEMPHSIS:
waveTransForm = ((WaveTransform) dlTransfrom); // waveTransForm = ((WaveTransform) dlTransfrom);
if (exampleSound.getSampleRate()<10000 && waveTransForm.getParams()[0].doubleValue()>0.1) { // if (exampleSound.getSampleRate()<10000 && waveTransForm.getParams()[0].doubleValue()>0.1) {
waveTransForm.setParams(new Number[] {0.1}); //set the correct samplerate // waveTransForm.setParams(new Number[] {0.1}); //set the correct samplerate
dlTransformPane.getDLTransformPanes().get(transforms.indexOf(dlTransfrom)).setParams(waveTransForm); // dlTransformPane.getDLTransformPanes().get(transforms.indexOf(dlTransfrom)).setParams(waveTransForm);
} // }
break; // break;
case SPEC2DB: // case SPEC2DB:
break; // break;
case SPECCLAMP: // case SPECCLAMP:
break; // break;
case SPECCROPINTERP: // case SPECCROPINTERP:
//
freqTranform = ((FreqTransform) dlTransfrom); // freqTranform = ((FreqTransform) dlTransfrom);
Number[] params = freqTranform.getParams(); // Number[] params = freqTranform.getParams();
//
double highestFreq = exampleSound.getSampleRate()/2; //nyquist // double highestFreq = exampleSound.getSampleRate()/2; //nyquist
//
if (params[0].doubleValue()>=highestFreq) params[0]=0.0; // if (params[0].doubleValue()>=highestFreq) params[0]=0.0;
//
//this will break stuff if interp frequency is greater than nyquist // //this will break stuff if interp frequency is greater than nyquist
if (params[1].doubleValue()>highestFreq) { // if (params[1].doubleValue()>highestFreq) {
// System.out.println("----HERE 1----"); //// System.out.println("----HERE 1----");
params[1]=highestFreq; //nyquist
}
//if we switch to a high frequency want to the interp not to just select the lowest band
// else if (params[1].doubleValue()<highestFreq/10) {
//// System.out.println("----HERE 2----" + exampleSound.getSampleRate()/10.0 + " " + params[1].doubleValue());
// params[1]=highestFreq; //nyquist // params[1]=highestFreq; //nyquist
// } // }
// //if we switch to a high frequency want to the interp not to just select the lowest band
//System.out.println("Interp params: " + params[0] + " " + params[1] + " " + params[2]); //
freqTranform.setParams(params); //// else if (params[1].doubleValue()<highestFreq/10) {
////// System.out.println("----HERE 2----" + exampleSound.getSampleRate()/10.0 + " " + params[1].doubleValue());
dlTransformPane.getDLTransformPanes().get(transforms.indexOf(dlTransfrom)).setParams(freqTranform); //// params[1]=highestFreq; //nyquist
//// }
break; //
case SPECNORMALISE: // //System.out.println("Interp params: " + params[0] + " " + params[1] + " " + params[2]);
break; // freqTranform.setParams(params);
case SPECNORMALISEROWSUM: //
break; // dlTransformPane.getDLTransformPanes().get(transforms.indexOf(dlTransfrom)).setParams(freqTranform);
case SPECTROGRAM: //
break; // break;
case TRIM: // case SPECNORMALISE:
break; // break;
default: // case SPECNORMALISEROWSUM:
break; // break;
// case SPECTROGRAM:
} // break;
} // case TRIM:
// break;
// default:
// break;
//
// }
// }
} }

View File

@ -192,7 +192,7 @@ public class RoccaContour {
(currentStartSample, fftLength, channelMap ); (currentStartSample, fftLength, channelMap );
} }
catch (RawDataUnavailableException e) { catch (RawDataUnavailableException e) {
System.out.println(e.getMessage()); System.out.println("RawDataUnavailableException in ROCCAContour.generateContour: " + e.getMessage());
currentRawData = null; currentRawData = null;
} }
/* every now and then the FFTDataUnit start sample doesn't match up /* every now and then the FFTDataUnit start sample doesn't match up
@ -237,7 +237,7 @@ public class RoccaContour {
nextRawData = rawDataBlockIn.getSamples(nextStartSample, fftLength, channelMap ); nextRawData = rawDataBlockIn.getSamples(nextStartSample, fftLength, channelMap );
} }
catch (RawDataUnavailableException e) { catch (RawDataUnavailableException e) {
System.out.println(e.getMessage()); System.out.println("RawDataUnavailableException (2) in ROCCAContour.generateContour: " + e.getMessage());
nextRawData = null; nextRawData = null;
} }
nextFFT = nextFFTDataUnit.getFftData(); nextFFT = nextFFTDataUnit.getFftData();

View File

@ -2333,7 +2333,7 @@ public class RoccaSpecPopUp extends javax.swing.JPanel {
} }
} }
catch (RawDataUnavailableException e) { catch (RawDataUnavailableException e) {
System.out.println(e.getMessage()); System.out.println("RawDataUnavailableException in ROCCASpecPopUp: " + e.getMessage());
} }
if (rawDataValues==null) { if (rawDataValues==null) {

View File

@ -205,9 +205,12 @@ public class RoccaWhistleSelect extends PamProcess implements SpectrogramMarkObs
* DG June '22. * DG June '22.
* I hope IT's K to set these back here. It's possible it's also * I hope IT's K to set these back here. It's possible it's also
* done elsewhere. * done elsewhere.
*
* MO Jan '23
* These are set to 0 in the RoccaSpecPopUp class, before the user closes the window. If set here, the objects are cleared before the user can trace the whistle and throws an exception
*/ */
selectedWhistle.setNaturalLifetimeMillis(0); // selectedWhistle.setNaturalLifetimeMillis(0);
selectedWhistleRaw.setNaturalLifetimeMillis(0); // selectedWhistleRaw.setNaturalLifetimeMillis(0);
} }
} }

View File

@ -280,7 +280,7 @@ public class RockBlockProcess2 extends PamProcess implements ModuleStatusManager
timeDelays[0] = rockBlockControl.getParams().getCommTiming(); timeDelays[0] = rockBlockControl.getParams().getCommTiming();
initializeRockBlock(); initializeRockBlock();
} catch (Exception e) { } catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Exception in rockBlockProcess: " + e.getMessage());
rbStatus.setPortError(e.getMessage()); rbStatus.setPortError(e.getMessage());
rbStatus.setCommReady(false); rbStatus.setCommReady(false);
commReady = false; commReady = false;

View File

@ -219,7 +219,7 @@ public class DWVConverter {
} }
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Exception 1 in DWVConverter.effortLine: " + e.getMessage());
} }
binaryStream.openOutputFiles(bclLine.getMilliseconds()); binaryStream.openOutputFiles(bclLine.getMilliseconds());
binaryStream.writeHeader(bclLine.getMilliseconds(), System.currentTimeMillis()); binaryStream.writeHeader(bclLine.getMilliseconds(), System.currentTimeMillis());
@ -234,7 +234,7 @@ public class DWVConverter {
PamCalendar.formatDBDateTime(wavFileStop), PamCalendar.formatDBDateTime(bclLine.getMilliseconds())); PamCalendar.formatDBDateTime(wavFileStop), PamCalendar.formatDBDateTime(bclLine.getMilliseconds()));
} }
catch (Exception e) { catch (Exception e) {
System.out.println(e.getMessage()); System.out.println("Exception 2 in DWVConverter.effortLine: " + e.getMessage());
} }
binaryStream.writeModuleFooter(); binaryStream.writeModuleFooter();
binaryStream.writeFooter(bclLine.getMilliseconds(), System.currentTimeMillis(), BinaryFooter.END_UNKNOWN); binaryStream.writeFooter(bclLine.getMilliseconds(), System.currentTimeMillis(), BinaryFooter.END_UNKNOWN);