From e65a28c1826194da7991c06458124fbabd8d0fd1 Mon Sep 17 00:00:00 2001
From: brutzman <brutzman@nps.edu>
Date: Fri, 24 Apr 2020 06:49:36 -0700
Subject: [PATCH] improved diagnostics

---
 src/edu/nps/moves/dis7/util/playerrecorder/Player.java   | 5 ++++-
 src/edu/nps/moves/dis7/util/playerrecorder/Recorder.java | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/edu/nps/moves/dis7/util/playerrecorder/Player.java b/src/edu/nps/moves/dis7/util/playerrecorder/Player.java
index 43c12a80ea..b5302ff9e5 100644
--- a/src/edu/nps/moves/dis7/util/playerrecorder/Player.java
+++ b/src/edu/nps/moves/dis7/util/playerrecorder/Player.java
@@ -164,8 +164,10 @@ public class Player
   
   private void showCounts()
   {
+    // use carriage return \r for transient display output as a run-time developer diagnostic
+    // (possibly as part of earlier diagnosis of threading-related problems with dropped packets)
     if (scenarioPduCount != null)
-      System.out.print(pduCount + " " + ++scenarioPduCount + "\r");
+      System.out.print(pduCount + " " + ++scenarioPduCount + "..." + "\r"); // TODO where are the ... ? not appearing in output
     else
       System.out.print(pduCount + "\r");
     showPduCountsOneTime = false;
@@ -205,6 +207,7 @@ public class Player
       showPduCountsOneTime = true;  // get the first one in there
     }
     else if (s.startsWith(STOP_COMMENT_MARKER)) {
+      System.out.print("Total PDUs: ");
       showCounts();
       System.out.println();
       System.out.println("End of replay from " + f.getName());
diff --git a/src/edu/nps/moves/dis7/util/playerrecorder/Recorder.java b/src/edu/nps/moves/dis7/util/playerrecorder/Recorder.java
index bbe81259a5..9710cf189b 100644
--- a/src/edu/nps/moves/dis7/util/playerrecorder/Recorder.java
+++ b/src/edu/nps/moves/dis7/util/playerrecorder/Recorder.java
@@ -127,7 +127,7 @@ public class Recorder implements PduReceiver
   private void writeHeader() throws IOException
   {
     String template = "Beginning of DIS capture file, %s.";
-    String startComment = String.format(template, logFile.getName());
+    String startComment = String.format(template, logFile.getName() + " (show transient progressing PDU count, then final total)");
     bufferedWriter.write(START_COMMENT_MARKER + startComment);
     bufferedWriter.newLine();
   }
-- 
GitLab