mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-21 22:52:22 +00:00
* Fix network sender since it was hopelessly out of date and did not send data in the correct format. OK now, though only tested on NARW. * Fix network sender since it was hopelessly out of date and did not send data in the correct format. OK now, though only tested on NARW. * Mods to support command line and Network control of PAMGuard and to retrieve summary information from some modules. * Fix issue #80: recording path command line override * Allow RUNNOTHING bearing calculations Co-authored-by: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com>
This commit is contained in:
parent
d2e69c507e
commit
fe0fe11faf
@ -17,6 +17,7 @@ import javax.swing.Timer;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import Acquisition.FolderInputSystem;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamController;
|
||||
@ -24,6 +25,7 @@ import PamController.PamControllerInterface;
|
||||
import PamController.PamSettingManager;
|
||||
import PamController.PamSettings;
|
||||
import PamController.command.CommandManager;
|
||||
import PamUtils.FileFunctions;
|
||||
import PamUtils.PamCalendar;
|
||||
import PamUtils.PamUtils;
|
||||
import PamView.MenuItemEnabler;
|
||||
@ -35,6 +37,7 @@ import SoundRecorder.trigger.RecorderTrigger;
|
||||
import SoundRecorder.trigger.RecorderTriggerData;
|
||||
import SoundRecorder.trigger.TriggerDecisionMaker;
|
||||
import backupmanager.BackupInformation;
|
||||
import pamguard.GlobalArguments;
|
||||
|
||||
/**
|
||||
* Control a sound file recorder. The sound file recorder has two
|
||||
@ -434,9 +437,51 @@ public class RecorderControl extends PamControlledUnit implements PamSettings {
|
||||
public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
recorderSettings = ((RecorderSettings) pamControlledUnitSettings.getSettings()).clone();
|
||||
newParams();
|
||||
/*
|
||||
* Then check to see if there is a command line override of the currently stored folder name.
|
||||
*/
|
||||
String globFolder = GlobalArguments.getParam(FolderInputSystem.GlobalWavFolderArg);
|
||||
if (globFolder != null) {
|
||||
boolean ok = checkGlobFolder(globFolder);
|
||||
if (ok) {
|
||||
recorderSettings.setOutputFolder(globFolder); // remember it.
|
||||
}
|
||||
else {
|
||||
System.err.println("Unable to set recording storage folder " + globFolder);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set and create if necessary the global folder.
|
||||
* @param globFolder
|
||||
*/
|
||||
private boolean checkGlobFolder(String globFolder) {
|
||||
File outFold = new File(globFolder);
|
||||
if (outFold.exists()) {
|
||||
if (outFold.isDirectory()) {
|
||||
return true; // all OK
|
||||
}
|
||||
else {
|
||||
return false; // it must be a file - that's bad !
|
||||
}
|
||||
}
|
||||
// try to create it.
|
||||
try {
|
||||
if (outFold.mkdirs()) {
|
||||
FileFunctions.setNonIndexingBit(outFold);
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false; // unable to make the folder.
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.err.println("Can't set recording store folder: " + e.getLocalizedMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a recorder trigger to this recorderControl. This can either be called
|
||||
|
@ -64,6 +64,10 @@ public class RecorderSettings implements Serializable, Cloneable, ManagedParamet
|
||||
*/
|
||||
public String outputFolder;
|
||||
|
||||
public void setOutputFolder(String outputFolder) {
|
||||
this.outputFolder = outputFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initials to add to the start of a file name, the rest
|
||||
* of which is made up from the date.
|
||||
|
@ -278,7 +278,7 @@ public class WhistleBinaryDataSource extends BinaryDataSource {
|
||||
* If we're n network receive mode, we can't do this until
|
||||
* channel numbers have been reassigned.
|
||||
*/
|
||||
if (runMode == PamController.RUN_PAMVIEW && delays != null) {
|
||||
if ((runMode == PamController.RUN_PAMVIEW || runMode == PamController.RUN_NOTHING) && delays != null) {
|
||||
ShapeConnector shapeConnector = wmDetector.findShapeConnector(channelMap);
|
||||
if (shapeConnector != null) {
|
||||
BearingLocaliser bl = shapeConnector.getBearingLocaliser();
|
||||
|
Loading…
Reference in New Issue
Block a user