Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect marshal/unmarshal of DIS 7 StartResumePdu #45

Merged
merged 1 commit into from
Jul 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions src/main/java/edu/nps/moves/dis7/StartResumePdu.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
*/
public class StartResumePdu extends SimulationManagementFamilyPdu implements Serializable
{
/** Identifier for originating entity(or simulation) */
protected EntityID originatingID = new EntityID();

/** Identifier for the receiving entity(or simulation) */
protected EntityID receivingID = new EntityID();

/** This field shall specify the real-world time (UTC) at which the entity is to start/resume in the exercise. This information shall be used by the participating simulation applications to start/resume an exercise synchronously. This field shall be represented by a Clock Time record (see 6.2.16). */
protected ClockTime realWorldTime = new ClockTime();
Expand All @@ -43,32 +38,13 @@ public int getMarshalledSize()
int marshalSize = 0;

marshalSize = super.getMarshalledSize();
marshalSize = marshalSize + originatingID.getMarshalledSize(); // originatingID
marshalSize = marshalSize + receivingID.getMarshalledSize(); // receivingID
marshalSize = marshalSize + realWorldTime.getMarshalledSize(); // realWorldTime
marshalSize = marshalSize + simulationTime.getMarshalledSize(); // simulationTime
marshalSize = marshalSize + 4; // requestID

return marshalSize;
}


public void setOriginatingID(EntityID pOriginatingID)
{ originatingID = pOriginatingID;
}

public EntityID getOriginatingID()
{ return originatingID;
}

public void setReceivingID(EntityID pReceivingID)
{ receivingID = pReceivingID;
}

public EntityID getReceivingID()
{ return receivingID;
}

public void setRealWorldTime(ClockTime pRealWorldTime)
{ realWorldTime = pRealWorldTime;
}
Expand Down Expand Up @@ -99,8 +75,6 @@ public void marshal(DataOutputStream dos)
super.marshal(dos);
try
{
originatingID.marshal(dos);
receivingID.marshal(dos);
realWorldTime.marshal(dos);
simulationTime.marshal(dos);
dos.writeInt( (int)requestID);
Expand All @@ -116,8 +90,6 @@ public void unmarshal(DataInputStream dis)

try
{
originatingID.unmarshal(dis);
receivingID.unmarshal(dis);
realWorldTime.unmarshal(dis);
simulationTime.unmarshal(dis);
requestID = dis.readInt();
Expand All @@ -140,8 +112,6 @@ public void unmarshal(DataInputStream dis)
public void marshal(java.nio.ByteBuffer buff)
{
super.marshal(buff);
originatingID.marshal(buff);
receivingID.marshal(buff);
realWorldTime.marshal(buff);
simulationTime.marshal(buff);
buff.putInt( (int)requestID);
Expand All @@ -158,8 +128,6 @@ public void unmarshal(java.nio.ByteBuffer buff)
{
super.unmarshal(buff);

originatingID.unmarshal(buff);
receivingID.unmarshal(buff);
realWorldTime.unmarshal(buff);
simulationTime.unmarshal(buff);
requestID = buff.getInt();
Expand Down Expand Up @@ -197,8 +165,6 @@ public boolean equalsImpl(Object obj)

final StartResumePdu rhs = (StartResumePdu)obj;

if( ! (originatingID.equals( rhs.originatingID) )) ivarsEqual = false;
if( ! (receivingID.equals( rhs.receivingID) )) ivarsEqual = false;
if( ! (realWorldTime.equals( rhs.realWorldTime) )) ivarsEqual = false;
if( ! (simulationTime.equals( rhs.simulationTime) )) ivarsEqual = false;
if( ! (requestID == rhs.requestID)) ivarsEqual = false;
Expand Down