Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
a2efbb4b
Commit
a2efbb4b
authored
5 years ago
by
Terry D. Norbraten
Browse files
Options
Downloads
Patches
Plain Diff
reactivate main for testing
parent
9030d266
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java
+20
-15
20 additions, 15 deletions
src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java
with
20 additions
and
15 deletions
src/edu/nps/moves/dis7/utilities/stream/PduRecorder.java
+
20
−
15
View file @
a2efbb4b
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment