""""Parse a message. This may recursively call embedded objects."""
self.expendableType.parse(inputStream)
self.padding = inputStream.read_long();
class PropulsionSystemData( object ):
"""contains information describing the propulsion systems of the entity. This information shall be provided for each active propulsion system defined. Section 6.2.68"""
def __init__(self):
""" Initializer for PropulsionSystemData"""
self.powerSetting = 0
""" powerSetting"""
self.engineRpm = 0
""" engine RPMs"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.powerSetting);
outputStream.write_float(self.engineRpm);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.powerSetting = inputStream.read_float();
self.engineRpm = inputStream.read_float();
class LiveEntityIdentifier( object ):
"""The unique designation of each entity in an event or exercise that is contained in a Live Entity PDU. Section 6.2.54 """
def __init__(self):
""" Initializer for LiveEntityIdentifier"""
self.liveSimulationAddress = LiveSimulationAddress();
""" Live Simulation Address record (see 6.2.54) """
self.entityNumber = 0
""" Live entity number """
def serialize(self, outputStream):
"""serialize the class """
self.liveSimulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.entityNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.liveSimulationAddress.parse(inputStream)
self.entityNumber = inputStream.read_unsigned_short();
class SeparationVP( object ):
"""Physical separation of an entity from another entity. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for SeparationVP"""
self.recordType = 2
""" the identification of the Variable Parameter record. Enumeration from EBV"""
self.reasonForSeparation = 0
""" Reason for separation. EBV"""
self.preEntityIndicator = 0
""" Whether the entity existed prior to separation EBV"""
self.padding1 = 0
""" padding"""
self.parentEntityID = EntityID();
""" ID of parent"""
self.padding2 = 0
""" padding"""
self.stationLocation = 0
""" Station separated from"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.recordType);
outputStream.write_unsigned_byte(self.reasonForSeparation);
outputStream.write_unsigned_byte(self.preEntityIndicator);
outputStream.write_unsigned_byte(self.padding1);
self.parentEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.padding2);
outputStream.write_unsigned_int(self.stationLocation);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_byte();
self.reasonForSeparation = inputStream.read_unsigned_byte();
self.preEntityIndicator = inputStream.read_unsigned_byte();
self.padding1 = inputStream.read_unsigned_byte();
self.parentEntityID.parse(inputStream)
self.padding2 = inputStream.read_unsigned_short();
self.stationLocation = inputStream.read_unsigned_int();
class EmitterSystem( object ):
"""This field shall specify information about a particular emitter system. Section 6.2.23."""
def __init__(self):
""" Initializer for EmitterSystem"""
self.emitterName = 0
""" Name of the emitter, 16 bit enumeration"""
self.emitterFunction = 0
""" function of the emitter, 8 bit enumeration"""
self.emitterIDNumber = 0
""" emitter ID, 8 bit enumeration"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.emitterName);
outputStream.write_unsigned_byte(self.emitterFunction);
outputStream.write_unsigned_byte(self.emitterIDNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.emitterName = inputStream.read_unsigned_short();
self.emitterFunction = inputStream.read_unsigned_byte();
self.emitterIDNumber = inputStream.read_unsigned_byte();
class PduStatus( object ):
"""PDU Status. These are a series of bit fields. Represented here as just a byte. Section 6.2.67"""
def __init__(self):
""" Initializer for PduStatus"""
self.pduStatus = 0
""" Bit fields. The semantics of the bit fields depend on the PDU type"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.pduStatus);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.pduStatus = inputStream.read_unsigned_byte();
class LiveEntityPdu( PduSuperclass ):
"""The live entity PDUs have a header with some different field names, but the same length. Section 9.3.2"""
def __init__(self):
""" Initializer for LiveEntityPdu"""
super(LiveEntityPdu, self).__init__()
self.subprotocolNumber = 0
""" Subprotocol used to decode the PDU. Section 13 of EBV."""
self.padding = 0
""" zero-filled array of padding"""
def serialize(self, outputStream):
"""serialize the class """
super( LiveEntityPdu, self ).serialize(outputStream)
outputStream.write_unsigned_short(self.subprotocolNumber);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( LiveEntityPdu, self).parse(inputStream)
self.subprotocolNumber = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_byte();
class Pdu( PduSuperclass ):
"""Adds some fields to the the classic PDU"""
def __init__(self):
""" Initializer for Pdu"""
super(Pdu, self).__init__()
self.pduStatus = 0
""" PDU Status Record. Described in 6.2.67. This field is not present in earlier DIS versions """
self.padding = 0
""" zero-filled array of padding"""
def serialize(self, outputStream):
"""serialize the class """
super( Pdu, self ).serialize(outputStream)
outputStream.write_unsigned_byte(self.pduStatus);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( Pdu, self).parse(inputStream)
self.pduStatus = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class EntityInformationFamilyPdu( Pdu ):
"""Section 5.3.3. Common superclass for EntityState, Collision, collision-elastic, and entity state update PDUs. This should be abstract. COMPLETE"""
def __init__(self):
""" Initializer for EntityInformationFamilyPdu"""
super(EntityInformationFamilyPdu, self).__init__()
self.protocolFamily = 1
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( EntityInformationFamilyPdu, self ).serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( EntityInformationFamilyPdu, self).parse(inputStream)
class LogisticsFamilyPdu( Pdu ):
""" Abstract superclass for logistics PDUs. Section 7.4 COMPLETE"""
def __init__(self):
""" Initializer for LogisticsFamilyPdu"""
super(LogisticsFamilyPdu, self).__init__()
self.protocolFamily = 3
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( LogisticsFamilyPdu, self ).serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( LogisticsFamilyPdu, self).parse(inputStream)
class EntityStateUpdatePdu( EntityInformationFamilyPdu ):
"""Nonstatic information about a particular entity may be communicated by issuing an Entity State Update PDU. Section 7.2.5. COMPLETE"""
def __init__(self):
""" Initializer for EntityStateUpdatePdu"""
super(EntityStateUpdatePdu, self).__init__()
self.entityID = EntityID();
""" This field shall identify the entity issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28)."""
self.padding1 = 0
""" Padding"""
self.numberOfVariableParameters = 0
""" This field shall specify the number of variable parameters present. This field shall be represented by an 8-bit unsigned integer (see Annex I)."""
self.entityLinearVelocity = Vector3Float();
""" This field shall specify an entitys linear velocity. The coordinate system for an entitys linear velocity depends on the dead reckoning algorithm used. This field shall be represented by a Linear Velocity Vector record [see 6.2.95 item c)])."""
self.entityLocation = Vector3Double();
""" This field shall specify an entitys physical location in the simulated world and shall be represented by a World Coordinates record (see 6.2.97)."""
self.entityOrientation = EulerAngles();
""" This field shall specify an entitys orientation and shall be represented by an Euler Angles record (see 6.2.33)."""
self.entityAppearance = 0
""" This field shall specify the dynamic changes to the entitys appearance attributes. This field shall be represented by an Entity Appearance record (see 6.2.26)."""
self.variableParameters = []
""" This field shall specify the parameter values for each Variable Parameter record that is included (see 6.2.93 and Annex I)."""
self.pduType = 67
""" initialize value """
self.protocolFamily = 1
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( EntityStateUpdatePdu, self ).serialize(outputStream)
self.entityID.serialize(outputStream)
outputStream.write_byte(self.padding1);
outputStream.write_unsigned_byte( len(self.variableParameters));
self.entityLinearVelocity.serialize(outputStream)
self.entityLocation.serialize(outputStream)
self.entityOrientation.serialize(outputStream)
outputStream.write_unsigned_int(self.entityAppearance);
for anObj in self.variableParameters:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( EntityStateUpdatePdu, self).parse(inputStream)
self.entityID.parse(inputStream)
self.padding1 = inputStream.read_byte();
self.numberOfVariableParameters = inputStream.read_unsigned_byte();
self.entityLinearVelocity.parse(inputStream)
self.entityLocation.parse(inputStream)
self.entityOrientation.parse(inputStream)
self.entityAppearance = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfVariableParameters):
element = VariableParameter()
element.parse(inputStream)
self.variableParameters.append(element)
class ServiceRequestPdu( LogisticsFamilyPdu ):
"""Service Request PDU shall be used to communicate information associated with one entity requesting a service from another). Section 7.4.2 COMPLETE"""
def __init__(self):
""" Initializer for ServiceRequestPdu"""
super(ServiceRequestPdu, self).__init__()
self.requestingEntityID = EntityID();
""" Entity that is requesting service (see 6.2.28), Section 7.4.2"""
self.servicingEntityID = EntityID();
""" Entity that is providing the service (see 6.2.28), Section 7.4.2"""
self.serviceTypeRequested = 0
""" Type of service requested, Section 7.4.2"""
self.numberOfSupplyTypes = 0
""" How many requested, Section 7.4.2"""
self.serviceRequestPadding = 0
""" padding"""
self.supplies = []
self.pduType = 5
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ServiceRequestPdu, self ).serialize(outputStream)
self.requestingEntityID.serialize(outputStream)
self.servicingEntityID.serialize(outputStream)
outputStream.write_unsigned_byte(self.serviceTypeRequested);
outputStream.write_unsigned_byte( len(self.supplies));
outputStream.write_short(self.serviceRequestPadding);
for anObj in self.supplies:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ServiceRequestPdu, self).parse(inputStream)
self.requestingEntityID.parse(inputStream)
self.servicingEntityID.parse(inputStream)
self.serviceTypeRequested = inputStream.read_unsigned_byte();
self.numberOfSupplyTypes = inputStream.read_unsigned_byte();
self.serviceRequestPadding = inputStream.read_short();
for idx in range(0, self.numberOfSupplyTypes):
element = null()
element.parse(inputStream)
self.supplies.append(element)
class RepairCompletePdu( LogisticsFamilyPdu ):
"""Section 7.4.6. Service Request PDU is received and repair is complete. COMPLETE"""
def __init__(self):
""" Initializer for RepairCompletePdu"""
super(RepairCompletePdu, self).__init__()
self.receivingEntityID = EntityID();
""" Entity that is receiving service. See 6.2.28"""
self.repairingEntityID = EntityID();
""" Entity that is supplying. See 6.2.28"""
self.repair = 0
""" Enumeration for type of repair. See 6.2.74"""
self.padding4 = 0
""" padding, number prevents conflict with superclass ivar name"""
self.pduType = 9
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( RepairCompletePdu, self ).serialize(outputStream)
self.receivingEntityID.serialize(outputStream)
self.repairingEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.repair);
outputStream.write_short(self.padding4);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( RepairCompletePdu, self).parse(inputStream)
self.receivingEntityID.parse(inputStream)
self.repairingEntityID.parse(inputStream)
self.repair = inputStream.read_unsigned_short();
self.padding4 = inputStream.read_short();
class SyntheticEnvironmentFamilyPdu( Pdu ):
"""Section 5.3.11: Abstract superclass for synthetic environment PDUs"""
def __init__(self):
""" Initializer for SyntheticEnvironmentFamilyPdu"""
super(SyntheticEnvironmentFamilyPdu, self).__init__()
self.protocolFamily = 9
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( SyntheticEnvironmentFamilyPdu, self ).serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( SyntheticEnvironmentFamilyPdu, self).parse(inputStream)
class CollisionPdu( EntityInformationFamilyPdu ):
"""Section 7.2.3 Collisions between entities shall be communicated by issuing a Collision PDU. COMPLETE"""
def __init__(self):
""" Initializer for CollisionPdu"""
super(CollisionPdu, self).__init__()
self.issuingEntityID = EntityID();
""" This field shall identify the entity that is issuing the PDU, and shall be represented by an Entity Identifier record (see 6.2.28)."""
self.collidingEntityID = EntityID();
""" This field shall identify the entity that has collided with the issuing entity (see <IP_ADDRESS>). This field shall be represented by an Entity Identifier record (see 6.2.28)."""
self.eventID = EventIdentifier();
""" This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34)."""
self.collisionType = 0
""" This field shall identify the type of collision. The Collision Type field shall be represented by an 8-bit record of enumerations"""
self.pad = 0
""" some padding"""
self.velocity = Vector3Float();
""" This field shall contain the velocity (at the time the collision is detected) of the issuing entity. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)]."""
self.mass = 0
""" This field shall contain the mass of the issuing entity, and shall be represented by a 32-bit floating point number representing kilograms."""
self.location = Vector3Float();
""" This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. The Location field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)]."""
self.pduType = 4
""" initialize value """
self.protocolFamily = 1
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( CollisionPdu, self ).serialize(outputStream)
self.issuingEntityID.serialize(outputStream)
self.collidingEntityID.serialize(outputStream)
self.eventID.serialize(outputStream)
outputStream.write_unsigned_byte(self.collisionType);
outputStream.write_byte(self.pad);
self.velocity.serialize(outputStream)
outputStream.write_float(self.mass);
self.location.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( CollisionPdu, self).parse(inputStream)
self.issuingEntityID.parse(inputStream)
self.collidingEntityID.parse(inputStream)
self.eventID.parse(inputStream)
self.collisionType = inputStream.read_unsigned_byte();
self.pad = inputStream.read_byte();
self.velocity.parse(inputStream)
self.mass = inputStream.read_float();
self.location.parse(inputStream)
class RepairResponsePdu( LogisticsFamilyPdu ):
"""Section 7.4.7. Sent after repair complete PDU. COMPLETE"""
def __init__(self):
""" Initializer for RepairResponsePdu"""
super(RepairResponsePdu, self).__init__()
self.receivingEntityID = EntityID();
""" Entity that requested repairs. See 6.2.28"""
self.repairingEntityID = EntityID();
""" Entity that is repairing. See 6.2.28"""
self.repairResult = 0
""" Result of repair operation"""
self.padding1 = 0
""" padding"""
self.padding2 = 0
""" padding"""
self.pduType = 10
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( RepairResponsePdu, self ).serialize(outputStream)
self.receivingEntityID.serialize(outputStream)
self.repairingEntityID.serialize(outputStream)
outputStream.write_unsigned_byte(self.repairResult);
outputStream.write_short(self.padding1);
outputStream.write_byte(self.padding2);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( RepairResponsePdu, self).parse(inputStream)
self.receivingEntityID.parse(inputStream)
self.repairingEntityID.parse(inputStream)
self.repairResult = inputStream.read_unsigned_byte();
self.padding1 = inputStream.read_short();
self.padding2 = inputStream.read_byte();
class SimulationManagementFamilyPdu( Pdu ):
"""Section 7.5 Abstract superclass for PDUs relating to the simulation itself. COMPLETE"""
def __init__(self):
""" Initializer for SimulationManagementFamilyPdu"""
super(SimulationManagementFamilyPdu, self).__init__()
self.originatingEntityID = EntityID();
""" Entity that is sending message"""
self.receivingEntityID = EntityID();
""" Entity that is intended to receive message"""
self.protocolFamily = 5
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( SimulationManagementFamilyPdu, self ).serialize(outputStream)
self.originatingEntityID.serialize(outputStream)
self.receivingEntityID.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( SimulationManagementFamilyPdu, self).parse(inputStream)
self.originatingEntityID.parse(inputStream)
self.receivingEntityID.parse(inputStream)
class DataQueryPdu( SimulationManagementFamilyPdu ):
"""Section 7.5.9. Request for data from an entity. COMPLETE"""
def __init__(self):
""" Initializer for DataQueryPdu"""
super(DataQueryPdu, self).__init__()
self.requestID = 0
""" ID of request"""
self.timeInterval = 0
""" time issues between issues of Data PDUs. Zero means send once only."""
self.numberOfFixedDatumRecords = 0
""" Number of fixed datum records"""
self.numberOfVariableDatumRecords = 0
""" Number of variable datum records"""
self.fixedDatums = []
""" variable length list of fixed datums"""
self.variableDatums = []
""" variable length list of variable length datums"""
self.pduType = 18
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DataQueryPdu, self ).serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int(self.timeInterval);
outputStream.write_unsigned_int( len(self.fixedDatums));
outputStream.write_unsigned_int( len(self.variableDatums));
for anObj in self.fixedDatums:
anObj.serialize(outputStream)
for anObj in self.variableDatums:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DataQueryPdu, self).parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
self.timeInterval = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatums.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatums.append(element)
class LinearObjectStatePdu( SyntheticEnvironmentFamilyPdu ):
""": Information abut the addition or modification of a synthecic enviroment object that is anchored to the terrain with a single point and has size or orientation. Section 7.10.5 COMPLETE"""
def __init__(self):
""" Initializer for LinearObjectStatePdu"""
super(LinearObjectStatePdu, self).__init__()
self.objectID = EntityID();
""" Object in synthetic environment"""
self.referencedObjectID = EntityID();
""" Object with which this point object is associated"""
self.updateNumber = 0
""" unique update number of each state transition of an object"""
self.forceID = 0
""" force ID"""
self.numberOfSegments = 0
""" number of linear segment parameters"""
self.requesterID = SimulationAddress();
""" requesterID"""
self.receivingID = SimulationAddress();
""" receiver ID"""
self.objectType = ObjectType();
""" Object type"""
self.linearSegmentParameters = []
""" Linear segment parameters"""
self.pduType = 44
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( LinearObjectStatePdu, self ).serialize(outputStream)
self.objectID.serialize(outputStream)
self.referencedObjectID.serialize(outputStream)
outputStream.write_unsigned_short(self.updateNumber);
outputStream.write_unsigned_byte(self.forceID);
outputStream.write_unsigned_byte( len(self.linearSegmentParameters));
self.requesterID.serialize(outputStream)
self.receivingID.serialize(outputStream)
self.objectType.serialize(outputStream)
for anObj in self.linearSegmentParameters:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( LinearObjectStatePdu, self).parse(inputStream)
self.objectID.parse(inputStream)
self.referencedObjectID.parse(inputStream)
self.updateNumber = inputStream.read_unsigned_short();
self.forceID = inputStream.read_unsigned_byte();
self.numberOfSegments = inputStream.read_unsigned_byte();
self.requesterID.parse(inputStream)
self.receivingID.parse(inputStream)
self.objectType.parse(inputStream)
for idx in range(0, self.numberOfSegments):
element = null()
element.parse(inputStream)
self.linearSegmentParameters.append(element)
class CreateEntityPdu( SimulationManagementFamilyPdu ):
"""Section 7.5.2. Create a new entity. COMPLETE"""
def __init__(self):
""" Initializer for CreateEntityPdu"""
super(CreateEntityPdu, self).__init__()
self.originatingID = EntityID();
""" Identifier for the request"""
self.receivingID = EntityID();
""" Identifier for the request"""
self.requestID = 0
""" Identifier for the request. See 6.2.75"""
self.pduType = 11
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( CreateEntityPdu, self ).serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( CreateEntityPdu, self).parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
class RadioCommunicationsFamilyPdu( Pdu ):
""" Abstract superclass for radio communications PDUs. Section 7.7"""
def __init__(self):
""" Initializer for RadioCommunicationsFamilyPdu"""
super(RadioCommunicationsFamilyPdu, self).__init__()
self.protocolFamily = 4
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( RadioCommunicationsFamilyPdu, self ).serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( RadioCommunicationsFamilyPdu, self).parse(inputStream)
class IntercomSignalPdu( RadioCommunicationsFamilyPdu ):
""" Actual transmission of intercome voice data. Section 7.7.5. COMPLETE"""
def __init__(self):
""" Initializer for IntercomSignalPdu"""
super(IntercomSignalPdu, self).__init__()
self.entityID = EntityID();
""" entity ID"""
self.communicationsDeviceID = 0
""" ID of communications device"""
self.encodingScheme = 0
""" encoding scheme"""
self.tdlType = 0
""" tactical data link type"""
self.sampleRate = 0
""" sample rate"""
self.dataLength = 0
""" data length"""
self.samples = 0
""" samples"""
self.data = []
""" data bytes"""
self.pduType = 31
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( IntercomSignalPdu, self ).serialize(outputStream)
self.entityID.serialize(outputStream)
outputStream.write_unsigned_short(self.communicationsDeviceID);
outputStream.write_unsigned_short(self.encodingScheme);
outputStream.write_unsigned_short(self.tdlType);
outputStream.write_unsigned_int(self.sampleRate);
outputStream.write_unsigned_short( len(self.data));
outputStream.write_unsigned_short(self.samples);
for anObj in self.data:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( IntercomSignalPdu, self).parse(inputStream)
self.entityID.parse(inputStream)
self.communicationsDeviceID = inputStream.read_unsigned_short();
self.encodingScheme = inputStream.read_unsigned_short();
self.tdlType = inputStream.read_unsigned_short();
self.sampleRate = inputStream.read_unsigned_int();
self.dataLength = inputStream.read_unsigned_short();
self.samples = inputStream.read_unsigned_short();
for idx in range(0, self.dataLength):
element = null()
element.parse(inputStream)
self.data.append(element)
class RemoveEntityPdu( SimulationManagementFamilyPdu ):
"""Section 7.5.3 The removal of an entity from an exercise shall be communicated with a Remove Entity PDU. COMPLETE"""
def __init__(self):
""" Initializer for RemoveEntityPdu"""
super(RemoveEntityPdu, self).__init__()
self.originatingID = EntityID();
""" Identifier for originating entity(or simulation)"""
self.receivingID = EntityID();
""" Identifier for the receiving entity(or simulation)"""
self.requestID = 0
""" This field shall identify the specific and unique start/resume request being made by the SM"""
self.pduType = 12
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( RemoveEntityPdu, self ).serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( RemoveEntityPdu, self).parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
class ResupplyReceivedPdu( LogisticsFamilyPdu ):
"""Section 7.4.4. Receipt of supplies is communicated by issuing Resupply Received PDU. COMPLETE"""
def __init__(self):
""" Initializer for ResupplyReceivedPdu"""
super(ResupplyReceivedPdu, self).__init__()
self.receivingEntityID = EntityID();
""" Entity that is receiving service. Shall be represented by Entity Identifier record (see 6.2.28)"""
self.supplyingEntityID = EntityID();
""" Entity that is supplying. Shall be represented by Entity Identifier record (see 6.2.28)"""
self.numberOfSupplyTypes = 0
""" How many supplies are taken by receiving entity"""
self.padding1 = 0
""" padding"""
self.padding2 = 0
""" padding"""
self.supplies = []
""" Type and amount of supplies for each specified supply type. See 6.2.85 for supply quantity record."""
self.pduType = 7
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ResupplyReceivedPdu, self ).serialize(outputStream)
self.receivingEntityID.serialize(outputStream)
self.supplyingEntityID.serialize(outputStream)
outputStream.write_unsigned_byte( len(self.supplies));
outputStream.write_short(self.padding1);
outputStream.write_byte(self.padding2);
for anObj in self.supplies:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ResupplyReceivedPdu, self).parse(inputStream)
self.receivingEntityID.parse(inputStream)
self.supplyingEntityID.parse(inputStream)
self.numberOfSupplyTypes = inputStream.read_unsigned_byte();
self.padding1 = inputStream.read_short();
self.padding2 = inputStream.read_byte();
for idx in range(0, self.numberOfSupplyTypes):
element = null()
element.parse(inputStream)
self.supplies.append(element)
class WarfareFamilyPdu( Pdu ):
"""abstract superclass for fire and detonation pdus that have shared information. Section 7.3 COMPLETE"""
def __init__(self):
""" Initializer for WarfareFamilyPdu"""
super(WarfareFamilyPdu, self).__init__()
self.firingEntityID = EntityID();
""" ID of the entity that shot"""
self.targetEntityID = EntityID();
""" ID of the entity that is being shot at"""
self.protocolFamily = 2
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( WarfareFamilyPdu, self ).serialize(outputStream)
self.firingEntityID.serialize(outputStream)
self.targetEntityID.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( WarfareFamilyPdu, self).parse(inputStream)
self.firingEntityID.parse(inputStream)
self.targetEntityID.parse(inputStream)
class CollisionElasticPdu( EntityInformationFamilyPdu ):
"""Information about elastic collisions in a DIS exercise shall be communicated using a Collision-Elastic PDU. Section 7.2.4. COMPLETE"""
def __init__(self):
""" Initializer for CollisionElasticPdu"""
super(CollisionElasticPdu, self).__init__()
self.issuingEntityID = EntityID();
""" This field shall identify the entity that is issuing the PDU and shall be represented by an Entity Identifier record (see 6.2.28)"""
self.collidingEntityID = EntityID();
""" This field shall identify the entity that has collided with the issuing entity. This field shall be a valid identifier of an entity or server capable of responding to the receipt of this Collision-Elastic PDU. This field shall be represented by an Entity Identifier record (see 6.2.28)."""
self.collisionEventID = EventIdentifier();
""" This field shall contain an identification generated by the issuing simulation application to associate related collision events. This field shall be represented by an Event Identifier record (see 6.2.34)."""
self.pad = 0
""" some padding"""
self.contactVelocity = Vector3Float();
""" This field shall contain the velocity at the time the collision is detected at the point the collision is detected. The velocity shall be represented in world coordinates. This field shall be represented by the Linear Velocity Vector record [see 6.2.95 item c)]"""
self.mass = 0
""" This field shall contain the mass of the issuing entity and shall be represented by a 32-bit floating point number representing kilograms"""
self.locationOfImpact = Vector3Float();
""" This field shall specify the location of the collision with respect to the entity with which the issuing entity collided. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)]."""
self.collisionIntermediateResultXX = 0
""" These six records represent the six independent components of a positive semi-definite matrix formed by pre-multiplying and post-multiplying the tensor of inertia, by the anti-symmetric matrix generated by the moment arm, and shall be represented by 32-bit floating point numbers (see <IP_ADDRESS>)"""
self.collisionIntermediateResultXY = 0
""" tensor values"""
self.collisionIntermediateResultXZ = 0
""" tensor values"""
self.collisionIntermediateResultYY = 0
""" tensor values"""
self.collisionIntermediateResultYZ = 0
""" tensor values"""
self.collisionIntermediateResultZZ = 0
""" tensor values"""
self.unitSurfaceNormal = Vector3Float();
""" This record shall represent the normal vector to the surface at the point of collision detection. The surface normal shall be represented in world coordinates. This field shall be represented by an Entity Coordinate Vector record [see 6.2.95 item a)]."""
self.coefficientOfRestitution = 0
""" This field shall represent the degree to which energy is conserved in a collision and shall be represented by a 32-bit floating point number. In addition, it represents a free parameter by which simulation application developers may tune their collision interactions."""
self.pduType = 66
""" initialize value """
self.protocolFamily = 1
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( CollisionElasticPdu, self ).serialize(outputStream)
self.issuingEntityID.serialize(outputStream)
self.collidingEntityID.serialize(outputStream)
self.collisionEventID.serialize(outputStream)
outputStream.write_short(self.pad);
self.contactVelocity.serialize(outputStream)
outputStream.write_float(self.mass);
self.locationOfImpact.serialize(outputStream)
outputStream.write_float(self.collisionIntermediateResultXX);
outputStream.write_float(self.collisionIntermediateResultXY);
outputStream.write_float(self.collisionIntermediateResultXZ);
outputStream.write_float(self.collisionIntermediateResultYY);
outputStream.write_float(self.collisionIntermediateResultYZ);
outputStream.write_float(self.collisionIntermediateResultZZ);
self.unitSurfaceNormal.serialize(outputStream)
outputStream.write_float(self.coefficientOfRestitution);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( CollisionElasticPdu, self).parse(inputStream)
self.issuingEntityID.parse(inputStream)
self.collidingEntityID.parse(inputStream)
self.collisionEventID.parse(inputStream)
self.pad = inputStream.read_short();
self.contactVelocity.parse(inputStream)
self.mass = inputStream.read_float();
self.locationOfImpact.parse(inputStream)
self.collisionIntermediateResultXX = inputStream.read_float();
self.collisionIntermediateResultXY = inputStream.read_float();
self.collisionIntermediateResultXZ = inputStream.read_float();
self.collisionIntermediateResultYY = inputStream.read_float();
self.collisionIntermediateResultYZ = inputStream.read_float();
self.collisionIntermediateResultZZ = inputStream.read_float();
self.unitSurfaceNormal.parse(inputStream)
self.coefficientOfRestitution = inputStream.read_float();
class ActionRequestPdu( SimulationManagementFamilyPdu ):
"""Section 7.5.7. Request from simulation manager to a managed entity to perform a specified action. COMPLETE"""
def __init__(self):
""" Initializer for ActionRequestPdu"""
super(ActionRequestPdu, self).__init__()
self.originatingID = EntityID();
""" Identifier for originating entity(or simulation)"""
self.receivingID = EntityID();
""" Identifier for the receiving entity(or simulation)"""
self.requestID = 0
""" identifies the request being made by the simulaton manager"""
self.actionID = 0
""" identifies the particular action being requested(see Section 7 of SISO-REF-010)."""
self.numberOfFixedDatumRecords = 0
""" Number of fixed datum records"""
self.numberOfVariableDatumRecords = 0
""" Number of variable datum records"""
self.fixedDatums = []
""" variable length list of fixed datums"""
self.variableDatums = []
""" variable length list of variable length datums"""
self.pduType = 16
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ActionRequestPdu, self ).serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int(self.actionID);
outputStream.write_unsigned_int( len(self.fixedDatums));
outputStream.write_unsigned_int( len(self.variableDatums));
for anObj in self.fixedDatums:
anObj.serialize(outputStream)
for anObj in self.variableDatums:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ActionRequestPdu, self).parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
self.actionID = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatums.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatums.append(element)
class AcknowledgePdu( SimulationManagementFamilyPdu ):
"""Section 7.5.6. Acknowledge the receipt of a start/resume, stop/freeze, or RemoveEntityPDU. COMPLETE"""
def __init__(self):
""" Initializer for AcknowledgePdu"""
super(AcknowledgePdu, self).__init__()
self.originatingID = EntityID();
""" Identifier for originating entity(or simulation)"""
self.receivingID = EntityID();
""" Identifier for the receiving entity(or simulation)"""
self.acknowledgeFlag = 0
""" type of message being acknowledged"""
self.responseFlag = 0
""" Whether or not the receiving entity was able to comply with the request"""
self.requestID = 0
""" Request ID that is unique"""
self.pduType = 15
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( AcknowledgePdu, self ).serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
outputStream.write_unsigned_short(self.acknowledgeFlag);
outputStream.write_unsigned_short(self.responseFlag);
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( AcknowledgePdu, self).parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
self.acknowledgeFlag = inputStream.read_unsigned_short();
self.responseFlag = inputStream.read_unsigned_short();
self.requestID = inputStream.read_unsigned_int();
class DistributedEmissionsFamilyPdu( Pdu ):
"""Section 5.3.7. Electronic Emissions. Abstract superclass for distirubted emissions PDU"""
def __init__(self):
""" Initializer for DistributedEmissionsFamilyPdu"""
super(DistributedEmissionsFamilyPdu, self).__init__()
self.protocolFamily = 6
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DistributedEmissionsFamilyPdu, self ).serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DistributedEmissionsFamilyPdu, self).parse(inputStream)
class SimulationManagementWithReliabilityFamilyPdu( Pdu ):
"""Section 5.3.12: Abstract superclass for reliable simulation management PDUs"""
def __init__(self):
""" Initializer for SimulationManagementWithReliabilityFamilyPdu"""
super(SimulationManagementWithReliabilityFamilyPdu, self).__init__()
self.originatingEntityID = EntityID();
""" Object originatig the request"""
self.receivingEntityID = EntityID();
""" Object with which this point object is associated"""
self.protocolFamily = 10
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( SimulationManagementWithReliabilityFamilyPdu, self ).serialize(outputStream)
self.originatingEntityID.serialize(outputStream)
self.receivingEntityID.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( SimulationManagementWithReliabilityFamilyPdu, self).parse(inputStream)
self.originatingEntityID.parse(inputStream)
self.receivingEntityID.parse(inputStream)
class ActionRequestReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: request from a simulation manager to a managed entity to perform a specified action. COMPLETE"""
def __init__(self):
""" Initializer for ActionRequestReliablePdu"""
super(ActionRequestReliablePdu, self).__init__()
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding"""
self.pad2 = 0
""" padding"""
self.requestID = 0
""" request ID"""
self.actionID = 0
""" request ID"""
self.numberOfFixedDatumRecords = 0
""" Fixed datum record count"""
self.numberOfVariableDatumRecords = 0
""" variable datum record count"""
self.fixedDatumRecords = []
""" Fixed datum records"""
self.variableDatumRecords = []
""" Variable datum records"""
self.pduType = 56
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ActionRequestReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int(self.actionID);
outputStream.write_unsigned_int( len(self.fixedDatumRecords));
outputStream.write_unsigned_int( len(self.variableDatumRecords));
for anObj in self.fixedDatumRecords:
anObj.serialize(outputStream)
for anObj in self.variableDatumRecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ActionRequestReliablePdu, self).parse(inputStream)
self.requiredReliabilityService = inputStream.read_unsigned_byte();
self.pad1 = inputStream.read_unsigned_short();
self.pad2 = inputStream.read_unsigned_byte();
self.requestID = inputStream.read_unsigned_int();
self.actionID = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatumRecords.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatumRecords.append(element)
class DesignatorPdu( DistributedEmissionsFamilyPdu ):
"""Section <IP_ADDRESS>. Handles designating operations. COMPLETE"""
def __init__(self):
""" Initializer for DesignatorPdu"""
super(DesignatorPdu, self).__init__()
self.designatingEntityID = EntityID();
""" ID of the entity designating"""
self.codeName = 0
""" This field shall specify a unique emitter database number assigned to differentiate between otherwise similar or identical emitter beams within an emitter system."""
self.designatedEntityID = EntityID();
""" ID of the entity being designated"""
self.designatorCode = 0
""" This field shall identify the designator code being used by the designating entity """
self.designatorPower = 0
""" This field shall identify the designator output power in watts"""
self.designatorWavelength = 0
""" This field shall identify the designator wavelength in units of microns"""
self.designatorSpotWrtDesignated = Vector3Float();
""" designtor spot wrt the designated entity"""
self.designatorSpotLocation = Vector3Double();
""" designtor spot wrt the designated entity"""
self.deadReckoningAlgorithm = 0
""" Dead reckoning algorithm"""
self.padding1 = 0
""" padding"""
self.padding2 = 0
""" padding"""
self.entityLinearAcceleration = Vector3Float();
""" linear accelleration of entity"""
self.pduType = 24
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DesignatorPdu, self ).serialize(outputStream)
self.designatingEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.codeName);
self.designatedEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.designatorCode);
outputStream.write_float(self.designatorPower);
outputStream.write_float(self.designatorWavelength);
self.designatorSpotWrtDesignated.serialize(outputStream)
self.designatorSpotLocation.serialize(outputStream)
outputStream.write_byte(self.deadReckoningAlgorithm);
outputStream.write_unsigned_short(self.padding1);
outputStream.write_byte(self.padding2);
self.entityLinearAcceleration.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DesignatorPdu, self).parse(inputStream)
self.designatingEntityID.parse(inputStream)
self.codeName = inputStream.read_unsigned_short();
self.designatedEntityID.parse(inputStream)
self.designatorCode = inputStream.read_unsigned_short();
self.designatorPower = inputStream.read_float();
self.designatorWavelength = inputStream.read_float();
self.designatorSpotWrtDesignated.parse(inputStream)
self.designatorSpotLocation.parse(inputStream)
self.deadReckoningAlgorithm = inputStream.read_byte();
self.padding1 = inputStream.read_unsigned_short();
self.padding2 = inputStream.read_byte();
self.entityLinearAcceleration.parse(inputStream)
class StopFreezePdu( SimulationManagementFamilyPdu ):
"""Section 7.5.5. Stop or freeze an enity (or exercise). COMPLETE"""
def __init__(self):
""" Initializer for StopFreezePdu"""
super(StopFreezePdu, self).__init__()
self.originatingID = EntityID();
""" Identifier for originating entity(or simulation)"""
self.receivingID = EntityID();
""" Identifier for the receiving entity(or simulation)"""
self.realWorldTime = ClockTime();
""" real-world(UTC) time at which the entity shall stop or freeze in the exercise"""
self.reason = 0
""" Reason the simulation was stopped or frozen (see section 7 of SISO-REF-010) represented by an 8-bit enumeration"""
self.frozenBehavior = 0
""" Internal behavior of the entity(or simulation) and its appearance while frozen to the other participants"""
self.padding1 = 0
""" padding"""
self.requestID = 0
""" Request ID that is unique"""
self.pduType = 14
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( StopFreezePdu, self ).serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
self.realWorldTime.serialize(outputStream)
outputStream.write_unsigned_byte(self.reason);
outputStream.write_unsigned_byte(self.frozenBehavior);
outputStream.write_short(self.padding1);
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( StopFreezePdu, self).parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
self.realWorldTime.parse(inputStream)
self.reason = inputStream.read_unsigned_byte();
self.frozenBehavior = inputStream.read_unsigned_byte();
self.padding1 = inputStream.read_short();
self.requestID = inputStream.read_unsigned_int();
class EntityStatePdu( EntityInformationFamilyPdu ):
"""Represents the postion and state of one entity in the world. Section 7.2.2. COMPLETE"""
def __init__(self):
""" Initializer for EntityStatePdu"""
super(EntityStatePdu, self).__init__()
self.entityID = EntityID();
""" Unique ID for an entity that is tied to this state information"""
self.forceId = 0
""" What force this entity is affiliated with, eg red, blue, neutral, etc"""
self.numberOfVariableParameters = 0
""" How many variable parameters are in the variable length list. In earlier versions of DIS these were known as articulation parameters"""
self.entityType = EntityType();
""" Describes the type of entity in the world"""
self.alternativeEntityType = EntityType();
self.entityLinearVelocity = Vector3Float();
""" Describes the speed of the entity in the world"""
self.entityLocation = Vector3Double();
""" describes the location of the entity in the world"""
self.entityOrientation = EulerAngles();
""" describes the orientation of the entity, in euler angles"""
self.entityAppearance = 0
""" a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc."""
self.deadReckoningParameters = DeadReckoningParameters();
""" parameters used for dead reckoning"""
self.marking = EntityMarking();
""" characters that can be used for debugging, or to draw unique strings on the side of entities in the world"""
self.capabilities = 0
""" a series of bit flags"""
self.variableParameters = []
""" variable length list of variable parameters. In earlier DIS versions this was articulation parameters."""
self.pduType = 1
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( EntityStatePdu, self ).serialize(outputStream)
self.entityID.serialize(outputStream)
outputStream.write_unsigned_byte(self.forceId);
outputStream.write_unsigned_byte( len(self.variableParameters));
self.entityType.serialize(outputStream)
self.alternativeEntityType.serialize(outputStream)
self.entityLinearVelocity.serialize(outputStream)
self.entityLocation.serialize(outputStream)
self.entityOrientation.serialize(outputStream)
outputStream.write_unsigned_int(self.entityAppearance);
self.deadReckoningParameters.serialize(outputStream)
self.marking.serialize(outputStream)
outputStream.write_unsigned_int(self.capabilities);
for anObj in self.variableParameters:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( EntityStatePdu, self).parse(inputStream)
self.entityID.parse(inputStream)
self.forceId = inputStream.read_unsigned_byte();
self.numberOfVariableParameters = inputStream.read_unsigned_byte();
self.entityType.parse(inputStream)
self.alternativeEntityType.parse(inputStream)
self.entityLinearVelocity.parse(inputStream)
self.entityLocation.parse(inputStream)
self.entityOrientation.parse(inputStream)
self.entityAppearance = inputStream.read_unsigned_int();
self.deadReckoningParameters.parse(inputStream)
self.marking.parse(inputStream)
self.capabilities = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfVariableParameters):
element = VariableParameter()
element.parse(inputStream)
self.variableParameters.append(element)
class EntityManagementFamilyPdu( Pdu ):
""" Managment of grouping of PDUs, and more. Section 7.8"""
def __init__(self):
""" Initializer for EntityManagementFamilyPdu"""
super(EntityManagementFamilyPdu, self).__init__()
self.protocolFamily = 7
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( EntityManagementFamilyPdu, self ).serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( EntityManagementFamilyPdu, self).parse(inputStream)
class StartResumePdu( SimulationManagementFamilyPdu ):
"""Section 7.5.4. Start or resume an exercise. COMPLETE"""
def __init__(self):
""" Initializer for StartResumePdu"""
super(StartResumePdu, self).__init__()
self.originatingID = EntityID();
""" Identifier for originating entity(or simulation)"""
self.receivingID = EntityID();
""" Identifier for the receiving entity(or simulation)"""
self.realWorldTime = ClockTime();
""" 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)."""
self.simulationTime = ClockTime();
""" The reference time within a simulation exercise. This time is established ahead of time by simulation management and is common to all participants in a particular exercise. Simulation time may be either Absolute Time or Relative Time. This field shall be represented by a Clock Time record (see 6.2.16)"""
self.requestID = 0
""" Identifier for the specific and unique start/resume request"""
self.pduType = 13
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( StartResumePdu, self ).serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
self.realWorldTime.serialize(outputStream)
self.simulationTime.serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( StartResumePdu, self).parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
self.realWorldTime.parse(inputStream)
self.simulationTime.parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
class TransmitterPdu( RadioCommunicationsFamilyPdu ):
"""Detailed information about a radio transmitter. This PDU requires manually written code to complete, since the modulation parameters are of variable length. Section 7.7.2 UNFINISHED"""
def __init__(self):
""" Initializer for TransmitterPdu"""
super(TransmitterPdu, self).__init__()
self.radioReferenceID = EntityID();
""" ID of the entitythat is the source of the communication"""
self.radioNumber = 0
""" particular radio within an entity"""
self.radioEntityType = EntityType();
""" Type of radio"""
self.transmitState = 0
""" transmit state"""
self.inputSource = 0
""" input source"""
self.variableTransmitterParameterCount = 0
""" count field"""
self.antennaLocation = Vector3Double();
""" Location of antenna"""
self.relativeAntennaLocation = Vector3Float();
""" relative location of antenna"""
self.antennaPatternType = 0
""" antenna pattern type"""
self.antennaPatternCount = 0
""" atenna pattern length"""
self.frequency = 0
""" frequency"""
self.transmitFrequencyBandwidth = 0
""" transmit frequency Bandwidth"""
self.power = 0
""" transmission power"""
self.modulationType = ModulationType();
""" modulation"""
self.cryptoSystem = 0
""" crypto system enumeration"""
self.cryptoKeyId = 0
""" crypto system key identifer"""
self.modulationParameterCount = 0
""" how many modulation parameters we have"""
self.padding2 = 0
""" padding2"""
self.padding3 = 0
""" padding3"""
self.modulationParametersList = []
""" variable length list of modulation parameters"""
self.antennaPatternList = []
""" variable length list of antenna pattern records"""
self.pduType = 25
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( TransmitterPdu, self ).serialize(outputStream)
self.radioReferenceID.serialize(outputStream)
outputStream.write_unsigned_short(self.radioNumber);
self.radioEntityType.serialize(outputStream)
outputStream.write_unsigned_byte(self.transmitState);
outputStream.write_unsigned_byte(self.inputSource);
outputStream.write_unsigned_short(self.variableTransmitterParameterCount);
self.antennaLocation.serialize(outputStream)
self.relativeAntennaLocation.serialize(outputStream)
outputStream.write_unsigned_short(self.antennaPatternType);
outputStream.write_unsigned_short( len(self.antennaPatternList));
outputStream.write_long(self.frequency);
outputStream.write_float(self.transmitFrequencyBandwidth);
outputStream.write_float(self.power);
self.modulationType.serialize(outputStream)
outputStream.write_unsigned_short(self.cryptoSystem);
outputStream.write_unsigned_short(self.cryptoKeyId);
outputStream.write_unsigned_byte( len(self.modulationParametersList));
outputStream.write_unsigned_short(self.padding2);
outputStream.write_unsigned_byte(self.padding3);
for anObj in self.modulationParametersList:
anObj.serialize(outputStream)
for anObj in self.antennaPatternList:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( TransmitterPdu, self).parse(inputStream)
self.radioReferenceID.parse(inputStream)
self.radioNumber = inputStream.read_unsigned_short();
self.radioEntityType.parse(inputStream)
self.transmitState = inputStream.read_unsigned_byte();
self.inputSource = inputStream.read_unsigned_byte();
self.variableTransmitterParameterCount = inputStream.read_unsigned_short();
self.antennaLocation.parse(inputStream)
self.relativeAntennaLocation.parse(inputStream)
self.antennaPatternType = inputStream.read_unsigned_short();
self.antennaPatternCount = inputStream.read_unsigned_short();
self.frequency = inputStream.read_long();
self.transmitFrequencyBandwidth = inputStream.read_float();
self.power = inputStream.read_float();
self.modulationType.parse(inputStream)
self.cryptoSystem = inputStream.read_unsigned_short();
self.cryptoKeyId = inputStream.read_unsigned_short();
self.modulationParameterCount = inputStream.read_unsigned_byte();
self.padding2 = inputStream.read_unsigned_short();
self.padding3 = inputStream.read_unsigned_byte();
for idx in range(0, self.modulationParameterCount):
element = null()
element.parse(inputStream)
self.modulationParametersList.append(element)
for idx in range(0, self.antennaPatternCount):
element = null()
element.parse(inputStream)
self.antennaPatternList.append(element)
class ElectronicEmissionsPdu( DistributedEmissionsFamilyPdu ):
"""Section <IP_ADDRESS>. Information about active electronic warfare (EW) emissions and active EW countermeasures shall be communicated using an Electromagnetic Emission PDU. NOT COMPLETE"""
def __init__(self):
""" Initializer for ElectronicEmissionsPdu"""
super(ElectronicEmissionsPdu, self).__init__()
self.emittingEntityID = EntityID();
""" ID of the entity emitting"""
self.eventID = EventIdentifier();
""" ID of event"""
self.stateUpdateIndicator = 0
""" This field shall be used to indicate if the data in the PDU represents a state update or just data that has changed since issuance of the last Electromagnetic Emission PDU [relative to the identified entity and emission system(s)]."""
self.numberOfSystems = 0
""" This field shall specify the number of emission systems being described in the current PDU."""
self.paddingForEmissionsPdu = 0
""" padding"""
self.systemDataLength = 0
""" this field shall specify the length of this emitter system's data in 32-bit words."""
self.numberOfBeams = 0
""" the number of beams being described in the current PDU for the emitter system being described. """
self.emitterSystem = EmitterSystem();
""" information about a particular emitter system and shall be represented by an Emitter System record (see 6.2.23)."""
self.location = Vector3Float();
""" the location of the antenna beam source with respect to the emitting entity's coordinate system. This location shall be the origin of the emitter coordinate system that shall have the same orientation as the entity coordinate system. This field shall be represented by an Entity Coordinate Vector record see 6.2.95 """
self.systems = []
""" Electronic emmissions systems THIS IS WRONG. It has the WRONG class type and will cause problems in any marshalling."""
self.pduType = 23
""" initialize value """
self.paddingForEmissionsPdu = 0
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ElectronicEmissionsPdu, self ).serialize(outputStream)
self.emittingEntityID.serialize(outputStream)
self.eventID.serialize(outputStream)
outputStream.write_unsigned_byte(self.stateUpdateIndicator);
outputStream.write_unsigned_byte( len(self.systems));
outputStream.write_unsigned_short(self.paddingForEmissionsPdu);
outputStream.write_unsigned_byte(self.systemDataLength);
outputStream.write_unsigned_byte(self.numberOfBeams);
self.emitterSystem.serialize(outputStream)
self.location.serialize(outputStream)
for anObj in self.systems:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ElectronicEmissionsPdu, self).parse(inputStream)
self.emittingEntityID.parse(inputStream)
self.eventID.parse(inputStream)
self.stateUpdateIndicator = inputStream.read_unsigned_byte();
self.numberOfSystems = inputStream.read_unsigned_byte();
self.paddingForEmissionsPdu = inputStream.read_unsigned_short();
self.systemDataLength = inputStream.read_unsigned_byte();
self.numberOfBeams = inputStream.read_unsigned_byte();
self.emitterSystem.parse(inputStream)
self.location.parse(inputStream)
for idx in range(0, self.numberOfSystems):
element = null()
element.parse(inputStream)
self.systems.append(element)
class ResupplyOfferPdu( LogisticsFamilyPdu ):
"""Information used to communicate the offer of supplies by a supplying entity to a receiving entity. Section 7.4.3 COMPLETE"""
def __init__(self):
""" Initializer for ResupplyOfferPdu"""
super(ResupplyOfferPdu, self).__init__()
self.receivingEntityID = EntityID();
""" Field identifies the Entity and respective Entity Record ID that is receiving service (see 6.2.28), Section 7.4.3"""
self.supplyingEntityID = EntityID();
""" Identifies the Entity and respective Entity ID Record that is supplying (see 6.2.28), Section 7.4.3"""
self.numberOfSupplyTypes = 0
""" How many supplies types are being offered, Section 7.4.3"""
self.padding1 = 0
""" padding"""
self.padding2 = 0
""" padding"""
self.supplies = []
""" A Reord that Specifies the type of supply and the amount of that supply for each of the supply types in numberOfSupplyTypes (see 6.2.85), Section 7.4.3"""
self.pduType = 6
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ResupplyOfferPdu, self ).serialize(outputStream)
self.receivingEntityID.serialize(outputStream)
self.supplyingEntityID.serialize(outputStream)
outputStream.write_unsigned_byte( len(self.supplies));
outputStream.write_byte(self.padding1);
outputStream.write_short(self.padding2);
for anObj in self.supplies:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ResupplyOfferPdu, self).parse(inputStream)
self.receivingEntityID.parse(inputStream)
self.supplyingEntityID.parse(inputStream)
self.numberOfSupplyTypes = inputStream.read_unsigned_byte();
self.padding1 = inputStream.read_byte();
self.padding2 = inputStream.read_short();
for idx in range(0, self.numberOfSupplyTypes):
element = null()
element.parse(inputStream)
self.supplies.append(element)
class AttributePdu( EntityInformationFamilyPdu ):
"""Information about individual attributes for a particular entity, other object, or event may be communicated using an Attribute PDU. The Attribute PDU shall not be used to exchange data available in any other PDU except where explicitly mentioned in the PDU issuance instructions within this standard. See 5.3.6 for the information requirements and issuance and receipt rules for this PDU. Section 7.2.6. INCOMPLETE"""
def __init__(self):
""" Initializer for AttributePdu"""
super(AttributePdu, self).__init__()
self.originatingSimulationAddress = SimulationAddress();
""" This field shall identify the simulation issuing the Attribute PDU. It shall be represented by a Simulation Address record (see 6.2.79)."""
self.padding1 = 0
""" Padding"""
self.padding2 = 0
""" Padding"""
self.attributeRecordPduType = 0
""" This field shall represent the type of the PDU that is being extended or updated, if applicable. It shall be represented by an 8-bit enumeration."""
self.attributeRecordProtocolVersion = 0
""" This field shall indicate the Protocol Version associated with the Attribute Record PDU Type. It shall be represented by an 8-bit enumeration."""
self.masterAttributeRecordType = 0
""" This field shall contain the Attribute record type of the Attribute records in the PDU if they all have the same Attribute record type. It shall be represented by a 32-bit enumeration."""
self.actionCode = 0
""" This field shall identify the action code applicable to this Attribute PDU. The Action Code shall apply to all Attribute records contained in the PDU. It shall be represented by an 8-bit enumeration."""
self.padding3 = 0
""" Padding"""
self.numberAttributeRecordSet = 0
""" This field shall specify the number of Attribute Record Sets that make up the remainder of the PDU. It shall be represented by a 16-bit unsigned integer."""
def serialize(self, outputStream):
"""serialize the class """
super( AttributePdu, self ).serialize(outputStream)
self.originatingSimulationAddress.serialize(outputStream)
outputStream.write_int(self.padding1);
outputStream.write_short(self.padding2);
outputStream.write_unsigned_byte(self.attributeRecordPduType);
outputStream.write_unsigned_byte(self.attributeRecordProtocolVersion);
outputStream.write_unsigned_int(self.masterAttributeRecordType);
outputStream.write_unsigned_byte(self.actionCode);
outputStream.write_byte(self.padding3);
outputStream.write_unsigned_short(self.numberAttributeRecordSet);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( AttributePdu, self).parse(inputStream)
self.originatingSimulationAddress.parse(inputStream)
self.padding1 = inputStream.read_int();
self.padding2 = inputStream.read_short();
self.attributeRecordPduType = inputStream.read_unsigned_byte();
self.attributeRecordProtocolVersion = inputStream.read_unsigned_byte();
self.masterAttributeRecordType = inputStream.read_unsigned_int();
self.actionCode = inputStream.read_unsigned_byte();
self.padding3 = inputStream.read_byte();
self.numberAttributeRecordSet = inputStream.read_unsigned_short();
class MinefieldFamilyPdu( Pdu ):
""" Abstract superclass for PDUs relating to minefields. Section 7.9"""
def __init__(self):
""" Initializer for MinefieldFamilyPdu"""
super(MinefieldFamilyPdu, self).__init__()
self.protocolFamily = 8
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( MinefieldFamilyPdu, self ).serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( MinefieldFamilyPdu, self).parse(inputStream)
class SetDataReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: initializing or chaning internal state information, reliable. Needs manual intervention to fix padding on variable datums. UNFINISHED"""
def __init__(self):
""" Initializer for SetDataReliablePdu"""
super(SetDataReliablePdu, self).__init__()
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding"""
self.pad2 = 0
""" padding"""
self.requestID = 0
""" Request ID"""
self.numberOfFixedDatumRecords = 0
""" Fixed datum record count"""
self.numberOfVariableDatumRecords = 0
""" variable datum record count"""
self.fixedDatumRecords = []
""" Fixed datum records"""
self.variableDatumRecords = []
""" Variable datum records"""
self.pduType = 59
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( SetDataReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int( len(self.fixedDatumRecords));
outputStream.write_unsigned_int( len(self.variableDatumRecords));
for anObj in self.fixedDatumRecords:
anObj.serialize(outputStream)
for anObj in self.variableDatumRecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( SetDataReliablePdu, self).parse(inputStream)
self.requiredReliabilityService = inputStream.read_unsigned_byte();
self.pad1 = inputStream.read_unsigned_short();
self.pad2 = inputStream.read_unsigned_byte();
self.requestID = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatumRecords.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatumRecords.append(element)
class EventReportPdu( SimulationManagementFamilyPdu ):
""" Reports occurance of a significant event to the simulation manager. Section 7.5.12. COMPLETE"""
def __init__(self):
""" Initializer for EventReportPdu"""
super(EventReportPdu, self).__init__()
self.eventType = 0
""" Type of event"""
self.padding1 = 0
""" padding"""
self.numberOfFixedDatumRecords = 0
""" Number of fixed datum records"""
self.numberOfVariableDatumRecords = 0
""" Number of variable datum records"""
self.fixedDatums = []
""" variable length list of fixed datums"""
self.variableDatums = []
""" variable length list of variable length datums"""
self.pduType = 21
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( EventReportPdu, self ).serialize(outputStream)
outputStream.write_unsigned_int(self.eventType);
outputStream.write_unsigned_int(self.padding1);
outputStream.write_unsigned_int( len(self.fixedDatums));
outputStream.write_unsigned_int( len(self.variableDatums));
for anObj in self.fixedDatums:
anObj.serialize(outputStream)
for anObj in self.variableDatums:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( EventReportPdu, self).parse(inputStream)
self.eventType = inputStream.read_unsigned_int();
self.padding1 = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatums.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatums.append(element)
class PointObjectStatePdu( SyntheticEnvironmentFamilyPdu ):
""": Inormation abut the addition or modification of a synthecic enviroment object that is anchored to the terrain with a single point. Section 7.10.4 COMPLETE"""
def __init__(self):
""" Initializer for PointObjectStatePdu"""
super(PointObjectStatePdu, self).__init__()
self.objectID = EntityID();
""" Object in synthetic environment"""
self.referencedObjectID = EntityID();
""" Object with which this point object is associated"""
self.updateNumber = 0
""" unique update number of each state transition of an object"""
self.forceID = 0
""" force ID"""
self.modifications = 0
""" modifications"""
self.objectType = ObjectType();
""" Object type"""
self.objectLocation = Vector3Double();
""" Object location"""
self.objectOrientation = EulerAngles();
""" Object orientation"""
self.objectAppearance = 0
""" Object apperance"""
self.requesterID = SimulationAddress();
""" requesterID"""
self.receivingID = SimulationAddress();
""" receiver ID"""
self.pad2 = 0
""" padding"""
self.pduType = 43
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( PointObjectStatePdu, self ).serialize(outputStream)
self.objectID.serialize(outputStream)
self.referencedObjectID.serialize(outputStream)
outputStream.write_unsigned_short(self.updateNumber);
outputStream.write_unsigned_byte(self.forceID);
outputStream.write_unsigned_byte(self.modifications);
self.objectType.serialize(outputStream)
self.objectLocation.serialize(outputStream)
self.objectOrientation.serialize(outputStream)
outputStream.write_double(self.objectAppearance);
self.requesterID.serialize(outputStream)
self.receivingID.serialize(outputStream)
outputStream.write_unsigned_int(self.pad2);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( PointObjectStatePdu, self).parse(inputStream)
self.objectID.parse(inputStream)
self.referencedObjectID.parse(inputStream)
self.updateNumber = inputStream.read_unsigned_short();
self.forceID = inputStream.read_unsigned_byte();
self.modifications = inputStream.read_unsigned_byte();
self.objectType.parse(inputStream)
self.objectLocation.parse(inputStream)
self.objectOrientation.parse(inputStream)
self.objectAppearance = inputStream.read_double();
self.requesterID.parse(inputStream)
self.receivingID.parse(inputStream)
self.pad2 = inputStream.read_unsigned_int();
class DataPdu( SimulationManagementFamilyPdu ):
""" Information issued in response to a data query pdu or a set data pdu is communicated using a data pdu. Section 7.5.11 COMPLETE"""
def __init__(self):
""" Initializer for DataPdu"""
super(DataPdu, self).__init__()
self.requestID = 0
""" ID of request"""
self.padding1 = 0
""" padding"""
self.numberOfFixedDatumRecords = 0
""" Number of fixed datum records"""
self.numberOfVariableDatumRecords = 0
""" Number of variable datum records"""
self.fixedDatums = []
""" variable length list of fixed datums"""
self.variableDatums = []
""" variable length list of variable length datums"""
self.pduType = 20
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DataPdu, self ).serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int(self.padding1);
outputStream.write_unsigned_int( len(self.fixedDatums));
outputStream.write_unsigned_int( len(self.variableDatums));
for anObj in self.fixedDatums:
anObj.serialize(outputStream)
for anObj in self.variableDatums:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DataPdu, self).parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
self.padding1 = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatums.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatums.append(element)
class FastEntityStatePdu( EntityInformationFamilyPdu ):
"""Represents the postion and state of one entity in the world. This is identical in function to entity state pdu, but generates less garbage to collect in the Java world. Section 7.2.2. COMPLETE"""
def __init__(self):
""" Initializer for FastEntityStatePdu"""
super(FastEntityStatePdu, self).__init__()
self.site = 0
""" The site ID"""
self.application = 0
""" The application ID"""
self.entity = 0
""" the entity ID"""
self.forceId = 0
""" what force this entity is affiliated with, eg red, blue, neutral, etc"""
self.numberOfVariableParameters = 0
""" How many variable (nee articulation) parameters are in the variable length list"""
self.entityKind = 0
""" Kind of entity"""
self.domain = 0
""" Domain of entity (air, surface, subsurface, space, etc)"""
self.country = 0
""" country to which the design of the entity is attributed"""
self.category = 0
""" category of entity"""
self.subcategory = 0
""" subcategory of entity"""
self.specific = 0
""" specific info based on subcategory field"""
self.extra = 0
self.altEntityKind = 0
""" Kind of entity"""
self.altDomain = 0
""" Domain of entity (air, surface, subsurface, space, etc)"""
self.altCountry = 0
""" country to which the design of the entity is attributed"""
self.altCategory = 0
""" category of entity"""
self.altSubcategory = 0
""" subcategory of entity"""
self.altSpecific = 0
""" specific info based on subcategory field"""
self.altExtra = 0
self.xVelocity = 0
""" X velo"""
self.yVelocity = 0
""" y Value"""
self.zVelocity = 0
""" Z value"""
self.xLocation = 0
""" X value"""
self.yLocation = 0
""" y Value"""
self.zLocation = 0
""" Z value"""
self.psi = 0
self.theta = 0
self.phi = 0
self.entityAppearance = 0
""" a series of bit flags that are used to help draw the entity, such as smoking, on fire, etc."""
self.deadReckoningAlgorithm = 0
""" enumeration of what dead reckoning algorighm to use"""
self.otherParameters = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
""" other parameters to use in the dead reckoning algorithm"""
self.xAcceleration = 0
""" X value"""
self.yAcceleration = 0
""" y Value"""
self.zAcceleration = 0
""" Z value"""
self.xAngularVelocity = 0
""" X value"""
self.yAngularVelocity = 0
""" y Value"""
self.zAngularVelocity = 0
""" Z value"""
self.marking = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
""" characters that can be used for debugging, or to draw unique strings on the side of entities in the world"""
self.capabilities = 0
""" a series of bit flags"""
self.variableParameters = []
""" variable length list of variable parameters. In earlier versions of DIS these were known as articulation parameters"""
self.pduType = 1
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( FastEntityStatePdu, self ).serialize(outputStream)
outputStream.write_unsigned_short(self.site);
outputStream.write_unsigned_short(self.application);
outputStream.write_unsigned_short(self.entity);
outputStream.write_unsigned_byte(self.forceId);
outputStream.write_byte( len(self.variableParameters));
outputStream.write_unsigned_byte(self.entityKind);
outputStream.write_unsigned_byte(self.domain);
outputStream.write_unsigned_short(self.country);
outputStream.write_unsigned_byte(self.category);
outputStream.write_unsigned_byte(self.subcategory);
outputStream.write_unsigned_byte(self.specific);
outputStream.write_unsigned_byte(self.extra);
outputStream.write_unsigned_byte(self.altEntityKind);
outputStream.write_unsigned_byte(self.altDomain);
outputStream.write_unsigned_short(self.altCountry);
outputStream.write_unsigned_byte(self.altCategory);
outputStream.write_unsigned_byte(self.altSubcategory);
outputStream.write_unsigned_byte(self.altSpecific);
outputStream.write_unsigned_byte(self.altExtra);
outputStream.write_float(self.xVelocity);
outputStream.write_float(self.yVelocity);
outputStream.write_float(self.zVelocity);
outputStream.write_double(self.xLocation);
outputStream.write_double(self.yLocation);
outputStream.write_double(self.zLocation);
outputStream.write_float(self.psi);
outputStream.write_float(self.theta);
outputStream.write_float(self.phi);
outputStream.write_int(self.entityAppearance);
outputStream.write_unsigned_byte(self.deadReckoningAlgorithm);
for idx in range(0, 15):
outputStream.write_byte( self.otherParameters[ idx ] );
outputStream.write_float(self.xAcceleration);
outputStream.write_float(self.yAcceleration);
outputStream.write_float(self.zAcceleration);
outputStream.write_float(self.xAngularVelocity);
outputStream.write_float(self.yAngularVelocity);
outputStream.write_float(self.zAngularVelocity);
for idx in range(0, 12):
outputStream.write_byte( self.marking[ idx ] );
outputStream.write_int(self.capabilities);
for anObj in self.variableParameters:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( FastEntityStatePdu, self).parse(inputStream)
self.site = inputStream.read_unsigned_short();
self.application = inputStream.read_unsigned_short();
self.entity = inputStream.read_unsigned_short();
self.forceId = inputStream.read_unsigned_byte();
self.numberOfVariableParameters = inputStream.read_byte();
self.entityKind = inputStream.read_unsigned_byte();
self.domain = inputStream.read_unsigned_byte();
self.country = inputStream.read_unsigned_short();
self.category = inputStream.read_unsigned_byte();
self.subcategory = inputStream.read_unsigned_byte();
self.specific = inputStream.read_unsigned_byte();
self.extra = inputStream.read_unsigned_byte();
self.altEntityKind = inputStream.read_unsigned_byte();
self.altDomain = inputStream.read_unsigned_byte();
self.altCountry = inputStream.read_unsigned_short();
self.altCategory = inputStream.read_unsigned_byte();
self.altSubcategory = inputStream.read_unsigned_byte();
self.altSpecific = inputStream.read_unsigned_byte();
self.altExtra = inputStream.read_unsigned_byte();
self.xVelocity = inputStream.read_float();
self.yVelocity = inputStream.read_float();
self.zVelocity = inputStream.read_float();
self.xLocation = inputStream.read_double();
self.yLocation = inputStream.read_double();
self.zLocation = inputStream.read_double();
self.psi = inputStream.read_float();
self.theta = inputStream.read_float();
self.phi = inputStream.read_float();
self.entityAppearance = inputStream.read_int();
self.deadReckoningAlgorithm = inputStream.read_unsigned_byte();
self.otherParameters = [0]*15
for idx in range(0, 15):
val = inputStream.read_byte()
self.otherParameters[ idx ] = val
self.xAcceleration = inputStream.read_float();
self.yAcceleration = inputStream.read_float();
self.zAcceleration = inputStream.read_float();
self.xAngularVelocity = inputStream.read_float();
self.yAngularVelocity = inputStream.read_float();
self.zAngularVelocity = inputStream.read_float();
self.marking = [0]*12
for idx in range(0, 12):
val = inputStream.read_byte()
self.marking[ idx ] = val
self.capabilities = inputStream.read_int();
for idx in range(0, self.numberOfVariableParameters):
element = VariableParameter()
element.parse(inputStream)
self.variableParameters.append(element)
class AcknowledgeReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: Ack receipt of a start-resume, stop-freeze, create-entity or remove enitty (reliable) pdus. COMPLETE"""
def __init__(self):
""" Initializer for AcknowledgeReliablePdu"""
super(AcknowledgeReliablePdu, self).__init__()
self.acknowledgeFlag = 0
""" ack flags"""
self.responseFlag = 0
""" response flags"""
self.requestID = 0
""" Request ID"""
self.pduType = 55
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( AcknowledgeReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_short(self.acknowledgeFlag);
outputStream.write_unsigned_short(self.responseFlag);
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( AcknowledgeReliablePdu, self).parse(inputStream)
self.acknowledgeFlag = inputStream.read_unsigned_short();
self.responseFlag = inputStream.read_unsigned_short();
self.requestID = inputStream.read_unsigned_int();
class StartResumeReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: Start resume simulation, relaible. COMPLETE"""
def __init__(self):
""" Initializer for StartResumeReliablePdu"""
super(StartResumeReliablePdu, self).__init__()
self.realWorldTime = ClockTime();
""" time in real world for this operation to happen"""
self.simulationTime = ClockTime();
""" time in simulation for the simulation to resume"""
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding"""
self.pad2 = 0
""" padding"""
self.requestID = 0
""" Request ID"""
self.pduType = 53
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( StartResumeReliablePdu, self ).serialize(outputStream)
self.realWorldTime.serialize(outputStream)
self.simulationTime.serialize(outputStream)
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( StartResumeReliablePdu, self).parse(inputStream)
self.realWorldTime.parse(inputStream)
self.simulationTime.parse(inputStream)
self.requiredReliabilityService = inputStream.read_unsigned_byte();
self.pad1 = inputStream.read_unsigned_short();
self.pad2 = inputStream.read_unsigned_byte();
self.requestID = inputStream.read_unsigned_int();
class ArealObjectStatePdu( SyntheticEnvironmentFamilyPdu ):
"""Information about the addition/modification of an oobject that is geometrically anchored to the terrain with a set of three or more points that come to a closure. Section 7.10.6 COMPLETE"""
def __init__(self):
""" Initializer for ArealObjectStatePdu"""
super(ArealObjectStatePdu, self).__init__()
self.objectID = EntityID();
""" Object in synthetic environment"""
self.referencedObjectID = EntityID();
""" Object with which this point object is associated"""
self.updateNumber = 0
""" unique update number of each state transition of an object"""
self.forceID = 0
""" force ID"""
self.modifications = 0
""" modifications enumeration"""
self.objectType = EntityType();
""" Object type"""
self.specificObjectAppearance = 0
""" Object appearance"""
self.generalObjectAppearance = 0
""" Object appearance"""
self.numberOfPoints = 0
""" Number of points"""
self.requesterID = SimulationAddress();
""" requesterID"""
self.receivingID = SimulationAddress();
""" receiver ID"""
self.objectLocation = []
""" location of object"""
self.pduType = 45
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ArealObjectStatePdu, self ).serialize(outputStream)
self.objectID.serialize(outputStream)
self.referencedObjectID.serialize(outputStream)
outputStream.write_unsigned_short(self.updateNumber);
outputStream.write_unsigned_byte(self.forceID);
outputStream.write_unsigned_byte(self.modifications);
self.objectType.serialize(outputStream)
outputStream.write_unsigned_int(self.specificObjectAppearance);
outputStream.write_unsigned_short(self.generalObjectAppearance);
outputStream.write_unsigned_short( len(self.objectLocation));
self.requesterID.serialize(outputStream)
self.receivingID.serialize(outputStream)
for anObj in self.objectLocation:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ArealObjectStatePdu, self).parse(inputStream)
self.objectID.parse(inputStream)
self.referencedObjectID.parse(inputStream)
self.updateNumber = inputStream.read_unsigned_short();
self.forceID = inputStream.read_unsigned_byte();
self.modifications = inputStream.read_unsigned_byte();
self.objectType.parse(inputStream)
self.specificObjectAppearance = inputStream.read_unsigned_int();
self.generalObjectAppearance = inputStream.read_unsigned_short();
self.numberOfPoints = inputStream.read_unsigned_short();
self.requesterID.parse(inputStream)
self.receivingID.parse(inputStream)
for idx in range(0, self.numberOfPoints):
element = null()
element.parse(inputStream)
self.objectLocation.append(element)
class DataQueryReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: request for data from an entity. COMPLETE"""
def __init__(self):
""" Initializer for DataQueryReliablePdu"""
super(DataQueryReliablePdu, self).__init__()
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding"""
self.pad2 = 0
""" padding"""
self.requestID = 0
""" request ID"""
self.timeInterval = 0
""" time interval between issuing data query PDUs"""
self.numberOfFixedDatumRecords = 0
""" Fixed datum record count"""
self.numberOfVariableDatumRecords = 0
""" variable datum record count"""
self.fixedDatumRecords = []
""" Fixed datum records"""
self.variableDatumRecords = []
""" Variable datum records"""
self.pduType = 58
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DataQueryReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int(self.timeInterval);
outputStream.write_unsigned_int( len(self.fixedDatumRecords));
outputStream.write_unsigned_int( len(self.variableDatumRecords));
for anObj in self.fixedDatumRecords:
anObj.serialize(outputStream)
for anObj in self.variableDatumRecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DataQueryReliablePdu, self).parse(inputStream)
self.requiredReliabilityService = inputStream.read_unsigned_byte();
self.pad1 = inputStream.read_unsigned_short();
self.pad2 = inputStream.read_unsigned_byte();
self.requestID = inputStream.read_unsigned_int();
self.timeInterval = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatumRecords.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatumRecords.append(element)
class MinefieldStatePdu( MinefieldFamilyPdu ):
"""information about the complete minefield. The minefield presence, perimiter, etc. Section 7.9.2 COMPLETE"""
def __init__(self):
""" Initializer for MinefieldStatePdu"""
super(MinefieldStatePdu, self).__init__()
self.minefieldID = MinefieldIdentifier();
""" Minefield ID"""
self.minefieldSequence = 0
""" Minefield sequence"""
self.forceID = 0
""" force ID"""
self.numberOfPerimeterPoints = 0
""" Number of permieter points"""
self.minefieldType = EntityType();
""" type of minefield"""
self.numberOfMineTypes = 0
""" how many mine types"""
self.minefieldLocation = Vector3Double();
""" location of center of minefield in world coords"""
self.minefieldOrientation = EulerAngles();
""" orientation of minefield"""
self.appearance = 0
""" appearance bitflags"""
self.protocolMode = 0
""" protocolMode. First two bits are the protocol mode, 14 bits reserved."""
self.perimeterPoints = []
""" perimeter points for the minefield"""
self.mineType = []
""" Type of mines"""
self.pduType = 37
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( MinefieldStatePdu, self ).serialize(outputStream)
self.minefieldID.serialize(outputStream)
outputStream.write_unsigned_short(self.minefieldSequence);
outputStream.write_unsigned_byte(self.forceID);
outputStream.write_unsigned_byte( len(self.perimeterPoints));
self.minefieldType.serialize(outputStream)
outputStream.write_unsigned_short( len(self.mineType));
self.minefieldLocation.serialize(outputStream)
self.minefieldOrientation.serialize(outputStream)
outputStream.write_unsigned_short(self.appearance);
outputStream.write_unsigned_short(self.protocolMode);
for anObj in self.perimeterPoints:
anObj.serialize(outputStream)
for anObj in self.mineType:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( MinefieldStatePdu, self).parse(inputStream)
self.minefieldID.parse(inputStream)
self.minefieldSequence = inputStream.read_unsigned_short();
self.forceID = inputStream.read_unsigned_byte();
self.numberOfPerimeterPoints = inputStream.read_unsigned_byte();
self.minefieldType.parse(inputStream)
self.numberOfMineTypes = inputStream.read_unsigned_short();
self.minefieldLocation.parse(inputStream)
self.minefieldOrientation.parse(inputStream)
self.appearance = inputStream.read_unsigned_short();
self.protocolMode = inputStream.read_unsigned_short();
for idx in range(0, self.numberOfPerimeterPoints):
element = null()
element.parse(inputStream)
self.perimeterPoints.append(element)
for idx in range(0, self.numberOfMineTypes):
element = null()
element.parse(inputStream)
self.mineType.append(element)
class DataReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: issued in response to a data query R or set dataR pdu. Needs manual intervention to fix padding on variable datums. UNFINSIHED"""
def __init__(self):
""" Initializer for DataReliablePdu"""
super(DataReliablePdu, self).__init__()
self.requestID = 0
""" Request ID"""
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding"""
self.pad2 = 0
""" padding"""
self.numberOfFixedDatumRecords = 0
""" Fixed datum record count"""
self.numberOfVariableDatumRecords = 0
""" variable datum record count"""
self.fixedDatumRecords = []
""" Fixed datum records"""
self.variableDatumRecords = []
""" Variable datum records"""
self.pduType = 60
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DataReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);
outputStream.write_unsigned_int( len(self.fixedDatumRecords));
outputStream.write_unsigned_int( len(self.variableDatumRecords));
for anObj in self.fixedDatumRecords:
anObj.serialize(outputStream)
for anObj in self.variableDatumRecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DataReliablePdu, self).parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
self.requiredReliabilityService = inputStream.read_unsigned_byte();
self.pad1 = inputStream.read_unsigned_short();
self.pad2 = inputStream.read_unsigned_byte();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatumRecords.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatumRecords.append(element)
class CommentPdu( SimulationManagementFamilyPdu ):
""" Arbitrary messages can be entered into the data stream via use of this PDU. Section 7.5.13 COMPLETE"""
def __init__(self):
""" Initializer for CommentPdu"""
super(CommentPdu, self).__init__()
self.numberOfFixedDatumRecords = 0
""" Number of fixed datum records"""
self.numberOfVariableDatumRecords = 0
""" Number of variable datum records"""
self.fixedDatums = []
""" variable length list of fixed datums"""
self.variableDatums = []
""" variable length list of variable length datums"""
self.pduType = 22
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( CommentPdu, self ).serialize(outputStream)
outputStream.write_unsigned_int( len(self.fixedDatums));
outputStream.write_unsigned_int( len(self.variableDatums));
for anObj in self.fixedDatums:
anObj.serialize(outputStream)
for anObj in self.variableDatums:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( CommentPdu, self).parse(inputStream)
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatums.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatums.append(element)
class CommentReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: Arbitrary messages. Only reliable this time. Neds manual intervention to fix padding in variable datums. UNFINISHED"""
def __init__(self):
""" Initializer for CommentReliablePdu"""
super(CommentReliablePdu, self).__init__()
self.numberOfFixedDatumRecords = 0
""" Fixed datum record count"""
self.numberOfVariableDatumRecords = 0
""" variable datum record count"""
self.fixedDatumRecords = []
""" Fixed datum records"""
self.variableDatumRecords = []
""" Variable datum records"""
self.pduType = 62
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( CommentReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_int( len(self.fixedDatumRecords));
outputStream.write_unsigned_int( len(self.variableDatumRecords));
for anObj in self.fixedDatumRecords:
anObj.serialize(outputStream)
for anObj in self.variableDatumRecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( CommentReliablePdu, self).parse(inputStream)
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatumRecords.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatumRecords.append(element)
class DirectedEnergyFirePdu( WarfareFamilyPdu ):
"""Firing of a directed energy weapon shall be communicated by issuing a Directed Energy Fire PDU Section 7.3.4 COMPLETE"""
def __init__(self):
""" Initializer for DirectedEnergyFirePdu"""
super(DirectedEnergyFirePdu, self).__init__()
self.munitionType = EntityType();
""" Field shall identify the munition type enumeration for the DE weapon beam, Section 7.3.4 """
self.shotStartTime = ClockTime();
""" Field shall indicate the simulation time at start of the shot, Section 7.3.4 """
self.commulativeShotTime = 0
""" Field shall indicate the current cumulative duration of the shot, Section 7.3.4 """
self.ApertureEmitterLocation = Vector3Float();
""" Field shall identify the location of the DE weapon aperture/emitter, Section 7.3.4 """
self.apertureDiameter = 0
""" Field shall identify the beam diameter at the aperture/emitter, Section 7.3.4 """
self.wavelength = 0
""" Field shall identify the emissions wavelength in units of meters, Section 7.3.4 """
self.peakIrradiance = 0
""" Field shall identify the current peak irradiance of emissions in units of Watts per square meter, Section 7.3.4 """
self.pulseRepetitionFrequency = 0
""" field shall identify the current pulse repetition frequency in units of cycles per second (Hertz), Section 7.3.4 """
self.pulseWidth = 0
""" field shall identify the pulse width emissions in units of seconds, Section 7.3.4"""
self.flags = 0
""" 16bit Boolean field shall contain various flags to indicate status information needed to process a DE, Section 7.3.4 """
self.pulseShape = 0
""" Field shall identify the pulse shape and shall be represented as an 8-bit enumeration, Section 7.3.4 """
self.padding1 = 0
""" padding, Section 7.3.4 """
self.padding2 = 0
""" padding, Section 7.3.4 """
self.padding3 = 0
""" padding, Section 7.3.4 """
self.numberOfDERecords = 0
""" Field shall specify the number of DE records, Section 7.3.4 """
self.dERecords = []
""" Fields shall contain one or more DE records, records shall conform to the variable record format (Section6.2.82), Section 7.3.4"""
self.pduType = 68
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DirectedEnergyFirePdu, self ).serialize(outputStream)
self.munitionType.serialize(outputStream)
self.shotStartTime.serialize(outputStream)
outputStream.write_float(self.commulativeShotTime);
self.ApertureEmitterLocation.serialize(outputStream)
outputStream.write_float(self.apertureDiameter);
outputStream.write_float(self.wavelength);
outputStream.write_float(self.peakIrradiance);
outputStream.write_float(self.pulseRepetitionFrequency);
outputStream.write_int(self.pulseWidth);
outputStream.write_int(self.flags);
outputStream.write_byte(self.pulseShape);
outputStream.write_unsigned_byte(self.padding1);
outputStream.write_unsigned_int(self.padding2);
outputStream.write_unsigned_short(self.padding3);
outputStream.write_unsigned_short( len(self.dERecords));
for anObj in self.dERecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DirectedEnergyFirePdu, self).parse(inputStream)
self.munitionType.parse(inputStream)
self.shotStartTime.parse(inputStream)
self.commulativeShotTime = inputStream.read_float();
self.ApertureEmitterLocation.parse(inputStream)
self.apertureDiameter = inputStream.read_float();
self.wavelength = inputStream.read_float();
self.peakIrradiance = inputStream.read_float();
self.pulseRepetitionFrequency = inputStream.read_float();
self.pulseWidth = inputStream.read_int();
self.flags = inputStream.read_int();
self.pulseShape = inputStream.read_byte();
self.padding1 = inputStream.read_unsigned_byte();
self.padding2 = inputStream.read_unsigned_int();
self.padding3 = inputStream.read_unsigned_short();
self.numberOfDERecords = inputStream.read_unsigned_short();
for idx in range(0, self.numberOfDERecords):
element = null()
element.parse(inputStream)
self.dERecords.append(element)
class DetonationPdu( WarfareFamilyPdu ):
"""Detonation or impact of munitions, as well as, non-munition explosions, the burst or initial bloom of chaff, and the ignition of a flare shall be indicated. Section 7.3.3 COMPLETE"""
def __init__(self):
""" Initializer for DetonationPdu"""
super(DetonationPdu, self).__init__()
self.explodingEntityID = EntityID();
""" ID of the expendable entity, Section 7.3.3 """
self.eventID = EventIdentifier();
""" ID of event, Section 7.3.3"""
self.velocity = Vector3Float();
""" velocity of the munition immediately before detonation/impact, Section 7.3.3 """
self.locationInWorldCoordinates = Vector3Double();
""" location of the munition detonation, the expendable detonation, Section 7.3.3 """
self.descriptor = MunitionDescriptor();
""" Describes the detonation represented, Section 7.3.3 """
self.locationOfEntityCoordinates = Vector3Float();
""" Velocity of the ammunition, Section 7.3.3 """
self.detonationResult = 0
""" result of the detonation, Section 7.3.3 """
self.numberOfVariableParameters = 0
""" How many articulation parameters we have, Section 7.3.3 """
self.pad = 0
""" padding"""
self.variableParameters = []
""" specify the parameter values for each Variable Parameter record, Section 7.3.3 """
self.pduType = 3
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( DetonationPdu, self ).serialize(outputStream)
self.explodingEntityID.serialize(outputStream)
self.eventID.serialize(outputStream)
self.velocity.serialize(outputStream)
self.locationInWorldCoordinates.serialize(outputStream)
self.descriptor.serialize(outputStream)
self.locationOfEntityCoordinates.serialize(outputStream)
outputStream.write_unsigned_byte(self.detonationResult);
outputStream.write_unsigned_byte( len(self.variableParameters));
outputStream.write_unsigned_short(self.pad);
for anObj in self.variableParameters:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( DetonationPdu, self).parse(inputStream)
self.explodingEntityID.parse(inputStream)
self.eventID.parse(inputStream)
self.velocity.parse(inputStream)
self.locationInWorldCoordinates.parse(inputStream)
self.descriptor.parse(inputStream)
self.locationOfEntityCoordinates.parse(inputStream)
self.detonationResult = inputStream.read_unsigned_byte();
self.numberOfVariableParameters = inputStream.read_unsigned_byte();
self.pad = inputStream.read_unsigned_short();
for idx in range(0, self.numberOfVariableParameters):
element = VariableParameter()
element.parse(inputStream)
self.variableParameters.append(element)
class SetDataPdu( SimulationManagementFamilyPdu ):
"""Section 7.5.10. Change state information with the data contained in this. COMPLETE"""
def __init__(self):
""" Initializer for SetDataPdu"""
super(SetDataPdu, self).__init__()
self.requestID = 0
""" ID of request"""
self.padding1 = 0
""" padding"""
self.numberOfFixedDatumRecords = 0
""" Number of fixed datum records"""
self.numberOfVariableDatumRecords = 0
""" Number of variable datum records"""
self.fixedDatums = []
""" variable length list of fixed datums"""
self.variableDatums = []
""" variable length list of variable length datums"""
self.pduType = 19
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( SetDataPdu, self ).serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int(self.padding1);
outputStream.write_unsigned_int( len(self.fixedDatums));
outputStream.write_unsigned_int( len(self.variableDatums));
for anObj in self.fixedDatums:
anObj.serialize(outputStream)
for anObj in self.variableDatums:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( SetDataPdu, self).parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
self.padding1 = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatums.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatums.append(element)
class RecordQueryReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: A request for one or more records of data from an entity. COMPLETE"""
def __init__(self):
""" Initializer for RecordQueryReliablePdu"""
super(RecordQueryReliablePdu, self).__init__()
self.requestID = 0
""" request ID"""
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding. The spec is unclear and contradictory here."""
self.pad2 = 0
""" padding"""
self.eventType = 0
""" event type"""
self.time = 0
""" time"""
self.numberOfRecords = 0
""" numberOfRecords"""
self.recordIDs = []
""" record IDs"""
self.pduType = 63
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( RecordQueryReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);
outputStream.write_unsigned_short(self.eventType);
outputStream.write_unsigned_int(self.time);
outputStream.write_unsigned_int( len(self.recordIDs));
for anObj in self.recordIDs:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( RecordQueryReliablePdu, self).parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
self.requiredReliabilityService = inputStream.read_unsigned_byte();
self.pad1 = inputStream.read_unsigned_short();
self.pad2 = inputStream.read_unsigned_byte();
self.eventType = inputStream.read_unsigned_short();
self.time = inputStream.read_unsigned_int();
self.numberOfRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfRecords):
element = null()
element.parse(inputStream)
self.recordIDs.append(element)
class ActionResponsePdu( SimulationManagementFamilyPdu ):
"""Section 7.5.8. response to an action request PDU. COMPLETE"""
def __init__(self):
""" Initializer for ActionResponsePdu"""
super(ActionResponsePdu, self).__init__()
self.originatingID = EntityID();
""" Identifier for originating entity(or simulation)"""
self.receivingID = EntityID();
""" Identifier for the receiving entity(or simulation)"""
self.requestID = 0
""" Request ID that is unique"""
self.requestStatus = 0
""" Status of response"""
self.numberOfFixedDatumRecords = 0
""" Number of fixed datum records"""
self.numberOfVariableDatumRecords = 0
""" Number of variable datum records"""
self.fixedDatums = []
""" variable length list of fixed datums"""
self.variableDatums = []
""" variable length list of variable length datums"""
self.pduType = 17
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ActionResponsePdu, self ).serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
outputStream.write_unsigned_int(self.requestID);
outputStream.write_unsigned_int(self.requestStatus);
outputStream.write_unsigned_int( len(self.fixedDatums));
outputStream.write_unsigned_int( len(self.variableDatums));
for anObj in self.fixedDatums:
anObj.serialize(outputStream)
for anObj in self.variableDatums:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ActionResponsePdu, self).parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
self.requestID = inputStream.read_unsigned_int();
self.requestStatus = inputStream.read_unsigned_int();
self.numberOfFixedDatumRecords = inputStream.read_unsigned_int();
self.numberOfVariableDatumRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatumRecords):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatums.append(element)
for idx in range(0, self.numberOfVariableDatumRecords):
element = VariableDatum()
element.parse(inputStream)
self.variableDatums.append(element)
class EntityDamageStatusPdu( WarfareFamilyPdu ):
"""shall be used to communicate detailed damage information sustained by an entity regardless of the source of the damage Section 7.3.5 COMPLETE"""
def __init__(self):
""" Initializer for EntityDamageStatusPdu"""
super(EntityDamageStatusPdu, self).__init__()
self.damagedEntityID = EntityID();
""" Field shall identify the damaged entity (see 6.2.28), Section 7.3.4 COMPLETE"""
self.padding1 = 0
""" Padding."""
self.padding2 = 0
""" Padding."""
self.numberOfDamageDescription = 0
""" field shall specify the number of Damage Description records, Section 7.3.5"""
self.damageDescriptionRecords = []
""" Fields shall contain one or more Damage Description records (see 6.2.17) and may contain other Standard Variable records, Section 7.3.5"""
self.pduType = 69
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( EntityDamageStatusPdu, self ).serialize(outputStream)
self.damagedEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.padding1);
outputStream.write_unsigned_short(self.padding2);
outputStream.write_unsigned_short( len(self.damageDescriptionRecords));
for anObj in self.damageDescriptionRecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( EntityDamageStatusPdu, self).parse(inputStream)
self.damagedEntityID.parse(inputStream)
self.padding1 = inputStream.read_unsigned_short();
self.padding2 = inputStream.read_unsigned_short();
self.numberOfDamageDescription = inputStream.read_unsigned_short();
for idx in range(0, self.numberOfDamageDescription):
element = null()
element.parse(inputStream)
self.damageDescriptionRecords.append(element)
class FirePdu( WarfareFamilyPdu ):
""" The firing of a weapon or expendable shall be communicated by issuing a Fire PDU. Sectioin 7.3.2. COMPLETE"""
def __init__(self):
""" Initializer for FirePdu"""
super(FirePdu, self).__init__()
self.munitionExpendibleID = EntityID();
""" This field shall specify the entity identification of the fired munition or expendable. This field shall be represented by an Entity Identifier record (see 6.2.28)."""
self.eventID = EventIdentifier();
""" This field shall contain an identification generated by the firing entity to associate related firing and detonation events. This field shall be represented by an Event Identifier record (see 6.2.34)."""
self.fireMissionIndex = 0
""" This field shall identify the fire mission (see <IP_ADDRESS>). This field shall be representedby a 32-bit unsigned integer."""
self.locationInWorldCoordinates = Vector3Double();
""" This field shall specify the location, in world coordinates, from which the munition was launched, and shall be represented by a World Coordinates record (see 6.2.97)."""
self.descriptor = MunitionDescriptor();
""" This field shall describe the firing or launch of a munition or expendable represented by one of the following types of Descriptor records: Munition Descriptor (<IP_ADDRESS>) or Expendable Descriptor (<IP_ADDRESS>)."""
self.velocity = Vector3Float();
""" This field shall specify the velocity of the fired munition at the point when the issuing simulation application intends the externally visible effects of the launch (e.g. exhaust plume or muzzle blast) to first become apparent. The velocity shall be represented in world coordinates. This field shall be represented by a Linear Velocity Vector record [see 6.2.95 item c)]."""
self.range = 0
""" This field shall specify the range that an entitys fire control system has assumed in computing the fire control solution. This field shall be represented by a 32-bit floating point number in meters. For systems where range is unknown or unavailable, this field shall contain a value of zero."""
self.pduType = 2
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( FirePdu, self ).serialize(outputStream)
self.munitionExpendibleID.serialize(outputStream)
self.eventID.serialize(outputStream)
outputStream.write_unsigned_int(self.fireMissionIndex);
self.locationInWorldCoordinates.serialize(outputStream)
self.descriptor.serialize(outputStream)
self.velocity.serialize(outputStream)
outputStream.write_float(self.range);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( FirePdu, self).parse(inputStream)
self.munitionExpendibleID.parse(inputStream)
self.eventID.parse(inputStream)
self.fireMissionIndex = inputStream.read_unsigned_int();
self.locationInWorldCoordinates.parse(inputStream)
self.descriptor.parse(inputStream)
self.velocity.parse(inputStream)
self.range = inputStream.read_float();
class ReceiverPdu( RadioCommunicationsFamilyPdu ):
""" Communication of a receiver state. Section 7.7.4 COMPLETE"""
def __init__(self):
""" Initializer for ReceiverPdu"""
super(ReceiverPdu, self).__init__()
self.receiverState = 0
""" encoding scheme used, and enumeration"""
self.padding1 = 0
""" padding"""
self.receivedPoser = 0
""" received power"""
self.transmitterEntityId = EntityID();
""" ID of transmitter"""
self.transmitterRadioId = 0
""" ID of transmitting radio"""
self.pduType = 27
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( ReceiverPdu, self ).serialize(outputStream)
outputStream.write_unsigned_short(self.receiverState);
outputStream.write_unsigned_short(self.padding1);
outputStream.write_float(self.receivedPoser);
self.transmitterEntityId.serialize(outputStream)
outputStream.write_unsigned_short(self.transmitterRadioId);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( ReceiverPdu, self).parse(inputStream)
self.receiverState = inputStream.read_unsigned_short();
self.padding1 = inputStream.read_unsigned_short();
self.receivedPoser = inputStream.read_float();
self.transmitterEntityId.parse(inputStream)
self.transmitterRadioId = inputStream.read_unsigned_short();
class UaPdu( DistributedEmissionsFamilyPdu ):
""" Information about underwater acoustic emmissions. This requires manual cleanup. The beam data records should ALL be a the finish, rather than attached to each emitter system. Section 7.6.4. UNFINISHED"""
def __init__(self):
""" Initializer for UaPdu"""
super(UaPdu, self).__init__()
self.emittingEntityID = EntityID();
""" ID of the entity that is the source of the emission"""
self.eventID = EventIdentifier();
""" ID of event"""
self.stateChangeIndicator = 0
""" This field shall be used to indicate whether the data in the UA PDU represent a state update or data that have changed since issuance of the last UA PDU"""
self.pad = 0
""" padding"""
self.passiveParameterIndex = 0
""" This field indicates which database record (or file) shall be used in the definition of passive signature (unintentional) emissions of the entity. The indicated database record (or file) shall define all noise generated as a function of propulsion plant configurations and associated auxiliaries."""
self.propulsionPlantConfiguration = 0
""" This field shall specify the entity propulsion plant configuration. This field is used to determine the passive signature characteristics of an entity."""
self.numberOfShafts = 0
""" This field shall represent the number of shafts on a platform"""
self.numberOfAPAs = 0
""" This field shall indicate the number of APAs described in the current UA PDU"""
self.numberOfUAEmitterSystems = 0
""" This field shall specify the number of UA emitter systems being described in the current UA PDU"""
self.shaftRPMs = []
""" shaft RPM values. THIS IS WRONG. It has the wrong class in the list."""
self.apaData = []
""" apaData. THIS IS WRONG. It has the worng class in the list."""
self.emitterSystems = []
""" THIS IS WRONG. It has the wrong class in the list."""
self.pduType = 29
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( UaPdu, self ).serialize(outputStream)
self.emittingEntityID.serialize(outputStream)
self.eventID.serialize(outputStream)
outputStream.write_byte(self.stateChangeIndicator);
outputStream.write_byte(self.pad);
outputStream.write_unsigned_short(self.passiveParameterIndex);
outputStream.write_unsigned_byte(self.propulsionPlantConfiguration);
outputStream.write_unsigned_byte( len(self.shaftRPMs));
outputStream.write_unsigned_byte( len(self.apaData));
outputStream.write_unsigned_byte( len(self.emitterSystems));
for anObj in self.shaftRPMs:
anObj.serialize(outputStream)
for anObj in self.apaData:
anObj.serialize(outputStream)
for anObj in self.emitterSystems:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( UaPdu, self).parse(inputStream)
self.emittingEntityID.parse(inputStream)
self.eventID.parse(inputStream)
self.stateChangeIndicator = inputStream.read_byte();
self.pad = inputStream.read_byte();
self.passiveParameterIndex = inputStream.read_unsigned_short();
self.propulsionPlantConfiguration = inputStream.read_unsigned_byte();
self.numberOfShafts = inputStream.read_unsigned_byte();
self.numberOfAPAs = inputStream.read_unsigned_byte();
self.numberOfUAEmitterSystems = inputStream.read_unsigned_byte();
for idx in range(0, self.numberOfShafts):
element = null()
element.parse(inputStream)
self.shaftRPMs.append(element)
for idx in range(0, self.numberOfAPAs):
element = null()
element.parse(inputStream)
self.apaData.append(element)
for idx in range(0, self.numberOfUAEmitterSystems):
element = null()
element.parse(inputStream)
self.emitterSystems.append(element)
class IntercomControlPdu( RadioCommunicationsFamilyPdu ):
""" Detailed inofrmation about the state of an intercom device and the actions it is requestion of another intercom device, or the response to a requested action. Required manual intervention to fix the intercom parameters, which can be of varialbe length. Section 7.7.5 UNFINSISHED"""
def __init__(self):
""" Initializer for IntercomControlPdu"""
super(IntercomControlPdu, self).__init__()
self.controlType = 0
""" control type"""
self.communicationsChannelType = 0
""" control type"""
self.sourceEntityID = EntityID();
""" Source entity ID"""
self.sourceCommunicationsDeviceID = 0
""" The specific intercom device being simulated within an entity."""
self.sourceLineID = 0
""" Line number to which the intercom control refers"""
self.transmitPriority = 0
""" priority of this message relative to transmissons from other intercom devices"""
self.transmitLineState = 0
""" current transmit state of the line"""
self.command = 0
""" detailed type requested."""
self.masterEntityID = EntityID();
""" eid of the entity that has created this intercom channel."""
self.masterCommunicationsDeviceID = 0
""" specific intercom device that has created this intercom channel"""
self.intercomParametersLength = 0
""" number of intercom parameters"""
self.intercomParameters = []
""" ^^^This is wrong the length of the data field is variable. Using a long for now."""
self.pduType = 32
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( IntercomControlPdu, self ).serialize(outputStream)
outputStream.write_unsigned_byte(self.controlType);
outputStream.write_unsigned_byte(self.communicationsChannelType);
self.sourceEntityID.serialize(outputStream)
outputStream.write_unsigned_byte(self.sourceCommunicationsDeviceID);
outputStream.write_unsigned_byte(self.sourceLineID);
outputStream.write_unsigned_byte(self.transmitPriority);
outputStream.write_unsigned_byte(self.transmitLineState);
outputStream.write_unsigned_byte(self.command);
self.masterEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.masterCommunicationsDeviceID);
outputStream.write_unsigned_int( len(self.intercomParameters));
for anObj in self.intercomParameters:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( IntercomControlPdu, self).parse(inputStream)
self.controlType = inputStream.read_unsigned_byte();
self.communicationsChannelType = inputStream.read_unsigned_byte();
self.sourceEntityID.parse(inputStream)
self.sourceCommunicationsDeviceID = inputStream.read_unsigned_byte();
self.sourceLineID = inputStream.read_unsigned_byte();
self.transmitPriority = inputStream.read_unsigned_byte();
self.transmitLineState = inputStream.read_unsigned_byte();
self.command = inputStream.read_unsigned_byte();
self.masterEntityID.parse(inputStream)
self.masterCommunicationsDeviceID = inputStream.read_unsigned_short();
self.intercomParametersLength = inputStream.read_unsigned_int();
for idx in range(0, self.intercomParametersLength):
element = null()
element.parse(inputStream)
self.intercomParameters.append(element)
class SignalPdu( RadioCommunicationsFamilyPdu ):
""" Detailed information about a radio transmitter. This PDU requires manually written code to complete. The encodingScheme field can be used in multiple ways, which requires hand-written code to finish. Section 7.7.3. UNFINISHED"""
def __init__(self):
""" Initializer for SignalPdu"""
super(SignalPdu, self).__init__()
self.encodingScheme = 0
""" encoding scheme used, and enumeration"""
self.tdlType = 0
""" tdl type"""
self.sampleRate = 0
""" sample rate"""
self.dataLength = 0
""" length od data"""
self.samples = 0
""" number of samples"""
self.data = []
""" list of eight bit values"""
self.pduType = 26
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( SignalPdu, self ).serialize(outputStream)
outputStream.write_unsigned_short(self.encodingScheme);
outputStream.write_unsigned_short(self.tdlType);
outputStream.write_unsigned_int(self.sampleRate);
outputStream.write_short( len(self.data));
outputStream.write_short(self.samples);
for anObj in self.data:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( SignalPdu, self).parse(inputStream)
self.encodingScheme = inputStream.read_unsigned_short();
self.tdlType = inputStream.read_unsigned_short();
self.sampleRate = inputStream.read_unsigned_int();
self.dataLength = inputStream.read_short();
self.samples = inputStream.read_short();
for idx in range(0, self.dataLength):
element = null()
element.parse(inputStream)
self.data.append(element)
class RemoveEntityReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: Removal of an entity , reliable. COMPLETE"""
def __init__(self):
""" Initializer for RemoveEntityReliablePdu"""
super(RemoveEntityReliablePdu, self).__init__()
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding"""
self.pad2 = 0
""" padding"""
self.requestID = 0
""" Request ID"""
self.pduType = 52
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( RemoveEntityReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( RemoveEntityReliablePdu, self).parse(inputStream)
self.requiredReliabilityService = inputStream.read_unsigned_byte();
self.pad1 = inputStream.read_unsigned_short();
self.pad2 = inputStream.read_unsigned_byte();
self.requestID = inputStream.read_unsigned_int();
class SeesPdu( DistributedEmissionsFamilyPdu ):
""" SEES PDU, supplemental emissions entity state information. Section 7.6.6 COMPLETE"""
def __init__(self):
""" Initializer for SeesPdu"""
super(SeesPdu, self).__init__()
self.orginatingEntityID = EntityID();
""" Originating entity ID"""
self.infraredSignatureRepresentationIndex = 0
""" IR Signature representation index"""
self.acousticSignatureRepresentationIndex = 0
""" acoustic Signature representation index"""
self.radarCrossSectionSignatureRepresentationIndex = 0
""" radar cross section representation index"""
self.numberOfPropulsionSystems = 0
""" how many propulsion systems"""
self.numberOfVectoringNozzleSystems = 0
""" how many vectoring nozzle systems"""
self.propulsionSystemData = []
""" variable length list of propulsion system data"""
self.vectoringSystemData = []
""" variable length list of vectoring system data"""
self.pduType = 30
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( SeesPdu, self ).serialize(outputStream)
self.orginatingEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.infraredSignatureRepresentationIndex);
outputStream.write_unsigned_short(self.acousticSignatureRepresentationIndex);
outputStream.write_unsigned_short(self.radarCrossSectionSignatureRepresentationIndex);
outputStream.write_unsigned_short( len(self.propulsionSystemData));
outputStream.write_unsigned_short( len(self.vectoringSystemData));
for anObj in self.propulsionSystemData:
anObj.serialize(outputStream)
for anObj in self.vectoringSystemData:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
super( SeesPdu, self).parse(inputStream)
self.orginatingEntityID.parse(inputStream)
self.infraredSignatureRepresentationIndex = inputStream.read_unsigned_short();
self.acousticSignatureRepresentationIndex = inputStream.read_unsigned_short();
self.radarCrossSectionSignatureRepresentationIndex = inputStream.read_unsigned_short();
self.numberOfPropulsionSystems = inputStream.read_unsigned_short();
self.numberOfVectoringNozzleSystems = inputStream.read_unsigned_short();
for idx in range(0, self.numberOfPropulsionSystems):
element = null()
element.parse(inputStream)
self.propulsionSystemData.append(element)
for idx in range(0, self.numberOfVectoringNozzleSystems):
element = null()
element.parse(inputStream)
self.vectoringSystemData.append(element)
class CreateEntityReliablePdu( SimulationManagementWithReliabilityFamilyPdu ):
"""Section <IP_ADDRESS>: creation of an entity , reliable. COMPLETE"""
def __init__(self):
""" Initializer for CreateEntityReliablePdu"""
super(CreateEntityReliablePdu, self).__init__()
self.requiredReliabilityService = 0
""" level of reliability service used for this transaction"""
self.pad1 = 0
""" padding"""
self.pad2 = 0
""" padding"""
self.requestID = 0
""" Request ID"""
self.pduType = 51
""" initialize value """
def serialize(self, outputStream):
"""serialize the class """
super( CreateEntityReliablePdu, self ).serialize(outputStream)
outputStream.write_unsigned_byte(self.requiredReliabilityService);
outputStream.write_unsigned_short(self.pad1);
outputStream.write_unsigned_byte(self.pad2);