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
d6ae88c9
Commit
d6ae88c9
authored
5 years ago
by
J. M. Bailey
Browse files
Options
Downloads
Patches
Plain Diff
Use longer pdu type enum names
parent
67e718db
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/util/PduFactory.java
+26
-25
26 additions, 25 deletions
src/edu/nps/moves/dis7/util/PduFactory.java
with
26 additions
and
25 deletions
src/edu/nps/moves/dis7/util/PduFactory.java
+
26
−
25
View file @
d6ae88c9
...
...
@@ -1168,7 +1168,7 @@ public class PduFactory
aPdu
=
new
ReceiverPdu
();
break
;
case
I
FF
:
case
I
DENTIFICATION_FRIEND_OR_FOE
:
aPdu
=
new
IFFPdu
();
break
;
...
...
@@ -1240,7 +1240,7 @@ public class PduFactory
aPdu
=
new
ArealObjectStatePdu
();
break
;
case
T
SPI
:
case
T
IME_SPACE_POSITION_INFORMATION
:
aPdu
=
new
TSPIPdu
();
break
;
...
...
@@ -1252,71 +1252,71 @@ public class PduFactory
aPdu
=
new
ArticulatedPartsPdu
();
break
;
case
L
E
_FIRE:
case
L
IVE_ENTITY
_FIRE:
aPdu
=
new
LEFirePdu
();
break
;
case
L
E
_DETONATION:
case
L
IVE_ENTITY
_DETONATION:
aPdu
=
new
LEDetonationPdu
();
break
;
case
CREATE_ENTITY_R:
case
CREATE_ENTITY_R
ELIABLE
:
aPdu
=
new
CreateEntityReliablePdu
();
break
;
case
REMOVE_ENTITY_R:
case
REMOVE_ENTITY_R
ELIABLE
:
aPdu
=
new
RemoveEntityReliablePdu
();
break
;
case
START_RESUME_R:
case
START_RESUME_R
ELIABLE
:
aPdu
=
new
StartResumeReliablePdu
();
break
;
case
STOP_FREEZE_R:
case
STOP_FREEZE_R
ELIABLE
:
aPdu
=
new
StopFreezeReliablePdu
();
break
;
case
ACKNOWLEDGE_R:
case
ACKNOWLEDGE_R
ELIABLE
:
aPdu
=
new
AcknowledgeReliablePdu
();
break
;
case
ACTION_REQUEST_R:
case
ACTION_REQUEST_R
ELIABLE
:
aPdu
=
new
ActionRequestReliablePdu
();
break
;
case
ACTION_RESPONSE_R:
case
ACTION_RESPONSE_R
ELIABLE
:
aPdu
=
new
ActionResponseReliablePdu
();
break
;
case
DATA_QUERY_R:
case
DATA_QUERY_R
ELIABLE
:
aPdu
=
new
DataQueryReliablePdu
();
break
;
case
SET_DATA_R:
case
SET_DATA_R
ELIABLE
:
aPdu
=
new
SetDataReliablePdu
();
break
;
case
DATA_R:
case
DATA_R
ELIABLE
:
aPdu
=
new
DataReliablePdu
();
break
;
case
EVENT_REPORT_R:
case
EVENT_REPORT_R
ELIABLE
:
aPdu
=
new
EventReportReliablePdu
();
break
;
case
COMMENT_R:
case
COMMENT_R
ELIABLE
:
aPdu
=
new
CommentReliablePdu
();
break
;
case
RECORD_R:
case
RECORD_R
ELIABLE
:
aPdu
=
new
RecordReliablePdu
();
break
;
case
SET_RECORD_R:
case
SET_RECORD_R
ELIABLE
:
aPdu
=
new
SetRecordReliablePdu
();
break
;
case
RECORD_QUERY_R:
case
RECORD_QUERY_R
ELIABLE
:
aPdu
=
new
RecordQueryReliablePdu
();
break
;
...
...
@@ -1381,7 +1381,7 @@ public class PduFactory
* @param data
* @return List of PDUs decoded
*/
public
List
<
Pdu
>
getPdusFromBundle
(
byte
data
[])
public
List
<
Pdu
>
getPdusFromBundle
(
byte
data
[]
,
int
length
)
{
// All the PDUs in this bundle we were able to decode
ArrayList
<
Pdu
>
pdus
=
new
ArrayList
<
Pdu
>();
...
...
@@ -1394,7 +1394,7 @@ public class PduFactory
// data array from where the last PDU left off to the end of the original
// data array. This lets us reuse a bunch of old code.
byte
remaining
[]
=
Arrays
.
copyOfRange
(
data
,
pduStartPointInData
,
data
.
length
);
byte
remaining
[]
=
Arrays
.
copyOfRange
(
data
,
pduStartPointInData
,
length
);
try
{
// Decode one PDU
...
...
@@ -1412,13 +1412,14 @@ public class PduFactory
}
// Advance the index to the start of the next PDU
int
pduLength
=
pdu
.
getMarshalledSize
();
//getLength();
int
pduLength
=
pdu
.
getMarshalledSize
();
pduStartPointInData
=
pduStartPointInData
+
pduLength
;
//System.out.println("PDUStartP
O
int:" + pduStartPointInData + " data: " +
data.
length);
//System.out.println("PDUStartP
o
int:" + pduStartPointInData + " data: " + length);
// Have we read all the data?
if
(
pduStartPointInData
>=
data
.
length
)
{
//System.out.println("Out of data to read" + pduStartPointInData + " data length:" +
data.
length);
if
(
pduStartPointInData
>=
length
)
{
//System.out.println("Out of data to read" + pduStartPointInData + " data length:" + length);
break
;
}
...
...
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