mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
Fix Data export bug
Bug causing npe when exporting data to database. Fixed problem. And better error messages in some thrown exceptions to make it easier to identify where errors are occurring.
This commit is contained in:
parent
f64deecbd5
commit
74066712b8
@ -4,7 +4,7 @@
|
||||
<groupId>org.pamguard</groupId>
|
||||
<artifactId>Pamguard</artifactId>
|
||||
<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>
|
||||
<url>www.pamguard.org</url>
|
||||
<organization>
|
||||
|
2
pom.xml
2
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.pamguard</groupId>
|
||||
<artifactId>Pamguard</artifactId>
|
||||
<version>2.02.07b</version>
|
||||
<version>2.02.07f</version>
|
||||
<name>Pamguard Java12+</name>
|
||||
<description>Pamguard for Java 12+, using Maven to control dependcies</description>
|
||||
<url>www.pamguard.org</url>
|
||||
|
@ -48,6 +48,7 @@ import PamView.dialog.PamGridBagContraints;
|
||||
import PamView.dialog.PamLabel;
|
||||
import PamView.panel.PamPanel;
|
||||
import PamView.panel.PamProgressBar;
|
||||
import PamguardMVC.debug.Debug;
|
||||
|
||||
/**
|
||||
* Read multiple files in sequence. Options exist to either pause and
|
||||
@ -116,7 +117,7 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings{
|
||||
if (folderInputParameters == null)
|
||||
setFolderInputParameters(new FolderInputParameters(getSystemType()));
|
||||
// PamSettingManager.getInstance().registerSettings(this); //calling super already registers this in the FileInputSystem constructor
|
||||
checkComandLine();
|
||||
// checkComandLine();
|
||||
makeSelFileList();
|
||||
newFileTimer = new Timer(1000, new RestartTimer());
|
||||
newFileTimer.setRepeats(false);
|
||||
@ -126,18 +127,21 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings{
|
||||
/**
|
||||
* Check to see if acquisition source folder was set in the command line.
|
||||
*/
|
||||
private void checkComandLine() {
|
||||
private String[] checkComandLineFolder() {
|
||||
String globalFolder = GlobalArguments.getParam(GlobalWavFolderArg);
|
||||
Debug.out.println("Checking -wavfilefolder option: is " + globalFolder);
|
||||
if (globalFolder == null) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
// see if it at least exists, though will we want to do this for Network folders ?
|
||||
File aFile = new File(globalFolder);
|
||||
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};
|
||||
folderInputParameters.setSelectedFiles(selList);
|
||||
// folderInputParameters.setSelectedFiles(selList);
|
||||
return selList;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -290,15 +294,24 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings{
|
||||
}
|
||||
|
||||
/**
|
||||
* 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?
|
||||
*/
|
||||
public int makeSelFileList() {
|
||||
|
||||
if (fileInputParameters.recentFiles == null || fileInputParameters.recentFiles.size() < 1) {
|
||||
return 0;
|
||||
String[] selection = checkComandLineFolder();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ public class StandardFileDate implements FileDate, PamSettings {
|
||||
} catch (ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("StandardfileDate.forcedDataFormat:" + e.getMessage());
|
||||
} //throws ParseException if no match
|
||||
setLastFormat(forcedDateFormat);
|
||||
if (d == null) {
|
||||
|
@ -368,7 +368,7 @@ abstract public class IshLocProcess extends PamProcess implements SpectrogramMar
|
||||
selectionSams = daqBlock.getSamples(startSam, (int)durationSam, channelMap);
|
||||
}
|
||||
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
|
||||
int newTime;
|
||||
|
@ -287,7 +287,7 @@ public final class SSHSession implements UserInfo {
|
||||
out.write(k);
|
||||
out.flush();
|
||||
} 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) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in SSHSession.pump: " + e.getMessage());
|
||||
} finally {
|
||||
closeQuietly(in);
|
||||
closeQuietly(out);
|
||||
|
@ -203,7 +203,7 @@ public class AcquireNmeaData extends PamProcess implements ActionListener, Modul
|
||||
try {
|
||||
pjSerialComm = PJSerialComm.openSerialPort(params.serialPortName, params.serialPortBitsPerSecond);
|
||||
} catch (PJSerialException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("PJSerialException in AcquireNMEAData" + e.getMessage());
|
||||
// WarnOnce.sho
|
||||
return;
|
||||
}
|
||||
|
@ -1277,7 +1277,12 @@ public class PamController implements PamControllerInterface, PamSettings {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
long t1 = System.currentTimeMillis();
|
||||
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 {
|
||||
Thread.sleep(10);
|
||||
} catch (InterruptedException e) {
|
||||
|
@ -1752,10 +1752,10 @@ public class PamSettingManager {
|
||||
fIs.close();
|
||||
fOs.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("FileNotFound exception in PamSettingsManager: " + e.getMessage());
|
||||
return false;
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IO exception in PamSettingsManager: " + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -31,12 +31,12 @@ public class PamguardVersionInfo {
|
||||
* Version number, major version.minorversion.sub-release.
|
||||
* 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
|
||||
*/
|
||||
static public final String date = "19 January 2023";
|
||||
static public final String date = "4 April 2023";
|
||||
|
||||
// /**
|
||||
// * Release type - Beta or Core
|
||||
|
@ -46,7 +46,7 @@ public class ExternalCapture extends ExternalController {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IOError in ExternalCapture.readInputStream: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -662,7 +662,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in PamguardXMLWriter.writeArray: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -704,7 +704,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
return e;
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in PamguardXMLWriter.writeObjectArray: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -729,7 +729,7 @@ public class PamguardXMLWriter implements PamSettings {
|
||||
// el.appendChild(e);
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in PamguardXMLWriter.writePrimativeArray: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ public class FileFunctions {
|
||||
return attrib;
|
||||
}
|
||||
catch (Error e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in FileFunctions.getAttributes: " + e.getMessage());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import PamUtils.PamFileFilter;
|
||||
import PamUtils.worker.PamWorkProgressMessage;
|
||||
import PamUtils.worker.PamWorkWrapper;
|
||||
import PamUtils.worker.PamWorker;
|
||||
import PamguardMVC.debug.Debug;
|
||||
|
||||
/**
|
||||
* 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.subFolders = subFolders;
|
||||
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)) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@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) {
|
||||
newFileList.addFolder();
|
||||
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());
|
||||
File[] moreFiles = folder.listFiles(fileFilter);
|
||||
if (moreFiles == null) {
|
||||
|
@ -225,6 +225,11 @@ public class AlarmProcess extends PamProcess {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateData(PamObservable o, PamDataUnit arg) {
|
||||
newData(o, arg);
|
||||
}
|
||||
|
||||
public boolean setupAlarm() {
|
||||
dataSource = PamController.getInstance().getDataBlock(PamDataUnit.class, alarmControl.alarmParameters.dataSourceName);
|
||||
if (dataSource == null) {
|
||||
|
@ -94,7 +94,7 @@ public class PlaySound extends AlarmAction implements PamSettings {
|
||||
double secs = fl/sr*1000;
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in PlaySound.playSound:" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -114,10 +114,10 @@ public class PlaySound extends AlarmAction implements PamSettings {
|
||||
System.out.println(f.getMessage());
|
||||
return currentClip = null;
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IOError in PlaySound.prepareClip: " + e.getMessage());
|
||||
return currentClip = null;
|
||||
} catch (LineUnavailableException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("LineUnavailableException in PlaySound.prepareClip: " + e.getMessage());
|
||||
return currentClip = null;
|
||||
}
|
||||
currentFile = soundFile;
|
||||
|
@ -118,7 +118,7 @@ public abstract class BackupStream implements PamSettings, BackupFunction {
|
||||
try {
|
||||
ok = doAction(backupManager, action, item);
|
||||
} 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(),
|
||||
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
|
||||
|
@ -1809,7 +1809,7 @@ public class ClickDetector extends PamProcess {
|
||||
newClick.setStartSample(newClick.getStartSample() - firstFilterDelay - secondFilterDelay);
|
||||
waveDataError = false;
|
||||
} catch (RawDataUnavailableException e) {
|
||||
System.out.println("RawDataUnavailableException");
|
||||
System.out.println(" Click Detector RawDataUnavailableException");
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
for (int k = 0; k < nChannels; k++) {
|
||||
|
@ -291,7 +291,7 @@ public class ClipProcess extends SpectrogramMarkProcess {
|
||||
try {
|
||||
rawData = rawDataBlock.getSamples(startSample, numSamples, channelMap);
|
||||
} catch (RawDataUnavailableException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("RawDataUnavailableException in ClipProcess.spectrogramNotification :" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
if (rawData == null) {
|
||||
|
@ -199,7 +199,7 @@ public class DbHtDialog extends PamDialog {
|
||||
params.calculateFilterThings(currentSampleRate);
|
||||
}
|
||||
catch (DbHtException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in DbHtDialog.updateEverything: " + e.getMessage());
|
||||
return;
|
||||
}
|
||||
double[] f = params.getFilterFrequencies(currentSampleRate);
|
||||
|
@ -1110,7 +1110,7 @@ public class DifarProcess extends PamProcess {
|
||||
rawData[0] = rawDataAll[0]; // is fine since getSamples was fed a channel map.
|
||||
}
|
||||
} catch (RawDataUnavailableException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in DifarProcess.difarTrigger" + e.getMessage());
|
||||
return;
|
||||
}
|
||||
if (rawData[0] == null) {
|
||||
|
@ -98,7 +98,7 @@ public class NativeDemux extends GreenridgeDemux {
|
||||
return true;
|
||||
}
|
||||
catch (UnsatisfiedLinkError e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in NativeDemux.loadLibrary" + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ public class DBSpeedTest {
|
||||
dropStmt.execute();
|
||||
} catch (SQLException e) {
|
||||
// e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in DBSpeedTest testSpeed2:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
@ -261,7 +261,13 @@ public class ContourFinder {
|
||||
* 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]);
|
||||
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;
|
||||
}
|
||||
|
||||
@ -282,6 +288,10 @@ public class ContourFinder {
|
||||
* Separate loops to get above and to sides, NOT diagonal matches.
|
||||
* 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
|
||||
int nX = binData.length-1;
|
||||
int nY = binData[0].length-1;
|
||||
|
@ -217,7 +217,7 @@ public class HyperbolicLocaliser extends TOADBaseAlgorithm {
|
||||
// answer2 = rightMatrix.times(leftInverse.transpose());
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in HyperbolicLocaliser.processTOADsPlane: " + e.getMessage());
|
||||
// Matrix m = leftMatrix.transpose();
|
||||
// m = m.inverse();
|
||||
return null;
|
||||
@ -254,7 +254,7 @@ public class HyperbolicLocaliser extends TOADBaseAlgorithm {
|
||||
|
||||
}
|
||||
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.
|
||||
@ -736,7 +736,7 @@ public class HyperbolicLocaliser extends TOADBaseAlgorithm {
|
||||
|
||||
}
|
||||
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),
|
||||
|
@ -146,7 +146,7 @@ public class ToadSimplexLocaliser extends TOADBaseAlgorithm {
|
||||
try {
|
||||
result = optimiser.optimize(chiFunc, goal, start);
|
||||
} catch (OptimizationException | FunctionEvaluationException | IllegalArgumentException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in TOADSimplexLocaliser.processTOADs: " + e.getMessage());
|
||||
nFails++;
|
||||
System.out.printf("%d fails out of %d = %3.2f%%\n", nFails, nCalls, (double) nFails * 100. / nCalls);
|
||||
resultChiData[iStart] = null;
|
||||
|
@ -129,7 +129,7 @@ public class EmulatorStream {
|
||||
try {
|
||||
emSocket.getOutputStream().write(data);
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Error in EmulatorStream.sendPamCommand: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
private boolean openSocket() {
|
||||
@ -137,9 +137,9 @@ public class EmulatorStream {
|
||||
try {
|
||||
emSocket = new Socket(sktParams.ipAddress, sktParams.portNumber);
|
||||
} catch (UnknownHostException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("UnknownHostException in EmulatorStream.sendPamCommand: " + e.getMessage());
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IOException in EmulatorStream.sendPamCommand: " + e.getMessage());
|
||||
}
|
||||
if (emSocket != null) {
|
||||
status.socketStatus = emSocket.isConnected();
|
||||
|
@ -458,7 +458,7 @@ public class NetworkReceiver extends PamControlledUnit implements PamSettings, N
|
||||
// checkExistingThreads(clientSocket, rxThread);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IOException in NeetworkReceiver" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -452,7 +452,7 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IOException in NeetworkSender.writeByteData: " + e.getMessage());
|
||||
currStatus = "Socket Closed";
|
||||
return false;
|
||||
}
|
||||
@ -465,7 +465,7 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IOException in NeetworkSender.writeStringData" + e.getMessage());
|
||||
currStatus = "Socket Closed";
|
||||
return false;
|
||||
}
|
||||
@ -513,7 +513,7 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
|
||||
tcpWriter.close();
|
||||
} catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("IOException in NeetworkSender.closeconnection" + e.getMessage());
|
||||
}
|
||||
tcpSocket = null;
|
||||
tcpWriter = null;
|
||||
|
@ -68,7 +68,7 @@ public class SerialOutput {
|
||||
SerialPort.NO_PARITY,
|
||||
SerialPort.FLOW_CONTROL_DISABLED); // disable flow control, since this is the RXTX default and it's not specified above
|
||||
} catch (PJSerialException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("PJSerialException in SerialOutput: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
@ -21,8 +21,6 @@ import dataMap.OfflineDataMapPoint;
|
||||
* @param <T>
|
||||
*/
|
||||
public class DataCopyTask<T extends PamDataUnit> extends OfflineTask<T> {
|
||||
|
||||
private PamDataBlock<T> pamDataBlock;
|
||||
|
||||
private SQLLogging sqlLogging;
|
||||
|
||||
@ -40,7 +38,6 @@ public class DataCopyTask<T extends PamDataUnit> extends OfflineTask<T> {
|
||||
*/
|
||||
public DataCopyTask(PamDataBlock<T> pamDataBlock) {
|
||||
super(pamDataBlock);
|
||||
this.pamDataBlock = pamDataBlock;
|
||||
this.sqlLogging = pamDataBlock.getLogging();
|
||||
this.binaryDataSource = pamDataBlock.getBinaryDataSource();
|
||||
setParentDataBlock(pamDataBlock);
|
||||
@ -77,7 +74,7 @@ public class DataCopyTask<T extends PamDataUnit> extends OfflineTask<T> {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Copy " + pamDataBlock.getDataName() + " To database";
|
||||
return "Copy " + getDataBlock().getDataName() + " To database";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -458,5 +458,4 @@ public abstract class OfflineTask<T extends PamDataUnit> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ public class PamAxisPane2 extends StackPane {
|
||||
// }
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Exception in PamAxisPanel2.ScaledNumberFormatter: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return "Err";
|
||||
}
|
||||
|
@ -121,6 +121,7 @@ public class Pamguard {
|
||||
|
||||
int runMode = PamController.RUN_NORMAL;
|
||||
String InputPsf = "NULL";
|
||||
|
||||
|
||||
|
||||
// set up the system to output to both a log file and the console window. Also
|
||||
@ -136,6 +137,14 @@ public class Pamguard {
|
||||
// TimeZone.setDefault(PamCalendar.defaultTimeZone);
|
||||
|
||||
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 {
|
||||
// get the java runnable file name.
|
||||
// http://stackoverflow.com/questions/4294522/jar-file-name-form-java-code
|
||||
@ -209,6 +218,7 @@ public class Pamguard {
|
||||
}
|
||||
else if (anArg.equalsIgnoreCase("-nogui")) {
|
||||
PamGUIManager.setType(PamGUIManager.NOGUI);
|
||||
System.out.println("no gui operation.");
|
||||
}
|
||||
///////////////
|
||||
else if (anArg.equalsIgnoreCase("-psf")) {
|
||||
@ -218,13 +228,16 @@ public class Pamguard {
|
||||
}
|
||||
else if (anArg.equalsIgnoreCase("-port")) {
|
||||
// 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")) {
|
||||
// multicast control (for multiple PAMGuards)
|
||||
String mAddr = args[iArg++];
|
||||
int mPort = Integer.parseInt(args[iArg++]);
|
||||
pamBuoyGlobals.setMultiportConfig(mAddr, mPort);
|
||||
System.out.printf("Setting multiport control addr %s port %d\n", mAddr, mPort);
|
||||
}
|
||||
else if (anArg.equalsIgnoreCase("-nolog")) {
|
||||
System.out.println("Disabling log file from command line switch...");
|
||||
@ -232,23 +245,31 @@ public class Pamguard {
|
||||
}
|
||||
else if (anArg.equalsIgnoreCase(BinaryStore.GlobalFolderArg)) {
|
||||
// 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)) {
|
||||
// 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)) {
|
||||
// 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)) {
|
||||
// auto start processing.
|
||||
GlobalArguments.setParam(PamController.AUTOSTART, PamController.AUTOSTART);
|
||||
System.out.println("Setting autostart ON");
|
||||
}
|
||||
else if (anArg.equalsIgnoreCase(PamController.AUTOEXIT)) {
|
||||
// auto exit at end of processing.
|
||||
GlobalArguments.setParam(PamController.AUTOEXIT, PamController.AUTOEXIT);
|
||||
System.out.println("Setting autoexit ON");
|
||||
}
|
||||
else if (anArg.equalsIgnoreCase("-help")) {
|
||||
System.out.println("--PamGuard Help");
|
||||
|
@ -192,7 +192,7 @@ public class RoccaContour {
|
||||
(currentStartSample, fftLength, channelMap );
|
||||
}
|
||||
catch (RawDataUnavailableException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("RawDataUnavailableException in ROCCAContour.generateContour: " + e.getMessage());
|
||||
currentRawData = null;
|
||||
}
|
||||
/* 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 );
|
||||
}
|
||||
catch (RawDataUnavailableException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("RawDataUnavailableException (2) in ROCCAContour.generateContour: " + e.getMessage());
|
||||
nextRawData = null;
|
||||
}
|
||||
nextFFT = nextFFTDataUnit.getFftData();
|
||||
|
@ -2333,7 +2333,7 @@ public class RoccaSpecPopUp extends javax.swing.JPanel {
|
||||
}
|
||||
}
|
||||
catch (RawDataUnavailableException e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("RawDataUnavailableException in ROCCASpecPopUp: " + e.getMessage());
|
||||
}
|
||||
|
||||
if (rawDataValues==null) {
|
||||
|
@ -280,7 +280,7 @@ public class RockBlockProcess2 extends PamProcess implements ModuleStatusManager
|
||||
timeDelays[0] = rockBlockControl.getParams().getCommTiming();
|
||||
initializeRockBlock();
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Exception in rockBlockProcess: " + e.getMessage());
|
||||
rbStatus.setPortError(e.getMessage());
|
||||
rbStatus.setCommReady(false);
|
||||
commReady = false;
|
||||
|
@ -219,7 +219,7 @@ public class DWVConverter {
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Exception 1 in DWVConverter.effortLine: " + e.getMessage());
|
||||
}
|
||||
binaryStream.openOutputFiles(bclLine.getMilliseconds());
|
||||
binaryStream.writeHeader(bclLine.getMilliseconds(), System.currentTimeMillis());
|
||||
@ -234,7 +234,7 @@ public class DWVConverter {
|
||||
PamCalendar.formatDBDateTime(wavFileStop), PamCalendar.formatDBDateTime(bclLine.getMilliseconds()));
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("Exception 2 in DWVConverter.effortLine: " + e.getMessage());
|
||||
}
|
||||
binaryStream.writeModuleFooter();
|
||||
binaryStream.writeFooter(bclLine.getMilliseconds(), System.currentTimeMillis(), BinaryFooter.END_UNKNOWN);
|
||||
|
Loading…
Reference in New Issue
Block a user