diff --git a/examples/src/OpenDis7Examples/PduReaderPlayer.java b/examples/src/OpenDis7Examples/PduReaderPlayer.java index 8b3aac54b7c8103f0283377783ef0795f380c199..b2269d08f66f0f325a0acc101d5b340b319163af 100644 --- a/examples/src/OpenDis7Examples/PduReaderPlayer.java +++ b/examples/src/OpenDis7Examples/PduReaderPlayer.java @@ -11,6 +11,7 @@ import java.util.Scanner; /** * PduSaver.java created on Aug 21, 2019 + * Renamed PduReaderPlayer * MOVES Institute Naval Postgraduate School, Monterey, CA, USA www.nps.edu * * @author Mike Bailey, jmbailey@nps.edu @@ -18,9 +19,9 @@ import java.util.Scanner; */ public class PduReaderPlayer { - private final static String DEFAULT_OUTPUTDIR = "pduLog"; - private final static String MCAST_ADDR = "239.1.2.3"; - private final static int DIS_PORT = 3000; + private final static String DEFAULT_OUTPUT_DIRECTORY = "pduLog"; + public static final String DEFAULT_MULTICAST_ADDRESS = AllPduSender.DEFAULT_MULTICAST_ADDRESS; + public static final int DEFAULT_MULTICAST_PORT = AllPduSender.DEFAULT_MULTICAST_PORT; private enum mystate { @@ -30,9 +31,9 @@ public class PduReaderPlayer public static void main(String[] args) { - String outDir = DEFAULT_OUTPUTDIR; - String mcast = MCAST_ADDR; - int port = DIS_PORT; + String outputDirectory = DEFAULT_OUTPUT_DIRECTORY; + String multicastAddress = DEFAULT_MULTICAST_ADDRESS; + int multicastPort = DEFAULT_MULTICAST_PORT; System.out.println("DisExamplesOpenDis7.PduReaderPlayer started..."); @@ -40,21 +41,21 @@ public class PduReaderPlayer case 0: break; case 1: - outDir = args[0]; + outputDirectory = args[0]; break; case 3: - outDir = args[0]; - mcast = args[1]; - port = Integer.parseInt(args[2]); + outputDirectory = args[0]; + multicastAddress = args[1]; + multicastPort = Integer.parseInt(args[2]); break; default: System.err.println("Usage: PduReaderPlayer() or PduReaderPlayer(\"outputdir\") or PduReaderPlayer(\"outputdir\",\"multicast address\", ipPort"); System.exit(1); } - System.out.println("Beginning pdu playback from directory " + outDir); + System.out.println("Beginning PduReaderPlayer (" + multicastAddress + ":" + multicastPort + ") to directory " + outputDirectory); try { - PduPlayer player = new PduPlayer(mcast, port, new File(outDir).toPath()); + PduPlayer player = new PduPlayer(multicastAddress, multicastPort, new File(outputDirectory).toPath()); player.startResume(); mystate state = mystate.RUNNING; Scanner scan = new Scanner(System.in); @@ -75,7 +76,7 @@ public class PduReaderPlayer break; } } - System.out.println("Ending pdu files playback for directory " + outDir); + System.out.println("Ending pdu files playback for directory " + outputDirectory); System.out.println("DisExamplesOpenDis7.PduReaderPlayer complete."); System.exit(0); // not sure why this is necessary with Netbeans... }