From f4978356a6e095f793bac7db4e99c6abd840fa1e Mon Sep 17 00:00:00 2001
From: brutzman <brutzman@DESKTOP-2S09UKA>
Date: Sat, 24 Aug 2019 23:18:13 -0700
Subject: [PATCH] corrected class name in output messages, provide full
 invocation instructions and log

---
 .../OpenDis7Examples/PduListenerSaver.java    | 10 ++++++--
 .../OpenDis7Examples/PduListenerSaverLog.txt  | 24 +++++++++++++++++++
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 examples/src/OpenDis7Examples/PduListenerSaverLog.txt

diff --git a/examples/src/OpenDis7Examples/PduListenerSaver.java b/examples/src/OpenDis7Examples/PduListenerSaver.java
index 88be82c203..cb6136c5aa 100644
--- a/examples/src/OpenDis7Examples/PduListenerSaver.java
+++ b/examples/src/OpenDis7Examples/PduListenerSaver.java
@@ -17,7 +17,7 @@ import java.util.Scanner;
  */
 public class PduListenerSaver
 {
-  private final static String DEFAULT_OUTPUTDIR = "./pduLog";
+  private final static String DEFAULT_OUTPUTDIR = "pduLog";
   private final static String MCAST_ADDR = "239.1.2.3";
   private final static int DIS_PORT = 3000;
 
@@ -32,6 +32,8 @@ public class PduListenerSaver
     String outDir = DEFAULT_OUTPUTDIR;
     String mcast = MCAST_ADDR;
     int port = DIS_PORT;
+    
+    System.out.println("DisExamplesOpenDis7.PduListenerSaver started...");
 
     switch (args.length) {
       case 0:
@@ -55,6 +57,7 @@ public class PduListenerSaver
 
       recorder.startResume();
       mystate state = mystate.RUNNING;
+      System.out.println("* recorder.startResume(), state=RUNNING");
       Scanner scan = new Scanner(System.in);
 
       while (true) {
@@ -63,20 +66,23 @@ public class PduListenerSaver
         if (line.equalsIgnoreCase("p") && state == mystate.RUNNING) {
           recorder.stopPause();
           state = mystate.PAUSED;
+          System.out.println("* recorder.stopPause(), state=PAUSED");
         }
         else if (line.equalsIgnoreCase("r") && state == mystate.PAUSED) {
           recorder.startResume();
           state = mystate.RUNNING;
+          System.out.println("* recorder.startResume(), state=RUNNING");
         }
         else if (line.equalsIgnoreCase("q")) {
           recorder.end();
+          System.out.println("* recorder.end(), recording complete.");
           break;
         }
       }
       System.out.println("Ending pdu save to "+recorder.getLogFile());
     }
     catch (IOException ex) {
-      System.err.println("Exception: " + ex.getClass().getSimpleName() + ": " + ex.getLocalizedMessage());
+      System.err.println("*** Exception: " + ex.getClass().getSimpleName() + ": " + ex.getLocalizedMessage());
     }
   }
 }
diff --git a/examples/src/OpenDis7Examples/PduListenerSaverLog.txt b/examples/src/OpenDis7Examples/PduListenerSaverLog.txt
new file mode 100644
index 0000000000..cc9df83879
--- /dev/null
+++ b/examples/src/OpenDis7Examples/PduListenerSaverLog.txt
@@ -0,0 +1,24 @@
+Invocation instructions:
+
+1. run or debug PduListenerSaver.java
+2. send PDUs from another program such as AllPduSender.java (used here)
+3. also running AllPduReceiver can confirm that DIS replay actually occurs.
+4. Type p/enter to pause, r/enter to resume, q/enter to quit
+5. if Pdusave.dislog file(s) already exist, your recording will be added.
+6. note existence of recorded files in directory, e.g. examples/pduLog/Pdusave.dislog
+7. rename/cut/paste your recording file to keep track of your results.
+
+Program response:
+
+===================================================
+
+DisExamplesOpenDis7.PduListenerSaver started...
+Beginning pdu save to directory pduLog
+* recorder.startResume(), state=RUNNING
+Type p/enter to pause, r/enter to resume, q/enter to quit
+q
+
+Recorder log file closed
+* recorder.end(), recording complete.
+Ending pdu save to C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\Pdusave1.dislog
+BUILD SUCCESSFUL (total time: 1 minute 51 seconds)
\ No newline at end of file
-- 
GitLab