From a2efbb4bfb39dd9ad978c4a93e30ff4c2a8385a2 Mon Sep 17 00:00:00 2001 From: "Norbraten, Terry" <tdnorbra@nps.edu> Date: Thu, 4 Jun 2020 19:46:22 -0700 Subject: [PATCH] reactivate main for testing --- .../dis7/utilities/stream/PduRecorder.java | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java b/src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java index 69accd5126..bdd65e8322 100644 --- a/src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java +++ b/src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java @@ -1,6 +1,8 @@ package edu.nps.moves.dis7.utilities.stream; import com.google.common.primitives.Longs; +import edu.nps.moves.dis7.Pdu; +import edu.nps.moves.dis7.enumerations.DISPDUType; import edu.nps.moves.dis7.utilities.DisNetworking; import edu.nps.moves.dis7.utilities.DisThreadedNetIF; import edu.nps.moves.dis7.utilities.PduFactory; @@ -233,25 +235,28 @@ public class PduRecorder implements PduReceiver String filename = "Pdusave"; PduRecorder recorder; - try{recorder = new PduRecorder();} catch(IOException ex) { + try { + recorder = new PduRecorder(); + } + catch(IOException ex) { System.err.println("Exception creating recorder: "+ex.getLocalizedMessage()); return; } -// // self test -// DISPDUType all[] = DISPDUType.values(); -// Arrays.stream(all).forEach(typ-> { -// if(typ != DISPDUType.OTHER) { -// try { -// Pdu pdu = factory.createPdu(typ); -// disnet.sendPdu(pdu); -// sleep(100); -// } -// catch(Exception ex) { -// System.err.println("Exception sending Pdu: "+ex.getLocalizedMessage()); -// } -// } -// }); + // self test + DISPDUType all[] = DISPDUType.values(); + Arrays.stream(all).forEach(typ-> { + if(typ != DISPDUType.OTHER) { + try { + Pdu pdu = factory.createPdu(typ); + disnet.sendPdu(pdu); + sleep(100); + } + catch(Exception ex) { + System.err.println("Exception sending Pdu: "+ex.getLocalizedMessage()); + } + } + }); System.out.println("Record for 10 seconds..."); // TODO arrrrgh this is awful sleep(10000); -- GitLab