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
4d0537af
Commit
4d0537af
authored
3 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
more-explicit logic for state-machine
parent
88917dd6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/edu/nps/moves/dis7/utilities/stream/PduPlayer.java
+39
-12
39 additions, 12 deletions
src/edu/nps/moves/dis7/utilities/stream/PduPlayer.java
src/edu/nps/moves/dis7/utilities/stream/PduPlayerSelfTestLog.txt
+1
-2
1 addition, 2 deletions
.../nps/moves/dis7/utilities/stream/PduPlayerSelfTestLog.txt
with
40 additions
and
14 deletions
src/edu/nps/moves/dis7/utilities/stream/PduPlayer.java
+
39
−
12
View file @
4d0537af
...
...
@@ -53,6 +53,10 @@ public class PduPlayer {
static
final
String
ENCODING_WIRESHARK_DATA_LOGGER
=
"ENCODING_WIRESHARK_DATA_LOGGER"
;
//
private
static
String
pduLogEncoding
=
PduRecorder
.
ENCODING_PLAINTEXT
;
// determined when reading file
private
boolean
hasBegun
=
false
;
private
boolean
playing
=
false
;
private
boolean
paused
=
false
;
/** Constructor that spawns the player thread.
*
...
...
@@ -81,7 +85,6 @@ public class PduPlayer {
private
int
pduCount
=
0
;
private
DatagramSocket
datagramSocket
;
private
Long
startNanoTime
=
null
;
private
boolean
paused
=
false
;
private
boolean
netSend
=
true
;
private
RawListener
rawListener
=
null
;
...
...
@@ -142,6 +145,11 @@ public class PduPlayer {
}
Base64
.
Decoder
base64Decoder
=
Base64
.
getDecoder
();
// activate state, commence playing
hasBegun
=
true
;
playing
=
true
;
paused
=
false
;
for
(
File
f
:
filesArray
)
{
...
...
@@ -403,7 +411,7 @@ public class PduPlayer {
System
.
err
.
println
(
"Exception reading/writing pdus: "
+
ex
.
getClass
().
getSimpleName
()
+
": "
+
ex
.
getLocalizedMessage
());
ex
.
printStackTrace
();
playerThread
=
null
;
close
r
();
close
Connections
();
}
}
...
...
@@ -418,14 +426,19 @@ public class PduPlayer {
showPduCountsOneTime
=
false
;
}
private
void
exitWithFailure
()
throws
IOException
{
private
void
exitWithFailure
()
throws
IOException
{
System
.
out
.
println
(
"Replay stopped."
);
close
r
();
close
Connections
();
throw
new
IOException
(
"PduPlayer parsing error"
);
}
private
void
closer
()
{
netSend
=
false
;
private
void
closeConnections
()
{
hasBegun
=
false
;
playing
=
false
;
paused
=
false
;
netSend
=
false
;
if
(
datagramSocket
!=
null
)
{
datagramSocket
.
close
();
datagramSocket
=
null
;
...
...
@@ -462,18 +475,31 @@ public class PduPlayer {
return
returnValue
;
}
/** Start or resume this instance */
public
void
startResume
()
{
paused
=
false
;
public
void
startResume
()
{
if
(!
hasBegun
)
{
System
.
out
.
println
(
"PduPlayer startResume() received before start of operations, invoking begion()"
);
begin
();
sleep
(
500
l
);
// allow thread to start
}
playing
=
true
;
paused
=
false
;
}
/** Stop or pause this instance */
public
void
stopPause
()
{
paused
=
true
;
public
void
stopPause
()
{
playing
=
true
;
paused
=
true
;
}
/** End operation of this instance */
public
void
end
()
{
closer
();
public
void
end
()
{
playing
=
false
;
paused
=
true
;
closeConnections
();
}
private
void
sleep
(
long
ms
)
{
...
...
@@ -506,6 +532,7 @@ public class PduPlayer {
try
{
System
.
out
.
println
(
"Prepare for PduPlayer self-test log by running PduRecorder() self-test first."
);
// create instance of class in this static block
PduPlayer
pduPlayer
=
new
PduPlayer
(
multicastAddress
,
multicastPort
,
Path
.
of
(
outputDirectory
),
sendToNet
);
// thread automatically starts up when class is instantiated
...
...
This diff is collapsed.
Click to expand it.
src/edu/nps/moves/dis7/utilities/stream/PduPlayerSelfTestLog.txt
+
1
−
2
View file @
4d0537af
...
...
@@ -4,10 +4,9 @@ Deleting: C:\x3d-github\open-dis7-java\build\built-jar.properties
deps-jar:
Updating property file: C:\x3d-github\open-dis7-java\build\built-jar.properties
Compiling 1 source file to C:\x3d-github\open-dis7-java\build\classes
warning: [options] bootstrap class path not set in conjunction with -source 8
1 warning
compile-single:
run-single:
Prepare for PduPlayer self-test log by running PduRecorder() self-test first.
PduPlayer begin() playing DIS logs found in ancestor pduLog directory.
ENCODING_PLAINTEXT
Replaying PDU log file with ENCODING_PLAINTEXT: C:\x3d-github\open-dis7-java\pduLog\PduRecorderSelfTestENCODING_PLAINTEXT_PduCaptureLog.dislog
...
...
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