mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-21 22:52:22 +00:00
Merge SMRUC Fork to PG Main Fork (#101)
* 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
* Quick solution to issue #88.
* Added logic to allow run nothing direct PAMGuard control for SMRU
Consulting batch processing
* Mistake in merge, committing changes from PAMGuard Main to SMRU Fork
* Run nothing updates for preventing thread leaks on bash
* Synchronize with Pamguard Main at PAMGuard/Pamguard:main commit 3573eaa
on 1/24/23
* Added network sender global arguments for port, ipaddress, station Id1,
station Id2
* Added runtime arguments for network send configuration
* Fix typo in tag 'netSend' rather than 'newSend'
* Fixed typo. set port to port, not to address
---------
Co-authored-by: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com>
This commit is contained in:
parent
74066712b8
commit
629f430988
@ -23,10 +23,12 @@ import javax.swing.SwingWorker;
|
||||
|
||||
import networkTransfer.emulator.NetworkEmulator;
|
||||
import networkTransfer.receive.NetworkReceiver;
|
||||
import pamguard.GlobalArguments;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import Acquisition.FolderInputSystem;
|
||||
import PamController.PamControlledUnit;
|
||||
import PamController.PamControlledUnitSettings;
|
||||
import PamController.PamController;
|
||||
@ -44,6 +46,11 @@ import PamguardMVC.PamDataBlock;
|
||||
*
|
||||
*/
|
||||
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();
|
||||
private NetworkEmulator networkEmulator;
|
||||
@ -169,6 +176,28 @@ public class NetworkSender extends PamControlledUnit implements PamSettings {
|
||||
public boolean restoreSettings(
|
||||
PamControlledUnitSettings pamControlledUnitSettings) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ import PamguardMVC.debug.Debug;
|
||||
import binaryFileStorage.BinaryStore;
|
||||
import dataPlotsFX.JamieDev;
|
||||
import generalDatabase.DBControl;
|
||||
import networkTransfer.send.NetworkSender;
|
||||
import rocca.RoccaDev;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@ -271,6 +272,23 @@ public class Pamguard {
|
||||
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("-help")) {
|
||||
System.out.println("--PamGuard Help");
|
||||
System.out.println("\n--For standard GUI deployment run without any options.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user