opendis.dis7 module
#
#This code is licensed under the BSD software license
#
class DataQueryDatumSpecification( object ):
"""List of fixed and variable datum records. Section 6.2.17 """
def __init__(self):
""" Initializer for DataQueryDatumSpecification"""
self.numberOfFixedDatums = 0
""" Number of fixed datums"""
self.numberOfVariableDatums = 0
""" Number of variable datums"""
self.fixedDatumIDList = []
""" variable length list fixed datum IDs"""
self.variableDatumIDList = []
""" variable length list variable datum IDs"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int( len(self.fixedDatumIDList));
outputStream.write_unsigned_int( len(self.variableDatumIDList));
for anObj in self.fixedDatumIDList:
anObj.serialize(outputStream)
for anObj in self.variableDatumIDList:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.numberOfFixedDatums = inputStream.read_unsigned_int();
self.numberOfVariableDatums = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatums):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatumIDList.append(element)
for idx in range(0, self.numberOfVariableDatums):
element = VariableDatum()
element.parse(inputStream)
self.variableDatumIDList.append(element)
class RadioIdentifier( object ):
"""The unique designation of an attached or unattached radio in an event or exercise Section 6.2.70"""
def __init__(self):
""" Initializer for RadioIdentifier"""
self.siteNumber = 0
""" site"""
self.applicationNumber = 0
""" application number"""
self.referenceNumber = 0
""" reference number"""
self.radioNumber = 0
""" Radio number"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.siteNumber);
outputStream.write_unsigned_short(self.applicationNumber);
outputStream.write_unsigned_short(self.referenceNumber);
outputStream.write_unsigned_short(self.radioNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.siteNumber = inputStream.read_unsigned_short();
self.applicationNumber = inputStream.read_unsigned_short();
self.referenceNumber = inputStream.read_unsigned_short();
self.radioNumber = inputStream.read_unsigned_short();
class RequestID( object ):
"""A monotonically increasing number inserted into all simulation managment PDUs. This should be a hand-coded thingie, maybe a singleton. Section 6.2.75"""
def __init__(self):
""" Initializer for RequestID"""
self.requestID = 0
""" monotonically increasing number"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.requestID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.requestID = inputStream.read_unsigned_int();
class IFFData( object ):
"""repeating element if IFF Data specification record"""
def __init__(self):
""" Initializer for IFFData"""
self.recordType = 0
""" enumeration for type of record"""
self.recordLength = 0
""" length of record. Should be padded to 32 bit boundary."""
self.iffData = []
""" IFF data."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short( len(self.iffData));
for anObj in self.iffData:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
for idx in range(0, self.recordLength):
element = null()
element.parse(inputStream)
self.iffData.append(element)
class MunitionDescriptor( object ):
"""Represents the firing or detonation of a munition. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for MunitionDescriptor"""
self.munitionType = EntityType();
""" What munition was used in the burst"""
self.warhead = 0
""" type of warhead enumeration"""
self.fuse = 0
""" type of fuse used enumeration"""
self.quantity = 0
""" how many of the munition were fired"""
self.rate = 0
""" rate at which the munition was fired"""
def serialize(self, outputStream):
"""serialize the class """
self.munitionType.serialize(outputStream)
outputStream.write_unsigned_short(self.warhead);
outputStream.write_unsigned_short(self.fuse);
outputStream.write_unsigned_short(self.quantity);
outputStream.write_unsigned_short(self.rate);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.munitionType.parse(inputStream)
self.warhead = inputStream.read_unsigned_short();
self.fuse = inputStream.read_unsigned_short();
self.quantity = inputStream.read_unsigned_short();
self.rate = inputStream.read_unsigned_short();
class MinefieldSensorType( object ):
"""Information about a minefield sensor. Section 6.2.57"""
def __init__(self):
""" Initializer for MinefieldSensorType"""
self.sensorType = 0
""" sensor type. bit fields 0-3 are the type category, 4-15 are teh subcategory"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.sensorType);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.sensorType = inputStream.read_unsigned_short();
class GroupID( object ):
"""Unique designation of a group of entities contained in the isGroupOfPdu. Represents a group of entities rather than a single entity. Section 6.2.43"""
def __init__(self):
""" Initializer for GroupID"""
self.simulationAddress = EntityType();
""" Simulation address (site and application number)"""
self.groupNumber = 0
""" group number"""
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.groupNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.groupNumber = inputStream.read_unsigned_short();
class LayerHeader( object ):
"""The identification of the additional information layer number, layer-specific information, and the length of the layer. Section 6.2.51"""
def __init__(self):
""" Initializer for LayerHeader"""
self.layerNumber = 0
self.layerSpecificInformation = 0
""" field shall specify layer-specific information that varies by System Type (see 6.2.86) and Layer Number."""
self.length = 0
""" This field shall specify the length in octets of the layer, including the Layer Header record"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.layerNumber);
outputStream.write_unsigned_byte(self.layerSpecificInformation);
outputStream.write_unsigned_short(self.length);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.layerNumber = inputStream.read_unsigned_byte();
self.layerSpecificInformation = inputStream.read_unsigned_byte();
self.length = inputStream.read_unsigned_short();
class UnsignedDISInteger( object ):
"""container class not in specification"""
def __init__(self):
""" Initializer for UnsignedDISInteger"""
self.val = 0
""" unsigned integer"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.val);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.val = inputStream.read_unsigned_int();
class DeadReckoningParameters( object ):
"""Not specified in the standard. This is used by the ESPDU"""
def __init__(self):
""" Initializer for DeadReckoningParameters"""
self.deadReckoningAlgorithm = 0
""" Algorithm to use in computing dead reckoning. See EBV doc."""
self.parameters = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
""" Dead reckoning parameters. Contents depends on algorithm."""
self.entityLinearAcceleration = Vector3Float();
""" Linear acceleration of the entity"""
self.entityAngularVelocity = Vector3Float();
""" Angular velocity of the entity"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.deadReckoningAlgorithm);
for idx in range(0, 15):
outputStream.write_unsigned_byte( self.parameters[ idx ] );
self.entityLinearAcceleration.serialize(outputStream)
self.entityAngularVelocity.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.deadReckoningAlgorithm = inputStream.read_unsigned_byte();
self.parameters = [0]*15
for idx in range(0, 15):
val = inputStream.read_unsigned_byte()
self.parameters[ idx ] = val
self.entityLinearAcceleration.parse(inputStream)
self.entityAngularVelocity.parse(inputStream)
class ProtocolMode( object ):
"""Bit field used to identify minefield data. bits 14-15 are a 2-bit enum, other bits unused. Section 6.2.69"""
def __init__(self):
""" Initializer for ProtocolMode"""
self.protocolMode = 0
""" Bitfields, 14-15 contain an enum"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.protocolMode);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.protocolMode = inputStream.read_unsigned_short();
class AngleDeception( object ):
"""The Angle Deception attribute record may be used to communicate discrete values that are associated with angle deception jamming that cannot be referenced to an emitter mode. The values provided in the record records (provided in the associated Electromagnetic Emission PDU). (The victim radar beams are those that are targeted by the jammer.) Section <IP_ADDRESS>.2"""
def __init__(self):
""" Initializer for AngleDeception"""
self.recordType = 3501
self.recordLength = 48
self.padding = 0
self.emitterNumber = 0
self.beamNumber = 0
self.stateIndicator = 0
self.padding2 = 0
self.azimuthOffset = 0
self.azimuthWidth = 0
self.azimuthPullRate = 0
self.azimuthPullAcceleration = 0
self.elevationOffset = 0
self.elevationWidth = 0
self.elevationPullRate = 0
self.elevationPullAcceleration = 0
self.padding3 = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_short(self.padding);
outputStream.write_unsigned_byte(self.emitterNumber);
outputStream.write_unsigned_byte(self.beamNumber);
outputStream.write_unsigned_byte(self.stateIndicator);
outputStream.write_unsigned_byte(self.padding2);
outputStream.write_float(self.azimuthOffset);
outputStream.write_float(self.azimuthWidth);
outputStream.write_float(self.azimuthPullRate);
outputStream.write_float(self.azimuthPullAcceleration);
outputStream.write_float(self.elevationOffset);
outputStream.write_float(self.elevationWidth);
outputStream.write_float(self.elevationPullRate);
outputStream.write_float(self.elevationPullAcceleration);
outputStream.write_unsigned_int(self.padding3);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
self.emitterNumber = inputStream.read_unsigned_byte();
self.beamNumber = inputStream.read_unsigned_byte();
self.stateIndicator = inputStream.read_unsigned_byte();
self.padding2 = inputStream.read_unsigned_byte();
self.azimuthOffset = inputStream.read_float();
self.azimuthWidth = inputStream.read_float();
self.azimuthPullRate = inputStream.read_float();
self.azimuthPullAcceleration = inputStream.read_float();
self.elevationOffset = inputStream.read_float();
self.elevationWidth = inputStream.read_float();
self.elevationPullRate = inputStream.read_float();
self.elevationPullAcceleration = inputStream.read_float();
self.padding3 = inputStream.read_unsigned_int();
class EntityAssociation( object ):
"""Association or disassociation of two entities. Section <IP_ADDRESS>.3"""
def __init__(self):
""" Initializer for EntityAssociation"""
self.recordType = 4
""" the identification of the Variable Parameter record. Enumeration from EBV"""
self.changeIndicator = 0
""" Indicates if this VP has changed since last issuance"""
self.associationStatus = 0
""" Indicates association status between two entities; 8 bit enum"""
self.associationType = 0
""" Type of association; 8 bit enum"""
self.entityID = EntityID();
""" Object ID of entity associated with this entity"""
self.ownStationLocation = 0
""" Station location on one's own entity. EBV doc."""
self.physicalConnectionType = 0
""" Type of physical connection. EBV doc"""
self.groupMemberType = 0
""" Type of member the entity is within th egroup"""
self.groupNumber = 0
""" Group if any to which the entity belongs"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.recordType);
outputStream.write_unsigned_byte(self.changeIndicator);
outputStream.write_unsigned_byte(self.associationStatus);
outputStream.write_unsigned_byte(self.associationType);
self.entityID.serialize(outputStream)
outputStream.write_unsigned_short(self.ownStationLocation);
outputStream.write_unsigned_byte(self.physicalConnectionType);
outputStream.write_unsigned_byte(self.groupMemberType);
outputStream.write_unsigned_short(self.groupNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_byte();
self.changeIndicator = inputStream.read_unsigned_byte();
self.associationStatus = inputStream.read_unsigned_byte();
self.associationType = inputStream.read_unsigned_byte();
self.entityID.parse(inputStream)
self.ownStationLocation = inputStream.read_unsigned_short();
self.physicalConnectionType = inputStream.read_unsigned_byte();
self.groupMemberType = inputStream.read_unsigned_byte();
self.groupNumber = inputStream.read_unsigned_short();
class VectoringNozzleSystem( object ):
"""Operational data for describing the vectoring nozzle systems Section 6.2.96"""
def __init__(self):
""" Initializer for VectoringNozzleSystem"""
self.horizontalDeflectionAngle = 0
""" In degrees"""
self.verticalDeflectionAngle = 0
""" In degrees"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.horizontalDeflectionAngle);
outputStream.write_float(self.verticalDeflectionAngle);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.horizontalDeflectionAngle = inputStream.read_float();
self.verticalDeflectionAngle = inputStream.read_float();
class FalseTargetsAttribute( object ):
"""The False Targets attribute record shall be used to communicate discrete values that are associated with false targets jamming that cannot be referenced to an emitter mode. The values provided in the False Targets attri- bute record shall be considered valid only for the victim radar beams listed in the jamming beam's Track/Jam Data records (provided in the associated Electromagnetic Emission PDU). Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for FalseTargetsAttribute"""
self.recordType = 3502
self.recordLength = 40
self.padding = 0
self.emitterNumber = 0
self.beamNumber = 0
self.stateIndicator = 0
self.padding2 = 0
self.falseTargetCount = 0
self.walkSpeed = 0
self.walkAcceleration = 0
self.maximumWalkDistance = 0
self.keepTime = 0
self.echoSpacing = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_short(self.padding);
outputStream.write_unsigned_byte(self.emitterNumber);
outputStream.write_unsigned_byte(self.beamNumber);
outputStream.write_unsigned_byte(self.stateIndicator);
outputStream.write_unsigned_byte(self.padding2);
outputStream.write_unsigned_short(self.falseTargetCount);
outputStream.write_float(self.walkSpeed);
outputStream.write_float(self.walkAcceleration);
outputStream.write_float(self.maximumWalkDistance);
outputStream.write_float(self.keepTime);
outputStream.write_float(self.echoSpacing);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
self.emitterNumber = inputStream.read_unsigned_byte();
self.beamNumber = inputStream.read_unsigned_byte();
self.stateIndicator = inputStream.read_unsigned_byte();
self.padding2 = inputStream.read_unsigned_byte();
self.falseTargetCount = inputStream.read_unsigned_short();
self.walkSpeed = inputStream.read_float();
self.walkAcceleration = inputStream.read_float();
self.maximumWalkDistance = inputStream.read_float();
self.keepTime = inputStream.read_float();
self.echoSpacing = inputStream.read_float();
class MinefieldIdentifier( object ):
"""The unique designation of a minefield Section 6.2.56 """
def __init__(self):
""" Initializer for MinefieldIdentifier"""
self.simulationAddress = SimulationAddress();
""" """
self.minefieldNumber = 0
""" """
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.minefieldNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.minefieldNumber = inputStream.read_unsigned_short();
class RadioType( object ):
"""Identifies the type of radio. Section 6.2.71"""
def __init__(self):
""" Initializer for RadioType"""
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
""" specific info based on subcategory field"""
self.specific = 0
self.extra = 0
def serialize(self, outputStream):
"""serialize the class """
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);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
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();
class NamedLocationIdentification( object ):
"""Information about the discrete positional relationship of the part entity with respect to the its host entity Section 6.2.62 """
def __init__(self):
""" Initializer for NamedLocationIdentification"""
self.stationName = 0
""" the station name within the host at which the part entity is located. If the part entity is On Station, this field shall specify the representation of the parts location data fields. This field shall be specified by a 16-bit enumeration """
self.stationNumber = 0
""" the number of the particular wing station, cargo hold etc., at which the part is attached. """
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.stationName);
outputStream.write_unsigned_short(self.stationNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.stationName = inputStream.read_unsigned_short();
self.stationNumber = inputStream.read_unsigned_short();
class FourByteChunk( object ):
"""32 bit piece of data"""
def __init__(self):
""" Initializer for FourByteChunk"""
self.otherParameters = [ 0, 0, 0, 0]
""" four bytes of arbitrary data"""
def serialize(self, outputStream):
"""serialize the class """
for idx in range(0, 4):
outputStream.write_byte( self.otherParameters[ idx ] );
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.otherParameters = [0]*4
for idx in range(0, 4):
val = inputStream.read_byte()
self.otherParameters[ idx ] = val
class ModulationParameters( object ):
"""Modulation parameters associated with a specific radio system. INCOMPLETE. 6.2.58 """
def __init__(self):
""" Initializer for ModulationParameters"""
def serialize(self, outputStream):
"""serialize the class """
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
class OneByteChunk( object ):
"""8 bit piece of data"""
def __init__(self):
""" Initializer for OneByteChunk"""
self.otherParameters = [ 0]
""" one byte of arbitrary data"""
def serialize(self, outputStream):
"""serialize the class """
for idx in range(0, 1):
outputStream.write_byte( self.otherParameters[ idx ] );
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.otherParameters = [0]*1
for idx in range(0, 1):
val = inputStream.read_byte()
self.otherParameters[ idx ] = val
class EulerAngles( object ):
"""Three floating point values representing an orientation, psi, theta, and phi, aka the euler angles, in radians. Section 6.2.33"""
def __init__(self):
""" Initializer for EulerAngles"""
self.psi = 0
self.theta = 0
self.phi = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.psi);
outputStream.write_float(self.theta);
outputStream.write_float(self.phi);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.psi = inputStream.read_float();
self.theta = inputStream.read_float();
self.phi = inputStream.read_float();
class DirectedEnergyPrecisionAimpoint( object ):
"""DE Precision Aimpoint Record. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for DirectedEnergyPrecisionAimpoint"""
self.recordType = 4000
""" Type of Record"""
self.recordLength = 88
""" Length of Record"""
self.padding = 0
""" Padding"""
self.targetSpotLocation = Vector3Double();
""" Position of Target Spot in World Coordinates."""
self.targetSpotEntityLocation = Vector3Float();
""" Position (meters) of Target Spot relative to Entity Position."""
self.targetSpotVelocity = Vector3Float();
""" Velocity (meters/sec) of Target Spot."""
self.targetSpotAcceleration = Vector3Float();
""" Acceleration (meters/sec/sec) of Target Spot."""
self.targetEntityID = EntityID();
""" Unique ID of the target entity."""
self.targetComponentID = 0
""" Target Component ID ENUM, same as in DamageDescriptionRecord."""
self.beamSpotType = 0
""" Spot Shape ENUM."""
self.beamSpotCrossSectionSemiMajorAxis = 0
""" Beam Spot Cross Section Semi-Major Axis."""
self.beamSpotCrossSectionSemiMinorAxis = 0
""" Beam Spot Cross Section Semi-Major Axis."""
self.beamSpotCrossSectionOrientationAngle = 0
""" Beam Spot Cross Section Orientation Angle."""
self.peakIrradiance = 0
""" Peak irradiance"""
self.padding2 = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_short(self.padding);
self.targetSpotLocation.serialize(outputStream)
self.targetSpotEntityLocation.serialize(outputStream)
self.targetSpotVelocity.serialize(outputStream)
self.targetSpotAcceleration.serialize(outputStream)
self.targetEntityID.serialize(outputStream)
outputStream.write_unsigned_byte(self.targetComponentID);
outputStream.write_unsigned_byte(self.beamSpotType);
outputStream.write_float(self.beamSpotCrossSectionSemiMajorAxis);
outputStream.write_float(self.beamSpotCrossSectionSemiMinorAxis);
outputStream.write_float(self.beamSpotCrossSectionOrientationAngle);
outputStream.write_float(self.peakIrradiance);
outputStream.write_unsigned_int(self.padding2);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
self.targetSpotLocation.parse(inputStream)
self.targetSpotEntityLocation.parse(inputStream)
self.targetSpotVelocity.parse(inputStream)
self.targetSpotAcceleration.parse(inputStream)
self.targetEntityID.parse(inputStream)
self.targetComponentID = inputStream.read_unsigned_byte();
self.beamSpotType = inputStream.read_unsigned_byte();
self.beamSpotCrossSectionSemiMajorAxis = inputStream.read_float();
self.beamSpotCrossSectionSemiMinorAxis = inputStream.read_float();
self.beamSpotCrossSectionOrientationAngle = inputStream.read_float();
self.peakIrradiance = inputStream.read_float();
self.padding2 = inputStream.read_unsigned_int();
class IffDataSpecification( object ):
"""Requires hand coding to be useful. Section 6.2.43"""
def __init__(self):
""" Initializer for IffDataSpecification"""
self.numberOfIffDataRecords = 0
""" Number of iff records"""
self.iffDataRecords = []
""" IFF data records"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short( len(self.iffDataRecords));
for anObj in self.iffDataRecords:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.numberOfIffDataRecords = inputStream.read_unsigned_short();
for idx in range(0, self.numberOfIffDataRecords):
element = null()
element.parse(inputStream)
self.iffDataRecords.append(element)
class OwnershipStatus( object ):
"""used to convey entity and conflict status information associated with transferring ownership of an entity. Section 6.2.65"""
def __init__(self):
""" Initializer for OwnershipStatus"""
self.entityId = EntityID();
""" EntityID"""
self.ownershipStatus = 0
""" The ownership and/or ownership conflict status of the entity represented by the Entity ID field."""
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
self.entityId.serialize(outputStream)
outputStream.write_unsigned_byte(self.ownershipStatus);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.entityId.parse(inputStream)
self.ownershipStatus = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class BeamAntennaPattern( object ):
"""Used when the antenna pattern type field has a value of 1. Specifies the direction, pattern, and polarization of radiation from an antenna. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for BeamAntennaPattern"""
self.beamDirection = EulerAngles();
""" The rotation that transforms the reference coordinate sytem into the beam coordinate system. Either world coordinates or entity coordinates may be used as the reference coordinate system, as specified by the reference system field of the antenna pattern record."""
self.azimuthBeamwidth = 0
self.elevationBeamwidth = 0
self.referenceSystem = 0
self.padding1 = 0
self.padding2 = 0
self.ez = 0.0
""" This field shall specify the magnitude of the Z-component (in beam coordinates) of the Electrical field at some arbitrary single point in the main beam and in the far field of the antenna. """
self.ex = 0.0
""" This field shall specify the magnitude of the X-component (in beam coordinates) of the Electri- cal field at some arbitrary single point in the main beam and in the far field of the antenna."""
self.phase = 0.0
""" This field shall specify the phase angle between EZ and EX in radians. If fully omni-direc- tional antenna is modeled using beam pattern type one, the omni-directional antenna shall be repre- sented by beam direction Euler angles psi, theta, and phi of zero, an azimuth beamwidth of 2PI, and an elevation beamwidth of PI"""
self.padding3 = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
self.beamDirection.serialize(outputStream)
outputStream.write_float(self.azimuthBeamwidth);
outputStream.write_float(self.elevationBeamwidth);
outputStream.write_unsigned_byte(self.referenceSystem);
outputStream.write_unsigned_byte(self.padding1);
outputStream.write_unsigned_short(self.padding2);
outputStream.write_float(self.ez);
outputStream.write_float(self.ex);
outputStream.write_float(self.phase);
outputStream.write_unsigned_int(self.padding3);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.beamDirection.parse(inputStream)
self.azimuthBeamwidth = inputStream.read_float();
self.elevationBeamwidth = inputStream.read_float();
self.referenceSystem = inputStream.read_unsigned_byte();
self.padding1 = inputStream.read_unsigned_byte();
self.padding2 = inputStream.read_unsigned_short();
self.ez = inputStream.read_float();
self.ex = inputStream.read_float();
self.phase = inputStream.read_float();
self.padding3 = inputStream.read_unsigned_int();
class AttachedParts( object ):
"""Removable parts that may be attached to an entity. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for AttachedParts"""
self.recordType = 1
""" the identification of the Variable Parameter record. Enumeration from EBV"""
self.detachedIndicator = 0
""" 0 = attached, 1 = detached. See I.2.3.1 for state transition diagram"""
self.partAttachedTo = 0
""" the identification of the articulated part to which this articulation parameter is attached. This field shall be specified by a 16-bit unsigned integer. This field shall contain the value zero if the articulated part is attached directly to the entity."""
self.parameterType = 0
""" The location or station to which the part is attached"""
self.parameterValue = 0
""" The definition of the 64 bits shall be determined based on the type of parameter specified in the Parameter Type field """
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.recordType);
outputStream.write_unsigned_byte(self.detachedIndicator);
outputStream.write_unsigned_short(self.partAttachedTo);
outputStream.write_unsigned_int(self.parameterType);
outputStream.write_long(self.parameterValue);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_byte();
self.detachedIndicator = inputStream.read_unsigned_byte();
self.partAttachedTo = inputStream.read_unsigned_short();
self.parameterType = inputStream.read_unsigned_int();
self.parameterValue = inputStream.read_long();
class VariableTransmitterParameters( object ):
"""Relates to radios. NOT COMPLETE. Section 6.2.94"""
def __init__(self):
""" Initializer for VariableTransmitterParameters"""
self.recordType = 0
""" Type of VTP. Enumeration from EBV"""
self.recordLength = 4
""" Length, in bytes"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_int(self.recordLength);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_int();
class Attribute( object ):
"""Used to convey information for one or more attributes. Attributes conform to the standard variable record format of 6.2.82. Section 6.2.10. NOT COMPLETE"""
def __init__(self):
""" Initializer for Attribute"""
self.recordType = 0
self.recordLength = 0
self.recordSpecificFields = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_long(self.recordSpecificFields);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.recordSpecificFields = inputStream.read_long();
class RecordQuerySpecification( object ):
"""The identification of the records being queried 6.2.72"""
def __init__(self):
""" Initializer for RecordQuerySpecification"""
self.numberOfRecords = 0
self.records = []
""" variable length list of 32 bit records"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int( len(self.records));
for anObj in self.records:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.numberOfRecords = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfRecords):
element = null()
element.parse(inputStream)
self.records.append(element)
class ArticulatedParts( object ):
""" articulated parts for movable parts and a combination of moveable/attached parts of an entity. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for ArticulatedParts"""
self.recordType = 0
""" the identification of the Variable Parameter record. Enumeration from EBV"""
self.changeIndicator = 0
""" indicate the change of any parameter for any articulated part. Starts at zero, incremented for each change """
self.partAttachedTo = 0
""" the identification of the articulated part to which this articulation parameter is attached. This field shall be specified by a 16-bit unsigned integer. This field shall contain the value zero if the articulated part is attached directly to the entity."""
self.parameterType = 0
""" the type of parameter represented, 32 bit enumeration"""
self.parameterValue = 0
""" The definition of the 64 bits shall be determined based on the type of parameter specified in the Parameter Type field """
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.recordType);
outputStream.write_unsigned_byte(self.changeIndicator);
outputStream.write_unsigned_short(self.partAttachedTo);
outputStream.write_unsigned_int(self.parameterType);
outputStream.write_long(self.parameterValue);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_byte();
self.changeIndicator = inputStream.read_unsigned_byte();
self.partAttachedTo = inputStream.read_unsigned_short();
self.parameterType = inputStream.read_unsigned_int();
self.parameterValue = inputStream.read_long();
class ObjectType( object ):
"""The unique designation of an environmental object. Section 6.2.64"""
def __init__(self):
""" Initializer for ObjectType"""
self.domain = 0
""" Domain of entity (air, surface, subsurface, space, etc)"""
self.objectKind = 0
""" country to which the design of the entity is attributed"""
self.category = 0
""" category of entity"""
self.subcategory = 0
""" subcategory of entity"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.domain);
outputStream.write_unsigned_byte(self.objectKind);
outputStream.write_unsigned_byte(self.category);
outputStream.write_unsigned_byte(self.subcategory);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.domain = inputStream.read_unsigned_byte();
self.objectKind = inputStream.read_unsigned_byte();
self.category = inputStream.read_unsigned_byte();
self.subcategory = inputStream.read_unsigned_byte();
class Association( object ):
"""An entity's associations with other entities and/or locations. For each association, this record shall specify the type of the association, the associated entity's EntityID and/or the associated location's world coordinates. This record may be used (optionally) in a transfer transaction to send internal state data from the divesting simulation to the acquiring simulation (see 5.9.4). This record may also be used for other purposes. Section 6.2.9"""
def __init__(self):
""" Initializer for Association"""
self.associationType = 0
self.padding4 = 0
self.associatedEntityID = EntityID();
""" identity of associated entity. If none, NO_SPECIFIC_ENTITY"""
self.associatedLocation = Vector3Double();
""" location, in world coordinates"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.associationType);
outputStream.write_unsigned_byte(self.padding4);
self.associatedEntityID.serialize(outputStream)
self.associatedLocation.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.associationType = inputStream.read_unsigned_byte();
self.padding4 = inputStream.read_unsigned_byte();
self.associatedEntityID.parse(inputStream)
self.associatedLocation.parse(inputStream)
class RecordSpecificationElement( object ):
"""Synthetic record, made up from section 6.2.72. This is used to acheive a repeating variable list element."""
def __init__(self):
""" Initializer for RecordSpecificationElement"""
self.recordID = 0
""" the data structure used to convey the parameter values of the record for each record. 32 bit enumeration."""
self.recordSetSerialNumber = 0
""" the serial number of the first record in the block of records"""
self.recordLength = 0
""" the length, in bits, of the record. Note, bits, not bytes."""
self.recordCount = 0
""" the number of records included in the record set """
self.recordValues = 0
""" the concatenated records of the format specified by the Record ID field. The length of this field is the Record Length multiplied by the Record Count, in units of bits. ^^^This is wrong--variable sized data records, bit values. THis MUST be patched after generation."""
self.pad4 = 0
""" Padding of 0 to 31 unused bits as required for 32-bit alignment of the Record Set field. ^^^This is wrong--variable sized padding. MUST be patched post-code generation"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordID);
outputStream.write_unsigned_int(self.recordSetSerialNumber);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_short(self.recordCount);
outputStream.write_unsigned_short(self.recordValues);
outputStream.write_unsigned_byte(self.pad4);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordID = inputStream.read_unsigned_int();
self.recordSetSerialNumber = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.recordCount = inputStream.read_unsigned_short();
self.recordValues = inputStream.read_unsigned_short();
self.pad4 = inputStream.read_unsigned_byte();
class EightByteChunk( object ):
"""64 bit piece of data"""
def __init__(self):
""" Initializer for EightByteChunk"""
self.otherParameters = [ 0, 0, 0, 0, 0, 0, 0, 0]
""" Eight bytes of arbitrary data"""
def serialize(self, outputStream):
"""serialize the class """
for idx in range(0, 8):
outputStream.write_byte( self.otherParameters[ idx ] );
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.otherParameters = [0]*8
for idx in range(0, 8):
val = inputStream.read_byte()
self.otherParameters[ idx ] = val
class AntennaLocation( object ):
"""Location of the radiating portion of the antenna, specified in world coordinates and entity coordinates. Section 6.2.8"""
def __init__(self):
""" Initializer for AntennaLocation"""
self.antennaLocation = Vector3Double();
""" Location of the radiating portion of the antenna in world coordinates"""
self.relativeAntennaLocation = Vector3Float();
""" Location of the radiating portion of the antenna in entity coordinates"""
def serialize(self, outputStream):
"""serialize the class """
self.antennaLocation.serialize(outputStream)
self.relativeAntennaLocation.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.antennaLocation.parse(inputStream)
self.relativeAntennaLocation.parse(inputStream)
class ObjectIdentifier( object ):
"""The unique designation of an environmental object. Section 6.2.63"""
def __init__(self):
""" Initializer for ObjectIdentifier"""
self.simulationAddress = SimulationAddress();
""" Simulation Address"""
self.objectNumber = 0
""" object number"""
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.objectNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.objectNumber = inputStream.read_unsigned_short();
class AggregateIdentifier( object ):
"""The unique designation of each aggrgate in an exercise is specified by an aggregate identifier record. The aggregate ID is not an entity and shall not be treated as such. Section 6.2.3."""
def __init__(self):
""" Initializer for AggregateIdentifier"""
self.simulationAddress = SimulationAddress();
""" Simulation address, ie site and application, the first two fields of the entity ID"""
self.aggregateID = 0
""" the aggregate ID"""
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.aggregateID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.aggregateID = inputStream.read_unsigned_short();
class FixedDatum( object ):
"""Fixed Datum Record. Section 6.2.38"""
def __init__(self):
""" Initializer for FixedDatum"""
self.fixedDatumID = 0
""" ID of the fixed datum, an enumeration"""
self.fixedDatumValue = 0
""" Value for the fixed datum"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.fixedDatumID);
outputStream.write_unsigned_int(self.fixedDatumValue);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.fixedDatumID = inputStream.read_unsigned_int();
self.fixedDatumValue = inputStream.read_unsigned_int();
class VariableParameter( object ):
"""specification of additional information associated with an entity or detonation, not otherwise accounted for in a PDU <IP_ADDRESS>"""
def __init__(self):
""" Initializer for VariableParameter"""
self.recordType = 0
""" the identification of the Variable Parameter record. Enumeration from EBV"""
self.variableParameterFields1 = 0
""" Variable parameter data fields. Two doubles minus one byte"""
self.variableParameterFields2 = 0
""" Variable parameter data fields. """
self.variableParameterFields3 = 0
""" Variable parameter data fields. """
self.variableParameterFields4 = 0
""" Variable parameter data fields. """
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.recordType);
outputStream.write_double(self.variableParameterFields1);
outputStream.write_unsigned_int(self.variableParameterFields2);
outputStream.write_unsigned_short(self.variableParameterFields3);
outputStream.write_unsigned_byte(self.variableParameterFields4);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_byte();
self.variableParameterFields1 = inputStream.read_double();
self.variableParameterFields2 = inputStream.read_unsigned_int();
self.variableParameterFields3 = inputStream.read_unsigned_short();
self.variableParameterFields4 = inputStream.read_unsigned_byte();
class ChangeOptions( object ):
"""This is wrong and breaks serialization. See section 6.2.13 aka B.2.41"""
def __init__(self):
""" Initializer for ChangeOptions"""
def serialize(self, outputStream):
"""serialize the class """
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
class LiveSimulationAddress( object ):
"""A simulation's designation associated with all Live Entity IDs contained in Live Entity PDUs. Section 6.2.55 """
def __init__(self):
""" Initializer for LiveSimulationAddress"""
self.liveSiteNumber = 0
""" facility, installation, organizational unit or geographic location may have multiple sites associated with it. The Site Number is the first component of the Live Simulation Address, which defines a live simulation."""
self.liveApplicationNumber = 0
""" An application associated with a live site is termed a live application. Each live application participating in an event """
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.liveSiteNumber);
outputStream.write_unsigned_byte(self.liveApplicationNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.liveSiteNumber = inputStream.read_unsigned_byte();
self.liveApplicationNumber = inputStream.read_unsigned_byte();
class EntityMarking( object ):
"""Specifies the character set used inthe first byte, followed by 11 characters of text data. Section 6.29"""
def __init__(self):
""" Initializer for EntityMarking"""
self.characterSet = 0
""" The character set"""
self.characters = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
""" The characters"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.characterSet);
for idx in range(0, 11):
outputStream.write_byte( self.characters[ idx ] );
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.characterSet = inputStream.read_unsigned_byte();
self.characters = [0]*11
for idx in range(0, 11):
val = inputStream.read_byte()
self.characters[ idx ] = val
class UAFundamentalParameter( object ):
"""Regeneration parameters for active emission systems that are variable throughout a scenario. Section 6.2.91"""
def __init__(self):
""" Initializer for UAFundamentalParameter"""
self.activeEmissionParameterIndex = 0
""" Which database record shall be used. An enumeration from EBV document"""
self.scanPattern = 0
""" The type of scan pattern, If not used, zero. An enumeration from EBV document"""
self.beamCenterAzimuthHorizontal = 0
""" center azimuth bearing of th emain beam. In radians."""
self.azimuthalBeamwidthHorizontal = 0
""" Horizontal beamwidth of th emain beam Meastued at the 3dB down point of peak radiated power. In radians."""
self.beamCenterDepressionElevation = 0
""" center of the d/e angle of th emain beam relative to the stablised de angle of the target. In radians."""
self.beamwidthDownElevation = 0
""" vertical beamwidth of the main beam. Meastured at the 3dB down point of peak radiated power. In radians."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.activeEmissionParameterIndex);
outputStream.write_unsigned_short(self.scanPattern);
outputStream.write_float(self.beamCenterAzimuthHorizontal);
outputStream.write_float(self.azimuthalBeamwidthHorizontal);
outputStream.write_float(self.beamCenterDepressionElevation);
outputStream.write_float(self.beamwidthDownElevation);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.activeEmissionParameterIndex = inputStream.read_unsigned_short();
self.scanPattern = inputStream.read_unsigned_short();
self.beamCenterAzimuthHorizontal = inputStream.read_float();
self.azimuthalBeamwidthHorizontal = inputStream.read_float();
self.beamCenterDepressionElevation = inputStream.read_float();
self.beamwidthDownElevation = inputStream.read_float();
class TwoByteChunk( object ):
"""16 bit piece of data"""
def __init__(self):
""" Initializer for TwoByteChunk"""
self.otherParameters = [ 0, 0]
""" two bytes of arbitrary data"""
def serialize(self, outputStream):
"""serialize the class """
for idx in range(0, 2):
outputStream.write_byte( self.otherParameters[ idx ] );
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.otherParameters = [0]*2
for idx in range(0, 2):
val = inputStream.read_byte()
self.otherParameters[ idx ] = val
class DirectedEnergyDamage( object ):
"""Damage sustained by an entity due to directed energy. Location of the damage based on a relative x,y,z location from the center of the entity. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for DirectedEnergyDamage"""
self.recordType = 4500
""" DE Record Type."""
self.recordLength = 40
""" DE Record Length (bytes)."""
self.padding = 0
""" padding."""
self.damageLocation = Vector3Float();
""" location of damage, relative to center of entity"""
self.damageDiameter = 0
""" Size of damaged area, in meters."""
self.temperature = -273.15
""" average temp of the damaged area, in degrees celsius. If firing entitty does not model this, use a value of -273.15"""
self.componentIdentification = 0
""" enumeration"""
self.componentDamageStatus = 0
""" enumeration"""
self.componentVisualDamageStatus = 0
""" enumeration"""
self.componentVisualSmokeColor = 0
""" enumeration"""
self.fireEventID = EventIdentifier();
""" For any component damage resulting this field shall be set to the fire event ID from that PDU."""
self.padding2 = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_short(self.padding);
self.damageLocation.serialize(outputStream)
outputStream.write_float(self.damageDiameter);
outputStream.write_float(self.temperature);
outputStream.write_unsigned_byte(self.componentIdentification);
outputStream.write_unsigned_byte(self.componentDamageStatus);
outputStream.write_unsigned_byte(self.componentVisualDamageStatus);
outputStream.write_unsigned_byte(self.componentVisualSmokeColor);
self.fireEventID.serialize(outputStream)
outputStream.write_unsigned_short(self.padding2);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
self.damageLocation.parse(inputStream)
self.damageDiameter = inputStream.read_float();
self.temperature = inputStream.read_float();
self.componentIdentification = inputStream.read_unsigned_byte();
self.componentDamageStatus = inputStream.read_unsigned_byte();
self.componentVisualDamageStatus = inputStream.read_unsigned_byte();
self.componentVisualSmokeColor = inputStream.read_unsigned_byte();
self.fireEventID.parse(inputStream)
self.padding2 = inputStream.read_unsigned_short();
class ExplosionDescriptor( object ):
"""Explosion of a non-munition. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for ExplosionDescriptor"""
self.explodingObject = EntityType();
""" Type of the object that exploded. See 6.2.30"""
self.explosiveMaterial = 0
""" Material that exploded. Can be grain dust, tnt, gasoline, etc. Enumeration"""
self.padding = 0
""" padding"""
self.explosiveForce = 0
""" Force of explosion, in equivalent KG of TNT"""
def serialize(self, outputStream):
"""serialize the class """
self.explodingObject.serialize(outputStream)
outputStream.write_unsigned_short(self.explosiveMaterial);
outputStream.write_unsigned_short(self.padding);
outputStream.write_float(self.explosiveForce);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.explodingObject.parse(inputStream)
self.explosiveMaterial = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
self.explosiveForce = inputStream.read_float();
class ClockTime( object ):
"""Time measurements that exceed one hour are represented by this record. The first field is the hours since the unix epoch (Jan 1 1970, used by most Unix systems and java) and the second field the timestamp units since the top of the hour. Section 6.2.14"""
def __init__(self):
""" Initializer for ClockTime"""
self.hour = 0
""" Hours in UTC"""
self.timePastHour = 0
""" Time past the hour"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.hour);
outputStream.write_unsigned_int(self.timePastHour);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.hour = inputStream.read_unsigned_int();
self.timePastHour = inputStream.read_unsigned_int();
class SecondaryOperationalData( object ):
"""Additional operational data for an IFF emitting system and the number of IFF Fundamental Parameter Data records Section 6.2.76."""
def __init__(self):
""" Initializer for SecondaryOperationalData"""
self.operationalData1 = 0
""" additional operational characteristics of the IFF emitting system. Each 8-bit field will vary depending on the system type."""
self.operationalData2 = 0
""" additional operational characteristics of the IFF emitting system. Each 8-bit field will vary depending on the system type."""
self.numberOfIFFFundamentalParameterRecords = 0
""" the number of IFF Fundamental Parameter Data records that follow"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.operationalData1);
outputStream.write_unsigned_byte(self.operationalData2);
outputStream.write_unsigned_short(self.numberOfIFFFundamentalParameterRecords);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.operationalData1 = inputStream.read_unsigned_byte();
self.operationalData2 = inputStream.read_unsigned_byte();
self.numberOfIFFFundamentalParameterRecords = inputStream.read_unsigned_short();
class EnvironmentType( object ):
"""Description of environmental data in environmental process and gridded data PDUs. Section 6.2.32"""
def __init__(self):
""" Initializer for EnvironmentType"""
self.entityKind = 0
""" Kind of entity"""
self.domain = 0
""" Domain of entity (air, surface, subsurface, space, etc)"""
self.entityClass = 0
""" class of environmental entity"""
self.category = 0
""" category of entity"""
self.subcategory = 0
""" subcategory of entity"""
self.specific = 0
""" specific info based on subcategory field"""
self.extra = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.entityKind);
outputStream.write_unsigned_byte(self.domain);
outputStream.write_unsigned_short(self.entityClass);
outputStream.write_unsigned_byte(self.category);
outputStream.write_unsigned_byte(self.subcategory);
outputStream.write_unsigned_byte(self.specific);
outputStream.write_unsigned_byte(self.extra);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.entityKind = inputStream.read_unsigned_byte();
self.domain = inputStream.read_unsigned_byte();
self.entityClass = 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();
class TotalRecordSets( object ):
"""Total number of record sets contained in a logical set of one or more PDUs. Used to transfer ownership, etc Section 6.2.88"""
def __init__(self):
""" Initializer for TotalRecordSets"""
self.totalRecordSets = 0
""" Total number of record sets"""
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.totalRecordSets);
outputStream.write_unsigned_short(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.totalRecordSets = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
class MineEntityIdentifier( object ):
"""The unique designation of a mine contained in the Minefield Data PDU. No espdus are issued for mine entities. Section 6.2.55 """
def __init__(self):
""" Initializer for MineEntityIdentifier"""
self.simulationAddress = SimulationAddress();
""" """
self.mineEntityNumber = 0
""" """
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.mineEntityNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.mineEntityNumber = inputStream.read_unsigned_short();
class Relationship( object ):
"""The relationship of the part entity to its host entity. Section 6.2.74."""
def __init__(self):
""" Initializer for Relationship"""
self.nature = 0
""" the nature or purpose for joining of the part entity to the host entity and shall be represented by a 16-bit enumeration"""
self.position = 0
""" the position of the part entity with respect to the host entity and shall be represented by a 16-bit enumeration"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.nature);
outputStream.write_unsigned_short(self.position);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.nature = inputStream.read_unsigned_short();
self.position = inputStream.read_unsigned_short();
class EEFundamentalParameterData( object ):
"""Contains electromagnetic emmission regeneration parameters that are variable throught a scenario. Section 6.2.22."""
def __init__(self):
""" Initializer for EEFundamentalParameterData"""
self.frequency = 0
""" center frequency of the emission in hertz."""
self.frequencyRange = 0
""" Bandwidth of the frequencies corresponding to the fequency field."""
self.effectiveRadiatedPower = 0
""" Effective radiated power for the emission in DdBm. For a radar noise jammer, indicates the peak of the transmitted power."""
self.pulseRepetitionFrequency = 0
""" Average repetition frequency of the emission in hertz."""
self.pulseWidth = 0
""" Average pulse width of the emission in microseconds."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.frequency);
outputStream.write_float(self.frequencyRange);
outputStream.write_float(self.effectiveRadiatedPower);
outputStream.write_float(self.pulseRepetitionFrequency);
outputStream.write_float(self.pulseWidth);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.frequency = inputStream.read_float();
self.frequencyRange = inputStream.read_float();
self.effectiveRadiatedPower = inputStream.read_float();
self.pulseRepetitionFrequency = inputStream.read_float();
self.pulseWidth = inputStream.read_float();
class JammingTechnique( object ):
"""Jamming technique. Section 6.2.49"""
def __init__(self):
""" Initializer for JammingTechnique"""
self.kind = 0
self.category = 0
self.subcategory = 0
self.specific = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.kind);
outputStream.write_unsigned_byte(self.category);
outputStream.write_unsigned_byte(self.subcategory);
outputStream.write_unsigned_byte(self.specific);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.kind = inputStream.read_unsigned_byte();
self.category = inputStream.read_unsigned_byte();
self.subcategory = inputStream.read_unsigned_byte();
self.specific = inputStream.read_unsigned_byte();
class DatumSpecification( object ):
"""List of fixed and variable datum records. Section 6.2.18 """
def __init__(self):
""" Initializer for DatumSpecification"""
self.numberOfFixedDatums = 0
""" Number of fixed datums"""
self.numberOfVariableDatums = 0
""" Number of variable datums"""
self.fixedDatumIDList = []
""" variable length list fixed datums"""
self.variableDatumIDList = []
""" variable length list variable datums"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int( len(self.fixedDatumIDList));
outputStream.write_unsigned_int( len(self.variableDatumIDList));
for anObj in self.fixedDatumIDList:
anObj.serialize(outputStream)
for anObj in self.variableDatumIDList:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.numberOfFixedDatums = inputStream.read_unsigned_int();
self.numberOfVariableDatums = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfFixedDatums):
element = FixedDatum()
element.parse(inputStream)
self.fixedDatumIDList.append(element)
for idx in range(0, self.numberOfVariableDatums):
element = VariableDatum()
element.parse(inputStream)
self.variableDatumIDList.append(element)
class DirectedEnergyAreaAimpoint( object ):
"""DE Precision Aimpoint Record. NOT COMPLETE. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for DirectedEnergyAreaAimpoint"""
self.recordType = 4001
""" Type of Record enumeration"""
self.recordLength = 0
""" Length of Record"""
self.padding = 0
""" Padding"""
self.beamAntennaPatternRecordCount = 0
""" Number of beam antenna pattern records"""
self.directedEnergyTargetEnergyDepositionRecordCount = 0
""" Number of DE target energy depositon records"""
self.beamAntennaParameterList = []
""" list of beam antenna records. See <IP_ADDRESS>"""
self.directedEnergyTargetEnergyDepositionRecordList = []
""" list of DE target deposition records. See <IP_ADDRESS>"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_short(self.padding);
outputStream.write_unsigned_short( len(self.beamAntennaParameterList));
outputStream.write_unsigned_short( len(self.directedEnergyTargetEnergyDepositionRecordList));
for anObj in self.beamAntennaParameterList:
anObj.serialize(outputStream)
for anObj in self.directedEnergyTargetEnergyDepositionRecordList:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
self.beamAntennaPatternRecordCount = inputStream.read_unsigned_short();
self.directedEnergyTargetEnergyDepositionRecordCount = inputStream.read_unsigned_short();
for idx in range(0, self.beamAntennaPatternRecordCount):
element = null()
element.parse(inputStream)
self.beamAntennaParameterList.append(element)
for idx in range(0, self.directedEnergyTargetEnergyDepositionRecordCount):
element = null()
element.parse(inputStream)
self.directedEnergyTargetEnergyDepositionRecordList.append(element)
class Vector3Float( object ):
"""Three floating point values, x, y, and z. Section 6.2.95"""
def __init__(self):
""" Initializer for Vector3Float"""
self.x = 0
""" X value"""
self.y = 0
""" y Value"""
self.z = 0
""" Z value"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.x);
outputStream.write_float(self.y);
outputStream.write_float(self.z);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.x = inputStream.read_float();
self.y = inputStream.read_float();
self.z = inputStream.read_float();
class Expendable( object ):
"""An entity's expendable (chaff, flares, etc) information. Section 6.2.36"""
def __init__(self):
""" Initializer for Expendable"""
self.expendable = EntityType();
""" Type of expendable"""
self.station = 0
self.quantity = 0
self.expendableStatus = 0
self.padding = 0
def serialize(self, outputStream):
"""serialize the class """
self.expendable.serialize(outputStream)
outputStream.write_unsigned_int(self.station);
outputStream.write_unsigned_short(self.quantity);
outputStream.write_unsigned_byte(self.expendableStatus);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.expendable.parse(inputStream)
self.station = inputStream.read_unsigned_int();
self.quantity = inputStream.read_unsigned_short();
self.expendableStatus = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class IOCommunicationsNode( object ):
"""A communications node that is part of a simulted communcations network. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for IOCommunicationsNode"""
self.recordType = 5501
self.recordLength = 16
self.communcationsNodeType = 0
self.padding = 0
self.communicationsNodeID = CommunicationsNodeID();
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_byte(self.communcationsNodeType);
outputStream.write_unsigned_byte(self.padding);
self.communicationsNodeID.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.communcationsNodeType = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
self.communicationsNodeID.parse(inputStream)
class ModulationType( object ):
"""Information about the type of modulation used for radio transmission. 6.2.59 """
def __init__(self):
""" Initializer for ModulationType"""
self.spreadSpectrum = 0
""" This field shall indicate the spread spectrum technique or combination of spread spectrum techniques in use. Bit field. 0=freq hopping, 1=psuedo noise, time hopping=2, reamining bits unused"""
self.majorModulation = 0
""" the major classification of the modulation type. """
self.detail = 0
""" provide certain detailed information depending upon the major modulation type"""
self.radioSystem = 0
""" the radio system associated with this Transmitter PDU and shall be used as the basis to interpret other fields whose values depend on a specific radio system."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.spreadSpectrum);
outputStream.write_unsigned_short(self.majorModulation);
outputStream.write_unsigned_short(self.detail);
outputStream.write_unsigned_short(self.radioSystem);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.spreadSpectrum = inputStream.read_unsigned_short();
self.majorModulation = inputStream.read_unsigned_short();
self.detail = inputStream.read_unsigned_short();
self.radioSystem = inputStream.read_unsigned_short();
class LinearSegmentParameter( object ):
"""The specification of an individual segment of a linear segment synthetic environment object in a Linear Object State PDU Section 6.2.52"""
def __init__(self):
""" Initializer for LinearSegmentParameter"""
self.segmentNumber = 0
""" the individual segment of the linear segment """
self.segmentModification = 0
""" whether a modification has been made to the point objects location or orientation"""
self.generalSegmentAppearance = 0
""" general dynamic appearance attributes of the segment. This record shall be defined as a 16-bit record of enumerations. The values defined for this record are included in Section 12 of SISO-REF-010."""
self.specificSegmentAppearance = 0
""" This field shall specify specific dynamic appearance attributes of the segment. This record shall be defined as a 32-bit record of enumerations."""
self.segmentLocation = Vector3Double();
""" This field shall specify the location of the linear segment in the simulated world and shall be represented by a World Coordinates record """
self.segmentOrientation = EulerAngles();
""" orientation of the linear segment about the segment location and shall be represented by a Euler Angles record """
self.segmentLength = 0
""" length of the linear segment, in meters, extending in the positive X direction"""
self.segmentWidth = 0
""" The total width of the linear segment, in meters, shall be specified by a 16-bit unsigned integer. One-half of the width shall extend in the positive Y direction, and one-half of the width shall extend in the negative Y direction."""
self.segmentHeight = 0
""" The height of the linear segment, in meters, above ground shall be specified by a 16-bit unsigned integer."""
self.segmentDepth = 0
""" The depth of the linear segment, in meters, below ground level """
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.segmentNumber);
outputStream.write_unsigned_byte(self.segmentModification);
outputStream.write_unsigned_short(self.generalSegmentAppearance);
outputStream.write_unsigned_int(self.specificSegmentAppearance);
self.segmentLocation.serialize(outputStream)
self.segmentOrientation.serialize(outputStream)
outputStream.write_float(self.segmentLength);
outputStream.write_float(self.segmentWidth);
outputStream.write_float(self.segmentHeight);
outputStream.write_float(self.segmentDepth);
outputStream.write_unsigned_int(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.segmentNumber = inputStream.read_unsigned_byte();
self.segmentModification = inputStream.read_unsigned_byte();
self.generalSegmentAppearance = inputStream.read_unsigned_short();
self.specificSegmentAppearance = inputStream.read_unsigned_int();
self.segmentLocation.parse(inputStream)
self.segmentOrientation.parse(inputStream)
self.segmentLength = inputStream.read_float();
self.segmentWidth = inputStream.read_float();
self.segmentHeight = inputStream.read_float();
self.segmentDepth = inputStream.read_float();
self.padding = inputStream.read_unsigned_int();
class SimulationAddress( object ):
"""A Simulation Address record shall consist of the Site Identification number and the Application Identification number. Section 6.2.79 """
def __init__(self):
""" Initializer for SimulationAddress"""
self.site = 0
""" A site is defined as a facility, installation, organizational unit or a geographic location that has one or more simulation applications capable of participating in a distributed event. """
self.application = 0
""" An application is defined as a software program that is used to generate and process distributed simulation data including live, virtual and constructive data."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.site);
outputStream.write_unsigned_short(self.application);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.site = inputStream.read_unsigned_short();
self.application = inputStream.read_unsigned_short();
class SystemIdentifier( object ):
"""The ID of the IFF emitting system. NOT COMPLETE. Section 6.2.87"""
def __init__(self):
""" Initializer for SystemIdentifier"""
self.systemType = 0
""" general type of emitting system, an enumeration"""
self.systemName = 0
""" named type of system, an enumeration"""
self.systemMode = 0
""" mode of operation for the system, an enumeration"""
self.changeOptions = ChangeOptions();
""" status of this PDU, see section 6.2.15"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.systemType);
outputStream.write_unsigned_short(self.systemName);
outputStream.write_unsigned_short(self.systemMode);
self.changeOptions.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.systemType = inputStream.read_unsigned_short();
self.systemName = inputStream.read_unsigned_short();
self.systemMode = inputStream.read_unsigned_short();
self.changeOptions.parse(inputStream)
class TrackJamData( object ):
""" Track-Jam data Section 6.2.89"""
def __init__(self):
""" Initializer for TrackJamData"""
self.entityID = EntityID();
""" the entity tracked or illumated, or an emitter beam targeted with jamming"""
self.emitterNumber = 0
""" Emitter system associated with the entity"""
self.beamNumber = 0
""" Beam associated with the entity"""
def serialize(self, outputStream):
"""serialize the class """
self.entityID.serialize(outputStream)
outputStream.write_unsigned_byte(self.emitterNumber);
outputStream.write_unsigned_byte(self.beamNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.entityID.parse(inputStream)
self.emitterNumber = inputStream.read_unsigned_byte();
self.beamNumber = inputStream.read_unsigned_byte();
class AggregateType( object ):
"""Identifies the type and organization of an aggregate. Section 6.2.5"""
def __init__(self):
""" Initializer for AggregateType"""
self.aggregateKind = 0
""" Grouping criterion used to group the aggregate. Enumeration from EBV document"""
self.domain = 0
""" Domain of entity (air, surface, subsurface, space, etc) Zero means domain does not apply."""
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.specificInfo = 0
""" specific info based on subcategory field. specific is a reserved word in sql."""
self.extra = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.aggregateKind);
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.specificInfo);
outputStream.write_unsigned_byte(self.extra);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.aggregateKind = 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.specificInfo = inputStream.read_unsigned_byte();
self.extra = inputStream.read_unsigned_byte();
class SimulationManagementPduHeader( object ):
"""First part of a simulation management (SIMAN) PDU and SIMAN-Reliability (SIMAN-R) PDU. Sectionn 6.2.81"""
def __init__(self):
""" Initializer for SimulationManagementPduHeader"""
self.pduHeader = PduHeader();
""" Conventional PDU header"""
self.originatingID = SimulationIdentifier();
""" IDs the simulation or entity, etiehr a simulation or an entity. Either 6.2.80 or 6.2.28"""
self.receivingID = SimulationIdentifier();
""" simulation, all simulations, a special ID, or an entity. See 5.6.5 and 5.12.4"""
def serialize(self, outputStream):
"""serialize the class """
self.pduHeader.serialize(outputStream)
self.originatingID.serialize(outputStream)
self.receivingID.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.pduHeader.parse(inputStream)
self.originatingID.parse(inputStream)
self.receivingID.parse(inputStream)
class BeamData( object ):
"""Describes the scan volue of an emitter beam. Section 6.2.11."""
def __init__(self):
""" Initializer for BeamData"""
self.beamAzimuthCenter = 0
""" Specifies the beam azimuth an elevation centers and corresponding half-angles to describe the scan volume"""
self.beamAzimuthSweep = 0
""" Specifies the beam azimuth sweep to determine scan volume"""
self.beamElevationCenter = 0
""" Specifies the beam elevation center to determine scan volume"""
self.beamElevationSweep = 0
""" Specifies the beam elevation sweep to determine scan volume"""
self.beamSweepSync = 0
""" allows receiver to synchronize its regenerated scan pattern to that of the emmitter. Specifies the percentage of time a scan is through its pattern from its origion."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.beamAzimuthCenter);
outputStream.write_float(self.beamAzimuthSweep);
outputStream.write_float(self.beamElevationCenter);
outputStream.write_float(self.beamElevationSweep);
outputStream.write_float(self.beamSweepSync);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.beamAzimuthCenter = inputStream.read_float();
self.beamAzimuthSweep = inputStream.read_float();
self.beamElevationCenter = inputStream.read_float();
self.beamElevationSweep = inputStream.read_float();
self.beamSweepSync = inputStream.read_float();
class EngineFuel( object ):
"""Information about an entity's engine fuel. Section 6.2.24."""
def __init__(self):
""" Initializer for EngineFuel"""
self.fuelQuantity = 0
""" Fuel quantity, units specified by next field"""
self.fuelMeasurementUnits = 0
""" Units in which the fuel is measured"""
self.fuelType = 0
""" Type of fuel"""
self.fuelLocation = 0
""" Location of fuel as related to entity. See section 14 of EBV document"""
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.fuelQuantity);
outputStream.write_unsigned_byte(self.fuelMeasurementUnits);
outputStream.write_unsigned_byte(self.fuelType);
outputStream.write_unsigned_byte(self.fuelLocation);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.fuelQuantity = inputStream.read_unsigned_int();
self.fuelMeasurementUnits = inputStream.read_unsigned_byte();
self.fuelType = inputStream.read_unsigned_byte();
self.fuelLocation = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class IOEffect( object ):
"""Effect of IO on an entity. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for IOEffect"""
self.recordType = 5500
self.recordLength = 16
self.ioStatus = 0
self.ioLinkType = 0
self.ioEffect = EntityID();
self.ioEffectDutyCycle = 0
self.ioEffectDuration = 0
self.ioProcess = 0
self.padding = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_byte(self.ioStatus);
outputStream.write_unsigned_byte(self.ioLinkType);
self.ioEffect.serialize(outputStream)
outputStream.write_unsigned_byte(self.ioEffectDutyCycle);
outputStream.write_unsigned_short(self.ioEffectDuration);
outputStream.write_unsigned_short(self.ioProcess);
outputStream.write_unsigned_short(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_int();
self.recordLength = inputStream.read_unsigned_short();
self.ioStatus = inputStream.read_unsigned_byte();
self.ioLinkType = inputStream.read_unsigned_byte();
self.ioEffect.parse(inputStream)
self.ioEffectDutyCycle = inputStream.read_unsigned_byte();
self.ioEffectDuration = inputStream.read_unsigned_short();
self.ioProcess = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
class SimulationIdentifier( object ):
"""The unique designation of a simulation when using the 48-bit identifier format shall be specified by the Sim- ulation Identifier record. The reason that the 48-bit format is required in addition to the 32-bit simulation address format that actually identifies a specific simulation is because some 48-bit identifier fields in PDUs may contain either an Object Identifier, such as an Entity ID, or a Simulation Identifier. Section 6.2.80"""
def __init__(self):
""" Initializer for SimulationIdentifier"""
self.simulationAddress = SimulationAddress();
""" Simulation address """
self.referenceNumber = 0
""" This field shall be set to zero as there is no reference number associated with a Simulation Identifier."""
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.referenceNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.referenceNumber = inputStream.read_unsigned_short();
class GridAxisDescriptorVariable( object ):
"""Grid axis descriptor fo variable spacing axis data. NOT COMPLETE. Need padding to 64 bit boundary."""
def __init__(self):
""" Initializer for GridAxisDescriptorVariable"""
self.domainInitialXi = 0
""" coordinate of the grid origin or initial value"""
self.domainFinalXi = 0
""" coordinate of the endpoint or final value"""
self.domainPointsXi = 0
""" The number of grid points along the Xi domain axis for the enviornmental state data"""
self.interleafFactor = 0
""" interleaf factor along the domain axis."""
self.axisType = 0
""" type of grid axis"""
self.numberOfPointsOnXiAxis = 0
""" Number of grid locations along Xi axis"""
self.initialIndex = 0
""" initial grid point for the current pdu"""
self.coordinateScaleXi = 0
""" value that linearly scales the coordinates of the grid locations for the xi axis"""
self.coordinateOffsetXi = 0.0
""" The constant offset value that shall be applied to the grid locations for the xi axis"""
self.xiValues = []
""" list of coordinates"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_double(self.domainInitialXi);
outputStream.write_double(self.domainFinalXi);
outputStream.write_unsigned_short(self.domainPointsXi);
outputStream.write_unsigned_byte(self.interleafFactor);
outputStream.write_unsigned_byte(self.axisType);
outputStream.write_unsigned_short( len(self.xiValues));
outputStream.write_unsigned_short(self.initialIndex);
outputStream.write_double(self.coordinateScaleXi);
outputStream.write_double(self.coordinateOffsetXi);
for anObj in self.xiValues:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.domainInitialXi = inputStream.read_double();
self.domainFinalXi = inputStream.read_double();
self.domainPointsXi = inputStream.read_unsigned_short();
self.interleafFactor = inputStream.read_unsigned_byte();
self.axisType = inputStream.read_unsigned_byte();
self.numberOfPointsOnXiAxis = inputStream.read_unsigned_short();
self.initialIndex = inputStream.read_unsigned_short();
self.coordinateScaleXi = inputStream.read_double();
self.coordinateOffsetXi = inputStream.read_double();
for idx in range(0, self.numberOfPointsOnXiAxis):
element = null()
element.parse(inputStream)
self.xiValues.append(element)
class SupplyQuantity( object ):
""" A supply, and the amount of that supply. Section 6.2.86"""
def __init__(self):
""" Initializer for SupplyQuantity"""
self.supplyType = EntityType();
""" Type of supply"""
self.quantity = 0
""" the number of units of a supply type. """
def serialize(self, outputStream):
"""serialize the class """
self.supplyType.serialize(outputStream)
outputStream.write_float(self.quantity);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.supplyType.parse(inputStream)
self.quantity = inputStream.read_float();
class SilentEntitySystem( object ):
"""information abou an enitity not producing espdus. Section 6.2.79"""
def __init__(self):
""" Initializer for SilentEntitySystem"""
self.numberOfEntities = 0
""" number of the type specified by the entity type field"""
self.numberOfAppearanceRecords = 0
""" number of entity appearance records that follow"""
self.entityType = EntityType();
""" Entity type"""
self.appearanceRecordList = []
""" Variable length list of appearance records"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.numberOfEntities);
outputStream.write_unsigned_short( len(self.appearanceRecordList));
self.entityType.serialize(outputStream)
for anObj in self.appearanceRecordList:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.numberOfEntities = inputStream.read_unsigned_short();
self.numberOfAppearanceRecords = inputStream.read_unsigned_short();
self.entityType.parse(inputStream)
for idx in range(0, self.numberOfAppearanceRecords):
element = null()
element.parse(inputStream)
self.appearanceRecordList.append(element)
class EventIdentifier( object ):
"""Identifies an event in the world. Use this format for every PDU EXCEPT the LiveEntityPdu. Section 6.2.34."""
def __init__(self):
""" Initializer for EventIdentifier"""
self.simulationAddress = SimulationAddress();
""" Site and application IDs"""
self.eventNumber = 0
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.eventNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.eventNumber = inputStream.read_unsigned_short();
class BlankingSector( object ):
"""The Blanking Sector attribute record may be used to convey persistent areas within a scan volume where emitter power for a specific active emitter beam is reduced to an insignificant value. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for BlankingSector"""
self.recordType = 3500
self.recordLength = 40
self.padding = 0
self.emitterNumber = 0
self.beamNumber = 0
self.stateIndicator = 0
self.padding2 = 0
self.leftAzimuth = 0
self.rightAzimuth = 0
self.lowerElevation = 0
self.upperElevation = 0
self.residualPower = 0
self.padding3 = 0
self.padding4 = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_int(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_short(self.padding);
outputStream.write_unsigned_byte(self.emitterNumber);
outputStream.write_unsigned_byte(self.beamNumber);
outputStream.write_unsigned_byte(self.stateIndicator);
outputStream.write_unsigned_byte(self.padding2);
outputStream.write_float(self.leftAzimuth);
outputStream.write_float(self.rightAzimuth);
outputStream.write_float(self.lowerElevation);
outputStream.write_float(self.upperElevation);
outputStream.write_float(self.residualPower);
outputStream.write_int(self.padding3);
outputStream.write_int(self.padding4);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_int();
self.recordLength = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
self.emitterNumber = inputStream.read_unsigned_byte();
self.beamNumber = inputStream.read_unsigned_byte();
self.stateIndicator = inputStream.read_unsigned_byte();
self.padding2 = inputStream.read_unsigned_byte();
self.leftAzimuth = inputStream.read_float();
self.rightAzimuth = inputStream.read_float();
self.lowerElevation = inputStream.read_float();
self.upperElevation = inputStream.read_float();
self.residualPower = inputStream.read_float();
self.padding3 = inputStream.read_int();
self.padding4 = inputStream.read_int();
class LaunchedMunitionRecord( object ):
"""Identity of a communications node. Section 6.2.50"""
def __init__(self):
""" Initializer for LaunchedMunitionRecord"""
self.fireEventID = EventIdentifier();
self.padding = 0
self.firingEntityID = EventIdentifier();
self.padding2 = 0
self.targetEntityID = EventIdentifier();
self.padding3 = 0
self.targetLocation = Vector3Double();
def serialize(self, outputStream):
"""serialize the class """
self.fireEventID.serialize(outputStream)
outputStream.write_unsigned_short(self.padding);
self.firingEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.padding2);
self.targetEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.padding3);
self.targetLocation.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.fireEventID.parse(inputStream)
self.padding = inputStream.read_unsigned_short();
self.firingEntityID.parse(inputStream)
self.padding2 = inputStream.read_unsigned_short();
self.targetEntityID.parse(inputStream)
self.padding3 = inputStream.read_unsigned_short();
self.targetLocation.parse(inputStream)
class IFFFundamentalParameterData( object ):
"""Fundamental IFF atc data. Section 6.2.45"""
def __init__(self):
""" Initializer for IFFFundamentalParameterData"""
self.erp = 0
""" ERP"""
self.frequency = 0
""" frequency"""
self.pgrf = 0
""" pgrf"""
self.pulseWidth = 0
""" Pulse width"""
self.burstLength = 0
""" Burst length"""
self.applicableModes = 0
""" Applicable modes enumeration"""
self.systemSpecificData = [ 0, 0, 0]
""" System-specific data"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.erp);
outputStream.write_float(self.frequency);
outputStream.write_float(self.pgrf);
outputStream.write_float(self.pulseWidth);
outputStream.write_unsigned_int(self.burstLength);
outputStream.write_unsigned_byte(self.applicableModes);
for idx in range(0, 3):
outputStream.write_unsigned_byte( self.systemSpecificData[ idx ] );
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.erp = inputStream.read_float();
self.frequency = inputStream.read_float();
self.pgrf = inputStream.read_float();
self.pulseWidth = inputStream.read_float();
self.burstLength = inputStream.read_unsigned_int();
self.applicableModes = inputStream.read_unsigned_byte();
self.systemSpecificData = [0]*3
for idx in range(0, 3):
val = inputStream.read_unsigned_byte()
self.systemSpecificData[ idx ] = val
class FundamentalOperationalData( object ):
"""Basic operational data for IFF. Section 6.2.40."""
def __init__(self):
""" Initializer for FundamentalOperationalData"""
self.systemStatus = 0
""" system status"""
self.dataField1 = 0
""" data field 1"""
self.informationLayers = 0
""" eight boolean fields"""
self.dataField2 = 0
""" enumeration"""
self.parameter1 = 0
""" parameter, enumeration"""
self.parameter2 = 0
""" parameter, enumeration"""
self.parameter3 = 0
""" parameter, enumeration"""
self.parameter4 = 0
""" parameter, enumeration"""
self.parameter5 = 0
""" parameter, enumeration"""
self.parameter6 = 0
""" parameter, enumeration"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.systemStatus);
outputStream.write_unsigned_byte(self.dataField1);
outputStream.write_unsigned_byte(self.informationLayers);
outputStream.write_unsigned_byte(self.dataField2);
outputStream.write_unsigned_short(self.parameter1);
outputStream.write_unsigned_short(self.parameter2);
outputStream.write_unsigned_short(self.parameter3);
outputStream.write_unsigned_short(self.parameter4);
outputStream.write_unsigned_short(self.parameter5);
outputStream.write_unsigned_short(self.parameter6);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.systemStatus = inputStream.read_unsigned_byte();
self.dataField1 = inputStream.read_unsigned_byte();
self.informationLayers = inputStream.read_unsigned_byte();
self.dataField2 = inputStream.read_unsigned_byte();
self.parameter1 = inputStream.read_unsigned_short();
self.parameter2 = inputStream.read_unsigned_short();
self.parameter3 = inputStream.read_unsigned_short();
self.parameter4 = inputStream.read_unsigned_short();
self.parameter5 = inputStream.read_unsigned_short();
self.parameter6 = inputStream.read_unsigned_short();
class IntercomCommunicationsParameters( object ):
"""Intercom communcations parameters. Section 6.2.47. This requires hand coding"""
def __init__(self):
""" Initializer for IntercomCommunicationsParameters"""
self.recordType = 0
""" Type of intercom parameters record"""
self.recordLength = 0
""" length of record"""
self.recordSpecificField = 0
""" This is a placeholder."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.recordType);
outputStream.write_unsigned_short(self.recordLength);
outputStream.write_unsigned_int(self.recordSpecificField);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_short();
self.recordLength = inputStream.read_unsigned_short();
self.recordSpecificField = inputStream.read_unsigned_int();
class EntityType( object ):
"""Identifies the type of Entity"""
def __init__(self):
""" Initializer for EntityType"""
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. Renamed from specific because that is a reserved word in SQL."""
self.extra = 0
def serialize(self, outputStream):
"""serialize the class """
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);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
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();
class Munition( object ):
"""An entity's munition (e.g., bomb, missile) information shall be represented by one or more Munition records. For each type or location of munition, this record shall specify the type, location, quantity and status of munitions that an entity contains. Section 6.2.60 """
def __init__(self):
""" Initializer for Munition"""
self.munitionType = EntityType();
""" This field shall identify the entity type of the munition. See section 6.2.30."""
self.station = 0
""" the station or launcher to which the munition is assigned. See Annex I"""
self.quantity = 0
""" the quantity remaining of this munition."""
self.munitionStatus = 0
""" the status of the munition. It shall be represented by an 8-bit enumeration. """
self.padding = 0
""" padding """
def serialize(self, outputStream):
"""serialize the class """
self.munitionType.serialize(outputStream)
outputStream.write_unsigned_int(self.station);
outputStream.write_unsigned_short(self.quantity);
outputStream.write_unsigned_byte(self.munitionStatus);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.munitionType.parse(inputStream)
self.station = inputStream.read_unsigned_int();
self.quantity = inputStream.read_unsigned_short();
self.munitionStatus = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class StandardVariableSpecification( object ):
"""Does not work, and causes failure in anything it is embedded in. Section 6.2.83"""
def __init__(self):
""" Initializer for StandardVariableSpecification"""
self.numberOfStandardVariableRecords = 0
""" Number of static variable records"""
self.standardVariables = []
""" variable length list of standard variables, The class type and length here are WRONG and will cause the incorrect serialization of any class in whihc it is embedded."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short( len(self.standardVariables));
for anObj in self.standardVariables:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.numberOfStandardVariableRecords = inputStream.read_unsigned_short();
for idx in range(0, self.numberOfStandardVariableRecords):
element = null()
element.parse(inputStream)
self.standardVariables.append(element)
class Vector2Float( object ):
"""Two floating point values, x, y"""
def __init__(self):
""" Initializer for Vector2Float"""
self.x = 0
""" X value"""
self.y = 0
""" y Value"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.x);
outputStream.write_float(self.y);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.x = inputStream.read_float();
self.y = inputStream.read_float();
class Environment( object ):
"""Incomplete environment record; requires hand coding to fix. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for Environment"""
self.environmentType = 0
""" type"""
self.length = 0
""" length, in bits, of the record"""
self.index = 0
""" identifies the sequntially numbered record index"""
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.environmentType);
outputStream.write_unsigned_short(self.length);
outputStream.write_unsigned_byte(self.index);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.environmentType = inputStream.read_unsigned_int();
self.length = inputStream.read_unsigned_short();
self.index = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class AcousticEmitter( object ):
""" information about a specific UA emmtter. Section 6.2.2."""
def __init__(self):
""" Initializer for AcousticEmitter"""
self.acousticSystemName = 0
""" the system for a particular UA emitter, and an enumeration"""
self.acousticFunction = 0
""" The function of the acoustic system"""
self.acousticIDNumber = 0
""" The UA emitter identification number relative to a specific system"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.acousticSystemName);
outputStream.write_unsigned_byte(self.acousticFunction);
outputStream.write_unsigned_byte(self.acousticIDNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.acousticSystemName = inputStream.read_unsigned_short();
self.acousticFunction = inputStream.read_unsigned_byte();
self.acousticIDNumber = inputStream.read_unsigned_byte();
class AngularVelocityVector( object ):
"""Angular velocity measured in radians per second out each of the entity's own coordinate axes. Order of measurement is angular velocity around the x, y, and z axis of the entity. The positive direction is determined by the right hand rule. Section 6.2.7"""
def __init__(self):
""" Initializer for AngularVelocityVector"""
self.x = 0
""" velocity about the x axis"""
self.y = 0
""" velocity about the y axis"""
self.z = 0
""" velocity about the zaxis"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_float(self.x);
outputStream.write_float(self.y);
outputStream.write_float(self.z);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.x = inputStream.read_float();
self.y = inputStream.read_float();
self.z = inputStream.read_float();
class AggregateMarking( object ):
"""Specifies the character set used in the first byte, followed by up to 31 characters of text data. Section 6.2.4. """
def __init__(self):
""" Initializer for AggregateMarking"""
self.characterSet = 0
""" The character set"""
self.characters = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
""" The characters"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.characterSet);
for idx in range(0, 31):
outputStream.write_unsigned_byte( self.characters[ idx ] );
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.characterSet = inputStream.read_unsigned_byte();
self.characters = [0]*31
for idx in range(0, 31):
val = inputStream.read_unsigned_byte()
self.characters[ idx ] = val
class DataFilterRecord( object ):
"""identify which of the optional data fields are contained in the Minefield Data PDU or requested in the Minefield Query PDU. This is a 32-bit record. For each field, true denotes that the data is requested or present and false denotes that the data is neither requested nor present. Section 6.2.16"""
def __init__(self):
""" Initializer for DataFilterRecord"""
self.bitFlags = 0
""" Bitflags field"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.bitFlags);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.bitFlags = inputStream.read_unsigned_int();
class IntercomIdentifier( object ):
"""Unique designation of an attached or unattached intercom in an event or exercirse. Section 6.2.48"""
def __init__(self):
""" Initializer for IntercomIdentifier"""
self.siteNumber = 0
self.applicationNumber = 0
self.referenceNumber = 0
self.intercomNumber = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.siteNumber);
outputStream.write_unsigned_short(self.applicationNumber);
outputStream.write_unsigned_short(self.referenceNumber);
outputStream.write_unsigned_short(self.intercomNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.siteNumber = inputStream.read_unsigned_short();
self.applicationNumber = inputStream.read_unsigned_short();
self.referenceNumber = inputStream.read_unsigned_short();
self.intercomNumber = inputStream.read_unsigned_short();
class StorageFuel( object ):
"""Information about an entity's engine fuel. Section 6.2.84."""
def __init__(self):
""" Initializer for StorageFuel"""
self.fuelQuantity = 0
""" Fuel quantity, units specified by next field"""
self.fuelMeasurementUnits = 0
""" Units in which the fuel is measured"""
self.fuelType = 0
""" Type of fuel"""
self.fuelLocation = 0
""" Location of fuel as related to entity. See section 14 of EBV document"""
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.fuelQuantity);
outputStream.write_unsigned_byte(self.fuelMeasurementUnits);
outputStream.write_unsigned_byte(self.fuelType);
outputStream.write_unsigned_byte(self.fuelLocation);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.fuelQuantity = inputStream.read_unsigned_int();
self.fuelMeasurementUnits = inputStream.read_unsigned_byte();
self.fuelType = inputStream.read_unsigned_byte();
self.fuelLocation = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class Sensor( object ):
"""An entity's sensor information. Section 6.2.77."""
def __init__(self):
""" Initializer for Sensor"""
self.sensorTypeSource = 0
""" the source of the Sensor Type field """
self.sensorOnOffStatus = 0
""" the on/off status of the sensor"""
self.sensorType = 0
""" the sensor type and shall be represented by a 16-bit enumeration. """
self.station = 0
""" the station to which the sensor is assigned. A zero value shall indi- cate that this Sensor record is not associated with any particular station and represents the total quan- tity of this sensor for this entity. If this field is non-zero, it shall either reference an attached part or an articulated part"""
self.quantity = 0
""" quantity of the sensor """
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.sensorTypeSource);
outputStream.write_unsigned_byte(self.sensorOnOffStatus);
outputStream.write_unsigned_short(self.sensorType);
outputStream.write_unsigned_int(self.station);
outputStream.write_unsigned_short(self.quantity);
outputStream.write_unsigned_short(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.sensorTypeSource = inputStream.read_unsigned_byte();
self.sensorOnOffStatus = inputStream.read_unsigned_byte();
self.sensorType = inputStream.read_unsigned_short();
self.station = inputStream.read_unsigned_int();
self.quantity = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_short();
class MunitionReload( object ):
"""indicate weapons (munitions) previously communicated via the Munition record. Section 6.2.61 """
def __init__(self):
""" Initializer for MunitionReload"""
self.munitionType = EntityType();
""" This field shall identify the entity type of the munition. See section 6.2.30."""
self.station = 0
""" the station or launcher to which the munition is assigned. See Annex I"""
self.standardQuantity = 0
""" the standard quantity of this munition type normally loaded at this station/launcher if a station/launcher is specified."""
self.maximumQuantity = 0
""" the maximum quantity of this munition type that this station/launcher is capable of holding when a station/launcher is specified """
self.standardQuantityReloadTime = 0
""" numer of seconds of sim time required to reload the std qty"""
self.maximumQuantityReloadTime = 0
""" the number of seconds of sim time required to reload the max possible quantity"""
def serialize(self, outputStream):
"""serialize the class """
self.munitionType.serialize(outputStream)
outputStream.write_unsigned_int(self.station);
outputStream.write_unsigned_short(self.standardQuantity);
outputStream.write_unsigned_short(self.maximumQuantity);
outputStream.write_unsigned_int(self.standardQuantityReloadTime);
outputStream.write_unsigned_int(self.maximumQuantityReloadTime);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.munitionType.parse(inputStream)
self.station = inputStream.read_unsigned_int();
self.standardQuantity = inputStream.read_unsigned_short();
self.maximumQuantity = inputStream.read_unsigned_short();
self.standardQuantityReloadTime = inputStream.read_unsigned_int();
self.maximumQuantityReloadTime = inputStream.read_unsigned_int();
class StorageFuelReload( object ):
"""For each type or location of Storage Fuel, this record shall specify the type, location, fuel measure- ment units, reload quantity and maximum quantity for storage fuel either for the whole entity or a specific storage fuel location (tank). Section 6.2.85."""
def __init__(self):
""" Initializer for StorageFuelReload"""
self.standardQuantity = 0
""" the standard quantity of this fuel type normally loaded at this station/launcher if a station/launcher is specified. If the Station/Launcher field is set to zero, then this is the total quantity of this fuel type that would be present in a standard reload of all appli- cable stations/launchers associated with this entity."""
self.maximumQuantity = 0
""" the maximum quantity of this fuel type that this sta- tion/launcher is capable of holding when a station/launcher is specified. This would be the value used when a maximum reload was desired to be set for this station/launcher. If the Station/launcher field is set to zero, then this is the maximum quantity of this fuel type that would be present on this entity at all stations/launchers that can accept this fuel type."""
self.standardQuantityReloadTime = 0
""" the seconds normally required to reload the standard quantity of this fuel type at this specific station/launcher. When the Station/Launcher field is set to zero, this shall be the time it takes to perform a standard quantity reload of this fuel type at all applicable stations/launchers for this entity."""
self.maximumQuantityReloadTime = 0
""" the seconds normally required to reload the maximum possible quantity of this fuel type at this station/launcher. When the Station/Launcher field is set to zero, this shall be the time it takes to perform a maximum quantity load/reload of this fuel type at all applicable stations/launchers for this entity."""
self.fuelMeasurementUnits = 0
""" the fuel measurement units. Enumeration"""
self.fuelType = 0
""" Fuel type. Enumeration"""
self.fuelLocation = 0
""" Location of fuel as related to entity. See section 14 of EBV document"""
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.standardQuantity);
outputStream.write_unsigned_int(self.maximumQuantity);
outputStream.write_unsigned_byte(self.standardQuantityReloadTime);
outputStream.write_unsigned_byte(self.maximumQuantityReloadTime);
outputStream.write_unsigned_byte(self.fuelMeasurementUnits);
outputStream.write_unsigned_byte(self.fuelType);
outputStream.write_unsigned_byte(self.fuelLocation);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.standardQuantity = inputStream.read_unsigned_int();
self.maximumQuantity = inputStream.read_unsigned_int();
self.standardQuantityReloadTime = inputStream.read_unsigned_byte();
self.maximumQuantityReloadTime = inputStream.read_unsigned_byte();
self.fuelMeasurementUnits = inputStream.read_unsigned_byte();
self.fuelType = inputStream.read_unsigned_byte();
self.fuelLocation = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class ExpendableReload( object ):
"""An entity's expendable (chaff, flares, etc) information. Section 6.2.37"""
def __init__(self):
""" Initializer for ExpendableReload"""
self.expendable = EntityType();
""" Type of expendable"""
self.station = 0
self.standardQuantity = 0
self.maximumQuantity = 0
self.standardQuantityReloadTime = 0
self.maximumQuantityReloadTime = 0
def serialize(self, outputStream):
"""serialize the class """
self.expendable.serialize(outputStream)
outputStream.write_unsigned_int(self.station);
outputStream.write_unsigned_short(self.standardQuantity);
outputStream.write_unsigned_short(self.maximumQuantity);
outputStream.write_unsigned_int(self.standardQuantityReloadTime);
outputStream.write_unsigned_int(self.maximumQuantityReloadTime);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.expendable.parse(inputStream)
self.station = inputStream.read_unsigned_int();
self.standardQuantity = inputStream.read_unsigned_short();
self.maximumQuantity = inputStream.read_unsigned_short();
self.standardQuantityReloadTime = inputStream.read_unsigned_int();
self.maximumQuantityReloadTime = inputStream.read_unsigned_int();
class EntityIdentifier( object ):
"""Entity Identifier. Unique ID for entities in the world. Consists of an simulation address and a entity number. Section 6.2.28."""
def __init__(self):
""" Initializer for EntityIdentifier"""
self.simulationAddress = SimulationAddress();
""" Site and application IDs"""
self.entityNumber = 0
""" Entity number"""
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.entityNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.entityNumber = inputStream.read_unsigned_short();
class DirectedEnergyTargetEnergyDeposition( object ):
"""DE energy depostion properties for a target entity. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for DirectedEnergyTargetEnergyDeposition"""
self.targetEntityID = EntityID();
""" Unique ID of the target entity."""
self.padding = 0
""" padding"""
self.peakIrradiance = 0
""" Peak irrandiance"""
def serialize(self, outputStream):
"""serialize the class """
self.targetEntityID.serialize(outputStream)
outputStream.write_unsigned_short(self.padding);
outputStream.write_float(self.peakIrradiance);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.targetEntityID.parse(inputStream)
self.padding = inputStream.read_unsigned_short();
self.peakIrradiance = inputStream.read_float();
class EntityID( object ):
"""more laconically named EntityIdentifier"""
def __init__(self):
""" Initializer for EntityID"""
self.siteID = 0
""" Site ID"""
self.applicationID = 0
""" application number ID"""
self.entityID = 0
""" Entity number ID"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_short(self.siteID);
outputStream.write_unsigned_short(self.applicationID);
outputStream.write_unsigned_short(self.entityID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.siteID = inputStream.read_unsigned_short();
self.applicationID = inputStream.read_unsigned_short();
self.entityID = inputStream.read_unsigned_short();
class EngineFuelReload( object ):
"""For each type or location of engine fuell, this record specifies the type, location, fuel measurement units, and reload quantity and maximum quantity. Section 6.2.25."""
def __init__(self):
""" Initializer for EngineFuelReload"""
self.standardQuantity = 0
""" standard quantity of fuel loaded"""
self.maximumQuantity = 0
""" maximum quantity of fuel loaded"""
self.standardQuantityReloadTime = 0
""" seconds normally required to to reload standard qty"""
self.maximumQuantityReloadTime = 0
""" seconds normally required to to reload maximum qty"""
self.fuelMeasurmentUnits = 0
""" Units of measure"""
self.fuelLocation = 0
""" fuel location as related to the entity"""
self.padding = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.standardQuantity);
outputStream.write_unsigned_int(self.maximumQuantity);
outputStream.write_unsigned_int(self.standardQuantityReloadTime);
outputStream.write_unsigned_int(self.maximumQuantityReloadTime);
outputStream.write_unsigned_byte(self.fuelMeasurmentUnits);
outputStream.write_unsigned_byte(self.fuelLocation);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.standardQuantity = inputStream.read_unsigned_int();
self.maximumQuantity = inputStream.read_unsigned_int();
self.standardQuantityReloadTime = inputStream.read_unsigned_int();
self.maximumQuantityReloadTime = inputStream.read_unsigned_int();
self.fuelMeasurmentUnits = inputStream.read_unsigned_byte();
self.fuelLocation = inputStream.read_unsigned_byte();
self.padding = inputStream.read_unsigned_byte();
class UnattachedIdentifier( object ):
"""The unique designation of one or more unattached radios in an event or exercise Section 6.2.91"""
def __init__(self):
""" Initializer for UnattachedIdentifier"""
self.simulationAddress = SimulationAddress();
""" See 6.2.79"""
self.referenceNumber = 0
""" Reference number"""
def serialize(self, outputStream):
"""serialize the class """
self.simulationAddress.serialize(outputStream)
outputStream.write_unsigned_short(self.referenceNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.simulationAddress.parse(inputStream)
self.referenceNumber = inputStream.read_unsigned_short();
class EntityTypeVP( object ):
"""Association or disassociation of two entities. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for EntityTypeVP"""
self.recordType = 3
""" the identification of the Variable Parameter record. Enumeration from EBV"""
self.changeIndicator = 0
""" Indicates if this VP has changed since last issuance"""
self.entityType = EntityType();
""" """
self.padding = 0
""" padding"""
self.padding1 = 0
""" padding"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.recordType);
outputStream.write_unsigned_byte(self.changeIndicator);
self.entityType.serialize(outputStream)
outputStream.write_unsigned_short(self.padding);
outputStream.write_unsigned_int(self.padding1);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.recordType = inputStream.read_unsigned_byte();
self.changeIndicator = inputStream.read_unsigned_byte();
self.entityType.parse(inputStream)
self.padding = inputStream.read_unsigned_short();
self.padding1 = inputStream.read_unsigned_int();
class BeamStatus( object ):
"""Information related to the status of a beam. This is contained in the beam status field of the electromagnitec emission PDU. The first bit determines whether the beam is active (0) or deactivated (1). Section 6.2.12."""
def __init__(self):
""" Initializer for BeamStatus"""
self.beamState = 0
""" First bit zero means beam is active, first bit = 1 means deactivated. The rest is padding."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.beamState);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.beamState = inputStream.read_unsigned_byte();
class EnvironmentGeneral( object ):
""" Information about a geometry, a state associated with a geometry, a bounding volume, or an associated entity ID. NOTE: this class requires hand coding. 6.2.31"""
def __init__(self):
""" Initializer for EnvironmentGeneral"""
self.environmentType = 0
""" Record type"""
self.length = 0
""" length, in bits"""
self.index = 0
""" Identify the sequentially numbered record index"""
self.padding1 = 0
""" padding"""
self.geometry = 0
""" Geometry or state record"""
self.padding2 = 0
""" padding to bring the total size up to a 64 bit boundry"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.environmentType);
outputStream.write_unsigned_byte(self.length);
outputStream.write_unsigned_byte(self.index);
outputStream.write_unsigned_byte(self.padding1);
outputStream.write_unsigned_byte(self.geometry);
outputStream.write_unsigned_byte(self.padding2);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.environmentType = inputStream.read_unsigned_int();
self.length = inputStream.read_unsigned_byte();
self.index = inputStream.read_unsigned_byte();
self.padding1 = inputStream.read_unsigned_byte();
self.geometry = inputStream.read_unsigned_byte();
self.padding2 = inputStream.read_unsigned_byte();
class Vector3Double( object ):
"""Three double precision floating point values, x, y, and z. Used for world coordinates Section 6.2.97."""
def __init__(self):
""" Initializer for Vector3Double"""
self.x = 0
""" X value"""
self.y = 0
""" y Value"""
self.z = 0
""" Z value"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_double(self.x);
outputStream.write_double(self.y);
outputStream.write_double(self.z);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.x = inputStream.read_double();
self.y = inputStream.read_double();
self.z = inputStream.read_double();
class GridAxis( object ):
"""Grid axis record for fixed data. Section 6.2.41"""
def __init__(self):
""" Initializer for GridAxis"""
self.domainInitialXi = 0
""" coordinate of the grid origin or initial value"""
self.domainFinalXi = 0
""" coordinate of the endpoint or final value"""
self.domainPointsXi = 0
""" The number of grid points along the Xi domain axis for the enviornmental state data"""
self.interleafFactor = 0
""" interleaf factor along the domain axis."""
self.axisType = 0
""" type of grid axis"""
self.numberOfPointsOnXiAxis = 0
""" Number of grid locations along Xi axis"""
self.initialIndex = 0
""" initial grid point for the current pdu"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_double(self.domainInitialXi);
outputStream.write_double(self.domainFinalXi);
outputStream.write_unsigned_short(self.domainPointsXi);
outputStream.write_unsigned_byte(self.interleafFactor);
outputStream.write_unsigned_byte(self.axisType);
outputStream.write_unsigned_short(self.numberOfPointsOnXiAxis);
outputStream.write_unsigned_short(self.initialIndex);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.domainInitialXi = inputStream.read_double();
self.domainFinalXi = inputStream.read_double();
self.domainPointsXi = inputStream.read_unsigned_short();
self.interleafFactor = inputStream.read_unsigned_byte();
self.axisType = inputStream.read_unsigned_byte();
self.numberOfPointsOnXiAxis = inputStream.read_unsigned_short();
self.initialIndex = inputStream.read_unsigned_short();
class RecordSpecification( object ):
"""This record shall specify the number of record sets contained in the Record Specification record and the record details. Section 6.2.73."""
def __init__(self):
""" Initializer for RecordSpecification"""
self.numberOfRecordSets = 0
""" The number of record sets"""
self.recordSets = []
""" variable length list record specifications."""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int( len(self.recordSets));
for anObj in self.recordSets:
anObj.serialize(outputStream)
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.numberOfRecordSets = inputStream.read_unsigned_int();
for idx in range(0, self.numberOfRecordSets):
element = null()
element.parse(inputStream)
self.recordSets.append(element)
class VariableDatum( object ):
"""the variable datum type, the datum length, and the value for that variable datum type. NOT COMPLETE. Section 6.2.93"""
def __init__(self):
""" Initializer for VariableDatum"""
self.variableDatumID = 0
""" Type of variable datum to be transmitted. 32 bit enumeration defined in EBV"""
self.variableDatumLength = 0
""" Length, IN BITS, of the variable datum."""
self.variableData = []
""" Variable datum. This can be any number of bits long, depending on the datum."""
def datumPaddingSizeInBits(self):
padding = 0
remainder = self.variableDatumLength % 64
if remainder != 0:
padding = 64 - remainder
return padding
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_int(self.variableDatumID);
outputStream.write_unsigned_int(self.variableDatumLength);
for x in range(self.variableDatumLength // 8): # length is in bits
outputStream.write_byte(self.variableData[x])
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.variableDatumID = inputStream.read_unsigned_int();
self.variableDatumLength = inputStream.read_unsigned_int();
for x in range(self.variableDatumLength // 8): # length is in bits
self.variableData.append(inputStream.read_byte());
# Skip over padding
# "This field shall be padded at the end to make the length a multiple of 64-bits."
for x in range(self.datumPaddingSizeInBits() // 8):
inputStream.read_byte()
class EventIdentifierLiveEntity( object ):
"""Identifies an event in the world. Use this format for ONLY the LiveEntityPdu. Section 6.2.34."""
def __init__(self):
""" Initializer for EventIdentifierLiveEntity"""
self.siteNumber = 0
self.applicationNumber = 0
self.eventNumber = 0
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.siteNumber);
outputStream.write_unsigned_byte(self.applicationNumber);
outputStream.write_unsigned_short(self.eventNumber);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.siteNumber = inputStream.read_unsigned_byte();
self.applicationNumber = inputStream.read_unsigned_byte();
self.eventNumber = inputStream.read_unsigned_short();
class PduHeader( object ):
"""Not used. The PDU Header Record is directly incoroporated into the PDU class. Here for completness only. Section 6.2.66"""
def __init__(self):
""" Initializer for PduHeader"""
self.protocolVersion = 7
""" The version of the protocol. 5=DIS-1995, 6=DIS-1998, 7=DIS-2009."""
self.exerciseID = 0
""" Exercise ID"""
self.pduType = 0
""" Type of pdu, unique for each PDU class"""
self.protocolFamily = 0
""" value that refers to the protocol family, eg SimulationManagement, etc"""
self.timestamp = 0
""" Timestamp value"""
self.pduLength = 0
""" Length, in bytes, of the PDU. Changed name from length to avoid use of Hibernate QL reserved word."""
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 """
outputStream.write_unsigned_byte(self.protocolVersion);
outputStream.write_unsigned_byte(self.exerciseID);
outputStream.write_unsigned_byte(self.pduType);
outputStream.write_unsigned_byte(self.protocolFamily);
outputStream.write_unsigned_int(self.timestamp);
outputStream.write_unsigned_byte(self.pduLength);
outputStream.write_unsigned_short(self.pduStatus);
outputStream.write_unsigned_byte(self.padding);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.protocolVersion = inputStream.read_unsigned_byte();
self.exerciseID = inputStream.read_unsigned_byte();
self.pduType = inputStream.read_unsigned_byte();
self.protocolFamily = inputStream.read_unsigned_byte();
self.timestamp = inputStream.read_unsigned_int();
self.pduLength = inputStream.read_unsigned_byte();
self.pduStatus = inputStream.read_unsigned_short();
self.padding = inputStream.read_unsigned_byte();
class PduSuperclass( object ):
"""The superclass for all PDUs, including classic and Live Entity (LE) PDUs. This incorporates the PduHeader record, section 7.2.2"""
def __init__(self):
""" Initializer for PduSuperclass"""
self.protocolVersion = 7
""" The version of the protocol. 5=DIS-1995, 6=DIS-1998, 7=DIS-2009."""
self.exerciseID = 0
""" Exercise ID"""
self.pduType = 0
""" Type of pdu, unique for each PDU class"""
self.protocolFamily = 0
""" value that refers to the protocol family, eg SimulationManagement, et"""
self.timestamp = 0
""" Timestamp value"""
self.length = 0
""" Length, in bytes, of the PDU"""
def serialize(self, outputStream):
"""serialize the class """
outputStream.write_unsigned_byte(self.protocolVersion);
outputStream.write_unsigned_byte(self.exerciseID);
outputStream.write_unsigned_byte(self.pduType);
outputStream.write_unsigned_byte(self.protocolFamily);
outputStream.write_unsigned_int(self.timestamp);
outputStream.write_unsigned_short(self.length);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.protocolVersion = inputStream.read_unsigned_byte();
self.exerciseID = inputStream.read_unsigned_byte();
self.pduType = inputStream.read_unsigned_byte();
self.protocolFamily = inputStream.read_unsigned_byte();
self.timestamp = inputStream.read_unsigned_int();
self.length = inputStream.read_unsigned_short();
class CommunicationsNodeID( object ):
"""Identity of a communications node. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for CommunicationsNodeID"""
self.entityID = EntityID();
self.elementID = 0
def serialize(self, outputStream):
"""serialize the class """
self.entityID.serialize(outputStream)
outputStream.write_unsigned_short(self.elementID);
def parse(self, inputStream):
""""Parse a message. This may recursively call embedded objects."""
self.entityID.parse(inputStream)
self.elementID = inputStream.read_unsigned_short();
class ExpendableDescriptor( object ):
"""Burst of chaff or expendible device. Section <IP_ADDRESS>"""
def __init__(self):
""" Initializer for ExpendableDescriptor"""
self.expendableType = EntityType();
""" Type of the object that exploded"""
self.padding = 0
""" Padding"""
def serialize(self, outputStream):
"""serialize the class """
self.expendableType.serialize(outputStream)
outputStream.write_long(self.padding);
def parse(self, inputStream):