Skip to content
Snippets Groups Projects
Commit 172e9a25 authored by Brutzman, Don's avatar Brutzman, Don
Browse files

Scanner rename to terminalKeyboardScanner for clarity; PduReaderPlayer output packets not seen

parent e5538979
No related branches found
No related tags found
No related merge requests found
...@@ -65,13 +65,14 @@ public class PduListenerSaver ...@@ -65,13 +65,14 @@ public class PduListenerSaver
System.out.println("Beginning PduListenerSaver (" + multicastAddress + ":" + multicastPort + ") to directory " + outputDirectory); System.out.println("Beginning PduListenerSaver (" + multicastAddress + ":" + multicastPort + ") to directory " + outputDirectory);
try { try {
PduRecorder recorder = new PduRecorder(outputDirectory, multicastAddress, multicastPort); // assumes save
mystate state = mystate.RUNNING; mystate state = mystate.RUNNING;
Scanner scannerTerminalKeyboard = new Scanner(System.in); Scanner terminalKeyboardScanner = new Scanner(System.in);
PduRecorder recorder = new PduRecorder(outputDirectory, multicastAddress, multicastPort); // assumes save on quit
while (true) { while (true) // monitor user input via keyboard
{
System.out.println("Type p/enter to pause, r/enter to resume, q/enter to quit"); System.out.println("Type p/enter to pause, r/enter to resume, q/enter to quit");
String line = scannerTerminalKeyboard.nextLine(); String line = terminalKeyboardScanner.nextLine();
if (line.equalsIgnoreCase("p") && state == mystate.RUNNING) { if (line.equalsIgnoreCase("p") && state == mystate.RUNNING) {
recorder.stopPause(); recorder.stopPause();
state = mystate.PAUSED; state = mystate.PAUSED;
......
...@@ -69,14 +69,16 @@ public class PduReaderPlayer ...@@ -69,14 +69,16 @@ public class PduReaderPlayer
System.out.println("Beginning PduReaderPlayer (" + multicastAddress + ":" + multicastPort + ") to directory " + outputDirectory); System.out.println("Beginning PduReaderPlayer (" + multicastAddress + ":" + multicastPort + ") to directory " + outputDirectory);
try { try {
mystate state = mystate.RUNNING;
Scanner terminalKeyboardScanner = new Scanner(System.in);
PduPlayer pduPlayer = new PduPlayer(multicastAddress, multicastPort, Path.of(outputDirectory), sendToNet); PduPlayer pduPlayer = new PduPlayer(multicastAddress, multicastPort, Path.of(outputDirectory), sendToNet);
pduPlayer.startResume(); pduPlayer.startResume();
mystate state = mystate.RUNNING;
Scanner scannerTerminalKeyboard = new Scanner(System.in);
while (true) { while (true) // monitor user input via keyboard
{
System.out.println("Type p/enter to pause, r/enter to resume, q/enter to quit"); System.out.println("Type p/enter to pause, r/enter to resume, q/enter to quit");
String line = scannerTerminalKeyboard.nextLine(); String line = terminalKeyboardScanner.nextLine();
if (line.equalsIgnoreCase("p") && state == mystate.RUNNING) { if (line.equalsIgnoreCase("p") && state == mystate.RUNNING) {
pduPlayer.stopPause(); pduPlayer.stopPause();
state = mystate.PAUSED; state = mystate.PAUSED;
......
Invocation instructions: Invocation instructions:
0. check for existence of recorded files in directory, e.g. examples/pduLog/Pdusave.dislog 0. check for existence of recorded files in directory, e.g. examples/pduLog/PduCaptureLog.dislog
1. first running AllPduReceiver can confirm that DIS replay actually occurs. 1. first launching AllPduReceiver or Wireshark can confirm that DIS replay actually occurs.
2. run or debug PduReaderPlayer.java 2. run or debug PduReaderPlayer.java
3. Type p/enter to pause, r/enter to resume, q/enter to quit 3. Type p/enter to pause, r/enter to resume, q/enter to quit
...@@ -9,16 +9,22 @@ Program response: ...@@ -9,16 +9,22 @@ Program response:
=================================================== ===================================================
DisExamplesOpenDis7.PduReaderPlayer started... ant -f C:\\x-nps-gitlab\\NetworkedGraphicsMV3500\\examples -Dnb.internal.action.name=run run
Beginning pdu playback from directory pduLog init:
Replaying DIS logs. Deleting: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties
Replaying C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\Pdusave.dislog deps-jar:
Beginning of DIS capture file, Pdusave.dislog. Updating property file: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties
compile:
run:
OpenDis7Examples.PduReaderPlayer started...
Beginning PduReaderPlayer (239.1.2.3:3000) to directory pduLog
Type p/enter to pause, r/enter to resume, q/enter to quit Type p/enter to pause, r/enter to resume, q/enter to quit
72 Replaying DIS logs.
End of replay from Pdusave.dislog Replaying C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\PduCaptureLog.dislog
End of DIS capture file, Pdusave.dislog. ENCODING_PLAINTEXT
Total PDUs: 72
End of replay from PduCaptureLog.dislog
q q
Ending pdu files playback for directory pduLog Ending pdu files playback for directory pduLog
DisExamplesOpenDis7.PduReaderPlayer complete. OpenDis7Examples.PduReaderPlayer complete.
BUILD SUCCESSFUL (total time: 20 seconds) BUILD SUCCESSFUL (total time: 15 seconds)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment